phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.sop...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.sop...
Date: Sat, 25 Nov 2006 23:12:10 +0000

CVSROOT:        /sources/phpgroupware
Module name:    projects
Changes by:     Sigurd Nes <sigurdne>   06/11/25 23:12:10

Modified files:
        inc            : class.boprojects.inc.php 
                         class.soprojects.inc.php 
                         class.uiprojecthours.inc.php 
                         class.uiprojects.inc.php 
                         class.uistatistics.inc.php 

Log message:
        notice and link

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.boprojects.inc.php?cvsroot=phpgroupware&r1=1.161&r2=1.162
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.soprojects.inc.php?cvsroot=phpgroupware&r1=1.113&r2=1.114
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojecthours.inc.php?cvsroot=phpgroupware&r1=1.86&r2=1.87
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojects.inc.php?cvsroot=phpgroupware&r1=1.164&r2=1.165
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uistatistics.inc.php?cvsroot=phpgroupware&r1=1.62&r2=1.63

Patches:
Index: class.boprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -b -r1.161 -r1.162
--- class.boprojects.inc.php    25 Nov 2006 15:50:00 -0000      1.161
+++ class.boprojects.inc.php    25 Nov 2006 23:12:10 -0000      1.162
@@ -6,7 +6,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package projects
-       * @version $Id: class.boprojects.inc.php,v 1.161 2006/11/25 15:50:00 
sigurdne Exp $
+       * @version $Id: class.boprojects.inc.php,v 1.162 2006/11/25 23:12:10 
sigurdne Exp $
        * $Source: 
/sources/phpgroupware/projects/inc/class.boprojects.inc.php,v $
        */
 
@@ -453,9 +453,9 @@
                function selected_employees($data = 0)
                {
                        $project_id = intval($data['project_id']);
-                       $pro_parent = intval($data['pro_parent']);
+                       $pro_parent = 
(isset($data['pro_parent'])?intval($data['pro_parent']):'');
 
-                       if($data['action'] == 'mains')
+                       if(isset($data['action']) && $data['action'] == 'mains')
                        {
                                $emps = $this->read_projects_acl();
                        }
@@ -975,6 +975,9 @@
 
                function get_sub_projects($params)
                {
+                       $column = '';
+                       if(isset($params['page']) && $params['page'])
+                       {
                        switch($params['page'])
                        {
                                case 'planned':                 $column = 
'project_id,parent,level,budget,time_planned'; break;
@@ -982,13 +985,14 @@
 //                             case 'budget':                  $column = 
'project_id,accounting,acc_factor,billable,level'; break;
                                case 'budget':                  $column = 
'project_id,parent,accounting,acc_factor,billable,level,budget,time_planned'; 
break;
                        }
+                       }
                        $subs = $this->soprojects->read_projects(array('column' 
=> $column,'limit' => False,'action' => 'subs','parent' => 
$params['project_id']));
 
                        $i = count($subs);
                        $subs[$i]['project_id'] = $params['project_id'];
-                       $subs[$i]['accounting'] = $params['accounting'];
-                       $subs[$i]['billable'] = $params['billable'];
-                       $subs[$i]['acc_factor'] = 
$params['project_accounting_factor'];
+                       $subs[$i]['accounting'] = 
(isset($params['accounting'])?$params['accounting']:'');
+                       $subs[$i]['billable'] = 
(isset($params['billable'])?$params['billable']:'');
+                       $subs[$i]['acc_factor'] = 
(isset($params['project_accounting_factor'])?$params['project_accounting_factor']:'');
 
                        //_debug_array($subs);
                        return $subs;
@@ -1120,7 +1124,7 @@
                                                }
                                        }
 
-                                       if($params['page'] == 'budget' || 
$params['page'] == 'hours')
+                                       if((isset($params['page']) && 
$params['page'] == 'budget') || (isset($params['page']) &&$params['page'] == 
'hours'))
                                        {
                                                $params['project_id']           
                        = $pro['project_id'];
                                                $params['accounting']           
                        = $pro['accounting'];
@@ -1130,17 +1134,20 @@
                                                $acc = 
$this->get_budget($params);
                                        }
 
-                                       $ptime_pro = $pro['ptime'] - 
$acc['ptime_jobs_min'];
-                                       $phours_pro = 
$this->colored($this->sohours->min2str($ptime_pro), $ptime_pro, 
$acc['uhours_pro_wminutes'], 'hours');
+                                       $ptime_pro = $pro['ptime'] - 
(isset($acc['ptime_jobs_min'])?$acc['ptime_jobs_min']:0);
+                                       $uhours_pro_wminutes = 
(isset($acc['uhours_pro_wminutes'])?$acc['uhours_pro_wminutes']:'');
                                        
-                                       $uhours_pro             = 
$this->colored($this->sohours->min2str($acc['uhours_pro_wminutes']), 
$ptime_pro, $acc['uhours_pro_wminutes'], 'hours');
+                                       $phours_pro = 
$this->colored($this->sohours->min2str($ptime_pro), $ptime_pro, 
$uhours_pro_wminutes, 'hours');
 
-                                       $uhours_jobs    = 
$this->colored(str_replace(".", 
":",sprintf("%01.2f",$acc['uhours_jobs'])),$pro['ptime'],$acc['uhours_jobs_wminutes'],'hours');
+                                       $uhours_pro             = 
$this->colored($this->sohours->min2str($uhours_pro_wminutes), $ptime_pro, 
$uhours_pro_wminutes, 'hours');
 
-                                       $ubudget_pro    = $acc['u_budget'];
-                                       $ubudget_jobs   = $acc['u_budget_jobs'];
+                                       $uhours_jobs    = 
$this->colored(str_replace(".", 
":",sprintf("%01.2f",(isset($acc['uhours_jobs'])?$acc['uhours_jobs']:''))),$pro['ptime'],(isset($acc['uhours_jobs_wminutes'])?$acc['uhours_jobs_wminutes']:''),'hours');
+
+                                       $ubudget_pro    = 
(isset($acc['u_budget'])?$acc['u_budget']:'');
+                                       $ubudget_jobs   = 
(isset($acc['u_budget_jobs'])?$acc['u_budget_jobs']:'');
 
                                        $space = '';
+                                       $spaceset = '';
                                        if ($pro['level'] > 0 && 
!isset($params['no_formatted_level']))
                                        {
                                                $space = 
($this->html_output?'&nbsp;.&nbsp;':'.');
@@ -1187,53 +1194,53 @@
                                                'status'                        
=> $pro['status'],
                                                'level'                         
=> $pro['level'],
                                                'uhours_pro'            => 
$uhours_pro,      //$acc['uhours_pro']?$acc['uhours_pro']:'0:00',
-                                               'uhours_pro_nobill'     => 
$acc['uhours_pro_nobill']?$acc['uhours_pro_nobill']:'0:00',
-                                               'uhours_pro_bill'       => 
$acc['uhours_pro_bill']?$acc['uhours_pro_bill']:'0:00',
+                                               'uhours_pro_nobill'     => 
(isset($acc['uhours_pro_nobill'])?$acc['uhours_pro_nobill']:'0:00'),
+                                               'uhours_pro_bill'       => 
(isset($acc['uhours_pro_bill'])?$acc['uhours_pro_bill']:'0:00'),
                                                'uhours_jobs'           => 
$uhours_jobs,     //$acc['uhours_jobs']?$acc['uhours_jobs']:'0:00',
-                                               'uhours_jobs_nobill'=> 
$acc['uhours_jobs_nobill']?str_replace(".", 
":",sprintf("%01.2f",$acc['uhours_jobs_nobill'])):'0:00',
-                                               'uhours_jobs_bill'      => 
$acc['uhours_jobs_bill']?str_replace(".", 
":",sprintf("%01.2f",$acc['uhours_jobs_bill'])):'0:00',
-                                               'ahours_pro'            => 
$ahours_pro,
-                                               'ahours_jobs'           => 
$ahours_jobs,
+                                               'uhours_jobs_nobill'=> 
(isset($acc['uhours_jobs_nobill'])?str_replace(".", 
":",sprintf("%01.2f",$acc['uhours_jobs_nobill'])):'0:00'),
+                                               'uhours_jobs_bill'      => 
(isset($acc['uhours_jobs_bill'])?str_replace(".", 
":",sprintf("%01.2f",$acc['uhours_jobs_bill'])):'0:00'),
+                                               'ahours_pro'            => 
(isset($ahours_pro)?$ahours_pro:''),
+                                               'ahours_jobs'           => 
(isset($ahours_jobs)?$ahours_jobs:''),
                                                'u_budget'                      
=> $ubudget_pro,     //$acc['u_budget']?$acc['u_budget']:'0.00',
                                                'u_budget_jobs'         => 
$ubudget_jobs,    //$acc['u_budget_jobs']?$acc['u_budget_jobs']:'0.00',
-                                               'a_budget'                      
=> $pro['budget']-$acc['u_budget'],
-                                               'a_budget_jobs'         => 
$pro['budget']-$acc['u_budget_jobs'],
-                                               'b_budget'                      
=> $acc['b_budget']?$acc['b_budget']:'0.00',
-                                               'b_budget_jobs'         => 
$acc['b_budget_jobs']?$acc['b_budget_jobs']:'0.00',
+                                               'a_budget'                      
=> $pro['budget']-(isset($acc['u_budget'])?$acc['u_budget']:0),
+                                               'a_budget_jobs'         => 
$pro['budget']-(isset($acc['u_budget_jobs'])?$acc['u_budget_jobs']:0),
+                                               'b_budget'                      
=> (isset($acc['b_budget'])?$acc['b_budget']:'0.00'),
+                                               'b_budget_jobs'         => 
(isset($acc['b_budget_jobs'])?$acc['b_budget_jobs']:'0.00'),
                                                
                                                /* AS: new version values with 
a stricter naming scheme (others should be deprecated but may still be in use 
somewhere) */
-                                               'item_planned_time'     => 
$pro['ptime'] - $acc['ptime_jobs_min'],
-                                               'item_used_time'        => 
$acc['utime_item'],
-                                               'item_bill_time'        => 
$acc['utime_item_bill'],
-                                               'item_nobill_time'      => 
$acc['utime_item_nobill'],
-                                               'item_avail_time'       => 
$acc['atime_item'],
-                                               'sum_planned_time'      => 
$pro['ptime'],
-                                               'sum_used_time'         => 
$acc['utime_sum'],
-                                               'sum_bill_time'         => 
$acc['utime_sum_bill'],
-                                               'sum_nobill_time'       => 
$acc['utime_sum_nobill'],
-                                               'sum_avail_time'        => 
$acc['atime_sum'],
-                                               'is_leaf'                       
=> $acc['is_leaf'],
+                                               'item_planned_time'     => 
$pro['ptime'] - (isset($acc['ptime_jobs_min'])?$acc['ptime_jobs_min']:0),
+                                               'item_used_time'        => 
(isset($acc['utime_item'])?$acc['utime_item']:''),
+                                               'item_bill_time'        => 
(isset($acc['utime_item_bill'])?$acc['utime_item_bill']:''),
+                                               'item_nobill_time'      => 
(isset($acc['utime_item_nobill'])?$acc['utime_item_nobill']:''),
+                                               'item_avail_time'       => 
(isset($acc['atime_item'])?$acc['atime_item']:''),
+                                               'sum_planned_time'      => 
(isset($pro['ptime'])?$pro['ptime']:''),
+                                               'sum_used_time'         => 
(isset($acc['utime_sum'])?$acc['utime_sum']:''),
+                                               'sum_bill_time'         => 
(isset($acc['utime_sum_bill'])?$acc['utime_sum_bill']:''),
+                                               'sum_nobill_time'       => 
(isset($acc['utime_sum_nobill'])?$acc['utime_sum_nobill']:''),
+                                               'sum_avail_time'        => 
(isset($acc['atime_sum'])?$acc['atime_sum']:''),
+                                               'is_leaf'                       
=> (isset($acc['is_leaf'])?$acc['is_leaf']:''),
 
-                                               'item_planned_budget' => 
$pro['budget']-$acc['pbudget_jobs'],
+                                               'item_planned_budget' => 
$pro['budget']-(isset($acc['pbudget_jobs'])?$acc['pbudget_jobs']:0),
                                                'item_used_budget'    => 
$ubudget_pro,
-                                               'item_bill_budget'    => 
$acc['b_budget']?$acc['b_budget']:'0.00',
-                                               'item_nobill_budget'    => 
$acc['nb_budget']?$acc['nb_budget']:'0.00',
-                                               'item_avail_budget'   => 
$pro['budget']-$acc['pbudget_jobs']-$acc['u_budget'],
+                                               'item_bill_budget'    => 
(isset($acc['b_budget'])?$acc['b_budget']:'0.00'),
+                                               'item_nobill_budget'    => 
(isset($acc['nb_budget'])?$acc['nb_budget']:'0.00'),
+                                               'item_avail_budget'   => 
$pro['budget']-(isset($acc['pbudget_jobs'])?$acc['pbudget_jobs']:0)-(isset($acc['u_budget'])?$acc['u_budget']:0),
                                                'sum_planned_budget'  => 
$pro['budget'],
                                                'sum_used_budget'    => 
$ubudget_jobs,
-                                               'sum_bill_budget'    => 
$acc['b_budget_jobs']?$acc['b_budget_jobs']:'0.00',
-                                               'sum_nobill_budget'    => 
$acc['nb_budget_jobs']?$acc['nb_budget_jobs']:'0.00',
-                                               'sum_avail_budget'   => 
$pro['budget']-$acc['u_budget_jobs'],
+                                               'sum_bill_budget'    => 
(isset($acc['b_budget_jobs'])?$acc['b_budget_jobs']:'0.00'),
+                                               'sum_nobill_budget'    => 
(isset($acc['nb_budget_jobs'])?$acc['nb_budget_jobs']:'0.00'),
+                                               'sum_avail_budget'   => 
$pro['budget']-(isset($acc['u_budget_jobs'])?$acc['u_budget_jobs']:0),
 
 /*
 planned_subs=planned_sum-planned_item
 used_subs=used_sum-used_item
 */
-                                               'sum_time_status'       => 
$this->is_red($pro['ptime'], $acc['utime_sum'], 'time') ? 'red' : 
($this->is_red($acc['ptime_jobs_min'], $acc['utime_sum']-$acc['utime_item'], 
'time') ? 'yellow':'green'),
-                                               'item_time_status'      => 
$this->is_red($pro['ptime'] - $acc['ptime_jobs_min'], $acc['utime_item'], 
'time') ? 'red' : ($this->is_red($acc['ptime_jobs_min'], 
$acc['utime_sum']-$acc['utime_item'], 'time') ? 'yellow':'green'),
+                                               'sum_time_status'       => 
$this->is_red($pro['ptime'], (isset($acc['utime_sum'])?$acc['utime_sum']:''), 
'time') ? 'red' : 
($this->is_red((isset($acc['ptime_jobs_min'])?$acc['ptime_jobs_min']:''), 
(isset($acc['utime_sum'])?$acc['utime_sum']:'')-(isset($acc['utime_item'])?$acc['utime_item']:0),
 'time') ? 'yellow':'green'),
+                                               'item_time_status'      => 
$this->is_red($pro['ptime'] - 
(isset($acc['ptime_jobs_min'])?$acc['ptime_jobs_min']:0), 
(isset($acc['utime_item'])?$acc['utime_item']:''), 'time') ? 'red' : 
($this->is_red((isset($acc['ptime_jobs_min'])?$acc['ptime_jobs_min']:''), 
(isset($acc['utime_sum'])?$acc['utime_sum']:'')-(isset($acc['utime_item'])?$acc['utime_item']:0),
 'time') ? 'yellow':'green'),
                                                
-                                               'sum_budget_status'     => 
$this->is_red($pro['budget'], $ubudget_jobs, 'budget') ? 'red' : 
($this->is_red($acc['pbudget_jobs'], $ubudget_jobs-$ubudget_pro, 'budget') ? 
'yellow':'green'),
-                                               'item_budget_status'=> 
$this->is_red($pro['budget']-$acc['pbudget_jobs'], $ubudget_pro, 'budget') ? 
'red' : ($this->is_red($acc['pbudget_jobs'], $ubudget_jobs-$ubudget_pro, 
'budget') ? 'yellow':'green')
+                                               'sum_budget_status'     => 
$this->is_red($pro['budget'], $ubudget_jobs, 'budget') ? 'red' : 
($this->is_red((isset($acc['pbudget_jobs'])?$acc['pbudget_jobs']:''), 
$ubudget_jobs-$ubudget_pro, 'budget') ? 'yellow':'green'),
+                                               'item_budget_status'=> 
$this->is_red($pro['budget']-(isset($acc['pbudget_jobs'])?$acc['pbudget_jobs']:0),
 $ubudget_pro, 'budget') ? 'red' : 
($this->is_red((isset($acc['pbudget_jobs'])?$acc['pbudget_jobs']:''), 
$ubudget_jobs-$ubudget_pro, 'budget') ? 'yellow':'green')
                                        );
                                }
                        }
@@ -1289,6 +1296,7 @@
                function formatted_edate($edate = 0,$colored = True,$type = 
'project')
                {
                        $edate = intval($edate);
+                       $edateout = '';
 
                        $month  = 
$GLOBALS['phpgw']->common->show_date(time(),'n');
                        $day    = 
$GLOBALS['phpgw']->common->show_date(time(),'d');
@@ -1544,7 +1552,7 @@
                                }
                                else
                                {
-                                       if($values['accounting'] == 'project' 
&& ($values['project_accounting_factor'] == 0) && 
($values['project_accounting_factor_d'] == 0))
+                                       if($values['accounting'] == 'project' 
&& ($values['project_accounting_factor'] == 0) && 
(!isset($values['project_accounting_factor_d']) || 
$values['project_accounting_factor_d'] == 0))
                                        {
                                                $error[] = lang('please set the 
accounting factor for the project');
                                        }
@@ -1723,7 +1731,9 @@
                                $e_budget += $subData['e_budget'];
                        }
 
-                       if($values['smonth'] || $values['sday'] || 
$values['syear'])
+                       if((isset($values['smonth']) && $values['smonth'])
+                               || (isset($values['sday']) && $values['sday'])
+                               || (isset($values['syear']) && 
$values['syear']))
                        {
                                if($sdate < 
mktime(12,0,0,$values['smonth'],$values['sday'],$values['syear']))
                                {
@@ -1731,7 +1741,9 @@
                                }
                        }
                        
-                       if($values['psmonth'] || $values['psday'] || 
$values['psyear'])
+                       if((isset($values['psmonth']) && $values['psmonth'])
+                               || (isset($values['psday']) && $values['psday'])
+                               || (isset($values['psyear']) && 
$values['psyear']))
                        {
                                if($psdate < 
mktime(12,0,0,$values['psmonth'],$values['psday'],$values['psyear']))
                                {
@@ -1739,7 +1751,9 @@
                                }
                        }
 
-                       if($values['emonth'] || $values['eday'] || 
$values['eyear'])
+                       if((isset($values['emonth']) && $values['emonth'])
+                               || (isset($values['eday']) && $values['eday'])
+                               || (isset($values['eyear']) && 
$values['eyear']))
                        {
                                if($edate > 
mktime(12,0,0,$values['emonth'],$values['eday'],$values['eyear']))
                                {
@@ -1747,7 +1761,9 @@
                                }
                        }
                        
-                       if($values['pemonth'] || $values['peday'] || 
$values['peyear'])
+                       if((isset($values['pemonth']) && $values['pemonth'])
+                               || (isset($values['peday']) && $values['peday'])
+                               || (isset($values['peyear']) && 
$values['peyear']))
                        {
                                if($pedate > 
mktime(12,0,0,$values['pemonth'],$values['peday'],$values['peyear']))
                                {
@@ -1755,7 +1771,7 @@
                                }
                        }
 
-                       if($values['plan_bottom_up'] == 'N')
+                       if(isset($values['plan_bottom_up']) && 
$values['plan_bottom_up'] == 'N')
                        {
                                if($ptime > (intval($values['ptime'])*60))
                                {
@@ -1773,7 +1789,7 @@
                                }
                        }
 
-                       if (is_array($error))
+                       if (isset($error) && is_array($error))
                        {
                                return $error;
                        }
@@ -1802,7 +1818,7 @@
                        $values['sdate'] = intval($values['sdate']);
                        $values['edate'] = intval($values['edate']);
 
-                       if (!$values['previous'] && $values['parent'])
+                       if (!$values['previous'] && isset($values['parent']) && 
$values['parent'])
                        {
                                $values['previous'] = 
$this->return_value('previous',$values['parent']);
                        }

Index: class.soprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -b -r1.113 -r1.114
--- class.soprojects.inc.php    25 Nov 2006 17:02:36 -0000      1.113
+++ class.soprojects.inc.php    25 Nov 2006 23:12:10 -0000      1.114
@@ -6,7 +6,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package projects
-       * @version $Id: class.soprojects.inc.php,v 1.113 2006/11/25 17:02:36 
sigurdne Exp $
+       * @version $Id: class.soprojects.inc.php,v 1.114 2006/11/25 23:12:10 
sigurdne Exp $
        * $Source: 
/sources/phpgroupware/projects/inc/class.soprojects.inc.php,v $
        */
 
@@ -334,9 +334,13 @@
                {
                        $this->db->query('SELECT * from phpgw_p_projects WHERE 
project_id=' . intval($project_id),__LINE__,__FILE__);
        
-                       list($project) = $this->db2projects();
+                       $pro = $this->db2projects();
+                       if(is_array($pro) && count($pro)>0)
+                       {
+                               list($project) = $pro;
                        return $project;
                }
+               }
 
                function select_project_list($values)
                {
@@ -418,7 +422,7 @@
                        $values['discount']                     = 
$values['discount'] + 0.0;
                        $values['project_accounting_factor'] = 
$values['project_accounting_factor'] + 0.0;
                        $values['project_accounting_factor_d'] = 
$values['project_accounting_factor_d'] + 0.0;
-                       $values['parent']                       = 
intval($values['parent']);
+                       $values['parent']                       = 
(isset($values['parent'])?intval($values['parent']):0);
 
                        if ($values['parent'] > 0)
                        {
@@ -722,6 +726,7 @@
                {
                        $pro_id         = intval($pro_id);
                        $account_id     = intval($account_id);
+                       $bla = '';
                        if ($action == 'act')
                        {                       
                                $this->db->query('SELECT a_number,descr from 
phpgw_p_activities where id=' . $pro_id,__LINE__,__FILE__);
@@ -1226,6 +1231,7 @@
                {
                        $this->db->query("SELECT * FROM phpgw_p_mstones WHERE 
project_id=" . intval($project_id),__LINE__,__FILE__);
 
+                       $stones = false;
                        while($this->db->next_record())
                        {
                                $stones[] = array
@@ -1358,12 +1364,14 @@
                {
                        $project_id = intval($data['project_id']);
                        $column         = 
isset($data['column'])?$data['column']:'*';
-                       $account_id     = intval($data['account_id']);
-                       $event_type     = 
$data['event_type']?$data['event_type']:'';
+                       $account_id     = 
(isset($data['account_id'])?intval($data['account_id']):'');
+                       $event_type     = 
(isset($data['event_type'])?$data['event_type']:'');
 
                        //echo 'SOPROJECTS->read->employee_roles: DATA ';
                        //_debug_array($data);
 
+                       $emp_select = '';
+                       $roles = '';
                        if($account_id > 0)
                        {
                                $emp_select = ' and account_id=' . $account_id;
@@ -1521,12 +1529,12 @@
 
                function plan_bottom_up_set_job_setting($main_project_id, 
$plan_bottom_up)
                {
-                       $this->db->query('UPDATE phpgw_p_projects SET 
plan_bottom_up="' . $plan_bottom_up . '" WHERE main=' . $main_project_id, 
__LINE__,__FILE__);
+                       $this->db->query("UPDATE phpgw_p_projects SET 
plan_bottom_up='" . $plan_bottom_up . "' WHERE main=" . $main_project_id, 
__LINE__,__FILE__);
                }
                
                function direct_work_set_job_setting($main_project_id, 
$direct_work)
                {
-                       $this->db->query('UPDATE phpgw_p_projects SET 
direct_work="' . $direct_work . '" WHERE main=' . $main_project_id, 
__LINE__,__FILE__);
+                       $this->db->query("UPDATE phpgw_p_projects SET 
direct_work='" . $direct_work . "' WHERE main=" . $main_project_id, 
__LINE__,__FILE__);
                }
 
                function get_projects_tree($mainProject = null, $fields = 
array('project_id', 'parent', 'title', 'p_number', 'direct_work', 'p_number', 
'end_date', 'customer_org'), $employee=-1)

Index: class.uiprojecthours.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojecthours.inc.php,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -b -r1.86 -r1.87
--- class.uiprojecthours.inc.php        25 Nov 2006 17:02:36 -0000      1.86
+++ class.uiprojecthours.inc.php        25 Nov 2006 23:12:10 -0000      1.87
@@ -6,7 +6,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package projects
-       * @version $Id: class.uiprojecthours.inc.php,v 1.86 2006/11/25 17:02:36 
sigurdne Exp $
+       * @version $Id: class.uiprojecthours.inc.php,v 1.87 2006/11/25 23:12:10 
sigurdne Exp $
        * $Source: 
/sources/phpgroupware/projects/inc/class.uiprojecthours.inc.php,v $
        */
 
@@ -1557,8 +1557,8 @@
                function controlling_sheet()
                {
                        $jscal                  = 
CreateObject('phpgwapi.jscalendar');  // before phpgw_header() !!!
-                       $start_array    = 
$jscal->input2date($_REQUEST['datum']['start']);
-                       $end_array              = 
$jscal->input2date($_REQUEST['datum']['end']);
+                       $start_array    = 
$jscal->input2date((isset($_REQUEST['datum']['start'])?$_REQUEST['datum']['start']:''));
+                       $end_array              = 
$jscal->input2date((isset($_REQUEST['datum']['end'])?$_REQUEST['datum']['end']:''));
 
                        // Workaround for new actions
                        if(get_var('export', array('POST')))

Index: class.uiprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -b -r1.164 -r1.165
--- class.uiprojects.inc.php    25 Nov 2006 17:02:36 -0000      1.164
+++ class.uiprojects.inc.php    25 Nov 2006 23:12:10 -0000      1.165
@@ -6,7 +6,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package projects
-       * @version $Id: class.uiprojects.inc.php,v 1.164 2006/11/25 17:02:36 
sigurdne Exp $
+       * @version $Id: class.uiprojects.inc.php,v 1.165 2006/11/25 23:12:10 
sigurdne Exp $
        * $Source: 
/sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v $
        */
 
@@ -221,7 +221,7 @@
                        {
                                foreach($pro as $p)
                                {
-                                       
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
+                                       
$this->nextmatchs->template_alternate_row_class($GLOBALS['phpgw']->template);
 
 // --------------- template declaration for list records 
-------------------------------------
 
@@ -288,10 +288,12 @@
                                                                                
                                                                                
. '" border="0">'));
 
                                        if 
($this->boprojects->add_perms(array('action' => $action,'coordinator' => 
$p['coordinator'],
-                                                                               
                                'main_co' => $main['coordinator'],'parent' => 
$p['parent'])))
+                                                                               
                                'main_co' => 
(isset($main['coordinator'])?$main['coordinator']:''),'parent' => 
$p['parent'])))
                                        {
-                                               
$GLOBALS['phpgw']->template->set_var('add_job_url',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.edit_project&action=subs&pro_parent='
-                                                                               
                                                        . $p['project_id'] . 
'&pro_main=' . ($pro_main?$pro_main:$p['project_id'])));
+                                               
$GLOBALS['phpgw']->template->set_var('add_job_url',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects.edit_project',
+                                                                               
                                                                                
                                                                
'action'=>'subs',
+                                                                               
                                                                                
                                                                'pro_parent'=> 
$p['project_id'],
+                                                                               
                                                                                
                                                                'pro_main'=> 
($pro_main?$pro_main:$p['project_id']))));
                                                
$GLOBALS['phpgw']->template->set_var('add_job_img','<img src="' . 
$GLOBALS['phpgw']->common->image('phpgwapi','new') . '" title="' . lang('add 
sub project')
                                                                                
                                                                . '" 
border="0">');
                                        }
@@ -496,15 +498,17 @@
                        {
                                foreach($pro as $p)
                                {
-                                       
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
+                                       
$this->nextmatchs->template_alternate_row_class($GLOBALS['phpgw']->template);
 
 // --------------- template declaration for list records 
-------------------------------------
 
                                        $link_data['project_id'] = 
$p['project_id'];
                                        $link_data['action']     = 
$p['parent']>0?'subs':'mains';
 
-                                       $projects_url = 
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojecthours.list_hours&project_id='
-                                                                       . 
$p['project_id'] . '&action=hours&pro_main=' . $p['main']);
+                                       $projects_url = 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojecthours.list_hours',
+                                                                               
                                                                'project_id'=> 
$p['project_id'],
+                                                                               
                                                                
'action'=>'hours',
+                                                                               
                                                                
'pro_main'=>$p['main']));
                                        
                                        
$GLOBALS['phpgw']->template->set_var(array
                                        (
@@ -572,8 +576,10 @@
                                        if 
($this->boprojects->add_perms(array('action' => $action,'coordinator' => 
$p['coordinator'],
                                                                                
                                'main_co' => $main['coordinator'],'parent' => 
$p['parent'])))
                                        {
-                                               
$GLOBALS['phpgw']->template->set_var('add_job_url',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.edit_project&action=subs&pro_parent='
-                                                                               
                                                        . $p['project_id'] . 
'&pro_main=' . ($pro_main?$pro_main:$p['project_id'])));
+                                               
$GLOBALS['phpgw']->template->set_var('add_job_url',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects.edit_project',
+                                                                               
                                                                                
                                        'action'=>'subs',
+                                                                               
                                                                                
                                        'pro_parent'=> $p['project_id'],
+                                                                               
                                                                                
                                        
'pro_main'=>($pro_main?$pro_main:$p['project_id']))));
                                                
$GLOBALS['phpgw']->template->set_var('add_job_img','<img src="' . 
$GLOBALS['phpgw']->common->image('phpgwapi','new') . '" title="' . lang('add 
sub project')
                                                                                
                                                                . '" 
border="0">');
                                        }
@@ -665,7 +671,7 @@
 
                        for ($i=0;$i<count($pro);$i++)
                        {
-                               
$this->nextmatchs->template_alternate_row_color($this->t);
+                               
$this->nextmatchs->template_alternate_row_class($this->t);
 
                                if ($action == 'mains')
                                {
@@ -805,8 +811,16 @@
                        {
                                $this->cat_id = ($values['cat'] ? 
$values['cat'] : '');
 
-                               $values['coordinator']  = $_POST['accountid'];
+                               $values['coordinator']  = 
(isset($_POST['accountid'])?$_POST['accountid']:'');
+                               
+                               if(isset($_POST['employees']) && 
is_array($_POST['employees']))
+                               {
                                $values['employees']    = 
array_merge($_POST['employees'], array($_POST['accountid']));
+                               }
+                               else
+                               {
+                                       $values['employees'] = 
array($_POST['accountid']);
+                               }                       
                                $values['project_id']   = $project_id;
                                $values['customer']     = $_POST['abid'];
                                $values['customer_org'] = 
$_POST['customer_org'];
@@ -1088,7 +1102,7 @@
                                {
                                        for($i=0;$i<count($mstones);++$i)
                                        {
-                                               
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
+                                               
$this->nextmatchs->template_alternate_row_class($GLOBALS['phpgw']->template);
 
                                                $link_data['s_id'] = 
$mstones[$i]['s_id'];
 
@@ -1583,7 +1597,7 @@
                        
$GLOBALS['phpgw']->template->set_var('quality',$values['quality']);
                        
$GLOBALS['phpgw']->template->set_var('priority',$this->boprojects->formatted_priority($values['priority']));
 
-                       
$GLOBALS['phpgw']->template->set_var('currency',$prefs['currency']);
+                       
$GLOBALS['phpgw']->template->set_var('currency',(isset($prefs['currency'])?$prefs['currency']:''));
 
                        $month = $this->boprojects->return_date();
                        
$GLOBALS['phpgw']->template->set_var('month',$month['monthformatted']);
@@ -1672,8 +1686,8 @@
                        while (is_array($emps) && (list($no_use,$emp) = 
each($emps)))
                        {
                                
$GLOBALS['phpgw']->template->set_var('emp_name',$emp['emp_name']);
-                               
$GLOBALS['phpgw']->template->set_var('events',$emp['events']);
-                               
$GLOBALS['phpgw']->template->set_var('role_name',$emp['role_name']);
+                               
$GLOBALS['phpgw']->template->set_var('events',(isset($emp['events'])?$emp['events']:''));
+                               
$GLOBALS['phpgw']->template->set_var('role_name',(isset($emp['role_name'])?$emp['role_name']:''));
                                
$GLOBALS['phpgw']->template->fp('emplisthandle','emplist',True);
                        }
 
@@ -1915,7 +1929,7 @@
                                        $upmost_level = $pro[$i]['level'];
                                }
                                
-                               
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
+                               
$this->nextmatchs->template_alternate_row_class($GLOBALS['phpgw']->template);
 
 // --------------- template declaration for list records 
-------------------------------------
 
@@ -2095,7 +2109,7 @@
                        {
                                foreach($roles as $role)
                                {
-                                       
$this->nextmatchs->template_alternate_row_color($GLOBALS['phpgw']->template);
+                                       
$this->nextmatchs->template_alternate_row_class($GLOBALS['phpgw']->template);
 
                                        
$GLOBALS['phpgw']->template->set_var('emp_name',$role['emp_name']);
 

Index: class.uistatistics.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uistatistics.inc.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- class.uistatistics.inc.php  25 Nov 2006 17:02:36 -0000      1.62
+++ class.uistatistics.inc.php  25 Nov 2006 23:12:10 -0000      1.63
@@ -6,7 +6,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package projects
-       * @version $Id: class.uistatistics.inc.php,v 1.62 2006/11/25 17:02:36 
sigurdne Exp $
+       * @version $Id: class.uistatistics.inc.php,v 1.63 2006/11/25 23:12:10 
sigurdne Exp $
        * $Source: 
/sources/phpgroupware/projects/inc/class.uistatistics.inc.php,v $
        */
 
@@ -486,10 +486,10 @@
 
                function list_users()
                {
-                       $values = $_POST['values'];
+                       $values = (isset($_POST['values'])?$_POST['values']:'');
 
                        $pro_user = array();
-                       if(is_array($values['account_id']))
+                       if(isset($values['account_id']) && 
is_array($values['account_id']))
                        {
                                $i = 0;
                                foreach($values['account_id'] as $a_id => $val)
@@ -567,7 +567,7 @@
 
                                
$GLOBALS['phpgw']->template->set_var('project_list','');
                                $GLOBALS['phpgw']->template->set_var('pro','');
-                               if(is_array($pro[$users[$i]['account_id']]))
+                               if(isset($pro[$users[$i]['account_id']]) && 
is_array($pro[$users[$i]['account_id']]))
                                {
                                        foreach($pro[$users[$i]['account_id']] 
as $p)
                                        {
@@ -585,7 +585,7 @@
 // ------------------------------- end record declaration 
---------------------------------
 
                        
$GLOBALS['phpgw']->template->pfp('out','user_list_t',True);
-                       $this->save_sessiondata($action);
+                       $this->save_sessiondata($action='');
                }
 
                function user_stat()
@@ -1120,7 +1120,7 @@
                {
                        $jscal = CreateObject('phpgwapi.jscalendar');   // 
before phpgw_header() !!!
 
-                       $values = $_POST['values'];
+                       $values = (isset($_POST['values'])?$_POST['values']:'');
 
                        //$GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . lang('User statistics')
                        //                                                      
                                        . $this->admin_header_info();
@@ -1155,7 +1155,7 @@
                        else
                        {
                                // show only current user
-                               $select_employee_list = '<input type="hidden" 
name="values[employee]" value="'.$account_id.'">'. 
$GLOBALS['phpgw']->common->grab_owner_name($this->account);
+                               $select_employee_list = '<input type="hidden" 
name="values[employee]" value="'. (isset($account_id)?$account_id:'') .'">'. 
$GLOBALS['phpgw']->common->grab_owner_name($this->account);
                        }
 
                        
$GLOBALS['phpgw']->template->set_var('select_employee_list', 
$select_employee_list);
@@ -1175,7 +1175,7 @@
                        while(list($stat, $lang_stat) = each($actions))
                        {
                                $select_action_list .= '<option 
value="'.$stat.'"';
-                               if($values['stat_action'] == $stat)
+                               if(isset($values['stat_action']) && 
$values['stat_action'] == $stat)
                                {
                                        $select_action_list .= ' selected';
                                }
@@ -1190,7 +1190,7 @@
 // ------------- jscal variable template-declarations 
-------------------------------
 
                        $start_val = false;
-                       if($values['sdate'])
+                       if(isset($values['sdate']) && $values['sdate'])
                        {
                                $start_array = 
$jscal->input2date($values['sdate']);
                                //$start_val   = $start_array['raw'];
@@ -1198,7 +1198,7 @@
                        }
 
                        $end_val = false;
-                       if($values['edate'])
+                       if(isset($values['edate']) && $values['edate'])
                        {
                                $end_array = 
$jscal->input2date($values['edate']);
                                //$end_val   = $end_array['raw'];




reply via email to

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