[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] projects/inc class.boconfig.inc.php class.bopro...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] projects/inc class.boconfig.inc.php class.bopro... |
Date: |
Mon, 27 Nov 2006 21:36:26 +0000 |
CVSROOT: /sources/phpgroupware
Module name: projects
Changes by: Sigurd Nes <sigurdne> 06/11/27 21:36:26
Modified files:
inc : class.boconfig.inc.php
class.boprojecthours.inc.php
class.boprojects.inc.php class.soconfig.inc.php
class.soprojecthours.inc.php
class.soprojects.inc.php class.uiconfig.inc.php
class.uiprojecthours.inc.php
class.uiprojects.inc.php hook_admin.inc.php
Log message:
various fixes
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.boconfig.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.boprojecthours.inc.php?cvsroot=phpgroupware&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.boprojects.inc.php?cvsroot=phpgroupware&r1=1.165&r2=1.166
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.soconfig.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.soprojecthours.inc.php?cvsroot=phpgroupware&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.soprojects.inc.php?cvsroot=phpgroupware&r1=1.116&r2=1.117
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiconfig.inc.php?cvsroot=phpgroupware&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojecthours.inc.php?cvsroot=phpgroupware&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojects.inc.php?cvsroot=phpgroupware&r1=1.167&r2=1.168
http://cvs.savannah.gnu.org/viewcvs/projects/inc/hook_admin.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
Patches:
Index: class.boconfig.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.boconfig.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- class.boconfig.inc.php 27 Nov 2006 15:00:08 -0000 1.24
+++ class.boconfig.inc.php 27 Nov 2006 21:36:26 -0000 1.25
@@ -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.boconfig.inc.php,v 1.24 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.boconfig.inc.php,v 1.25 2006/11/27 21:36:26
sigurdne Exp $
* $Source: /sources/phpgroupware/projects/inc/class.boconfig.inc.php,v $
*/
@@ -19,6 +19,7 @@
var $order;
var $sort;
var $cat_id;
+ var $limit;
var $public_functions = array
(
@@ -335,9 +336,9 @@
$error[] = lang('Description
can not exceed 250 characters in length');
}
- if (! $values['choose'])
+ if (!isset($values['choose']) ||
!$values['choose'])
{
- if (! $values['number'])
+ if (!isset($values['number'])
|| !$values['number'])
{
$error[] = lang('Please
enter an ID');
}
@@ -364,7 +365,7 @@
if
($this->boprojects->siteconfig['activity_bill'] == 'wu')
{
- if ((! $values['minperae']) ||
($values['minperae'] == 0))
+ if (!isset($values['minperae'])
|| (!$values['minperae']) || ($values['minperae'] == 0))
{
$error[] = lang('please
enter the minutes per workunit');
}
@@ -372,7 +373,7 @@
break;
}
- if (is_array($error))
+ if (isset($error) && is_array($error))
{
return $error;
}
@@ -389,12 +390,12 @@
function save_activity($values)
{
- if ($values['choose'])
+ if (isset($values['choose']) && $values['choose'])
{
$values['number'] =
$this->boprojects->soprojects->create_activityid();
}
- if ($values['activity_id'])
+ if (isset($values['activity_id']) &&
$values['activity_id'])
{
if ($values['activity_id'] &&
intval($values['activity_id']) > 0)
{
@@ -402,7 +403,9 @@
if ($values['minperae'])
{
-
$this->boprojects->sohours->update_hours_act($values['activity_id'],$values['minperae']);
+
+ // Fix this !! - obsolete ?
+ //
$this->boprojects->sohours->update_hours_act($values['activity_id'],$values['minperae']);
}
}
}
Index: class.boprojecthours.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.boprojecthours.inc.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- class.boprojecthours.inc.php 27 Nov 2006 15:00:08 -0000 1.41
+++ class.boprojecthours.inc.php 27 Nov 2006 21:36:26 -0000 1.42
@@ -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.boprojecthours.inc.php,v 1.41 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.boprojecthours.inc.php,v 1.42 2006/11/27 21:36:26
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.boprojecthours.inc.php,v $
*/
@@ -644,6 +644,7 @@
if(is_array($project_list))
{
+ $hours =false;
foreach($project_list as $key => $pro)
{
$hours[$key] = array
Index: class.boprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -b -r1.165 -r1.166
--- class.boprojects.inc.php 27 Nov 2006 15:00:08 -0000 1.165
+++ class.boprojects.inc.php 27 Nov 2006 21:36:26 -0000 1.166
@@ -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.165 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.boprojects.inc.php,v 1.166 2006/11/27 21:36:26
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.boprojects.inc.php,v $
*/
@@ -192,12 +192,12 @@
$column = $this->type($action);
$data =
$GLOBALS['phpgw']->session->appsession('session_data',$column);
- $this->start = $data['start'];
- $this->query = $data['query'];
- $this->filter = $data['filter'];
- $this->order = $data['order'];
- $this->sort = $data['sort'];
- $this->cat_id = $data['cat_id'];
+ $this->start =
(isset($data['start'])?$data['start']:'');
+ $this->query =
(isset($data['query'])?$data['query']:'');
+ $this->filter =
(isset($data['filter'])?$data['filter']:'');
+ $this->order =
(isset($data['order'])?$data['order']:'');
+ $this->sort =
(isset($data['sort'])?$data['sort']:'');
+ $this->cat_id =
(isset($data['cat_id'])?$data['cat_id']:'');
$this->status =
(isset($data['status'])?$data['status']:'');
$this->state =
(isset($data['state'])?$data['state']:'');
$this->project_id =
(isset($data['project_id'])?$data['project_id']:'');
@@ -588,6 +588,9 @@
function get_activity_budget($params)
{
$subs = $this->get_sub_projects($params);
+ $sum_budget = '';
+ $sum_ptime = '';
+
if(is_array($subs))
{
$i = 0;
@@ -595,7 +598,7 @@
{
$sub_pro[$i] = $sub['project_id'];
$i++;
- if($sub['parent'] ==
$params['project_id'])
+ if(isset($sub['parent']) &&
$sub['parent'] == $params['project_id'])
{
$sum_budget += $sub['budget'];
$sum_ptime +=
$sub['time_planned'];
@@ -1830,7 +1833,7 @@
$values['ptime'] = intval($values['ptime']);
$values['budget'] = round($values['budget'], 2);
- if ($values['accounting'] == 'project')
+ if (isset($values['accounting']) &&
$values['accounting'] == 'project')
{
if ($values['project_accounting_factor'] ||
$values['project_accounting_factor_d'])
{
@@ -1956,12 +1959,12 @@
$values['project_id'] = intval($values['project_id']);
- $values['old_edate'] = intval($values['old_edate']);
+ $values['old_edate'] =
(isset($values['old_edate'])?intval($values['old_edate']):0);
$async = CreateObject('phpgwapi.asyncservice');
if($values['edate'] > 0 && $values['old_edate'] !=
$values['edate'])
{
$event_extra =
$this->soconfig->get_event_extra('project date due');
- $next =
mktime(date('H',time()),date('i',time())+5,0,$values['emonth'],$values['eday']-$event_extra,$values['eyear']);
+ $next =
mktime(date('H',time()),date('i',time())+5,0,(isset($values['emonth'])?$values['emonth']:0),(isset($values['eday'])?$values['eday']:0)-$event_extra,(isset($values['eyear'])?$values['eyear']:0));
$edate = $this->format_date($values['edate']);
$async->write(array('id' => 'projects-' .
$values['project_id'], 'next' => $next,'times' => array('year' =>
date('Y',$next),
@@ -2555,7 +2558,7 @@
$send_role = True;
}
- if($send_role)
+ if(isset($send_role) && $send_role)
{
$values['event_type'] = 'assignment to
role';
$this->send_alarm($values);
@@ -2663,8 +2666,9 @@
$id = $action . '_id';
$name = $action . '_name';
- if(is_array($list))
+ if(isset($list) && is_array($list))
{
+ $list_list ='';
foreach($list as $li)
{
$list_list .= '<option value="' .
$li[$id] . '"';
Index: class.soconfig.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.soconfig.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- class.soconfig.inc.php 27 Nov 2006 15:00:08 -0000 1.24
+++ class.soconfig.inc.php 27 Nov 2006 21:36:26 -0000 1.25
@@ -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.soconfig.inc.php,v 1.24 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.soconfig.inc.php,v 1.25 2006/11/27 21:36:26
sigurdne Exp $
* $Source: /sources/phpgroupware/projects/inc/class.soconfig.inc.php,v $
*/
@@ -186,6 +186,7 @@
$this->db->query('SELECT
activity_id,a_number,descr,billperae,billable FROM
phpgw_p_projectactivities,phpgw_p_activities WHERE project_id ='
. intval($project_id) .
' AND phpgw_p_projectactivities.activity_id=phpgw_p_activities.id order by
descr asc',__LINE__,__FILE__);
+ $hours_act = '';
while ($this->db->next_record())
{
$hours_act .= '<option value="' .
$this->db->f('activity_id') . '"';
@@ -242,10 +243,10 @@
function exists($values)
{
- $pa_id = isset($values['pa_id'])?$values['pa_id']:0;
- $number = isset($values['number'])?$values['number']:'';
- $action =
isset($values['action'])?$values['action']:'activitiy';
- $check = isset($values['check'])?$values['check']:'';
+ $pa_id = isset($values['pa_id']) && $values['pa_id']
?$values['pa_id']:0;
+ $number = isset($values['number']) && $values['number']
?$values['number']:'';
+ $action = isset($values['action']) && $values['action']
? $values['action']:'activity';
+ $check = isset($values['check']) && $values['check']
?$values['check']:'';
$pa_id = intval($pa_id);
@@ -369,13 +370,14 @@
{
$start = isset($values['start'])?$values['start']:0;
$limit = isset($values['limit'])?$values['limit']:True;
- $sort = isset($values['sort'])?$values['sort']:'ASC';
- $order =
isset($values['order'])?$values['order']:'a_number';
+ $sort = isset($values['sort']) &&
$values['sort']?$values['sort']:'ASC';
+ $order = isset($values['order']) &&
$values['order']?$values['order']:'a_number';
$cat_id = isset($values['cat_id'])?$values['cat_id']:0;
$query = $this->db->db_addslashes($values['query']);
$ordermethod = " order by $order $sort";
+ $filtermethod = '';
if ($query)
{
@@ -407,6 +409,7 @@
$this->db->query($sql .
$ordermethod,__LINE__,__FILE__);
}
+ $act = false;
$i = 0;
while ($this->db->next_record())
{
@@ -584,6 +587,8 @@
$query = $this->db->db_addslashes($values['query']);
$ordermethod = " order by role_name $sort";
+ $querymethod = '';
+ $roles = false;
if ($query)
{
@@ -622,6 +627,7 @@
function list_events($type = '')
{
+ $type_select = '';
if($type)
{
$type_select = " where event_type='$type'";
Index: class.soprojecthours.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.soprojecthours.inc.php,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- class.soprojecthours.inc.php 27 Nov 2006 15:00:08 -0000 1.43
+++ class.soprojecthours.inc.php 27 Nov 2006 21:36:26 -0000 1.44
@@ -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.soprojecthours.inc.php,v 1.43 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.soprojecthours.inc.php,v 1.44 2006/11/27 21:36:26
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.soprojecthours.inc.php,v $
*/
@@ -486,6 +486,7 @@
function db2track()
{
+ $track = false;
while ($this->db->next_record())
{
$track[] = array
Index: class.soprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -b -r1.116 -r1.117
--- class.soprojects.inc.php 26 Nov 2006 22:21:13 -0000 1.116
+++ class.soprojects.inc.php 27 Nov 2006 21:36:26 -0000 1.117
@@ -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.116 2006/11/26 22:21:13
sigurdne Exp $
+ * @version $Id: class.soprojects.inc.php,v 1.117 2006/11/27 21:36:26
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.soprojects.inc.php,v $
*/
@@ -115,9 +115,9 @@
{
$start =
(isset($values['start'])?intval($values['start']):0);
$limit =
(isset($values['limit'])?$values['limit']:true);
- $filter =
(isset($values['filter'])?$values['filter']:'none');
+ $filter = (isset($values['filter']) &&
$values['filter']?$values['filter']:'none');
$sort = (isset($values['sort']) &&
$values['sort']?$values['sort']:'ASC');
- $order =
(isset($values['order'])?$values['order']:'p_number,title,start_date');
+ $order = (isset($values['order']) &&
$values['order']?$values['order']:'p_number,title,start_date');
$status =
isset($values['status'])?$values['status']:'active';
$action =
(isset($values['action'])?$values['action']:'mains');
@@ -379,7 +379,7 @@
foreach($pro as $p)
{
$s .= '<option value="' .
$p['project_id'] . '"';
- if ($p['project_id'] ==
$values['selected'])
+ if (isset($values['selected']) &&
$p['project_id'] == $values['selected'])
{
$s .= ' selected';
}
@@ -421,8 +421,8 @@
$values['e_budget'] =
$values['e_budget'] + 0.0;
$values['e_budget_childs'] =
$values['e_budget_childs'] + 0.0;
$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['project_accounting_factor'] =
(isset($values['project_accounting_factor'])?$values['project_accounting_factor']:0)
+ 0.0;
+ $values['project_accounting_factor_d'] =
(isset($values['project_accounting_factor_d'])?$values['project_accounting_factor_d']:0)
+ 0.0;
$values['parent'] =
(isset($values['parent'])?intval($values['parent']):0);
if ($values['parent'] > 0)
@@ -442,10 +442,10 @@
.
intval($values['sdate']) . ',' . intval($values['edate']) . ',' .
intval($values['coordinator']) . ',' . intval($values['customer']) . ",'"
. $values['status'] .
"','" . $values['descr'] . "','" . $values['title'] . "'," . $values['budget']
. "," . $values['budget_childs'] . ",'" . $values['number'] . "',"
. $values['parent'] .
',' . intval($values['ptime']) . ',' . intval($values['ptime_childs']) . ',' .
time() . ',' . $this->account . ",'" . $values['investment_nr']
- . "'," .
intval($values['main']) . ',' . intval($values['level']) . ',' .
intval($values['previous']) . ",'"
+ . "'," .
(isset($values['main'])?intval($values['main']):0) . ',' .
(isset($values['level'])?intval($values['level']):0) . ',' .
intval($values['previous']) . ",'"
.
$values['customer_nr'] . "','" . $values['url'] . "','" . $values['reference']
. "','" . $values['result'] . "','"
- . $values['test'] .
"','" . $values['quality'] . "','" . $values['accounting'] . "'," .
$values['project_accounting_factor']
- . ',' .
$values['project_accounting_factor_d'] . ",'". ($values['billable']?'N':'Y') .
"','" . $values['inv_method'] . "',"
+ . $values['test'] .
"','" . $values['quality'] . "','" .
(isset($values['accounting'])?$values['accounting']:'') . "'," .
$values['project_accounting_factor']
+ . ',' .
$values['project_accounting_factor_d'] . ",'". (isset($values['billable']) &&
$values['billable']?'N':'Y') . "','" . $values['inv_method'] . "',"
.
intval($values['psdate']) . ',' . intval($values['pedate']) . ',' .
intval($values['priority']) . ',' . $values['e_budget'] . ',' .
$values['e_budget_childs'] . ','
. $values['discount'] .
",'" . $values['discount_type'] . "', '".$values['plan_bottom_up']."',
".intval($values['customer_org']).",
'".$values['direct_work']."')",__LINE__,__FILE__);
Index: class.uiconfig.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiconfig.inc.php,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- class.uiconfig.inc.php 27 Nov 2006 15:00:08 -0000 1.34
+++ class.uiconfig.inc.php 27 Nov 2006 21:36:26 -0000 1.35
@@ -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.uiconfig.inc.php,v 1.34 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.uiconfig.inc.php,v 1.35 2006/11/27 21:36:26
sigurdne Exp $
* $Source: /sources/phpgroupware/projects/inc/class.uiconfig.inc.php,v $
*/
@@ -180,22 +180,22 @@
switch($this->siteconfig['accounting'])
{
case 'activity':
-
$GLOBALS['phpgw']->template->set_var('link_accounting',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_activities&action=act'));
+
$GLOBALS['phpgw']->template->set_var('link_accounting',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.list_activities','action'=>'act')));
$GLOBALS['phpgw']->template->set_var('lang_accounting',lang('Activities'));
break;
default:
-
$GLOBALS['phpgw']->template->set_var('link_accounting',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_employees&action=accounting'));
+
$GLOBALS['phpgw']->template->set_var('link_accounting',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.list_employees','action'=>'accounting')));
$GLOBALS['phpgw']->template->set_var('lang_accounting',lang('Accounting'));
}
$GLOBALS['phpgw']->template->fp('admin_header','projects_admin_header');
}
-
$GLOBALS['phpgw']->template->set_var('link_budget',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_budget&action=mains'));
-
$GLOBALS['phpgw']->template->set_var('link_jobs',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_projects&action=subs'));
-
$GLOBALS['phpgw']->template->set_var('link_hours',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojecthours.list_projects&action=mains'));
-
$GLOBALS['phpgw']->template->set_var('link_ttracker',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojecthours.ttracker'));
-
$GLOBALS['phpgw']->template->set_var('link_statistics',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uistatistics.list_projects&action=mains'));
-
$GLOBALS['phpgw']->template->set_var('link_projects',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_projects&action=mains'));
+
$GLOBALS['phpgw']->template->set_var('link_budget',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects.list_budget','action'=>'mains')));
+
$GLOBALS['phpgw']->template->set_var('link_jobs',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects.list_projects','action'=>'subs')));
+
$GLOBALS['phpgw']->template->set_var('link_hours',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojecthours.list_projects','action'=>'mains')));
+
$GLOBALS['phpgw']->template->set_var('link_ttracker',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojecthours.ttracker')));
+
$GLOBALS['phpgw']->template->set_var('link_statistics',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uistatistics.list_projects','action'=>'mains')));
+
$GLOBALS['phpgw']->template->set_var('link_projects',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects.list_projects','action'=>'mains')));
$GLOBALS['phpgw']->template->fp('app_header','projects_header');
}
@@ -345,12 +345,13 @@
'edate_formatted'
=> $emps[$i]['edate_formatted'],
'weekly_workhours_num' =>
$emps[$i]['weekly_workhours'],
'cost_centre_num'
=> $emps[$i]['cost_centre'],
- 'delete_emp'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_employees&id='
-
. $emps[$i]['id'] .
'&delete=True'),
+ 'delete_emp'
=>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.list_employees',
+
'id'=> $emps[$i]['id'],
+
'delete'=>'True')),
'delete_img'
=> $GLOBALS['phpgw']->common->image('phpgwapi','delete'),
'lang_delete_factor' =>
lang('delete factor'),
- 'edit_emp'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.edit_employee_factor&id='
-
.
$emps[$i]['id']),
+ 'edit_emp'
=>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.edit_employee_factor',
+
'id'=> $emps[$i]['id'])),
'edit_img'
=> $GLOBALS['phpgw']->common->image('phpgwapi','edit'),
'lang_edit_factor'
=> lang('edit factor')
));
@@ -535,7 +536,7 @@
$GLOBALS['phpgw']->template->set_var('search_action',$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->template->set_var('search_list',$this->nextmatchs->search(array('query'
=> $this->query)));
- switch($prefs['bill'])
+
switch((isset($this->siteconfig['activity_bill'])?$this->siteconfig['activity_bill']:''))
{
case 'wu': $bill = lang('Bill per
workunit'); break;
case 'h': $bill = lang('Bill per hour');
break;
@@ -549,7 +550,7 @@
$GLOBALS['phpgw']->template->set_var('sort_descr',$this->nextmatchs->show_sort_order($this->sort,'descr',$this->order,'/index.php',lang('Description')));
$GLOBALS['phpgw']->template->set_var('sort_billperae',$this->nextmatchs->show_sort_order($this->sort,'billperae',$this->order,'/index.php',$bill));
- if ($prefs['bill'] == 'wu')
+ if (isset($this->siteconfig['activity_bill']) &&
$this->siteconfig['activity_bill'] == 'wu')
{
$GLOBALS['phpgw']->template->set_var('sort_minperae','<td width="10%"
align="right">' . $this->nextmatchs->show_sort_order($this->sort,'minperae',
$this->order,'/index.php',lang('Minutes per workunit') . '</td>'));
@@ -572,7 +573,7 @@
'descr' => $descr,
'billperae' => $act[$i]['billperae']));
- if ($prefs['bill'] == 'wu')
+ if (isset($this->siteconfig['activity_bill'])
&& $this->siteconfig['activity_bill'] == 'wu')
{
$GLOBALS['phpgw']->template->set_var('minperae','<td align="right">' .
$act[$i]['minperae'] . '</td>');
}
@@ -617,7 +618,7 @@
'action' => 'act'
);
- if ($_POST['save'])
+ if (isset($_POST['save']) && $_POST['save'])
{
$this->cat_id =
($values['cat']?$values['cat']:'');
$values['activity_id'] = $activity_id;
@@ -634,7 +635,7 @@
}
}
- if($_POST['cancel'])
+ if(isset($_POST['cancel']) && $_POST['cancel'])
{
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
@@ -648,7 +649,7 @@
$GLOBALS['phpgw']->template->set_file(array('edit_activity' =>
'formactivity.tpl'));
$GLOBALS['phpgw']->template->set_var('done_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
-
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.edit_activity&activity_id='
. $activity_id));
+
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.edit_activity','activity_id'=>
$activity_id)));
$GLOBALS['phpgw']->template->set_var('currency',$GLOBALS['phpgw_info']['user']['preferences']['common']['currency']);
@@ -666,37 +667,37 @@
}
$GLOBALS['phpgw']->template->set_var('cats_list',$this->boconfig->boprojects->cats->formatted_list('select','all',$this->cat_id,True));
-
$GLOBALS['phpgw']->template->set_var('num',$GLOBALS['phpgw']->strip_html($values['number']));
- $descr =
$GLOBALS['phpgw']->strip_html($values['descr']);
+
$GLOBALS['phpgw']->template->set_var('num',$GLOBALS['phpgw']->strip_html((isset($values['number'])?$values['number']:'')));
+ $descr =
$GLOBALS['phpgw']->strip_html((isset($values['descr'])?$values['descr']:''));
if (! $descr) $descr = ' ';
$GLOBALS['phpgw']->template->set_var('descr',$descr);
- if ($values['remarkreq'] == 'N'):
+ if (isset($values['remarkreq']) && $values['remarkreq']
== 'N'):
$stat_sel[0]=' selected';
- elseif ($values['remarkreq'] == 'Y'):
+ elseif (isset($values['remarkreq']) &&
$values['remarkreq'] == 'Y'):
$stat_sel[1]=' selected';
endif;
- $remarkreq_list = '<option value="N"' . $stat_sel[0] .
'>' . lang('No') . '</option>' . "\n"
- . '<option value="Y"' . $stat_sel[1] .
'>' . lang('Yes') . '</option>' . "\n";
+ $remarkreq_list = '<option value="N"' .
(isset($stat_sel[0])?$stat_sel[0]:'') . '>' . lang('No') . '</option>' . "\n"
+ . '<option value="Y"' .
(isset($stat_sel[1])?$stat_sel[1]:'') . '>' . lang('Yes') . '</option>' . "\n";
$GLOBALS['phpgw']->template->set_var('remarkreq_list',$remarkreq_list);
- if ($prefs['bill'] == 'wu')
+ if (isset($this->siteconfig['activity_bill']) &&
$this->siteconfig['activity_bill'] == 'wu')
{
$GLOBALS['phpgw']->template->set_var('lang_billperae',lang('Bill per
workunit'));
$GLOBALS['phpgw']->template->set_var('lang_minperae',lang('Minutes per
workunit'));
-
$GLOBALS['phpgw']->template->set_var('minperae','<input type="text"
name="values[minperae]" value="' . $values['minperae'] . '">');
+
$GLOBALS['phpgw']->template->set_var('minperae','<input type="text"
name="values[minperae]" value="' .
(isset($values['minperae'])?$values['minperae']:'') . '">');
}
else
{
$GLOBALS['phpgw']->template->set_var('lang_billperae',lang('Bill per hour'));
}
-
$GLOBALS['phpgw']->template->set_var('billperae',$values['billperae']);
+
$GLOBALS['phpgw']->template->set_var('billperae',(isset($values['billperae'])?$values['billperae']:''));
$link_data['menuaction'] =
'projects.uiconfig.delete_pa';
- $link_data['pa_id'] = $values[$i]['activity_id'];
+ $link_data['pa_id'] =
(isset($values['activity_id'])?$values['activity_id']:'');
$GLOBALS['phpgw']->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
@@ -736,6 +737,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . $header_info;
$GLOBALS['phpgw']->common->phpgw_header(True);
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
unset($GLOBALS['phpgw']->template->file);
unset($GLOBALS['phpgw']->template->varkeys);
unset($GLOBALS['phpgw']->template->varvals);
@@ -839,7 +841,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . $header_info;
$GLOBALS['phpgw']->common->phpgw_header(True);
-
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$this->set_app_langs();
$GLOBALS['phpgw']->template->set_file(array('admin_add'
=> 'form_admin.tpl'));
@@ -895,6 +897,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('roles list');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$this->set_app_langs();
$GLOBALS['phpgw']->template->set_file(array('roles_list_t' =>
'list_roles.tpl'));
@@ -931,8 +934,9 @@
$GLOBALS['phpgw']->template->set_var(array
(
'role_name' =>
$roles[$i]['role_name'],
- 'delete_role' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_roles&role_id='
-
. $roles[$i]['role_id']
. '&delete=True'),
+ 'delete_role' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.list_roles',
+
'role_id'=> $roles[$i]['role_id'],
+
'delete'=>'True')),
'delete_img' =>
$GLOBALS['phpgw']->common->image('phpgwapi','delete')
));
$GLOBALS['phpgw']->template->fp('list','roles_list',True);
@@ -967,6 +971,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('edit events');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$this->set_app_langs();
$GLOBALS['phpgw']->template->set_file(array('event_list_t' =>
'list_events.tpl'));
@@ -1058,6 +1063,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('edit surcharges');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$this->set_app_langs();
$GLOBALS['phpgw']->template->set_file(array('charge_list_t' =>
'list_surcharges.tpl'));
@@ -1077,10 +1083,12 @@
(
'charge_name'
=> $charge['charge_name'],
'charge_percent'
=> $charge['charge_percent'],
- 'delete_url'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_surcharges&charge_id='
-
. $charge['charge_id']
. '&delete=True'),
- 'edit_url'
=>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiconfig.list_surcharges&charge_id='
-
. $charge['charge_id']
. '&edit=True'),
+ 'delete_url'
=>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.list_surcharges',
+
'charge_id'=> $charge['charge_id'],
+
'delete'=>'True')),
+ 'edit_url'
=>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiconfig.list_surcharges',
+
'charge_id'=> $charge['charge_id'],
+
'edit'=>'True')),
'edit_img'
=> $GLOBALS['phpgw']->common->image('phpgwapi','edit'),
'lang_edit_surcharge' =>
lang('edit surcharge'),
'delete_img'
=> $GLOBALS['phpgw']->common->image('phpgwapi','delete'),
@@ -1118,12 +1126,13 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('edit project id help msg');
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$this->set_app_langs();
$GLOBALS['phpgw']->template->set_file(array('proidhelp'
=> 'config_proid_help.tpl'));
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
$GLOBALS['phpgw']->template->set_var('helpmsg',stripslashes($this->boconfig->config_proid_help_msg(array('action'
=> 'get'))));
-
$GLOBALS['phpgw']->template->set_var('help_url',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects_base.proid_help_popup'));
+
$GLOBALS['phpgw']->template->set_var('help_url',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects_base.proid_help_popup')));
$GLOBALS['phpgw']->template->set_var('lang_show',lang('show help msg'));
$GLOBALS['phpgw']->template->pfp('out','proidhelp',True);
}
@@ -1259,6 +1268,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . lang('preferences');
$GLOBALS['phpgw']->common->phpgw_header(True);
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$GLOBALS['phpgw']->template->set_file(array('prefs' =>
'preferences.tpl'));
$this->set_app_langs();
@@ -1266,7 +1276,6 @@
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
$prefs = $this->boconfig->boprojects->read_prefs();
- _debug_array($prefs);
$columns = array(
array('id' => 'priority',
@@ -1357,6 +1366,7 @@
)
);
+ $sel ='';
for ($i = 0; $i < count($columns); $i++)
{
$selected = '';
@@ -1367,6 +1377,7 @@
$sel .= '<option value="'.$columns[$i]['id'].'"
'.$selected.'>'.$columns[$i]['name'].'</option>'."\n";
}
+ $cssel ='';
for ($i = 0; $i < count($cscolumns); $i++)
{
$selected = '';
@@ -1385,6 +1396,7 @@
$GLOBALS['phpgw']->template->set_var('mainscreen_checked',($prefs['mainscreen_showevents']==True?'
CHECKED':''));
$GLOBALS['phpgw']->template->set_var('worktime_statusmail_desc',lang('worktime
statusmail'));
+ $mailTypeSelected = '';
for($i = 0; $i < count($mailTypeEntries); $i++)
{
$selected = '';
@@ -1426,6 +1438,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . $header_info;
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$GLOBALS['phpgw']->template->set_file(array('config' =>
'config_worktime_statusmail.tpl'));
@@ -1485,6 +1498,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . $header_info;
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$GLOBALS['phpgw']->template->set_file(array('config' =>
'config_workhours_booking.tpl'));
@@ -1555,6 +1569,7 @@
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('projects') . ': ' . $header_info;
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
+ $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$GLOBALS['phpgw']->template->set_file(array('config' =>
'config_worktime_warnmail.tpl'));
Index: class.uiprojecthours.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojecthours.inc.php,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- class.uiprojecthours.inc.php 27 Nov 2006 15:00:08 -0000 1.90
+++ class.uiprojecthours.inc.php 27 Nov 2006 21:36:26 -0000 1.91
@@ -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.90 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.uiprojecthours.inc.php,v 1.91 2006/11/27 21:36:26
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.uiprojecthours.inc.php,v $
*/
@@ -654,20 +654,20 @@
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
-
$GLOBALS['phpgw']->template->set_var('remark',$values['remark']);
-
$GLOBALS['phpgw']->template->set_var('hours',sprintf("%02d",$values['hours']));
-
$GLOBALS['phpgw']->template->set_var('minutes',sprintf("%02d",$values['minutes']));
-
$GLOBALS['phpgw']->template->set_var('km_distance',sprintf("%01.2f",$values['km_distance']));
+
$GLOBALS['phpgw']->template->set_var('remark',(isset($values['remark'])?$values['remark']:''));
+
$GLOBALS['phpgw']->template->set_var('hours',sprintf("%02d",(isset($values['hours'])?$values['hours']:'')));
+
$GLOBALS['phpgw']->template->set_var('minutes',sprintf("%02d",(isset($values['minutes'])?$values['minutes']:'')));
+
$GLOBALS['phpgw']->template->set_var('km_distance',sprintf("%01.2f",(isset($values['km_distance'])?$values['km_distance']:'')));
$GLOBALS['phpgw']->template->set_var('t_journey_h',sprintf("%02d",
floor($values['t_journey']/60)));
$GLOBALS['phpgw']->template->set_var('t_journey_m',sprintf("%02d",
intval($values['t_journey']%60)));
-
$GLOBALS['phpgw']->template->set_var('surcharge_list',$this->boprojects->action_format($values['surcharge'],'charge'));
+
$GLOBALS['phpgw']->template->set_var('surcharge_list',$this->boprojects->action_format((isset($values['surcharge'])?$values['surcharge']:''),'charge'));
- $start =
$start_val?$start_val:mktime(12,0,0,date('m'),date('d'),date('Y'));
+ $start =
isset($start_val)?$start_val:mktime(12,0,0,date('m'),date('d'),date('Y'));
$GLOBALS['phpgw']->template->set_var('start_date_select',$jscal->input('sdate[str]',$start));
if($this->siteconfig['hoursbookingday'] == 'yes')
{
- $end =
$end_val?$end_val:mktime(12,0,0,date('m'),date('d'),date('Y'));
+ $end =
isset($end_val)?$end_val:mktime(12,0,0,date('m'),date('d'),date('Y'));
$GLOBALS['phpgw']->template->set_var('end_date_select',$jscal->input('edate[str]',$end));
$GLOBALS['phpgw']->template->fp('datehandle','booking_date',True);
@@ -679,12 +679,12 @@
if($this->siteconfig['accounting'] == 'activity')
{
-
$GLOBALS['phpgw']->template->set_var('activity_list',$this->boprojects->select_hours_activities($this->project_id,$values['activity_id']));
+
$GLOBALS['phpgw']->template->set_var('activity_list',$this->boprojects->select_hours_activities($this->project_id,(isset($values['activity_id'])?$values['activity_id']:'')));
$GLOBALS['phpgw']->template->fp('activityhandle','activity',True);
}
else
{
-
$GLOBALS['phpgw']->template->set_var('hours_descr',$values['hours_descr']);
+
$GLOBALS['phpgw']->template->set_var('hours_descr',(isset($values['hours_descr'])?$values['hours_descr']:''));
$GLOBALS['phpgw']->template->fp('actownhandle','act_own',True);
}
@@ -706,6 +706,8 @@
$GLOBALS['phpgw']->template->set_var('thours_list','');
+ if(isset($track['hours']) &&
is_array($track['hours']))
+ {
for($i=0;$i<count($track['hours']);$i++)
{
$this->nextmatchs->template_alternate_row_class($GLOBALS['phpgw']->template);
@@ -743,6 +745,7 @@
$GLOBALS['phpgw']->template->fp('thours_list','ttracker_list',True);
}
+ }
$GLOBALS['phpgw']->template->fp('track','ttracker',True);
}
Index: class.uiprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -b -r1.167 -r1.168
--- class.uiprojects.inc.php 27 Nov 2006 15:00:08 -0000 1.167
+++ class.uiprojects.inc.php 27 Nov 2006 21:36:26 -0000 1.168
@@ -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.167 2006/11/27 15:00:08
sigurdne Exp $
+ * @version $Id: class.uiprojects.inc.php,v 1.168 2006/11/27 21:36:26
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v $
*/
@@ -267,7 +267,7 @@
}
$GLOBALS['phpgw']->template->set_var('col_align',$col_align);
-
$GLOBALS['phpgw']->template->set_var('column',$p[$col]);
+
$GLOBALS['phpgw']->template->set_var('column',(isset($p[$col])?$p[$col]:''));
$GLOBALS['phpgw']->template->fp('pro_column','pro_cols',True);
}
//$GLOBALS['phpgw']->template->set_var('pro_column',$pdata);
@@ -879,7 +879,7 @@
$project_id =
$this->boprojects->save_project($action, $values);
$this->attached_files->save_file(array('action_id' => $project_id));
$link_data['project_id'] = $project_id;
- if($_POST['save'])
+ if(isset($_POST['save']) &&
$_POST['save'])
{
unset($jscal);
$link_data['menuaction'] =
'projects.uiprojects.tree_view_projects';
@@ -955,7 +955,7 @@
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
- $check = array('action' =>
$action,'coordinator' => $values['coordinator'],'main' =>
$values['main'],'parent' => $values['parent']);
+ $check = array('action' =>
$action,'coordinator' => $values['coordinator'],'main' =>
(isset($values['main'])?$values['main']:''),'parent' =>
(isset($values['parent'])?$values['parent']:''));
if(!$this->boprojects->edit_perms($check))
{
$link_data['menuaction'] =
'projects.uiprojects.tree_view_projects';
@@ -1459,8 +1459,8 @@
$GLOBALS['phpgw']->template->set_var('customer_org_name', $customer_org_name);
$GLOBALS['phpgw']->template->set_var('customer_org',
$customer_org_id);
- if ($project_id &&
$this->boprojects->edit_perms(array('action' => $action,'coordinator' =>
$values['coordinator'],'main_co' => $main['coordinator'],
-
'parent_co' => $parent['coordinator'],'type' =>
'delete')))
+ if ($project_id &&
$this->boprojects->edit_perms(array('action' => $action,'coordinator' =>
$values['coordinator'],'main_co' =>
(isset($main['coordinator'])?$main['coordinator']:''),
+
'parent_co' =>
(isset($parent['coordinator'])?$parent['coordinator']:''),'type' => 'delete')))
{
$GLOBALS['phpgw']->template->set_var('delete_button','<input type="submit"
name="delete" value="' . lang('Delete') .'">');
}
@@ -2022,16 +2022,23 @@
$r_id = get_var('r_id',array('GET','POST'));
$project_id =
get_var('project_id',array('GET','POST'));
$values = get_var('values',array('POST'));
+ $message = '';
- if(!$_POST['save'] && !$_GET['delete'] &&
!$_POST['done'] && !$_GET['edit'])
+ if((!isset($_POST['save']) || !$_POST['save'])
+ && (!isset($_GET['delete']) || !$_GET['delete'])
+ && (!isset($_POST['done']) || !$_POST['done'])
+ && (!isset($_GET['edit']) || !$_GET['edit']))
{
$referer = get_var('referer',array('POST'));
}
- if($_POST['save'] || $_GET['delete'] || $_POST['done']
|| $_GET['edit'])
+ if((isset($_POST['save']) && $_POST['save'])
+ || (isset($_GET['delete']) && $_GET['delete'])
+ || (isset($_POST['done']) && $_POST['done'])
+ || (isset($_GET['edit']) && $_GET['edit']))
{
$referer = get_var('referer',array('GET'));
}
- if(!$referer) //$_POST['back'] && !$_POST['done'] &&
!$_POST['edit'])
+ if(!isset($referer) || !$referer) //$_POST['back'] &&
!$_POST['done'] && !$_POST['edit'])
{
$referer = $_SERVER['HTTP_REFERER'];
}
@@ -2046,14 +2053,14 @@
'referer' => $referer
);
- if ($_POST['save'])
+ if (isset($_POST['save']) && $_POST['save'])
{
$values['project_id'] = $project_id;
$this->boprojects->save_employee_role($values);
$GLOBALS['phpgw']->template->set_var('message',lang('assignment has been
saved'));
}
- if ($_POST['done'])
+ if (isset($_POST['done']) && $_POST['done'])
{
$link = array
(
@@ -2065,13 +2072,13 @@
//Header('Location: ' . $referer);
}
- if ($_GET['delete'])
+ if (isset($_GET['delete']) && $_GET['delete'])
{
$this->boprojects->delete_item(array('id' =>
$r_id,'action' => 'emp_role'));
$message = lang('assignment has been deleted');
}
- if($_GET['edit'])
+ if(isset($_GET['edit']) && $_GET['edit'])
{
list($values) =
$this->boprojects->get_employee_roles(array('project_id' =>
$project_id,'account_id' => $_GET['account_id']));
}
@@ -2088,7 +2095,7 @@
$pro =
$this->boprojects->read_single_project($project_id);
$GLOBALS['phpgw']->template->set_var('title_pro',$pro['title']);
$GLOBALS['phpgw']->template->set_var('pro_url',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'projects.uiprojects.view_project',
-
'action'=> ($pro['level']==0?'mains':'subs'),
+
'action'=> (isset($pro['level']) &&
$pro['level']==0?'mains':'subs'),
'project_id'=> $project_id)));
$GLOBALS['phpgw']->template->set_var('coordinator_pro',$pro['coordinatorout']);
$GLOBALS['phpgw']->template->set_var('number_pro',$pro['number']);
@@ -2135,9 +2142,9 @@
$link_data['r_id'] =
$role['r_id'];
$link_data['delete'] =
True;
-
$GLOBALS['phpgw']->template->set_var('delete_role',($delete_rights=='no'?'':'<a
href="' . $GLOBALS['phpgw']->link('/index.php',$link_data) . '">'));
+
$GLOBALS['phpgw']->template->set_var('delete_role',(isset($delete_rights) &&
$delete_rights=='no'?'':'<a href="' .
$GLOBALS['phpgw']->link('/index.php',$link_data) . '">'));
$link_data['delete'] =
False;
-
$GLOBALS['phpgw']->template->set_var('delete_img',($delete_rights=='no'?'':'<img
src="' . $GLOBALS['phpgw']->common->image('phpgwapi','delete')
+
$GLOBALS['phpgw']->template->set_var('delete_img',(isset($delete_rights) &&
$delete_rights=='no'?'':'<img src="' .
$GLOBALS['phpgw']->common->image('phpgwapi','delete')
. '" . border="0"
title="' . lang('delete') . '"></a>'));
}
}
@@ -2150,10 +2157,10 @@
}
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
-
$GLOBALS['phpgw']->template->set_var('role_select',$this->boprojects->action_format($values['role_id']));
-
$GLOBALS['phpgw']->template->set_var('event_select',$this->boprojects->action_format($values['events'],'event'));
+
$GLOBALS['phpgw']->template->set_var('role_select',$this->boprojects->action_format((isset($values['role_id'])?$values['role_id']:'')));
+
$GLOBALS['phpgw']->template->set_var('event_select',$this->boprojects->action_format((isset($values['events'])?$values['events']:''),'event'));
$GLOBALS['phpgw']->template->set_var('lang_select_role',lang('select role'));
-
$GLOBALS['phpgw']->template->set_var('emp_select',$this->ui_base->employee_format(array('type'
=> 'selectbox','project_id' => $project_id,'selected' => $values['account_id']
+
$GLOBALS['phpgw']->template->set_var('emp_select',$this->ui_base->employee_format(array('type'
=> 'selectbox','project_id' => $project_id,'selected' =>
(isset($values['account_id'])?$values['account_id']:'')
,'project_only' => True,'admins_included' => True)));
$GLOBALS['phpgw']->template->set_var('lang_assign',lang('assign'));
$GLOBALS['phpgw']->template->pfp('out','role_list_t',True);
Index: hook_admin.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/hook_admin.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- hook_admin.inc.php 9 Sep 2006 09:04:50 -0000 1.24
+++ hook_admin.inc.php 27 Nov 2006 21:36:26 -0000 1.25
@@ -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: hook_admin.inc.php,v 1.24 2006/09/09 09:04:50 skwashd
Exp $
+ * @version $Id: hook_admin.inc.php,v 1.25 2006/11/27 21:36:26 sigurdne
Exp $
* $Source: /sources/phpgroupware/projects/inc/hook_admin.inc.php,v $
*/
@@ -15,6 +15,8 @@
(
'Site Configuration' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index', 'appname' => 'projects') ),
'project administrators' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'projects.uiconfig.list_admins') ),
+ 'Activities' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'projects.uiconfig.list_activities','action'=>'act') ),
+ 'Budget' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'projects.uiconfig.list_budget','action'=>'mains') ),
'Worktime statusmail' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'projects.uiconfig.config_worktime_statusmail') ),
'Worktime warnmail' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'projects.uiconfig.config_worktime_warnmail') ),
'Workhours booking' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'projects.uiconfig.config_workhours_booking') ),