CVSROOT: /sources/phpgroupware Module name: ged Changes by: Pascal Vilarem <maat> 07/09/28 17:00:07
Modified files: inc : class.ged_dm.inc.php Log message: fix : removed _debug things CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.47&r2=1.48 Patches: Index: class.ged_dm.inc.php =================================================================== RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v retrieving revision 1.47 retrieving revision 1.48 diff -u -b -r1.47 -r1.48 --- class.ged_dm.inc.php 7 Sep 2007 14:07:04 -0000 1.47 +++ class.ged_dm.inc.php 28 Sep 2007 17:00:06 -0000 1.48 @@ -150,10 +150,14 @@ // TODO : If the document type requires a chrono // TODO : generate reference and override the reference // TODO : given by user if needed - if ((int)$parent['project_root'] != 0 && $this->is_chrono_type($new_file['doc_type'])) + if ( !isset($new_file['reference']) || ((int)$parent['project_root'] != 0 && $this->is_chrono_type($new_file['doc_type']))) + { $next_ref=$this->get_next_available_reference($new_file['doc_type'], $parent['project_root'] ); + } else + { $next_ref=$new_file['reference']; + } if ($download_result=='OK') { @@ -430,7 +434,7 @@ { if ($new_version['type']=='major') { - $major ++; + $major++; $minor=0; } elseif ($new_version['type']=='minor') $minor ++; @@ -514,17 +518,30 @@ if ( $me_version['status']=='working' ) { + if ( isset($cur_version)) + { $major=$cur_version['major']; $minor=$cur_version['minor']; if ($amended_version['type']=='major') { - $major ++; + $major++; $minor=0; } - elseif ($amended_version['type']=='minor') $minor ++; + elseif ($amended_version['type']=='minor') + { + $minor ++; + } else + { return "PB Version"; + } + } + else + { + $major=$me_version['major']; + $minor=$me_version['minor']; + } // MEMO gestion du stored_name pour �viter les �crasements. @@ -667,7 +684,7 @@ $sql_model="INSERT INTO %s ( type, parent_id, name, reference, description, owner_id, creator_id, creation_date, project_name, project_root ) VALUES "; $sql_model.=" ( '%s', %d, '%s', '%s', '%s', %d, %d, %d, '%s', %d) "; - $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(),$parent['project_name'],$parent['project_root']); + $sql=sprintf($sql_model, $this->tables['elements'], 'folder', $new_folder['parent_id'], $new_folder['name'], $parent['reference'], $new_folder['description'], $GLOBALS['phpgw_info']['user']['account_id'], $GLOBALS['phpgw_info']['user']['account_id'], time(),$parent['project_name'],$parent['project_root']); $set_project=false; } @@ -1491,8 +1508,8 @@ if ( is_array($the_current_version)) { - if ( $the_element_id == 496 ) - _debug_array($the_current_version); + //if ( $the_element_id == 496 ) + //_debug_array($the_current_version); $go=true; } else @@ -2308,7 +2325,7 @@ function approve_file ( $element_id, $comment='approved', $comment_file=null ) { - _debug_array($comment_file); + //_debug_array($comment_file); $pending_version=$this->get_pending_for_internal_review($element_id); $element=$this->get_element_info($element_id); _______________________________________________ phpGroupWare-cvs mailing list phpGroupWare-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/phpgroupware-cvs