phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php, 1.52, 1.


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php, 1.52, 1.53 class.soprojects.inc.php, 1.43, 1.44 class.uiprojects.inc.php, 1.65, 1.66
Date: Wed, 10 Sep 2003 22:47:58 -0400

Update of /cvsroot/phpgroupware/projects/inc
In directory subversions:/tmp/cvs-serv5204/inc

Modified Files:
        class.boprojects.inc.php class.soprojects.inc.php 
        class.uiprojects.inc.php 
Log Message:
update

Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** class.boprojects.inc.php    10 Sep 2003 00:28:57 -0000      1.52
--- class.boprojects.inc.php    11 Sep 2003 02:47:56 -0000      1.53
***************
*** 671,674 ****
--- 671,684 ----
                        }
  
+                       if ($values['previous'])
+                       {
+                               $edate = 
$this->return_value('edate',$values['previous']);
+ 
+                               if (intval($edate) == 0)
+                               {
+                                       $error[] = lang('the choosen previous 
project does not have an end date specified');
+                               }
+                       }
+ 
                        if ($action == 'mains')
                        {

Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** class.soprojects.inc.php    10 Sep 2003 00:28:57 -0000      1.43
--- class.soprojects.inc.php    11 Sep 2003 02:47:56 -0000      1.44
***************
*** 166,170 ****
                        else
                        {
!                               $filtermethod = ' coordinator=' . 
$this->account . "' AND access='private'";
                        }
  
--- 166,170 ----
                        else
                        {
!                               $filtermethod = ' coordinator=' . 
$this->account . " AND access='private'";
                        }
  
***************
*** 510,513 ****
--- 510,584 ----
                        {
                                $this->db->query("Update phpgw_p_projects set 
status='" . $values['status'] . "' WHERE parent=" . 
$values['project_id'],__LINE__,__FILE__);
+                       }
+ 
+                       if (isset($values['old_edate']) && $values['old_edate'] 
!= $values['edate'])
+                       {
+                               $this->db->query('SELECT id,start_date,end_date 
from phpgw_p_projects where previous=' . 
$values['project_id'],__LINE__,__FILE__);
+ 
+                               while($this->db->next_record())
+                               {
+                                       $following[] = array
+                                       (
+                                               'id'    => $this->db->f('id'),
+                                               'sdate' => 
$this->db->f('start_date'),
+                                               'edate' => 
$this->db->f('end_date')
+                                       );
+                               };
+ 
+                               if (is_array($following))
+                               {
+                                       $diff = 
abs($values['edate']-$values['old_edate']);
+ 
+                                       if ($values['old_edate'] > 
$values['edate'])
+                                       {
+                                               $op = 'sub';
+                                       }
+                                       else
+                                       {
+                                               $op = 'add';
+                                       }
+ 
+                                       while (list(,$fol) = each($following))
+                                       {
+                                               switch($op)
+                                               {
+                                                       case 'add':
+                                                               $nsdate = 
$fol['sdate']+$diff;
+                                                               $nedate = 
$fol['edate']+$diff;
+                                                               break;
+                                                       case 'sub':
+                                                               $nsdate = 
$fol['sdate']-$diff;
+                                                               $nedate = 
$fol['edate']-$diff;
+                                                               break;
+                                               }
+                                               $this->db->query('UPDATE 
phpgw_p_projects set start_date=' . $nsdate . ', end_date=' . $nedate . ', 
entry_date=' . time()
+                                                                               
. ', processor=' . $this->account . ' WHERE id=' . 
$fol['id'],__LINE__,__FILE__);
+ 
+                                               $this->db->query('SELECT s_id, 
edate from phpgw_p_mstones WHERE project_id=' . $fol['id'],__LINE__,__FILE__);
+ 
+                                               while($this->db->next_record())
+                                               {
+                                                       $stones[] = array
+                                                       (
+                                                               's_id'  => 
$this->db->f('s_id'),
+                                                               'edate' => 
$this->db->f('edate')
+                                                       );
+                                               };
+ 
+                                               while(is_array($stones) && 
list(,$stone) = each($stones))
+                                               {
+                                                       switch($op)
+                                                       {
+                                                               case 'add':
+                                                                       $sedate 
= $stone['edate']+$diff;
+                                                                       break;
+                                                               case 'sub':
+                                                                       $sedate 
= $stone['edate']-$diff;
+                                                                       break;
+                                                       }
+                                                       
$this->db->query('UPDATE phpgw_p_mstones set edate=' . $sedate . ' WHERE s_id=' 
. $stone['s_id'],__LINE__,__FILE__);
+                                               }
+                                       }
+                               }
                        }
                }

Index: class.uiprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -r1.65 -r1.66
*** class.uiprojects.inc.php    10 Sep 2003 00:28:57 -0000      1.65
--- class.uiprojects.inc.php    11 Sep 2003 02:47:56 -0000      1.66
***************
*** 129,133 ****
                        
$GLOBALS['phpgw']->template->set_var('lang_creator',lang('creator'));
                        
$GLOBALS['phpgw']->template->set_var('lang_processor',lang('processor'));
! 
                        
$GLOBALS['phpgw']->template->set_var('lang_bookable_activities',lang('Bookable 
activities'));
                        
$GLOBALS['phpgw']->template->set_var('lang_billable_activities',lang('Billable 
activities'));
--- 129,133 ----
                        
$GLOBALS['phpgw']->template->set_var('lang_creator',lang('creator'));
                        
$GLOBALS['phpgw']->template->set_var('lang_processor',lang('processor'));
!                       
$GLOBALS['phpgw']->template->set_var('lang_previous',lang('previous project'));
                        
$GLOBALS['phpgw']->template->set_var('lang_bookable_activities',lang('Bookable 
activities'));
                        
$GLOBALS['phpgw']->template->set_var('lang_billable_activities',lang('Billable 
activities'));
***************
*** 605,608 ****
--- 605,609 ----
                                
$GLOBALS['phpgw']->template->set_var('old_status',$values['status']);
                                
$GLOBALS['phpgw']->template->set_var('old_parent',$values['parent']);
+                               
$GLOBALS['phpgw']->template->set_var('old_edate',$values['edate']);
                                
$GLOBALS['phpgw']->template->set_var('lang_choose','');
                                
$GLOBALS['phpgw']->template->set_var('choose','');
***************
*** 698,704 ****
                        $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="values[access]" value="True"' . ($values['access'] == 
'private'?' checked':'') . '>');
  
                        if ($action == 'mains' || $action == 'amains')
                        {
!                               $cat = '<select name="cat_id"><option 
value="">' . lang('None') . '</option>'
                                                .       
$this->bo->cats->formatted_list('select','all',$this->cat_id,True) . 
'</select>';
  
--- 699,710 ----
                        $GLOBALS['phpgw']->template->set_var('access','<input 
type="checkbox" name="values[access]" value="True"' . ($values['access'] == 
'private'?' checked':'') . '>');
  
+                       
$GLOBALS['phpgw']->template->set_var('previous_select',$this->bo->select_project_list(array('type'
 => 'all',
+                                                                               
                                                                                
                                                'status' => $values['status'],
+                                                                               
                                                                                
                                                'self' => $project_id,
+                                                                               
                                                                                
                                        'selected' => $values['previous'])));
+ 
                        if ($action == 'mains' || $action == 'amains')
                        {
!                               $cat = '<select name="values[cat]"><option 
value="">' . lang('None') . '</option>'
                                                .       
$this->bo->cats->formatted_list('select','all',$this->cat_id,True) . 
'</select>';
  





reply via email to

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