fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7161] rental: not everyone use the catch-module


From: Sigurd Nes
Subject: [Fmsystem-commits] [7161] rental: not everyone use the catch-module
Date: Sat, 02 Apr 2011 15:18:56 +0000

Revision: 7161
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7161
Author:   sigurdne
Date:     2011-04-02 15:18:55 +0000 (Sat, 02 Apr 2011)
Log Message:
-----------
rental: not everyone use the catch-module

Modified Paths:
--------------
    trunk/rental/inc/hook_config.inc.php
    trunk/rental/templates/base/config.tpl

Modified: trunk/rental/inc/hook_config.inc.php
===================================================================
--- trunk/rental/inc/hook_config.inc.php        2011-04-02 11:47:50 UTC (rev 
7160)
+++ trunk/rental/inc/hook_config.inc.php        2011-04-02 15:18:55 UTC (rev 
7161)
@@ -50,28 +50,36 @@
        
        function entity_config_move_in_out($config)
        {
-               $entity                 = 
CreateObject('property.soadmin_entity');
-               $entities       = $entity->read(array('allrows' => true, 'type' 
=> 'catch'));
-               $selected_entity = isset($config['entity_config_move_in_out']) 
? $config['entity_config_move_in_out'] : '';
-               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
-               if ( is_array($entities) && count($entities) )
+               if(isset($GLOBALS['phpgw_info']['apps']['catch']))
                {
-                       foreach($entities as $entry)
+                       $entity                 = 
CreateObject('property.soadmin_entity');
+                       $entities       = $entity->read(array('allrows' => 
true, 'type' => 'catch'));
+                       $selected_entity = 
isset($config['entity_config_move_in_out']) ? 
$config['entity_config_move_in_out'] : '';
+                       $out = '<select 
name="newsettings[entity_config_move_in_out]">' . "\n";
+                       $out .= '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+                       if ( is_array($entities) && count($entities) )
                        {
-                               
-                               $id = $entry['id'];
-                               $selected = '';
-                               if ( $selected_entity == $id )
+                               foreach($entities as $entry)
                                {
-                                       $selected = ' selected';
+                                       
+                                       $id = $entry['id'];
+                                       $selected = '';
+                                       if ( $selected_entity == $id )
+                                       {
+                                               $selected = ' selected';
+                                       }
+               
+                                       $out .=  <<<HTML
+                                               <option 
value="{$id}"{$selected}>{$entry['name']}</option>                      
+HTML;
                                }
-       
-                               $out .=  <<<HTML
-                                       <option 
value="{$id}"{$selected}>{$entry['name']}</option>
-                       
-HTML;
                        }
+                       $out .= ' </select>' . "\n";
                }
+               else
+               {
+                       $out = '<b>The catch-module is not installed</b>' . 
"\n";
+               }
                return $out;
        }
        
@@ -140,4 +148,4 @@
                        }
                }
                return $out;
-       }
\ No newline at end of file
+       }

Modified: trunk/rental/templates/base/config.tpl
===================================================================
--- trunk/rental/templates/base/config.tpl      2011-04-02 11:47:50 UTC (rev 
7160)
+++ trunk/rental/templates/base/config.tpl      2011-04-02 15:18:55 UTC (rev 
7161)
@@ -55,9 +55,7 @@
                <tr class="row_off">
                        <td>{lang_entity_config_move_in_out}:</td>
                        <td>
-                        <select name="newsettings[entity_config_move_in_out]">
 {hook_entity_config_move_in_out}
-                        </select>
                        </td>
                </tr>
                <tr class="row_on">




reply via email to

[Prev in Thread] Current Thread [Next in Thread]