[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.soc...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] projects/inc class.boprojects.inc.php class.soc... |
Date: |
Tue, 28 Nov 2006 17:54:51 +0000 |
CVSROOT: /sources/phpgroupware
Module name: projects
Changes by: Sigurd Nes <sigurdne> 06/11/28 17:54:51
Modified files:
inc : class.boprojects.inc.php class.soconfig.inc.php
class.soprojects.inc.php
class.uiprojects.inc.php
Log message:
Notices and fixes
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.boprojects.inc.php?cvsroot=phpgroupware&r1=1.166&r2=1.167
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.soconfig.inc.php?cvsroot=phpgroupware&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.soprojects.inc.php?cvsroot=phpgroupware&r1=1.117&r2=1.118
http://cvs.savannah.gnu.org/viewcvs/projects/inc/class.uiprojects.inc.php?cvsroot=phpgroupware&r1=1.168&r2=1.169
Patches:
Index: class.boprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.boprojects.inc.php,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -b -r1.166 -r1.167
--- class.boprojects.inc.php 27 Nov 2006 21:36:26 -0000 1.166
+++ class.boprojects.inc.php 28 Nov 2006 17:54:50 -0000 1.167
@@ -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.166 2006/11/27 21:36:26
sigurdne Exp $
+ * @version $Id: class.boprojects.inc.php,v 1.167 2006/11/28 17:54:50
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.boprojects.inc.php,v $
*/
@@ -1528,9 +1528,9 @@
$error[] = lang('title 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 the
project id');
}
@@ -1733,9 +1733,9 @@
$edate = $subData['edate'];
if(isset($subData['pedate']) &&
($subData['pedate'] > $pedate))
$pedate = $subData['pedate'];
- $ptime += $subData['ptime'];
- $budget += $subData['budget'];
- $e_budget += $subData['e_budget'];
+ $ptime +=
(isset($subData['ptime'])?$subData['ptime']:0);
+ $budget +=
(isset($subData['budget'])?$subData['budget']:0);
+ $e_budget +=
(isset($subData['e_budget'])?$subData['e_budget']:0);
}
if((isset($values['smonth']) && $values['smonth'])
@@ -1804,7 +1804,7 @@
function save_project($action, $values)
{
- if ($values['choose'])
+ if (isset($values['choose']) && $values['choose'])
{
switch($action)
{
@@ -1928,9 +1928,10 @@
$this->send_alarm(array('project_name' =>
$values['project_name'],'event_type' => 'changes of project data','project_id'
=> $values['project_id']));
+ $values['old_coordinator'] =
(isset($values['old_coordinator'])?$values['old_coordinator']:'');
if($values['coordinator'] !=
$values['old_coordinator'])
{
- $this->send_alarm(array('account_id' =>
$values['coordinator'],'events' => array($event_id),'project_name' =>
$values['project_name'],
+ $this->send_alarm(array('account_id' =>
$values['coordinator'],'events' =>
array((isset($event_id)?$event_id:'')),'project_name' =>
$values['project_name'],
'event_type' => 'assignment to role','project_id' =>
$values['project_id']));
}
}
@@ -2104,7 +2105,7 @@
}
}
- if(is_array($error))
+ if(isset($error) && is_array($error))
{
return $error;
}
@@ -2116,10 +2117,9 @@
function save_mstone($values)
{
- _debug_array($values);
$values['edate'] = intval($values['edate']);
- if (intval($values['s_id']) > 0)
+ if (isset($values['s_id']) && intval($values['s_id']) >
0)
{
$this->soprojects->edit_mstone($values);
}
@@ -2188,7 +2188,7 @@
$notify_hours =
$this->soprojects->check_alarm($values['project_id'],'hours');
$notify_budget =
$this->soprojects->check_alarm($values['project_id'],'budget');
-
+ $returncode = '';
for($k=0;$k<count($emp_events);$k++)
{
for($i=0;$i<count($emp_events[$k]['events']);$i++)
Index: class.soconfig.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.soconfig.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- class.soconfig.inc.php 28 Nov 2006 11:55:10 -0000 1.27
+++ class.soconfig.inc.php 28 Nov 2006 17:54:50 -0000 1.28
@@ -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.27 2006/11/28 11:55:10
sigurdne Exp $
+ * @version $Id: class.soconfig.inc.php,v 1.28 2006/11/28 17:54:50
sigurdne Exp $
* $Source: /sources/phpgroupware/projects/inc/class.soconfig.inc.php,v $
*/
@@ -79,6 +79,7 @@
. 'WHERE
phpgw_p_projectactivities.project_id=' . $project_id . ' AND
phpgw_p_activities.id='
.
'phpgw_p_projectactivities.activity_id' . $bill_filter,__LINE__,__FILE__);
+ $act = false;
while ($this->db->next_record())
{
$act[] = array
Index: class.soprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.soprojects.inc.php,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -b -r1.117 -r1.118
--- class.soprojects.inc.php 27 Nov 2006 21:36:26 -0000 1.117
+++ class.soprojects.inc.php 28 Nov 2006 17:54:50 -0000 1.118
@@ -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.117 2006/11/27 21:36:26
sigurdne Exp $
+ * @version $Id: class.soprojects.inc.php,v 1.118 2006/11/28 17:54:50
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.soprojects.inc.php,v $
*/
@@ -584,7 +584,7 @@
$values['url'] =
$this->db->db_addslashes($values['url']);
$values['reference'] =
$this->db->db_addslashes($values['reference']);
$values['inv_method'] =
$this->db->db_addslashes($values['inv_method']);
- $values['parent'] =
intval($values['parent']);
+ $values['parent'] =
(isset($values['parent'])?intval($values['parent']):0);
$values['edate'] =
intval($values['edate']);
$values['budget'] =
$values['budget'] + 0.0;
@@ -592,13 +592,13 @@
$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;
- if($values['billable'] == 'N')
+ $values['project_accounting_factor'] =
(isset($values['project_accounting_factor'])?$values['project_accounting_factor']:'')
+ 0.0;
+ $values['project_accounting_factor_d'] =
(isset($values['project_accounting_factor_d'])?$values['project_accounting_factor_d']:'')
+ 0.0;
+ if(isset($values['billable']) && $values['billable'] ==
'N')
{
$values['billable'] = false;
}
- elseif($values['billable'] == 'Y')
+ elseif(isset($values['billable']) &&
$values['billable'] == 'Y')
{
$values['billable'] = true;
}
@@ -626,10 +626,10 @@
. $values['descr'] .
"', title='" . $values['title'] . "', budget=" . $values['budget'] . ",
budget_childs=" . $values['budget_childs'] . ", p_number='"
. $values['number'] .
"', time_planned=" . intval($values['ptime']) . ", time_planned_childs=" .
intval($values['ptime_childs']) . ', processor=' . $this->account . ",
investment_nr='"
.
$values['investment_nr'] . "', inv_method='" . $values['inv_method'] . "',
parent=" . $values['parent'] . ', main=' . intval($values['main'])
- . ', level=' .
intval($values['level']) . ', previous=' . intval($values['previous']) . ",
customer_nr='" . $values['customer_nr']
+ . ', level=' .
(isset($values['level'])?intval($values['level']):0) . ', previous=' .
intval($values['previous']) . ", customer_nr='" . $values['customer_nr']
. "', url='" .
$values['url'] . "', reference='" . $values['reference'] . "', result='" .
$values['result'] . "', test='"
- . $values['test'] . "',
quality='" . $values['quality'] . "', accounting='" . $values['accounting'] .
"', acc_factor="
- .
$values['project_accounting_factor'] . ', acc_factor_d=' .
$values['project_accounting_factor_d'] . ",billable='" .
($values['billable']?'N':'Y')
+ . $values['test'] . "',
quality='" . $values['quality'] . "', accounting='" .
(isset($values['accounting'])?$values['accounting']:'') . "', acc_factor="
+ .
$values['project_accounting_factor'] . ', acc_factor_d=' .
$values['project_accounting_factor_d'] . ",billable='" .
(isset($values['billable']) && $values['billable']?'N':'Y')
. "', discount_type='"
. $values['discount_type'] . "',psdate=" . intval($values['psdate']) . ',
pedate=' . intval($values['pedate']) . ', priority='
.
intval($values['priority']) . ", e_budget=" . $values['e_budget'] . ",
e_budget_childs=" . $values['e_budget_childs'] . ", discount=" .
$values['discount'] .", plan_bottom_up='" . $values['plan_bottom_up']
. "',
customer_org=".intval($values['customer_org']). ", direct_work='" .
$values['direct_work'] . "' where project_id=" .
$values['project_id'],__LINE__,__FILE__);
@@ -639,12 +639,12 @@
$this->db->query("Update phpgw_p_projects set
status='archive' WHERE parent=" . $values['project_id'],__LINE__,__FILE__);
}
- if($values['oldstatus'] && $values['oldstatus'] ==
'archive' && $values['status'] != 'archive')
+ if(isset($values['oldstatus']) && $values['oldstatus']
== 'archive' && $values['status'] != 'archive')
{
$this->db->query("Update phpgw_p_projects set
status='" . $values['status'] . "' WHERE parent=" .
$values['project_id'],__LINE__,__FILE__);
}
- $values['old_edate'] = intval($values['old_edate']);
+ $values['old_edate'] =
(isset($values['old_edate'])?intval($values['old_edate']):0);
if ($values['old_edate'] > 0 && $values['edate'] > 0 &&
$values['old_edate'] != $values['edate'])
{
$this->db->query('SELECT
project_id,title,p_number,start_date,end_date from phpgw_p_projects where
previous=' . $values['project_id'],__LINE__,__FILE__);
@@ -1408,7 +1408,7 @@
$event_type = explode(',',$event_type);
}
- for($i=0;$i<=count($event_type);$i++)
+ for($i=0;$i<count($event_type);$i++)
{
$event_id = $this->item2id(array('item'
=> $event_type[$i]));
@@ -1426,7 +1426,7 @@
}
}
}
- $roles = is_array($eroles)?$eroles:False;
+ $roles = (isset($eroles) &&
is_array($eroles)?$eroles:False);
}
//echo 'SOPROJECTS->read_employee_roles: ROLES ';
@@ -1556,9 +1556,9 @@
if($this->member)
{
$this->db->query('SELECT '.implode($fields,
',').' FROM phpgw_p_projects '.
- 'WHERE status = "active" AND
('.
+ "WHERE status = 'active' AND
(".
'coordinator =
'.$employee.' OR '.
- '(access != "private"
AND project_id in(' . implode(',',$this->member) . '))) ');
+ "(access != 'private'
AND project_id in(" . implode(',',$this->member) . '))) ');
}
else
{
Index: class.uiprojects.inc.php
===================================================================
RCS file: /sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -b -r1.168 -r1.169
--- class.uiprojects.inc.php 27 Nov 2006 21:36:26 -0000 1.168
+++ class.uiprojects.inc.php 28 Nov 2006 17:54:50 -0000 1.169
@@ -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.168 2006/11/27 21:36:26
sigurdne Exp $
+ * @version $Id: class.uiprojects.inc.php,v 1.169 2006/11/28 17:54:50
sigurdne Exp $
* $Source:
/sources/phpgroupware/projects/inc/class.uiprojects.inc.php,v $
*/
@@ -877,7 +877,10 @@
else
{
$project_id =
$this->boprojects->save_project($action, $values);
+ if(isset($_FILES['attachment']['name'])
&& $_FILES['attachment']['name'])
+ {
$this->attached_files->save_file(array('action_id' => $project_id));
+ }
$link_data['project_id'] = $project_id;
if(isset($_POST['save']) &&
$_POST['save'])
{
@@ -1042,8 +1045,8 @@
$values['customer_org'] =
$_POST['customer_org'];
$values['book_activities'] =
$book_activities;
$values['bill_activities'] =
$bill_activities;
- $values['number'] =
$_POST['values']['number'];
- $values['investment_nr'] =
$_POST['values']['investment_nr'];
+ $values['number'] =
(isset($_POST['values']['number'])?$_POST['values']['number']:'');
+ $values['investment_nr'] =
(isset($_POST['values']['investment_nr'])?$_POST['values']['investment_nr']:'');
$values['title'] =
$_POST['values']['title'];
$values['descr'] =
$_POST['values']['descr'];
$values['previous'] =
$_POST['values']['previous'];
@@ -1125,8 +1128,8 @@
$GLOBALS['phpgw']->template->set_var('mstone_edit_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
unset($link_data['edit_mstone']);
- if
($this->boprojects->edit_perms(array('action' => $action,'main' =>
$parent['pro_main'],'parent' => $parent['project_id'],'type' => 'delete',
-
'coordinator' => $pro['coordinator'])))
+ if
($this->boprojects->edit_perms(array('action' => $action,'main' =>
(isset($parent['pro_main'])?$parent['pro_main']:''),'parent' =>
$parent['project_id'],'type' => 'delete',
+
'coordinator' =>
(isset($pro['coordinator'])?$pro['coordinator']:''))))
{
$link_data['delete_mstone'] = True;
@@ -1710,7 +1713,8 @@
{
// ------------ activites bookable ----------------------
$boact =
$this->boprojects->activities_list($project_id,False);
- if (is_array($boact))
+ $boact_list ='';
+ if (isset($boact) && is_array($boact))
{
while (list($null,$bo) = each($boact))
{
@@ -1722,7 +1726,8 @@
// -------------- activities billable ----------------------
$billact =
$this->boprojects->activities_list($project_id,True);
- if (is_array($billact))
+ $billact_list = '';
+ if (isset($billact) && is_array($billact))
{
while (list($null,$bill) =
each($billact))
{