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 inc/hook_home.inc....


From: Pascal Vilarem
Subject: [Phpgroupware-cvs] ged inc/class.ged_dm.inc.php inc/hook_home.inc....
Date: Mon, 12 Mar 2007 16:53:33 +0000

CVSROOT:        /sources/phpgroupware
Module name:    ged
Changes by:     Pascal Vilarem <maat>   07/03/12 16:53:33

Modified files:
        inc            : class.ged_dm.inc.php hook_home.inc.php 
                         class.ged_ui.inc.php 
        templates/base : browse.tpl 
        templates/base/css: default.css 
Added files:
        templates/base/images: ready_for_delivery-16.png current-16.png 
                               rejected-16.png obsolete-16.png 
                               pending_for_internal_review-16.png 
                               alert-16.png approved-16.png view-16.png 
                               working-16.png 
                               pending_for_approval-16.png 
                               download-16.png 

Log message:
        improved home board

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/ged/inc/hook_home.inc.php?cvsroot=phpgroupware&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_ui.inc.php?cvsroot=phpgroupware&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/ready_for_delivery-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/current-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/rejected-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/obsolete-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/pending_for_internal_review-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/alert-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/approved-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/view-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/working-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/pending_for_approval-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/images/download-16.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/browse.tpl?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/templates/base/css/default.css?cvsroot=phpgroupware&r1=1.3&r2=1.4

Patches:
Index: inc/class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- inc/class.ged_dm.inc.php    8 Mar 2007 22:24:46 -0000       1.7
+++ inc/class.ged_dm.inc.php    12 Mar 2007 16:53:32 -0000      1.8
@@ -264,7 +264,10 @@
                
$cur_version=$this->get_current_version($new_version['element_id']);
                $major=$cur_version['major'];
                $minor=$cur_version['minor'];
+               
$last_version=$this->get_last_version($new_version['element_id']);
 
+               if ($last_version['status'] == 'current' || 
$last_version['status'] == 'rejected' )
+               {
                if ($new_version['type']=='major')
                {
                        $major ++;
@@ -331,6 +334,7 @@
                        print ( "add_version: end.<br>\n");
 
                return "OK";
+               }
 
        }
 
@@ -342,6 +346,8 @@
                
$cur_version=$this->get_current_version($amended_version['element_id']);
                
$me_version=$this->get_version_info($amended_version['version_id']);
 
+               if (  $me_version['status']=='working' )
+               {
                $major=$cur_version['major'];
                $minor=$cur_version['minor'];
 
@@ -411,6 +417,8 @@
                $this->db->query($sql1, __LINE__, __FILE__);
                $this->db->unlock();
 
+               }
+
                // New status management system
                // Based on aproval in progress
                
@@ -612,6 +620,54 @@
                return $version;
        }
 
+       function get_working_version($element_id)
+       {
+               if ( $this->debug('get_working_version') )
+                       print ( "get_working_version: entering with 
element_id=".$element_id."<br>\n");
+               
+               $sql="SELECT * FROM ".$this->tables['versions']." ";
+               $sql.="WHERE element_id=".$element_id." ";
+               $sql.="AND ( status='working' )";
+               $sql.="ORDER BY version_id DESC LIMIT 1";
+
+               if ( $this->debug('get_working_version') )
+                       print ( "get_working_version: ".$sql."<br>\n");
+
+               //print ("<pre>");
+               //print_r($this->db->metadata( $this->tables['versions'] ));
+               //print ("</pre>");
+               
+               
+               $this->db->query($sql, __LINE__, __FILE__);
+
+               if ($this->db->next_record());
+               {
+                       
+                       
$version['validation_date']=$this->db->f('validation_date');
+                       $version['url']=$this->db->f('url');
+                       $version['size']=$this->db->f('size');
+                       $version['status']=$this->db->f('status');
+                       $version['creator_id']=$this->db->f('creator_id');
+                       $version['creation_date']=$this->db->f('creation_date');
+                       $version['minor']=$this->db->f('minor');
+                       $version['version_id']=$this->db->f('version_id');
+                       $version['element_id']=$this->db->f('element_id');
+                       $version['description']=$this->db->f('description');
+                       
$version['file_extension']=$this->db->f('file_extension');
+                       $version['file_name']=$this->db->f('file_name');
+                       $version['stored_name']=$this->db->f('stored_name');
+                       $version['major']=$this->db->f('major');
+                       
$version['file_full_path']=$this->datadir.'/'.$version['stored_name'];
+                       
+                       
$version['mime_type']=$this->get_mime_type($version['file_extension']);
+                       
+               }
+
+               $this->db->unlock();
+                               
+               return $version;
+       }
+
        function get_working_or_pending_version($element_id)
        {
                if ( $this->debug('get_working_version') )
@@ -619,7 +675,7 @@
                
                $sql="SELECT * FROM ".$this->tables['versions']." ";
                $sql.="WHERE element_id=".$element_id." ";
-               $sql.="AND ( status='working' OR status='pending' )";
+               $sql.="AND ( status='working' OR 
status='pending_for_internal_review' OR status='pending_for_approval' )";
                $sql.="ORDER BY version_id DESC LIMIT 1";
 
                if ( $this->debug('get_working_version') )
@@ -1384,6 +1440,21 @@
        // and the performer of this action must have editor role
        function submit_file ( $element_id )
        {
+                       
$working_version=$this->get_working_version($element_id);
+                       
+                       // Need to check if there is a working version
+                       if (is_array($working_version) )
+                       {
+                               if ($working_version['version_id'] )
+                               {
+                                       // Set "pending_for_internal_review" 
status
+                                       // TODO : Add submission date
+                                       $sql="UPDATE ged_versions set 
status='pending_for_internal_review' WHERE 
version_id=".$working_version['version_id'];                   
+                                       $this->db->query($sql, __LINE__, 
__FILE__);
+                               }
+                       }
+                                               
+                       $this->db->unlock();
        }
 
        function list_new_documents ()
@@ -1403,7 +1474,7 @@
                
                // List new suff
                
-               $sql="SELECT * from ged_elements INNER JOIN ged_versions ON 
ged_elements.element_id=ged_versions.element_id ";
+               $sql="SELECT ged_elements.*, ged_versions.* from ged_elements 
INNER JOIN ged_versions ON ged_elements.element_id=ged_versions.element_id ";
                $sql.="WHERE ged_versions.status='current' AND ( 
ged_versions.validation_date >=$then ";
                $sql.="OR ( ( ged_elements.validity_period > 0 OR 
ged_elements.validity_period IS NOT NULL) AND ged_versions.creation_date 
>=$then ))";
                
@@ -1418,6 +1489,7 @@
                        {
                                $docs[$i]['element_id']=$element_id;
                                $docs[$i]['name']=$this->db->f('name');
+                               $docs[$i]['status']=$this->db->f('status');
                                
$docs[$i]['reference']=$this->db->f('reference');
                                
$docs[$i]['description']=$this->db->f('description');
                                $i ++;
@@ -1437,9 +1509,16 @@
                $now=time();
                $then=$now+$period*24*3600;
                
-               $sql="SELECT * from ged_elements INNER JOIN ged_versions ON 
ged_elements.element_id=ged_versions.element_id ";
-               $sql.="WHERE ged_versions.status='current' AND ( 
ged_elements.validity_period+ged_versions.validation_date < $then ";
-               $sql.="OR ( ( ged_elements.validity_period > 0 OR 
ged_elements.validity_period IS NOT NULL) AND ged_versions.validation_date IS 
NULL ))";
+               $sql="SELECT ged_elements.*, ged_current_version.* ";
+               $sql.="FROM ( ged_elements ";
+               $sql.="INNER JOIN ged_versions as ged_current_version ";
+               $sql.="ON 
ged_elements.element_id=ged_current_version.element_id ";
+               $sql.="AND ged_current_version.status='current' ) ";
+               $sql.="GROUP BY ged_elements.element_id ";
+               $sql.="HAVING ged_elements.validity_period IS NOT NULL ";
+               $sql.="AND ged_elements.validity_period > 0 ";
+               $sql.="AND ( 
ged_elements.validity_period+ged_current_version.validation_date < $then ";
+               $sql.="OR  ged_current_version.validation_date IS NULL ) ";
                
                $this->db->query($sql);
 
@@ -1447,12 +1526,14 @@
                while ($this->db->next_record())
                {
                        $element_id=$this->db->f('element_id');
+                       $version_id=$this->db->f('version_id');
                        
                        if ( $this->can_read($element_id) )
                        {
                                $docs[$i]['element_id']=$element_id;
                                $docs[$i]['name']=$this->db->f('name');
                                
$docs[$i]['reference']=$this->db->f('reference');
+                               $docs[$i]['status']=$this->db->f('status');
                                
$docs[$i]['description']=$this->db->f('description');
                                
$docs[$i]['validity_period']=$this->db->f('validity_period');
                                
$docs[$i]['validation_date']=$this->db->f('validation_date');
@@ -1463,7 +1544,48 @@
                        
                $this->db->unlock();
 
+               if ( isset($docs))
                return ($docs);
+               else
+                       return null;
+       
+       }
+
+       function list_pending_documents ()
+       {
+                                       
+               $sql="SELECT ged_elements.*, ged_current_version.* ";
+               $sql.="FROM ( ged_elements ";
+               $sql.="INNER JOIN ged_versions as ged_current_version ";
+               $sql.="ON 
ged_elements.element_id=ged_current_version.element_id ";
+               $sql.="AND ( 
ged_current_version.status='pending_for_internal_review' or 
ged_current_version.status='pending_for_approval' )) ";
+               $sql.="GROUP BY ged_elements.element_id ";
+               
+               $this->db->query($sql);
+
+               $i=0;
+               while ($this->db->next_record())
+               {
+                       $element_id=$this->db->f('element_id');
+                       $version_id=$this->db->f('version_id');
+                       
+                       if ( $this->can_write($element_id) )
+                       {
+                               $docs[$i]['element_id']=$element_id;
+                               $docs[$i]['name']=$this->db->f('name');
+                               $docs[$i]['status']=$this->db->f('status');
+                               
$docs[$i]['reference']=$this->db->f('reference');
+                               
$docs[$i]['description']=$this->db->f('description');
+                               $i ++;
+                       }
+               }
+                       
+               $this->db->unlock();
+               
+               if ( isset($docs))
+                       return ($docs);
+               else
+                       return null;
        
        }
 

Index: inc/hook_home.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/hook_home.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- inc/hook_home.inc.php       30 Aug 2006 17:02:38 -0000      1.5
+++ inc/hook_home.inc.php       12 Mar 2007 16:53:32 -0000      1.6
@@ -19,7 +19,7 @@
                        $title='<font color="#FFFFFF">'.lang('ged').'</font>';
                
                $portalbox=CreateObject('phpgwapi.listbox',
-                       Array(
+                       @Array(
                                'title'=>$title,
                                
'primary'=>$GLOBALS['phpgw_info']['theme']['navbar_bg'],
                                
'secondary'=>$GLOBALS['phpgw_info']['theme']['navbar_bg'],
@@ -33,11 +33,11 @@
                $app_id=$GLOBALS['phpgw']->applications->name2id('ged');
                $GLOBALS['portal_order'][]=$app_id;
                $var=Array(
-                       'up'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
-                       'down'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
-                       'close'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
-                       'question'=>Array('url'=>'/set_box.php', 
'app'=>$app_id),
-                       'edit'=>Array('url'=>'/set_box.php', 'app'=>$app_id)
+               //      'up'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
+               //      'down'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
+               //      'close'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
+               //      'question'=>Array('url'=>'/set_box.php', 
'app'=>$app_id),
+               //      'edit'=>Array('url'=>'/set_box.php', 'app'=>$app_id)
                );
 
                while(list($key,$value)=each($var))
@@ -47,12 +47,13 @@
 
                        $portalbox->data=Array();
                        
-                       if($data)
+                       if ( isset($data))
+                               if(is_array($data))
                        {
                                $portalbox->data=$data;
                        }
                        
-                       $GLOBALS['extra_data']='<td style="background: 
white;"><div style="margin-left: 1em;">'."\n";
+                       $GLOBALS['extra_data']='<td><div style="margin-left: 
1em;">'."\n";
                        
                        /* partie interessante */
                        
@@ -62,9 +63,13 @@
                        
                        if ( is_array($docs1) )
                        {
+                               $GLOBALS['extra_data'] .="<table>\n";
+                               $GLOBALS['extra_data'] .="<tr>\n";
+                               $GLOBALS['extra_data'] .="<td colspan=\"2\">\n";
                                $GLOBALS['extra_data'] .="<h2>".lang ('New 
documents')."</h2>"."\n";
+                               $GLOBALS['extra_data'] .="</td>\n";
+                               $GLOBALS['extra_data'] .="</tr>\n";
                        
-                               $GLOBALS['extra_data'] .="<ul 
style=\"margin-left: 2em;\">\n";
                                foreach ( $docs1 as $doc )
                                {
                                        
@@ -72,21 +77,34 @@
                                        
$link_data['focused_id']=$doc['element_id'];
                                        
$link=$GLOBALS['phpgw']->link('/index.php', $link_data);
                        
+                                       $GLOBALS['extra_data'] .="<tr>\n";
+                                       $GLOBALS['extra_data'] .="<td>\n";
+                                       $GLOBALS['extra_data'] .= "<img 
src=\"".$GLOBALS['phpgw']->common->image('ged', $doc['status']."-16")."\">\n";
+                                       $GLOBALS['extra_data'] .="</td>\n";
+
+                                       $GLOBALS['extra_data'] .="<td>\n";
                                        if ( $doc['reference'] !="" )
-                                               $GLOBALS['extra_data'] 
.="<li><a href=\"".$link."\" >".$doc['name']." 
(".$doc['reference'].")</a>"."</li>\n";
+                                               $GLOBALS['extra_data'] .="<a 
href=\"".$link."\" >".$doc['name']." [".$doc['reference']."]</a>\n";
                                        else
-                                               $GLOBALS['extra_data'] 
.="<li><a href=\"".$link."\" >".$doc['name']."</a>"."</li>\n";
+                                               $GLOBALS['extra_data'] .="<a 
href=\"".$link."\" >".$doc['name']."</a>\n";
+                                       
+                                       $GLOBALS['extra_data'] .="</td>\n";
+                                       $GLOBALS['extra_data'] .="</tr>\n";
                                }
-                               $GLOBALS['extra_data'] .="</ul>\n";
+                               $GLOBALS['extra_data'] .="</table>\n";
                        }
 
                        $docs2=$ged_dm->list_documents_to_expire();
                        
                        if ( is_array($docs2) )
                        {
-                               $GLOBALS['extra_data'] .="<h2>".lang('Documents 
to check soon')."</h2>"."\n";
+                               $GLOBALS['extra_data'] .="<table>\n";
+                               $GLOBALS['extra_data'] .="<tr>\n";
+                               $GLOBALS['extra_data'] .="<td colspan=\"2\">\n";
+                               $GLOBALS['extra_data'] .="<h2>".lang 
('Documents to check soon')."</h2>"."\n";
+                               $GLOBALS['extra_data'] .="</td>\n";
+                               $GLOBALS['extra_data'] .="</tr>\n";
                                
-                               $GLOBALS['extra_data'] .="<ul 
style=\"margin-left: 2em;\">"."\n";
                                foreach ( $docs2 as $doc )
                                {
                                        
@@ -99,12 +117,57 @@
                                        else
                                                $expiration=lang("Too late!");
                        
+                                       $GLOBALS['extra_data'] .="<tr>\n";
+                                       $GLOBALS['extra_data'] .="<td>\n";
+                                       $GLOBALS['extra_data'] .= "<img 
src=\"".$GLOBALS['phpgw']->common->image('ged', $doc['status']."-16")."\">\n";
+                                       $GLOBALS['extra_data'] .="</td>\n";
+
+                                       $GLOBALS['extra_data'] .="<td>\n";
+
                                        if ( $doc['reference'] !="" )
-                                               $GLOBALS['extra_data'] 
.="<li><a href=\"".$link."\" >".$doc['name']." (".$doc['reference'].")</a> 
[".lang("Deadline")." : ".$expiration."]</li>"."\n";
+                                               $GLOBALS['extra_data'] .="<a 
href=\"".$link."\" >".$doc['name']." [".$doc['reference']."]</a> 
(".lang("Deadline")." : ".$expiration.")"."\n";
                                        else
-                                               $GLOBALS['extra_data'] 
.="<li><a href=\"".$link."\" >".$doc['name']."</a> [".lang("Deadline")." : 
".$expiration."]</li>"."\n";
+                                               $GLOBALS['extra_data'] .="<a 
href=\"".$link."\" >".$doc['name']."</a> (".lang("Deadline")." : 
".$expiration.")"."\n";
+
+                                       $GLOBALS['extra_data'] .="</td>\n";
+                                       $GLOBALS['extra_data'] .="</tr>\n";
+                               }
+                               $GLOBALS['extra_data'] .="</table>\n";
+                       }
+
+                       $docs3=$ged_dm->list_pending_documents();
+                       
+                       if ( is_array($docs3) )
+                       {
+                               $GLOBALS['extra_data'] .="<table>\n";
+                               $GLOBALS['extra_data'] .="<tr>\n";
+                               $GLOBALS['extra_data'] .="<td colspan=\"2\">\n";
+                               $GLOBALS['extra_data'] .="<h2>".lang ('Pending 
documents')."</h2>"."\n";
+                               $GLOBALS['extra_data'] .="</td>\n";
+                               $GLOBALS['extra_data'] .="</tr>\n";
+
+                               foreach ( $docs3 as $doc )
+                               {
+                                       
+                                       
$link_data['menuaction']='ged.ged_ui.browse';
+                                       
$link_data['focused_id']=$doc['element_id'];
+                                       
$link=$GLOBALS['phpgw']->link('/index.php', $link_data);
+                                                               
+                                       $GLOBALS['extra_data'] .="<tr>\n";
+                                       $GLOBALS['extra_data'] .="<td>\n";
+                                       $GLOBALS['extra_data'] .= "<img 
src=\"".$GLOBALS['phpgw']->common->image('ged', $doc['status']."-16")."\">\n";
+                                       $GLOBALS['extra_data'] .="</td>\n";
+
+                                       $GLOBALS['extra_data'] .="<td>\n";
+                                       if ( $doc['reference'] !="" )
+                                               $GLOBALS['extra_data'] .="<a 
href=\"".$link."\" >".$doc['name']." [".$doc['reference']."]</a>"."\n";
+                                       else
+                                               $GLOBALS['extra_data'] .="<a 
href=\"".$link."\" >".$doc['name']."</a>"."\n";
+
+                                       $GLOBALS['extra_data'] .="</td>\n";
+                                       $GLOBALS['extra_data'] .="</tr>\n";
                                }
-                               $GLOBALS['extra_data'] .="</ul>"."\n";
+                               $GLOBALS['extra_data'] .="</table>\n";
                        }
                        
                        /* fin partie interessante */

Index: inc/class.ged_ui.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_ui.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- inc/class.ged_ui.inc.php    9 Mar 2007 16:27:10 -0000       1.11
+++ inc/class.ged_ui.inc.php    12 Mar 2007 16:53:32 -0000      1.12
@@ -22,7 +22,7 @@
        var $debug=1;
        var $browser;
 
-       var $public_functions=array('browse'=>true, 'add_file'=>true, 
'add_folder'=>true, 'update_file'=>true, 'update_folder'=>true, 
'delete_folder'=>true, 'download'=>true, 'view'=>true, 'update_file'=>true, 
'delete_file'=>true, 'change_acl'=>true, 'approve_file'=>true );
+       var $public_functions=array('browse'=>true, 'add_file'=>true, 
'add_folder'=>true, 'update_file'=>true, 'update_folder'=>true, 
'delete_folder'=>true, 'download'=>true, 'view'=>true, 'update_file'=>true, 
'delete_file'=>true, 'change_acl'=>true, 'approve_file'=>true, 'submit_file'=> 
true );
 
        var $icons;
 
@@ -695,6 +695,8 @@
                                if ( $this->debug('browse') )
                                        print ( "browse: case file<br/>\n");
 
+                               
$last_version=$this->ged_dm->get_last_version($focused_id);
+
                                $this->t->set_var('main_content', 
$this->draw_file_panel($focused_id));
                                $this->t->set_var('add_folder', '');
                                $this->t->set_var('lang_add_folder', '');
@@ -702,7 +704,7 @@
                                $this->t->set_var('lang_add_file', '');
                                
                                // TODO if acl write DONE
-                               if ( $this->ged_dm->can_write($focused_id) )
+                               if ( $this->ged_dm->can_write($focused_id) && ( 
$last_version['status'] == 'working' || $last_version['status'] == 'current' || 
$last_version['status'] == 'rejected'  ) )
                                {
                                        $link_data=null;
                                        
$link_data['menuaction']='ged.ged_ui.update_file';
@@ -723,9 +725,19 @@
                                // TODO : Add actions depending on document 
status and user roles
                                // TODO : if can_write and exist working version
                                // TODO : add a "submit" document link 
+                               if ( $this->ged_dm->can_write($focused_id) && 
$last_version['status'] == 'working' )
+                               {
+                                       $link_data=null;
+                                       
$link_data['menuaction']='ged.ged_ui.submit_file';
+                                       $link_data['element_id']=$focused_id;
+                                       
$approve_file_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
+                                       $this->t->set_var('submit_file', "<a 
href=\"".$approve_file_url."\">".lang('Submit file')."</a>");
+                                       
+                               }
+                               
                                
                                // TODO : droit specifique d'approbation ?
-                               if ( $this->ged_dm->can_change_acl($focused_id) 
)
+                               if ( $this->ged_dm->admin && 
($last_version['status'] == 'working' || $last_version['status'] == 
'pending_for_internal_review' || $last_version['status'] == 
'pending_for_approval' )  )
                                {
                                        $link_data=null;
                                        
$link_data['menuaction']='ged.ged_ui.approve_file';
@@ -1395,8 +1407,8 @@
 
        }
        
-       // TODO : g�rer la confirmation DONE
-       // TODO : Afficher quelques d�tails... nom etc.
+       // TODO : gerer la confirmation DONE
+       // TODO : Afficher quelques details... nom etc.
        function delete_folder()
        {
                $element_id=get_var('element_id', array('GET', 'POST'));
@@ -1627,6 +1639,19 @@
                $GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
        }
        
+       function submit_file()
+       {
+               $element_id=get_var('element_id', array('GET', 'POST'));
+               
+               $this->ged_dm->submit_file ( $element_id );
+
+               $link_data=null;
+               $link_data['menuaction']='ged.ged_ui.browse';
+               $link_data['focused_id']=$element_id;
+       
+               $GLOBALS['phpgw']->redirect_link('/index.php', $link_data);
+       }
+       
 }
 
 ?>

Index: templates/base/browse.tpl
===================================================================
RCS file: /sources/phpgroupware/ged/templates/base/browse.tpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- templates/base/browse.tpl   8 Mar 2007 17:01:31 -0000       1.2
+++ templates/base/browse.tpl   12 Mar 2007 16:53:32 -0000      1.3
@@ -1,4 +1,4 @@
-<div id="ged_top_menu">{top_link} {up_link} {update_folder} {add_folder} 
{delete_folder} {add_file} {edit_file} {update_file} {approve_file} 
{delete_file} {change_acl}</div>
+<div id="ged_top_menu">{top_link} {up_link} {update_folder} {add_folder} 
{delete_folder} {add_file} {edit_file} {update_file} {submit_file} 
{accept_file} {reject_file} {approve_file} {delete_file} {change_acl}</div>
 <br/>
 <div id="ged_info">
 {main_content}

Index: templates/base/css/default.css
===================================================================
RCS file: /sources/phpgroupware/ged/templates/base/css/default.css,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- templates/base/css/default.css      8 Mar 2007 22:24:46 -0000       1.3
+++ templates/base/css/default.css      12 Mar 2007 16:53:32 -0000      1.4
@@ -140,22 +140,22 @@
 background: #fff9c4;
 }
 
-.file_version_waiting_internal_check_odd
+.file_version_pending_for_internal_review_odd
 {
-background: #7ba7ff;
+background: #fff9c4;
 }
 
-.file_version_waiting_internal_check_even
+.file_version_pending_for_internal_review_even
 {
-background: #7ba7ff;
+background: #fff9c4;
 }
 
-.file_version_waiting_approval_odd
+.file_version_pending_for_approval_odd
 {
 background: #ffbd83;
 }
 
-.file_version_waiting_approval_even
+.file_version_pending_for_approval_even
 {
 background: #ffbd83;
 }

Index: templates/base/images/ready_for_delivery-16.png
===================================================================
RCS file: templates/base/images/ready_for_delivery-16.png
diff -N templates/base/images/ready_for_delivery-16.png
Binary files /dev/null and /tmp/cvs6NCaBp differ

Index: templates/base/images/current-16.png
===================================================================
RCS file: templates/base/images/current-16.png
diff -N templates/base/images/current-16.png
Binary files /dev/null and /tmp/cvsqeMCmq differ

Index: templates/base/images/rejected-16.png
===================================================================
RCS file: templates/base/images/rejected-16.png
diff -N templates/base/images/rejected-16.png
Binary files /dev/null and /tmp/cvsLSc8qt differ

Index: templates/base/images/obsolete-16.png
===================================================================
RCS file: templates/base/images/obsolete-16.png
diff -N templates/base/images/obsolete-16.png
Binary files /dev/null and /tmp/cvsmXrhiu differ

Index: templates/base/images/pending_for_internal_review-16.png
===================================================================
RCS file: templates/base/images/pending_for_internal_review-16.png
diff -N templates/base/images/pending_for_internal_review-16.png
Binary files /dev/null and /tmp/cvsVahXFs differ

Index: templates/base/images/alert-16.png
===================================================================
RCS file: templates/base/images/alert-16.png
diff -N templates/base/images/alert-16.png
Binary files /dev/null and /tmp/cvskHA8dw differ

Index: templates/base/images/approved-16.png
===================================================================
RCS file: templates/base/images/approved-16.png
diff -N templates/base/images/approved-16.png
Binary files /dev/null and /tmp/cvszOYTEu differ

Index: templates/base/images/view-16.png
===================================================================
RCS file: templates/base/images/view-16.png
diff -N templates/base/images/view-16.png
Binary files /dev/null and /tmp/cvs8HKMfv differ

Index: templates/base/images/working-16.png
===================================================================
RCS file: templates/base/images/working-16.png
diff -N templates/base/images/working-16.png
Binary files /dev/null and /tmp/cvs1VXXpy differ

Index: templates/base/images/pending_for_approval-16.png
===================================================================
RCS file: templates/base/images/pending_for_approval-16.png
diff -N templates/base/images/pending_for_approval-16.png
Binary files /dev/null and /tmp/cvsr27B8y differ

Index: templates/base/images/download-16.png
===================================================================
RCS file: templates/base/images/download-16.png
diff -N templates/base/images/download-16.png
Binary files /dev/null and /tmp/cvsmxOF3x differ




reply via email to

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