phpgroupware-cvs
[Top][All Lists]
Advanced

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

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


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] ged/inc class.ged_ui.inc.php class.ged_dm.inc.php
Date: Fri, 30 Mar 2007 12:37:48 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ged
Changes by:     Pascal Vilarem <maat>   07/03/30 12:37:47

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

Log message:
        fixed : guess of new version for files with dependance alerts and 
quotes in descriptions

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_ui.inc.php?cvsroot=phpgroupware&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.16&r2=1.17

Patches:
Index: class.ged_ui.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_ui.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- class.ged_ui.inc.php        28 Mar 2007 15:24:22 -0000      1.21
+++ class.ged_ui.inc.php        30 Mar 2007 12:37:47 -0000      1.22
@@ -204,11 +204,6 @@
                $this->t->set_var('lang_reset_acl', lang('Reset AC'));
                $this->t->set_var('lang_go_back', lang('Go back'));
 
-               
//$this->t->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
-               
//$this->t->set_var('row_on',$GLOBALS['phpgw_info']['theme']['row_on']);
-               
//$this->t->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
-               
//$this->t->set_var('table_bg',$GLOBALS['phpgw_info']['theme']['table_bg']);
-
                $this->t->set_var('action_field', 'default');
 
                $this->t->set_var('input_default_class', 'text_default');
@@ -220,7 +215,7 @@
 
                $this->t->set_var('reference_color', 'red');
 
-               $this->t->set_var('img_download', 
$GLOBALS['phpgw']->common->image('ged', 'backup'));
+               $this->t->set_var('img_download-', 
$GLOBALS['phpgw']->common->image('ged', 'download'));
                $this->t->set_var('img_view', 
$GLOBALS['phpgw']->common->image('ged', 'eye'));
                $this->t->set_var('img_edit_version', 
$GLOBALS['phpgw']->common->image('ged', 'admin_log'));
 
@@ -1258,7 +1253,7 @@
       }
       else
       {
-       // Cetait la
+       // Cetait la [HOP1]
        
         $this->t->set_var('update_version_action', lang('New'));
         $version_type='minor';
@@ -1269,7 +1264,7 @@
 
 
 
-       // Now c'est là
+       // Now c'est là [HOP1]
        
       if ( ( $search=="search" || $do_add_relation != '' || 
$do_remove_relation != '' ) && $query != ''  )
                        {
@@ -1297,6 +1292,7 @@
                        else
                        {
                                
$version_relations=$this->ged_dm->list_version_relations_out ( 
$last_version['version_id'] );
+                               //_debug_array($version_relations);
                        }
                        
                        if ( $do_add_relation != '')
@@ -1330,19 +1326,26 @@
                        {
                                if ( $version_relation['status']=='obsolete' || 
$version_relation['status']=='rejected' )
                                {
-                               //print ( 'new version : 
'.$version_relation['version_id']."<br/>\n");
+                               print ( 'new version : 
'.$version_relation['version_id']."<br/>\n");
                                
                                // TODO : prepare data for future relation 
creation
-                               
$new_relations[$nri]=$this->ged_dm->get_current_version($version_relation['element_id']);
+                               
$the_new_relations=$this->ged_dm->get_current_version($version_relation['element_id']);
+                               
+                               
$new_relations[$nri]['linked_version_id']=$the_new_relations['version_id'];
+                               
$new_relations[$nri]['reference']=$version_relation['reference'];
+                               
$new_relations[$nri]['name']=$version_relation['name'];
+                               
$new_relations[$nri]['major']=$the_new_relations['major'];
+                               
$new_relations[$nri]['minor']=$the_new_relations['minor'];
+                               
$new_relations[$nri]['status']=$the_new_relations['status'];
+                               
                                
-                               
$new_relations[$nri]['linked_version_id']=$version_relation['version_id'];
                                
$new_relations[$nri]['relation_type']='dependancy';
                                
                                $nri++;                                         
                                }
                                else
                                {
-                               //print ( 'report : 
'.$version_relation['version_id']."<br/>\n");
+                               print ( 'report : 
'.$version_relation['version_id']."<br/>\n");
                                
                                // TODO : prepare data for future relation 
creation
                                
$new_relations[$nri]['linked_version_id']=$version_relation['version_id'];

Index: class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- class.ged_dm.inc.php        28 Mar 2007 15:24:22 -0000      1.16
+++ class.ged_dm.inc.php        30 Mar 2007 12:37:47 -0000      1.17
@@ -322,7 +322,7 @@
                                $sql_model1="INSERT INTO %s ( size, file_name, 
stored_name, file_extension, creator_id, creation_date, status, element_id, 
description, major, minor ) VALUES ";
                                $sql_model1.=" (  %d, '%s', '%s', '%s', %d, %d, 
'%s', %d, '%s', %d, %d ) ";
        
-                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], $new_version['file_size'], 
$new_version['file_name'], $candidate_name, $extension, 
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'working', 
$new_version['element_id'], $new_version['description'], $major, $minor);
+                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], $new_version['file_size'], 
$new_version['file_name'], $candidate_name, $extension, 
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'working', 
$new_version['element_id'], $this->cleanstr($new_version['description']), 
$major, $minor);
        
                                //print ("<br/>".$sql1);
        
@@ -368,7 +368,7 @@
 
                // MEMO gestion des numeros de versions
                
-               
$cur_version=$this->get_current_version($amended_version['element_id']);
+               
$cur_version=$this->get_current_or_alert_or_rejected_version($amended_version['element_id']);
                
$me_version=$this->get_version_info($amended_version['version_id']);
                
                if (  $me_version['status']=='working' )
@@ -431,7 +431,7 @@
                                $sql_model1.="status='%s', description='%s', 
major=%d, minor=%d ";
                                $sql_model1.="WHERE version_id=%d";
        
-                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], $amended_version['file_size'], 
$amended_version['file_name'], $candidate_name, $extension, 'working', 
$amended_version['description'], $major, $minor, 
$amended_version['version_id']);
+                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], $amended_version['file_size'], 
$amended_version['file_name'], $this->cleanstr($candidate_name), $extension, 
'working', $this->cleanstr($amended_version['description']), $major, $minor, 
$amended_version['version_id']);
                        }
                        else
                        {
@@ -439,7 +439,7 @@
                                $sql_model1.="status='%s', description='%s', 
major=%d, minor=%d ";
                                $sql_model1.="WHERE version_id=%d";
        
-                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], 'working', $amended_version['description'], $major, 
$minor, $amended_version['version_id']);
+                               $sql1=sprintf($sql_model1, 
$this->tables['versions'], 'working', 
$this->cleanstr($amended_version['description']), $major, $minor, 
$amended_version['version_id']);
                        }
        
                        $this->db->query($sql1, __LINE__, __FILE__);




reply via email to

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