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.42.2.5.2


From: Bettina Gille <address@hidden>
Subject: [Phpgroupware-cvs] CVS: projects/inc class.boprojects.inc.php,1.42.2.5.2.8,1.42.2.5.2.9 class.soprojects.inc.php,1.34.2.6.2.7,1.34.2.6.2.8
Date: Mon, 02 Jun 2003 19:22:53 -0400

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

Modified Files:
      Tag: Version-0_9_16-branch
        class.boprojects.inc.php class.soprojects.inc.php 
Log Message:
update

Index: class.boprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.42.2.5.2.8
retrieving revision 1.42.2.5.2.9
diff -C2 -r1.42.2.5.2.8 -r1.42.2.5.2.9
*** class.boprojects.inc.php    2 Jun 2003 22:11:23 -0000       1.42.2.5.2.8
--- class.boprojects.inc.php    2 Jun 2003 23:22:50 -0000       1.42.2.5.2.9
***************
*** 544,547 ****
--- 544,563 ----
                                        }
                                }
+ 
+                               $ptime_parent   = 
$this->so->return_value('ptime',$values['parent']);
+                               $sum_ptime              = 
$this->so->get_planned_value(array('action' => 'tparent','parent_id' => 
$values['parent']
+                                                                               
                                                        ,'project_id' => 
$values['project_id']));
+                               if ((intval($values['ptime'])+$sum_ptime) > 
$ptime_parent)
+                               {
+                                       $error[] = lang('planned time sum of 
all sub projects is bigger than the planned time of the main project');
+                               }
+ 
+                               $budget_parent  = 
$this->so->return_value('budget',$values['parent']);
+                               $sum_budget             = 
$this->so->get_planned_value(array('action' => 'bparent','parent_id' => 
$values['parent']
+                                                                               
                                                        ,'project_id' => 
$values['project_id']));
+                               if ($values['budget'])+$sum_budget) > 
$budget_parent)
+                               {
+                                       $error[] = lang('budget sum of all sub 
projects is bigger than the budget of the main project');
+                               }
                        }
  

Index: class.soprojects.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.34.2.6.2.7
retrieving revision 1.34.2.6.2.8
diff -C2 -r1.34.2.6.2.7 -r1.34.2.6.2.8
*** class.soprojects.inc.php    2 Jun 2003 22:11:23 -0000       1.34.2.6.2.7
--- class.soprojects.inc.php    2 Jun 2003 23:22:50 -0000       1.34.2.6.2.8
***************
*** 484,492 ****
                }
  
!               function return_value($action,$item)
                {
                        if ($action == 'act')
                        {                       
!                               $this->db->query('SELECT num,descr from 
phpgw_p_activities where id=' . $item,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
--- 484,492 ----
                }
  
!               function return_value($action,$pro_id)
                {
                        if ($action == 'act')
                        {                       
!                               $this->db->query('SELECT num,descr from 
phpgw_p_activities where id=' . $pro_id,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
***************
*** 496,500 ****
                        elseif ($action == 'co')
                        {
!                               $this->db->query('SELECT coordinator from 
phpgw_p_projects where id=' . $item,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
--- 496,500 ----
                        elseif ($action == 'co')
                        {
!                               $this->db->query('SELECT coordinator from 
phpgw_p_projects where id=' . $pro_id,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
***************
*** 511,517 ****
                                        case 'ptime':   $column = 
'time_planned'; break;
                                        case 'invest':  $column = 
'investment_nr'; break;
                                }
  
!                               $this->db->query('SELECT ' . $column . ' from 
phpgw_p_projects where id=' . $item,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
--- 511,518 ----
                                        case 'ptime':   $column = 
'time_planned'; break;
                                        case 'invest':  $column = 
'investment_nr'; break;
+                                       case 'budget':  $column = 'budget'; 
break;
                                }
  
!                               $this->db->query('SELECT ' . $column . ' from 
phpgw_p_projects where id=' . $pro_id,__LINE__,__FILE__);
                                if ($this->db->next_record())
                                {
***************
*** 1002,1029 ****
                }
  
!               function get_planned_time($option)
                {
!                       if(is_array($option))
                        {
!                               $action         = 
(isset($option['action'])?$option['action']:'main');
!                               $project_id     = 
(isset($option['project_id'])?$option['project_id']:'');
!                               $parent_id      = 
(isset($option['parent_id'])?$option['parent_id']:0);
                        }
  
                        switch($action)
                        {
!                               case 'main':    $filter = 'main=' . $parent_id 
. ' and id !=' . $parent_id; break;
!                               case 'parent':  $filter = 'parent=' . 
$parent_id; break;
                        }
  
!                       if($project_id)
                        {
                                $editfilter = ' and id !=' . $project_id;
                        }
  
!                       $this->db->query('SELECT SUM(time_planned) as sumtime 
from phpgw_p_projects where (' . $filter . $editfilter . ')',__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
!                               return $this->db->f('sumtime');
                        }
                }
--- 1003,1040 ----
                }
  
!               function get_planned_value($option)
                {
!                       $action         = 
(isset($option['action'])?$option['action']:'main');
!                       $project_id     = 
(isset($option['project_id'])?$option['project_id']:0);
!                       $parent_id      = 
(isset($option['parent_id'])?$option['parent_id']:0);
! 
!                       $project_id = intval($project_id);
!                       $parent_id = intval($parent_id);
! 
!                       switch($action)
                        {
!                               case 'tmain':
!                               case 'bmain':   $filter = 'main=' . $parent_id 
. ' and id !=' . $parent_id; break;
!                               case 'tparent':
!                               case 'bparent': $filter = 'parent=' . 
$parent_id; break;
                        }
  
                        switch($action)
                        {
!                               case 'bmain':
!                               case 'bparent': $column = 'budget'; break;
!                               case 'tmain':
!                               case 'tparent': $column = 'time_planned'; break;
                        }
  
!                       if($project_id > 0)
                        {
                                $editfilter = ' and id !=' . $project_id;
                        }
  
!                       $this->db->query('SELECT SUM(' . $column . ') as 
sumvalue from phpgw_p_projects where (' . $filter . $editfilter . 
')',__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
!                               return $this->db->f('sumvalue');
                        }
                }





reply via email to

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