phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] ged/inc class.ged_dm.inc.php


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] ged/inc class.ged_dm.inc.php
Date: Wed, 07 Mar 2007 18:00:16 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ged
Changes by:     Pascal Vilarem <maat>   07/03/07 18:00:16

Modified files:
        inc            : class.ged_dm.inc.php 

Log message:
        Tiny corrections to avoid php low level notices

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.4&r2=1.5

Patches:
Index: class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- class.ged_dm.inc.php        2 Mar 2007 14:20:27 -0000       1.4
+++ class.ged_dm.inc.php        7 Mar 2007 18:00:16 -0000       1.5
@@ -77,6 +77,21 @@
 
        function debug ($thefunction)
        {
+               if ( ! isset($GLOBALS['debug']))
+                       $GLOBALS['debug']=Array();
+                       
+               if ( ! isset($GLOBALS['debug']['all']))
+                       $GLOBALS['debug']=false;
+               
+               if ( ! isset($GLOBALS['debug']['all']))
+                       $GLOBALS['debug']=false;
+               
+               if ( $GLOBALS['debug']["ged.".get_class($this)] )
+                       $GLOBALS['debug']["ged.".get_class($this)]=false;
+               
+               if ( 
$GLOBALS['debug']["ged.".get_class($this).".".$thefunction] )
+                       
$GLOBALS['debug']["ged.".get_class($this).".".$thefunction];
+
                if ( $GLOBALS['debug']['all'] || 
$GLOBALS['debug']["ged.".get_class($this)] || 
$GLOBALS['debug']["ged.".get_class($this).".".$thefunction])
                {
                        $GLOBALS['debug']['show']=true;
@@ -90,7 +105,7 @@
                return $ext;
        }
 
-       // TODO fo gerer aussi les contr�les d'acces */
+       // TODO fo gerer aussi les controles d'acces */
        function add_file($new_file)
        {
 
@@ -168,10 +183,10 @@
                        print ( "update_file: entering.<br>\n");
 
                // DONE : add 'validity_period'
-               $sql_model="UPDATE %s set name='%s', description='%s', 
reference='%s', validity_period='%s' WHERE ";
+               $sql_model="UPDATE %s set name='%s', description='%s', 
validity_period='%s' WHERE ";
                $sql_model.=" element_id=%d";
 
-               $sql=sprintf($sql_model, $this->tables['elements'], 
$new_file['name'], $new_file['description'], $new_file['reference'], 
$new_file['validity_period'], $new_file['element_id']);
+               $sql=sprintf($sql_model, $this->tables['elements'], 
$new_file['name'], addslashes($new_file['description']), 
$new_file['validity_period'], $new_file['element_id']);
 
                // TODO gestion des slashes !
                //print ($sql);
@@ -412,7 +427,7 @@
                $sql_model="INSERT INTO %s ( type, parent_id, name, reference, 
description, owner_id, creator_id, creation_date ) VALUES ";
                $sql_model.=" ( '%s', %d, '%s', '%s', '%s', %d, %d, %d) ";
 
-               $sql=sprintf($sql_model, $this->tables['elements'], 'folder', 
$new_folder['parent_id'], $new_folder['name'], $new_folder['steria_ref'], 
$new_folder['description'], $GLOBALS['phpgw_info']['user']['account_id'], 
$GLOBALS['phpgw_info']['user']['account_id'], time());
+               $sql=sprintf($sql_model, $this->tables['elements'], 'folder', 
$new_folder['parent_id'], $new_folder['name'], $new_folder['referenceq'], 
$new_folder['description'], $GLOBALS['phpgw_info']['user']['account_id'], 
$GLOBALS['phpgw_info']['user']['account_id'], time());
 
                //print ($sql);
 
@@ -718,7 +733,7 @@
                return ( $result );
        }
        
-       // TODO acl management DONE
+       // DONE acl management 
        function list_elements($parent_id=0, $type='', $order='name')
        {
 
@@ -752,7 +767,7 @@
                }
                //print ( $sql );
 
-               
+               $elements=Array();
 
                $i=0;
                while ($this->db->next_record())
@@ -827,7 +842,7 @@
                                
$versions[$ii]['file_extension']=$this->db->f('file_extension');
                                
$versions[$ii]['file_name']=$this->db->f('file_name');
                                
$versions[$ii]['stored_name']=$this->db->f('stored_name');
-//                             
$versions[$ii]['mime_type']=$this->get_mime_type($versions[$ii]['file_extension']);
+                               
$versions[$ii]['mime_type']=$this->get_mime_type($versions[$ii]['file_extension']);
                                
$versions[$ii]['file_full_path']=$this->datadir.'/'.$versions[$ii]['stored_name'];
                                
$versions[$ii]['validation_date']=$this->db->f('validation_date');
 
@@ -1112,7 +1127,7 @@
        // Positionnement des droits par d�faut
        // Full droits au groupe Admin (huhu)
        // Full droits au createur (presque huhu)
-       // H�ritage des droits du parent
+       // Heritage des droits du parent
        function set_default_acl($element_id)
        {
                $owner_id=$GLOBALS['phpgw_info']['user']['account_id'];




reply via email to

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