phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [19043] fixed acl: now allowing to change quality ref


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] [19043] fixed acl: now allowing to change quality reference with write privilege
Date: Tue, 27 Jan 2009 16:48:17 +0000

Revision: 19043
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=19043
Author:   maat
Date:     2009-01-27 16:48:16 +0000 (Tue, 27 Jan 2009)

Log Message:
-----------
fixed acl: now allowing to change quality reference with write privilege
fixed reference numbering: start from las reference for increments

Modified Paths:
--------------
    modules/ged/trunk/inc/class.flow_client.inc.php
    modules/ged/trunk/inc/class.ged_dm.inc.php

Modified: modules/ged/trunk/inc/class.flow_client.inc.php
===================================================================
--- modules/ged/trunk/inc/class.flow_client.inc.php     2009-01-22 14:23:38 UTC 
(rev 19042)
+++ modules/ged/trunk/inc/class.flow_client.inc.php     2009-01-27 16:48:16 UTC 
(rev 19043)
@@ -593,7 +593,7 @@
                        
                        $this->t->set_block('update_file_tpl', 'power_block', 
'power_block_handle');
                        // Begin power_block zone
-                       if ( $this->ged_dm->admin )
+                       if ( $this->ged_dm->can_write($version['element_id']) )
                        {
        
                        $this->t->set_var('new_reference', $referenceq);

Modified: modules/ged/trunk/inc/class.ged_dm.inc.php
===================================================================
--- modules/ged/trunk/inc/class.ged_dm.inc.php  2009-01-22 14:23:38 UTC (rev 
19042)
+++ modules/ged/trunk/inc/class.ged_dm.inc.php  2009-01-27 16:48:16 UTC (rev 
19043)
@@ -284,7 +284,7 @@
                        $sep=", ";
                }
 
-               if ( array_key_exists('doc_type', $new_file) && 
$new_file['doc_type'] != '' && $this->admin == true )
+               if ( array_key_exists('doc_type', $new_file) && 
$new_file['doc_type'] != '' && ( $this->admin == true || 
$this->can_write($new_file['element_id'] ) ) )
                {
                        
$sql.=$sep."doc_type='".$this->cleanstr($new_file['doc_type'])."'";
                        $sep=", ";
@@ -293,12 +293,12 @@
                        
$sql.=$sep."reference='".$this->cleanstr($new_file['reference'])."'";
                }
 
-               if ((int)$myelement['project_root'] != 0 && 
$this->is_chrono_type($new_file['doc_type']) && $myelement['doc_type'] != 
$new_file['doc_type'] && $this->admin == true )
+               if ((int)$myelement['project_root'] != 0 && 
$myelement['doc_type'] != $new_file['doc_type'] && ( $this->admin == true || 
$this->can_write($new_file['element_id'] ) ) )
                        
$next_ref=$this->get_next_available_reference($new_file['doc_type'], 
$myelement['project_root'] );
                else
                        $next_ref=$this->cleanstr($new_file['reference']);
 
-               if ( $next_ref != "" && $this->admin == true )
+               if ( $next_ref != "" && ( $this->admin == true || 
$this->can_write($new_file['element_id'] ) ) )
                {
                        $sql.=$sep."reference='".$next_ref."'";
                        $sep=", ";
@@ -3328,7 +3328,7 @@
                $type_base_ref=$project_base_ref."/".$type_std_ref;
                
                $db2 = clone($this->db);
-               $sql="SELECT reference FROM ged_elements WHERE reference like 
'".$type_base_ref."%' order by element_id desc limit 1";
+               $sql="SELECT reference FROM ged_elements WHERE reference like 
'".$type_base_ref."%' order by reference desc limit 1";
                $db2->query($sql, __LINE__, __FILE__);
                
                if($db2->next_record() && $type_base_ref != '')






reply via email to

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