fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15717]


From: nelson . guerra
Subject: [Fmsystem-commits] [15717]
Date: Thu, 22 Sep 2016 02:45:27 +0000 (UTC)

Revision: 15717
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15717
Author:   nelson224
Date:     2016-09-22 02:45:27 +0000 (Thu, 22 Sep 2016)
Log Message:
-----------


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

Modified: 
branches/dev-syncromind-2/property/inc/import/class.import_entity_categories.inc.php
===================================================================
--- 
branches/dev-syncromind-2/property/inc/import/class.import_entity_categories.inc.php
        2016-09-22 02:45:10 UTC (rev 15716)
+++ 
branches/dev-syncromind-2/property/inc/import/class.import_entity_categories.inc.php
        2016-09-22 02:45:27 UTC (rev 15717)
@@ -240,6 +240,7 @@
                                return $receipt;
                        }
                        
+                       $count = 0;
                        foreach ($building_part_in_table as $k => $v)
                        {       
                                $values2 = array
@@ -258,9 +259,14 @@
                                                $receipt['error'][] = 
array('msg' => $error['msg'].'. Building Part: '. $k);
                                        }
                                } else {
-                                       $receipt['message'][] = array('msg' => 
lang('Attributes has been added').'. Building Part: '. $k);
+                                       $count++;
+                                       
                                }
                        }
+                       if ($count)
+                       {
+                               $receipt['message'][] = array('msg' => 
lang('attributes has been added to %1 entity categories', $count));
+                       }
                        
                        return $receipt;
                }
@@ -444,92 +450,6 @@
                        return $receipt;
                }
                
-               /*public function add_attributes_to_template(&$columns, 
$attrib_names, $attrib_data_types, $attrib_precision)
-               {
-                       $receipt = array();
-                       
-                       $entity_id = $this->entity_id_from_template;
-                       $cat_id = $this->cat_id_from_template;
-                       
-                       $template_attrib_list = 
$this->bo->read_attrib(array('entity_id' => $entity_id, 'cat_id' => $cat_id, 
'allrows' => true));
-                       $template_attrib_names = array();
-                       foreach ($template_attrib_list as $attrib)
-                       {
-                               $template_attrib_names[] = 
$attrib['column_name'];
-                       }
-
-                       $appname = $this->type_app[$this->type];
-                       $location = ".{$this->type}.{$entity_id}.{$cat_id}";
-                       $attrib_table = 
$GLOBALS['phpgw']->locations->get_attrib_table($appname, $location);
-                       
-                       $attributes = array();
-                       
-                       foreach ($columns as $_row_key => $_value_key)
-                       {
-                               $attrib = array();
-                               if ($_value_key == 'new_column')
-                               {
-                                       $attrib['entity_id'] = $entity_id;
-                                       $attrib['cat_id'] = $cat_id;
-                                       $attrib['appname'] = $appname;
-                                       $attrib['location'] = $location;
-                       
-                                       $attrib['column_name'] = 
$attrib_names[$_row_key];
-                                       $attrib['input_text'] = 
ucfirst($attrib_names[$_row_key]);
-                                       $attrib['statustext'] = 
ucfirst($attrib_names[$_row_key]);
-                                       $attrib['column_info']['type'] = 
$attrib_data_types[$_row_key];
-                                       $attrib['column_info']['precision'] = 
$attrib_precision[$_row_key];
-                                       $attrib['column_info']['nullable'] = 
'True';
-                                       $attrib['search'] = 1;
-                                       
-                                       $receipt = 
$this->_valid_attributes($attrib);
-                                       if ($receipt['error'])
-                                       {
-                                               break;
-                                       }
-                                       
-                                       if(in_array($attrib['column_name'], 
$template_attrib_names, true))
-                                       {
-                                               continue;
-                                       }
-                                       
-                                       $attrib['_row_key'] = $_row_key;
-                                       $attributes[] = $attrib;
-                               }
-                       }
-                       
-                       if ($receipt['error'])
-                       {
-                               return $receipt;
-                       }
-                       
-                       $count = 0;
-                       foreach($attributes as $attrib)
-                       {
-                               $id = $this->custom->add($attrib, 
$attrib_table);       
-                               if ($id <= 0)
-                               {
-                                       $receipt['error'][] = array('msg' => 
lang('Unable to add field %1 ', $attrib['column_name']));
-                                       break;
-                               }
-                               else if ($id == -1)
-                               {
-                                       $receipt['error'][] = array('msg' => 
lang('field %1 already exists, please choose another name', 
$attrib['column_name']));
-                                       $receipt['error'][] = array('msg' => 
lang('Attribute %1 has NOT been saved', $attrib['column_name']));
-                                       break;
-                               }
-                               $columns[$attrib['_row_key']] = 
$attrib['column_name'];
-                               $count++;
-                       }
-                       
-                       if ($count)
-                       {
-                               $receipt['message'][] = array('msg' => lang('%1 
attributes has been added to template', $count));
-                       }
-                       
-                       return $receipt;
-               }*/
-               
                private function _valid_attributes($values)
                {
                        $receipt = array();




reply via email to

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