fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14983]


From: Nelson Guerra
Subject: [Fmsystem-commits] [14983]
Date: Sat, 07 May 2016 00:43:37 +0000

Revision: 14983
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14983
Author:   nelson224
Date:     2016-05-07 00:43:37 +0000 (Sat, 07 May 2016)
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     
2016-05-07 00:43:22 UTC (rev 14982)
+++ branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php     
2016-05-07 00:43:37 UTC (rev 14983)
@@ -161,6 +161,39 @@
                        return $values;
                }
                
+               function set_file_relation( $items = array(), $location_id, 
$file_id )
+               {
+                       $this->db->query("DELETE FROM phpgw_vfs_file_relation 
WHERE file_id = {$file_id} AND location_id = {$location_id}", __LINE__, 
__FILE__);
+                       
+                       $date_format = 
phpgwapi_datetime::date_array(date('Y-m-d'));
+                       $date = mktime(2, 0, 0, $date_format['month'], 
$date_format['day'], $date_format['year']);
+                               
+                       if (count($items))
+                       {
+                               foreach($items as $item)
+                               {
+                                       $values_insert = array
+                                       (
+                                               'relation_id' => $item,
+                                               'file_id' => (int)$file_id,
+                                               'location_id' => 
(int)$location_id,
+                                               'location_item_id' => $item,
+                                               'is_private' => 0,
+                                               'account_id' => 
$GLOBALS['phpgw_info']['user']['account_id'],
+                                               'entry_date' => $date,
+                                               'start_date' => $date,
+                                               'end_date' => $date
+                                       );                              
+
+                                       $this->db->query("INSERT INTO 
phpgw_vfs_file_relation (" . implode(',', array_keys($values_insert)) . ') 
VALUES ('
+                                               . 
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__, 
__FILE__);                          
+                               }
+                       }
+                       
+                       return true;
+               }
+               
+               
                public function add( $data = array(), $file_id )
                {
                        $values_insert = array




reply via email to

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