fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17489] property: condition survey location_level


From: sigurdne
Subject: [Fmsystem-commits] [17489] property: condition survey location_level
Date: Wed, 3 Jan 2018 09:50:13 -0500 (EST)

Revision: 17489
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17489
Author:   sigurdne
Date:     2018-01-03 09:50:13 -0500 (Wed, 03 Jan 2018)
Log Message:
-----------
property: condition survey location_level

Modified Paths:
--------------
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/inc/hook_config.inc.php
    trunk/property/setup/phpgw_no.lang
    trunk/property/templates/base/config.tpl

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2018-01-03 14:06:02 UTC 
(rev 17488)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2018-01-03 14:50:13 UTC 
(rev 17489)
@@ -475,13 +475,20 @@
                                $values['location_data'] = 
execMethod('property.solocation.read_single', $values['location_code']);
                        }
 
+                       $this->config = CreateObject('phpgwapi.config', 
'property');
+                       $this->config->read();
+                       
+                       $survey_location_level = 
empty($this->config->config_data['survey_location_level']) ? 2 : 
(int)$this->config->config_data['survey_location_level'];
+
                        $categories = $this->_get_categories($values['cat_id']);
 
                        $bolocation = CreateObject('property.bolocation');
+
+
                        $location_data = $bolocation->initiate_ui_location(array
                                (
                                'values' => $values['location_data'],
-                               'type_id' => 2,
+                               'type_id' => $survey_location_level,
                                'required_level' => 1,
                                'no_link' => $_no_link, // disable lookup links 
for location type less than type_id
                                'lookup_type' => $mode == 'edit' ? 'form2' : 
'view2',
@@ -579,9 +586,6 @@
                                )
                        );
 
-                       $this->config = CreateObject('phpgwapi.config', 
'property');
-                       $this->config->read();
-
                        $data = array
                                (
                                'datatable_def' => $datatable_def,

Modified: trunk/property/inc/hook_config.inc.php
===================================================================
--- trunk/property/inc/hook_config.inc.php      2018-01-03 14:06:02 UTC (rev 
17488)
+++ trunk/property/inc/hook_config.inc.php      2018-01-03 14:50:13 UTC (rev 
17489)
@@ -466,6 +466,32 @@
        }
 
        /**
+        * Get HTML options with location levels that should be listed in a 
listbox
+        *
+        * @param $config
+        * @return string HTML options to be placed in a select
+        */
+       function list_location_level_otions_survey( $config )
+       {
+               $location_types = 
execMethod('property.soadmin_location.select_location_type');
+
+               $level_assigned = isset($config['survey_location_level']) ? 
$config['survey_location_level'] : 0;
+               $out = '';
+               foreach ($location_types as $dummy => $level)
+               {
+                       $selected = '';
+                       if (($level['id'] == $level_assigned))
+                       {
+                               $selected = ' selected = "selected"';
+                       }
+                       $out .= <<<HTML
+                       <option value="{$level['id']}" 
{$selected}><label>{$level['name']}</label></option>
+HTML;
+               }
+               return $out;
+       }
+
+       /**
         * Get HTML options with roles for responsibilities that should be 
listed in a listbox
         *
         * @param $config

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2018-01-03 14:06:02 UTC (rev 17488)
+++ trunk/property/setup/phpgw_no.lang  2018-01-03 14:50:13 UTC (rev 17489)
@@ -2242,4 +2242,6 @@
 deadline for execution property        no      Frist for ferdigstillelse
 outside contract       property        no      Utenfor rammeavtale
 refund property        no      Refusjon
-both   property        no      Begge
\ No newline at end of file
+both   property        no      Begge
+condition survey location level        property        no      
Tilstandsanalyse lokasjonsnivå
+condition survey import category       property        no      
Tilstandsanalyse importkategori
\ No newline at end of file

Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl    2018-01-03 14:06:02 UTC (rev 
17488)
+++ trunk/property/templates/base/config.tpl    2018-01-03 14:50:13 UTC (rev 
17489)
@@ -685,6 +685,14 @@
                                        </table>
                                </td>
                        </tr>
+                       <tr>
+                               <td>{lang_condition_survey_location_level}:</td>
+                               <td>
+                                       <select 
name="newsettings[survey_location_level]">
+                                               
{hook_list_location_level_otions_survey}
+                                       </select>
+                               </td>
+                       </tr>
 
                        <tr>
                                
<td>{lang_condition_survey_import_category}:</td>




reply via email to

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