fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16215]


From: nelson . guerra
Subject: [Fmsystem-commits] [16215]
Date: Tue, 31 Jan 2017 23:15:35 -0500 (EST)

Revision: 16215
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16215
Author:   nelson224
Date:     2017-01-31 23:15:35 -0500 (Tue, 31 Jan 2017)
Log Message:
-----------


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

Modified: 
branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php     
2017-02-01 04:15:12 UTC (rev 16214)
+++ branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php     
2017-02-01 04:15:35 UTC (rev 16215)
@@ -199,6 +199,54 @@
                        return $values;
                }
                
+               public function get_file_relations_componentes($data) 
+               {
+                       $start = isset($data['start']) && $data['start'] ? 
$data['start'] : 0;
+                       $results = isset($data['results']) && $data['results'] 
? $data['results'] : 0;
+                       $file_id = isset($data['file_id']) && $data['file_id'] 
? (int)$data['file_id'] : 0;
+                       $location_id = isset($data['location_id']) && 
$data['location_id'] ? (int)$data['location_id'] : 0;
+                       $allrows = isset($data['allrows']) ? $data['allrows'] : 
'';
+                       
+                       if ($location_id)
+                       {
+                               $filtermethod = "WHERE a.location_id = 
{$location_id} AND a.file_id = {$file_id}";
+                       } else {
+                               $filtermethod = "WHERE a.file_id = {$file_id}";
+                       }
+                       
+                       $sql = "SELECT a.file_id, b.type, b.id, b.location_id, 
b.location_code, b.json_representation, c.name AS category_name "
+                                       . "FROM phpgw_vfs_file_relation a INNER 
JOIN fm_bim_item b ON a.location_id = b.location_id AND a.location_item_id = 
b.id "
+                                       . "LEFT JOIN fm_entity_category c ON 
b.location_id = c.location_id" ." {$filtermethod} ";
+
+                       if (!$allrows)
+                       {
+                               $this->db->limit_query($sql, $start, __LINE__, 
__FILE__, $results);
+                       }
+                       else
+                       {
+                               $this->db->query($sql, __LINE__, __FILE__);
+                       }
+
+                       $values = array();
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array
+                                       (
+                                       'id' => $this->db->f('id'),
+                                       'location_id' => 
$this->db->f('location_id'),
+                                       'category_name' => 
$this->db->f('category_name')
+                               );
+                       }
+                       
+                       $sql2 = "SELECT count(*) as cnt FROM 
phpgw_vfs_file_relation a INNER JOIN fm_bim_item b ON a.location_id = 
b.location_id AND a.location_item_id = b.id " ." {$filtermethod} ";
+                       $this->db->query($sql2, __LINE__, __FILE__);
+
+                       $this->db->next_record();
+                       $this->total_records_componentes = $this->db->f('cnt');
+                       
+                       return $values;
+               }
+               
                function save_file_relations( $add, $delete, $location_id, 
$file_id )
                {
                        $this->db->transaction_begin();




reply via email to

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