fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15769]


From: nelson . guerra
Subject: [Fmsystem-commits] [15769]
Date: Sat, 1 Oct 2016 00:58:46 +0000 (UTC)

Revision: 15769
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15769
Author:   nelson224
Date:     2016-10-01 00:58:46 +0000 (Sat, 01 Oct 2016)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind-2/property/inc/class.uiimport_components.inc.php

Modified: 
branches/dev-syncromind-2/property/inc/class.uiimport_components.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.uiimport_components.inc.php    
2016-09-30 09:24:54 UTC (rev 15768)
+++ branches/dev-syncromind-2/property/inc/class.uiimport_components.inc.php    
2016-10-01 00:58:46 UTC (rev 15769)
@@ -306,6 +306,17 @@
                        return $html_table;             
                }
                
+               private function _get_default_options() 
+               {
+                       return  array (
+                               '' => ' ... ',
+                               'new_column' => lang('New attribute'),
+                               'building_part' => lang('Building Part'),
+                               'name_building_part' => lang('Name of the 
Building Part'),
+                               'component_id'    => lang('Component ID')
+                       );
+               }
+               
                private function _build_columns()
                {
                        $cached_file = $this->_get_components_cached_file();
@@ -327,14 +338,7 @@
 
                        $html_table = '<table class="pure-table 
pure-table-bordered">';
 
-                       $_options = array
-                       (
-                               '' => ' ... ',
-                               'new_column' => 'New attribute',
-                               'building_part' => '-- Building Part',
-                               'name_building_part' => '-- Name of the 
Building Part',
-                               'component_id'    => '-- Component ID'
-                       );
+                       $_options = $this->_get_default_options();
 
                        $template = explode("_", $template_id);
 
@@ -386,7 +390,7 @@
                        $cat_id = $template[1];
                        $attributes = 
$this->custom->find($this->type_app[$this->type], 
".{$this->type}.{$entity_id}.{$cat_id}", 0, '', 'ASC', 'attrib_sort', true, 
true);
                        
-                       $_options = array();
+                       $_options = $this->_get_default_options();
                        foreach ($attributes as $attribute)
                        {
                                if ($attrib_name_componentID == 
$attribute['column_name'])
@@ -395,14 +399,15 @@
                                }
                                $_options[$attribute['column_name']] = 
$attribute['input_text'];
                        }
-
-                       $_options['building_part'] = 'Building Part';
-                       $_options['component_id'] = 'Component ID';
-                       $_options['name_building_part'] = 'Name of the Building 
Part';
                        
                        $columns_name = array();
                        foreach ($columns as $k => $v)
                        {
+                               if ($v == 'new_column')
+                               {
+                                       unset($columns[$k]);
+                                       continue;
+                               }
                                $columns_name[] = $k .' => '.$_options[$v];
                        }
                        




reply via email to

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