[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.uip...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.uip... |
Date: |
Sat, 25 Nov 2006 15:23:22 +0000 |
CVSROOT: /sources/phpgroupware
Module name: projects
Changes by: Sigurd Nes <sigurdne> 06/11/25 15:23:22
Modified files:
inc : class.boprojects.inc.php
class.uiprojects.inc.php
class.uiprojects_base.inc.php
Log message:
notices
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.boprojects.inc.php?cvsroot=phpgroupware&r1=1.159&r2=1.160
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojects.inc.php?cvsroot=phpgroupware&r1=1.162&r2=1.163
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojects_base.inc.php?cvsroot=phpgroupware&r1=1.15&r2=1.16
Patches:
Index: class.boprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -b -r1.159 -r1.160
--- class.boprojects.inc.php 25 Nov 2006 10:28:07 -0000 1.159
+++ class.boprojects.inc.php 25 Nov 2006 15:23:22 -0000 1.160
@@ -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.159 2006/11/25 10:28:07
sigurdne Exp $
+ * @version $Id: class.boprojects.inc.php,v 1.160 2006/11/25 15:23:22
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.boprojects.inc.php,v $
*/
@@ -516,7 +516,7 @@
//$this->accounts =
CreateObject('phpgwapi.accounts',$emps[$i]);
//$this->accounts->read_repository();
- if($data['roles_included'] == True)
+ if(isset($data['roles_included']) &&
$data['roles_included'] == True)
{
$role_name =
$this->soprojects->return_value('role',$project_id,$emps[$i]);
}
Index: class.uiprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -b -r1.162 -r1.163
--- class.uiprojects.inc.php 25 Nov 2006 10:28:07 -0000 1.162
+++ class.uiprojects.inc.php 25 Nov 2006 15:23:22 -0000 1.163
@@ -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.162 2006/11/25 10:28:07
sigurdne Exp $
+ * @version $Id: class.uiprojects.inc.php,v 1.163 2006/11/25 15:23:22
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v $
*/
@@ -76,6 +76,7 @@
function priority_list($selected = 0)
{
+ $list = '';
for($i=1;$i<=10;$i++)
{
$list .= '<option value="' . $i . '"' . ($i ==
$selected?' SELECTED>':'>') . $i . '</option>';
@@ -721,6 +722,7 @@
function edit_project()
{
+ $message ='';
if(!is_object($GLOBALS['phpgw']->js))
{
$GLOBALS['phpgw']->js =
createObject('phpgwapi.javascript');
@@ -799,7 +801,7 @@
//_debug_array($sdate);
- if ($_POST['save'] || $_POST['apply'])
+ if ((isset($_POST['save']) && $_POST['save']) ||
(isset($_POST['apply']) && $_POST['apply']))
{
$this->cat_id = ($values['cat'] ?
$values['cat'] : '');
@@ -871,22 +873,22 @@
}
}
}
- elseif($_POST['cancel'])
+ elseif(isset($_POST['cancel']) && $_POST['cancel'])
{
- if(!$project_id)
+ if(!isset($project_id) || !$project_id)
{
$link_data['project_id'] = $pro_parent;
}
$link_data['menuaction'] =
'projects.uiprojects.tree_view_projects';
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
- elseif($_POST['delete'])
+ elseif(isset($_POST['delete']) && $_POST['delete'])
{
$link_data['menuaction'] =
'projects.uiprojects.delete_project';
$link_data['pa_id'] = $project_id;
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
- elseif($_POST['mstone_save'])
+ elseif(isset($_POST['mstone_save']) &&
$_POST['mstone_save'])
{
$mstone_edate =
get_var('mstone_edate',array('GET','POST'));
$vmstone =
get_var('vmstone',array('GET','POST'));
@@ -916,15 +918,15 @@
$message = lang('milestone has been
saved');
}
}
- elseif($_POST['roles'])
+ elseif(isset($_POST['roles']) && $_POST['roles'])
{
$link_data['menuaction'] =
'projects.uiprojects.assign_employee_roles';
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
}
- if($project_id)
+ if(isset($project_id) && $project_id)
{
- if(!is_array($values))
+ if(!isset($values) || !is_array($values))
{
$values =
$this->boprojects->read_single_project($project_id);
}
@@ -989,7 +991,7 @@
$main =
$this->boprojects->read_single_project($pro_main,'planned');
}
- if(!$pro_parent && is_array($main) || ($pro_main ==
$pro_parent && is_array($main)))
+ if(!$pro_parent && isset($main) && is_array($main) ||
($pro_main == $pro_parent && isset($main) && is_array($main)))
{
$parent = $main;
}
@@ -1158,16 +1160,16 @@
switch($action)
{
case 'mains':
- $start =
$start_val?$start_val:''; //mktime(12,0,0,date('m'),date('d'),date('Y'));
- $end = $end_val?$end_val:'';
- $pstart =
$pstart_val?$pstart_val:''; //mktime(12,0,0,date('m'),date('d'),date('Y'));
- $pend =
$pend_val?$pend_val:'';
+ $start =
(isset($start_val)?$start_val:'');
//mktime(12,0,0,date('m'),date('d'),date('Y'));
+ $end =
(isset($end_val)?$end_val:'');
+ $pstart =
(isset($pstart_val)?$pstart_val:'');
//mktime(12,0,0,date('m'),date('d'),date('Y'));
+ $pend =
(isset($pend_val)?$pend_val:'');
$values['access'] =
isset($values['access'])?$values['access']:'public';
$values['direct_work'] =
isset($values['direct_work'])?$values['direct_work']:'Y';
break;
case 'subs':
- if(is_array($parent))
+ if(isset($parent) &&
is_array($parent))
{
$start =
$start_val?$start_val:($parent['sdate']?mktime(12,0,0,date('m',$parent['sdate']),date('d',$parent['sdate']),date('Y',$parent['sdate'])):'');
//mktime(12,0,0,date('m'),date('d'),date('Y')));
$end =
$end_val?$end_val:($parent['edate']?mktime(12,0,0,date('m',$parent['edate']),date('d',$parent['edate']),date('Y',$parent['edate'])):'');
@@ -1279,14 +1281,14 @@
$link_data['menuaction'] =
'projects.uiprojects.edit_project';
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
- $GLOBALS['phpgw']->template->set_var('budget_type',
($values['ptime'] > 0 && 0 == $values['budget']) ? 'h' : 'm');
+ $GLOBALS['phpgw']->template->set_var('budget_type',
(isset($values['ptime']) && $values['ptime'] > 0 && 0 == $values['budget']) ?
'h' : 'm');
$GLOBALS['phpgw']->template->set_var('lang_budget_type', lang('budget type'));
$GLOBALS['phpgw']->template->set_var('currency',$prefs['currency']);
$month = $this->boprojects->return_date();
$GLOBALS['phpgw']->template->set_var('month',$month['monthformatted']);
-
$GLOBALS['phpgw']->template->set_var('status_list',$this->ui_base->status_format($values['status'],(($action
== 'mains')?True:False)));
-
$GLOBALS['phpgw']->template->set_var('priority_list',$this->priority_list($values['priority']));
+
$GLOBALS['phpgw']->template->set_var('status_list',$this->ui_base->status_format((isset($values['status'])?$values['status']:''),(($action
== 'mains')?True:False)));
+
$GLOBALS['phpgw']->template->set_var('priority_list',$this->priority_list((isset($values['priority'])?$values['priority']:'')));
$acces_private = '<option value="private"' .
($values['access'] == 'private'?' selected="selected"':'') . '>' .
lang('private') . '</option>';
$acces_public = '<option value="public"' .
($values['access'] == 'public'?' selected="selected"':'') . '>' .
lang('public') . '</option>';
@@ -1296,22 +1298,22 @@
$GLOBALS['phpgw']->template->set_var('acces_public',$acces_public);
$GLOBALS['phpgw']->template->set_var('acces_anonym',$acces_anonym);
- $GLOBALS['phpgw']->template->set_var('access',$aradio);
+
$GLOBALS['phpgw']->template->set_var('access',(isset($aradio)?$aradio:''));
$GLOBALS['phpgw']->template->set_var('previous_select',$this->boprojects->select_project_list(array('action'
=> 'all',
-
'status' => $values['status'],
+
'status' =>
(isset($values['status'])?$values['status']:''),
'self' => $project_id,
-
'selected' => $values['previous'])));
+
'selected' =>
(isset($values['previous'])?$values['previous']:''))));
$GLOBALS['phpgw']->template->set_var('help_image',$GLOBALS['phpgw']->common->image('projects','help.png'));
$GLOBALS['phpgw']->template->set_var('help_project_nr','http://' .
$_SERVER['HTTP_HOST'] . $GLOBALS['phpgw_info']['server']['webserver_url'] .
'/projects/templates/default/projects_nr_help.html');
if($this->boprojects->siteconfig['accounting'] == 'own')
{
-
$GLOBALS['phpgw']->template->set_var('acc_employee_selected',($values['accounting']=='employee'?'
selected="selected"':''));
-
$GLOBALS['phpgw']->template->set_var('acc_project_selected',($values['accounting']=='project'?'
selected="selected"':''));
-
$GLOBALS['phpgw']->template->set_var('project_accounting_factor',sprintf("%01.2f",$values['project_accounting_factor']));
-
$GLOBALS['phpgw']->template->set_var('acc_billable_checked',($values['billable']=='N'?'
checked':''));
+
$GLOBALS['phpgw']->template->set_var('acc_employee_selected',(isset($values['accounting'])
&& $values['accounting']=='employee'?' selected="selected"':''));
+
$GLOBALS['phpgw']->template->set_var('acc_project_selected',(isset($values['accounting'])
&& $values['accounting']=='project'?' selected="selected"':''));
+
$GLOBALS['phpgw']->template->set_var('project_accounting_factor',sprintf("%01.2f",(isset($values['project_accounting_factor'])?$values['project_accounting_factor']:'')));
+
$GLOBALS['phpgw']->template->set_var('acc_billable_checked',(isset($values['billable'])
&& $values['billable']=='N'?' checked':''));
$GLOBALS['phpgw']->template->fp('accounting_ownhandle','accounting_own',True);
}
@@ -1336,34 +1338,37 @@
}
}
-
$GLOBALS['phpgw']->template->set_var('discount',$values['discount']);
-
$GLOBALS['phpgw']->template->set_var('dt_no',$values['discount_type']=='no'?'
selected="selected"':'');
-
$GLOBALS['phpgw']->template->set_var('dt_amount',$values['discount_type']=='amount'?'
selected="selected"':'');
-
$GLOBALS['phpgw']->template->set_var('dt_percent',$values['discount_type']=='percent'?'
selected="selected"':'');
-
-
$GLOBALS['phpgw']->template->set_var('budget',$values['budget']);
-
$GLOBALS['phpgw']->template->set_var('e_budget',$values['e_budget']);
-
$GLOBALS['phpgw']->template->set_var('number',$values['number']);
-
$GLOBALS['phpgw']->template->set_var('title',$values['title']);
-
$GLOBALS['phpgw']->template->set_var('descr',$values['descr']);
-
$GLOBALS['phpgw']->template->set_var('ptime',(intval($values['ptime'])==0?'':intval($values['ptime'])));
-
$GLOBALS['phpgw']->template->set_var('investment_nr',$values['investment_nr']);
-
$GLOBALS['phpgw']->template->set_var('customer_nr',$values['customer_nr']);
-
-
$GLOBALS['phpgw']->template->set_var('inv_method',$values['inv_method']);
-
$GLOBALS['phpgw']->template->set_var('reference',$values['reference']);
-
$GLOBALS['phpgw']->template->set_var('url',$values['url']);
-
-
$GLOBALS['phpgw']->template->set_var('result',$values['result']);
-
$GLOBALS['phpgw']->template->set_var('test',$values['test']);
-
$GLOBALS['phpgw']->template->set_var('quality',$values['quality']);
+
$GLOBALS['phpgw']->template->set_var('discount',(isset($values['discount'])?$values['discount']:''));
+
$GLOBALS['phpgw']->template->set_var('dt_no',(isset($values['discount_type'])
&& $values['discount_type']=='no'?' selected="selected"':''));
+
$GLOBALS['phpgw']->template->set_var('dt_amount',(isset($values['discount_type'])
&& $values['discount_type']=='amount'?' selected="selected"':''));
+
$GLOBALS['phpgw']->template->set_var('dt_percent',(isset($values['discount_type'])
&& $values['discount_type']=='percent'?' selected="selected"':''));
+
+
$GLOBALS['phpgw']->template->set_var('budget',(isset($values['budget'])?$values['budget']:''));
+
$GLOBALS['phpgw']->template->set_var('e_budget',(isset($values['e_budget'])?$values['e_budget']:''));
+
$GLOBALS['phpgw']->template->set_var('number',(isset($values['number'])?$values['number']:''));
+
$GLOBALS['phpgw']->template->set_var('title',(isset($values['title'])?$values['title']:''));
+
$GLOBALS['phpgw']->template->set_var('descr',(isset($values['descr'])?$values['descr']:''));
+ $values['ptime'] =
(isset($values['ptime'])?$values['ptime']:0);
+
$GLOBALS['phpgw']->template->set_var('ptime',(isset($values['ptime']) &&
intval($values['ptime'])==0?'':intval($values['ptime'])));
+
$GLOBALS['phpgw']->template->set_var('investment_nr',(isset($values['investment_nr'])?$values['investment_nr']:''));
+
$GLOBALS['phpgw']->template->set_var('customer_nr',(isset($values['customer_nr'])?$values['customer_nr']:''));
+
+
$GLOBALS['phpgw']->template->set_var('inv_method',(isset($values['inv_method'])?$values['inv_method']:''));
+
$GLOBALS['phpgw']->template->set_var('reference',(isset($values['reference'])?$values['reference']:''));
+
$GLOBALS['phpgw']->template->set_var('url',(isset($values['url'])?$values['url']:''));
+
+
$GLOBALS['phpgw']->template->set_var('result',(isset($values['result'])?$values['result']:''));
+
$GLOBALS['phpgw']->template->set_var('test',(isset($values['test'])?$values['test']:''));
+
$GLOBALS['phpgw']->template->set_var('quality',(isset($values['quality'])?$values['quality']:''));
$GLOBALS['phpgw']->template->set_var('attachment',$this->attached_files->get_files($project_id,
True));
//--------- coordinator -------------
$GLOBALS['phpgw']->template->set_var('lang_coordinator',lang('Coordinator'));
-
switch($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'])
+
+ $account_selection =
(isset($GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection'])?$GLOBALS['phpgw_info']['user']['preferences']['common']['account_selection']:'');
+ switch($account_selection)
{
case 'popup':
if ($values['coordinator'])
@@ -1409,26 +1414,28 @@
$GLOBALS['phpgw']->template->fp('efieldhandle','efield',True);
break;
default:
-
$GLOBALS['phpgw']->template->set_var('coordinator_list',$this->ui_base->employee_format(array('selected'
=>
($values['coordinator']?$values['coordinator']:$this->boprojects->account))));
+
$GLOBALS['phpgw']->template->set_var('coordinator_list',$this->ui_base->employee_format(array('selected'
=>
(isset($values['coordinator'])?$values['coordinator']:$this->boprojects->account))));
$GLOBALS['phpgw']->template->set_var('cfieldhandle','');
$GLOBALS['phpgw']->template->fp('clisthandle','clist',True);
+ $parent['project_id'] =
(isset($parent['project_id'])?$parent['project_id']:'');
$GLOBALS['phpgw']->template->set_var('employee_list',$this->ui_base->employee_format(array('project_id'
=> ($project_id?$project_id:$parent['project_id']),'action' => $action,
-
'pro_parent' =>
$parent['project_id'],'selected' => $values['employees'])));
+
'pro_parent' =>
$parent['project_id'],'selected' =>
(isset($values['employees'])?$values['employees']:''))));
$GLOBALS['phpgw']->template->set_var('efieldhandle','');
$GLOBALS['phpgw']->template->fp('elisthandle','elist',True);
break;
}
+ unset($account_selection);
- $abid = $values['customer'];
+ $abid =
(isset($values['customer'])?$values['customer']:'');
$customer =
$this->boprojects->read_single_contact($abid);
$name = $customer[0] ? $customer[0]['per_first_name'] .
' ' . $customer[0]['per_last_name'] : '';
$GLOBALS['phpgw']->template->set_var('name',$name);
$GLOBALS['phpgw']->template->set_var('abid',$abid);
- $customer_org_id = $values['customer_org'];
+ $customer_org_id =
(isset($values['customer_org'])?$values['customer_org']:'');
$customer_org =
$this->boprojects->read_single_contact_org($customer_org_id);
- $customer_org_name = $customer_org[0] ?
$customer[0]['org_name'] : '';
+ $customer_org_name = (isset($customer_org[0]) ?
$customer[0]['org_name'] : '');
$GLOBALS['phpgw']->template->set_var('customer_org_name', $customer_org_name);
$GLOBALS['phpgw']->template->set_var('customer_org',
$customer_org_id);
Index: class.uiprojects_base.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojects_base.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- class.uiprojects_base.inc.php 25 Nov 2006 13:51:10 -0000 1.15
+++ class.uiprojects_base.inc.php 25 Nov 2006 15:23:22 -0000 1.16
@@ -7,7 +7,7 @@
* @copyright Copyright (C) 2004-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_base.inc.php,v 1.15 2006/11/25
13:51:10 sigurdne Exp $
+ * @version $Id: class.uiprojects_base.inc.php,v 1.16 2006/11/25
15:23:22 sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.uiprojects_base.inc.php,v $
*/
@@ -1150,7 +1150,7 @@
$type =
(isset($data['type'])? $data['type']: 'selectbox');
$selected =
(isset($data['selected'])?
$data['selected']:$this->boprojects->get_acl_for_project($data['project_id']));
$project_only =
(isset($data['project_only'])?$data['project_only']:False);
- $pro_parent =
intval($data['pro_parent']);
+ $pro_parent =
(isset($data['pro_parent'])?intval($data['pro_parent']):0);
if($project_only)
{
@@ -1166,9 +1166,9 @@
switch($type)
{
case 'selectbox':
- $employees =
$this->boprojects->selected_employees(array('action' => $data['action'],
+ $employees =
$this->boprojects->selected_employees(array('action' =>
(isset($data['action'])?$data['action']:''),
'pro_parent' => (($pro_parent>0 && $pro_parent !=
$data['project_id'])?$pro_parent:''),
-
'project_id' => $data['project_id']
+
'project_id' =>
(isset($data['project_id'])?$data['project_id']:'')
));
break;
case 'popup':
@@ -1181,9 +1181,10 @@
usort($employees, array('uiprojects_base',
'cmp_employees'));
}
+ $s = '';
while (is_array($employees) && (list($null,$account) =
each($employees)))
{
- $s .= '<option value="' .
$account['account_id'] . '"';
+ $s .= '<option value="' .
(isset($account['account_id'])?$account['account_id']:'') . '"';
if (in_array($account['account_id'],$selected))
{
$s .= ' SELECTED';
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.uip...,
Sigurd Nes <=