fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15415]


From: nelson . guerra
Subject: [Fmsystem-commits] [15415]
Date: Thu, 4 Aug 2016 01:25:32 +0000 (UTC)

Revision: 15415
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15415
Author:   nelson224
Date:     2016-08-04 01:25:30 +0000 (Thu, 04 Aug 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-08-03 13:01:30 UTC (rev 15414)
+++ branches/dev-syncromind-2/property/inc/class.uiimport_components.inc.php    
2016-08-04 01:25:30 UTC (rev 15415)
@@ -46,8 +46,8 @@
 
                        $this->bocommon = CreateObject('property.bocommon');
                        $this->acl = & $GLOBALS['phpgw']->acl;
+                       $this->db = & $GLOBALS['phpgw']->db;
 
-
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"property::documentation::generic";
                }
 
@@ -74,6 +74,9 @@
                public function import_component_files()
                {
                        $get_identificator = true;
+                       
+                       //$query = '+VZ=330.0001-UZ0010T - Sprinklerhoder';
+                       //$ids = $this->get_component($query);
 
                        $result = 
$this->getexceldata($_FILES['file']['tmp_name'], $get_identificator);
                        $data = array();
@@ -88,7 +91,14 @@
                                $data[$row[0]][] = $row[(count($row)-1)];
                        }
                        
-                       print_r($data); die;
+                       foreach ($data as $k => $v)
+                       {
+                               $ids = $this->get_component($k);
+                               $values[$k]['ids'] = $ids;
+                               $values[$k]['files'] = $v;
+                       }
+                       
+                       print_r($values); die;
                        /*require_once PHPGW_SERVER_ROOT . 
"/property/inc/import/server/php/UploadHandler.php";
                        $options['upload_dir'] = 
$GLOBALS['phpgw_info']['server']['files_dir'];
                        $options['script_url'] = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiimport_components.delete_file_upload'));
@@ -198,6 +208,27 @@
 
                }
                
+               protected function get_component( $query )
+               {
+                       if ($query)
+                       {
+                               $query = $this->db->db_addslashes($query);
+                       }
+
+                       $sql = "SELECT * from fm_bim_item where 
(xpath('//./benevnelse/text()', xml_representation))[1]::text = '$query'::text";
+
+                       $this->db->query($sql, __LINE__, __FILE__);
+
+                       $values = array();
+                       while ($this->db->next_record())
+                       {
+                               $values['id'] = $this->db->f('id');
+                               $values['location_id'] = 
$this->db->f('location_id');
+                       }
+
+                       return $values;
+               }
+               
                /**
                 * Prepare UI
                 * @return void




reply via email to

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