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 inc/class.ged_dm.i...


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] ged inc/class.ged_ui.inc.php inc/class.ged_dm.i...
Date: Thu, 05 Apr 2007 09:27:16 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ged
Changes by:     Pascal Vilarem <maat>   07/04/05 09:27:16

Modified files:
        inc            : class.ged_ui.inc.php class.ged_dm.inc.php 
        templates/base : update_file.tpl 

Log message:
        fix : do jnot erase reference when updating file
        added : go back button when editing file

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_ui.inc.php?cvsroot=phpgroupware&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/update_file.tpl?cvsroot=phpgroupware&r1=1.6&r2=1.7

Patches:
Index: inc/class.ged_ui.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_ui.inc.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- inc/class.ged_ui.inc.php    4 Apr 2007 13:55:46 -0000       1.25
+++ inc/class.ged_ui.inc.php    5 Apr 2007 09:27:16 -0000       1.26
@@ -1200,6 +1200,8 @@
                $version_description=get_var('version_description', 
array('POST', 'GET'));
                $version_type=get_var('version_type', array('POST', 'GET'));
                
+               $go_back=get_var('go_back', array('POST', 'GET'));
+               
                $search=get_var('search', array('POST', 'GET'));
                $query=get_var('query', array('POST', 'GET'));
                $do_add_relation=get_var('do_add_relation', array('POST', 
'GET'));
@@ -1234,6 +1236,9 @@
                $this->t->set_var('reset_version_field', 'reset_version');
                $this->t->set_var('reset_version_action', lang('Undo'));
 
+               $this->t->set_var('go_back_field', 'go_back');
+               $this->t->set_var('go_back_action', lang('Go back'));
+
                $this->t->set_var('element_id_field', 'element_id');
                $this->t->set_var('file_name_field', 'file_name');
                $this->t->set_var('file_description_field', 'file_description');
@@ -1299,8 +1304,10 @@
         $GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
       }
       else
+      {
         print ( $version_added);
-      
+        $this->t->set_var('update_version_action', lang('New'));
+      }
       
     }
                elseif ($update_version==lang('Update') )
@@ -1342,6 +1349,14 @@
       
 
                }
+               elseif ( $go_back == lang('Go back'))
+               {
+                               $link_data=null;
+                               $link_data['menuaction']='ged.ged_ui.browse';
+                               $link_data['focused_id']=$element_id;
+
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
$link_data);                     
+               }
                else
                {
                        
$focused_element=$this->ged_dm->get_element_info($element_id);

Index: inc/class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- inc/class.ged_dm.inc.php    2 Apr 2007 18:06:36 -0000       1.21
+++ inc/class.ged_dm.inc.php    5 Apr 2007 09:27:16 -0000       1.22
@@ -188,7 +188,7 @@
                        print ( "update_file: entering.<br>\n");
 
                // DONE : add 'validity_period'
-               $sql_model="UPDATE %s set name='%s', description='%s', 
validity_period=%d, reference='%s' WHERE ";
+               $sql_model="UPDATE %s set name='%s', description='%s', 
validity_period=%d WHERE ";
                $sql_model.=" element_id=%d";
                
                if ( array_key_exists('validity_period', $new_file) )
@@ -196,7 +196,7 @@
                else
                        $new_file2['validity_period']=null;
                        
-               $sql=sprintf($sql_model, $this->tables['elements'], 
$this->cleanstr($new_file['name']), $this->cleanstr($new_file['description']), 
$new_file2['validity_period'], $this->cleanstr($new_file['reference']), 
$new_file['element_id']);
+               $sql=sprintf($sql_model, $this->tables['elements'], 
$this->cleanstr($new_file['name']), $this->cleanstr($new_file['description']), 
$new_file2['validity_period'], $new_file['element_id']);
 
                // TODO gestion des slashes !
                //print ($sql);

Index: templates/base/update_file.tpl
===================================================================
RCS file: /sources/phpgroupware/ged/templates/base/update_file.tpl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- templates/base/update_file.tpl      23 Mar 2007 16:07:15 -0000      1.6
+++ templates/base/update_file.tpl      5 Apr 2007 09:27:16 -0000       1.7
@@ -29,8 +29,10 @@
 </td>
 </tr>
 <tr>
-<td style="vertical-align: top; text-align: center;" colspan="2"><input 
type="submit" name="{update_file_field}" value="{update_file_action}">
+<td style="vertical-align: top; text-align: center;" colspan="2">
+<input type="submit" name="{update_file_field}" value="{update_file_action}">
 <input type="reset" name="{reset_file_field}" value="{reset_file_action}">
+<input type="submit" name="{go_back_field}" value="{go_back_action}">
 </form>
 </td>
 </tr>
@@ -127,6 +129,7 @@
 <td style="vertical-align: top; text-align: center;" colspan="2">
 <input type="submit" name="{update_version_field}" 
value="{update_version_action}">
 <input type="reset" name="{reset_version_field}" 
value="{reset_version_action}">
+<input type="submit" name="{go_back_field}" value="{go_back_action}">
 </form>
 </td>
 </tr>




reply via email to

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