[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] projects/inc/class.boprojects.inc.php, 1.142
From: |
nomail |
Subject: |
[Phpgroupware-cvs] projects/inc/class.boprojects.inc.php, 1.142 |
Date: |
Mon, 21 Jun 2004 16:35:34 +0200 |
Update of /projects/inc
Modified Files:
Branch:
class.boprojects.inc.php
date: 2004/06/21 14:35:34; author: ceb; state: Exp; lines: +52 -74
Log Message:
update
=====================================================================
Index: projects/inc/class.boprojects.inc.php
diff -u projects/inc/class.boprojects.inc.php:1.141
projects/inc/class.boprojects.inc.php:1.142
--- projects/inc/class.boprojects.inc.php:1.141 Sun Jun 20 23:02:36 2004
+++ projects/inc/class.boprojects.inc.php Mon Jun 21 14:35:34 2004
@@ -1331,71 +1331,71 @@
$error[] = lang('please choose the discount
type');
}
- if ($values['smonth'] || $values['sday'] ||
$values['syear'])
+ if ($values['previous'])
{
- if (!
checkdate($values['smonth'],$values['sday'],$values['syear']))
- {
- $error[] = lang('You have entered an
invalid start date');
- }
- }
+ $edate =
$this->return_value('edate',$values['previous']);
- if ($values['emonth'] || $values['eday'] ||
$values['eyear'])
- {
- if (!
checkdate($values['emonth'],$values['eday'],$values['eyear']))
+ if (intval($edate) == 0)
{
- $error[] = lang('You have entered an
invalid date due');
+ $error[] = lang('the choosen previous
project does not have an end date specified');
}
}
- if ($values['psmonth'] || $values['psday'] ||
$values['psyear'])
+ if ($action == 'subs')
{
- if (!
checkdate($values['psmonth'],$values['psday'],$values['psyear']))
+ $main_edate =
$this->return_value('edate',$values['parent']);
+
+ if ($main_edate > 0)
{
- $error[] = lang('You have entered an
invalid planned start date');
+ if ($values['edate'] > $main_edate)
+ {
+ $error[] = lang('end date can
not be after parent projects date due');
+ }
}
- }
- if ($values['pemonth'] || $values['peday'] ||
$values['peyear'])
- {
- if (!
checkdate($values['pemonth'],$values['peday'],$values['peyear']))
+ $main_sdate =
$this->return_value('sdate',$values['parent']);
+
+ if ($main_sdate > 0 && $values['sdate'] > 0)
{
- $error[] = lang('You have entered an
invalid planned end date');
+ if ($values['sdate'] < $main_sdate)
+ {
+ $error[] = lang('start date can
not be before parent projects start date');
+ }
}
- }
- if ($values['previous'])
- {
- $edate =
$this->return_value('edate',$values['previous']);
+ $main_pedate =
$this->return_value('pedate',$values['parent']);
- if (intval($edate) == 0)
+ if ($main_pedate > 0)
{
- $error[] = lang('the choosen previous
project does not have an end date specified');
+ if ($values['pedate'] > $main_pedate)
+ {
+ $error[] = lang('end date
planned can not be after parent projects end date planned');
+ }
}
- }
- if ($action == 'subs')
- {
- $main_edate =
$this->return_value('edate',$values['parent']);
+ $main_psdate =
$this->return_value('psdate',$values['parent']);
- if ($main_edate != 0)
+ if ($main_psdate > 0 && $values['psdate'] > 0)
{
- $checkdate =
mktime(12,0,0,$values['emonth'],$values['eday'],$values['eyear']);
-
- if ($checkdate > $main_edate)
+ if ($values['psdate'] < $main_psdate)
{
- $error[] = lang('ending date
can not be after parent projects date due');
+ $error[] = lang('start date
planned can not be before parent projects start date planned');
}
}
- $main_sdate =
$this->return_value('sdate',$values['parent']);
-
- if ($main_sdate != 0)
+ if($values['sdate'] > 0 && $values['edate'] > 0)
{
- $checkdate =
mktime(12,0,0,$values['smonth'],$values['sday'],$values['syear']);
+ if($values['edate'] < $values['sdate'])
+ {
+ $error[] = lang('end date can
not be before start date');
+ }
+ }
- if ($checkdate < $main_sdate)
+ if($values['psdate'] > 0 && $values['pedate'] >
0)
+ {
+ if($values['pedate'] <
$values['psdate'])
{
- $error[] = lang('start date can
not be before parent projects start date');
+ $error[] = lang('end date
planned can not be before start date planned');
}
}
@@ -1429,7 +1429,6 @@
if (is_array($error))
{
return $error;
- //_debug_array($error);
}
}
@@ -1448,32 +1447,13 @@
$values['ptime'] = intval($values['ptime'])*60;
- if ($values['smonth'] || $values['sday'] ||
$values['syear'])
- {
- $values['sdate'] =
mktime(12,0,0,$values['smonth'], $values['sday'], $values['syear']);
- }
-
if (!$values['sdate'])
{
$values['sdate'] = time();
}
- if ($values['emonth'] || $values['eday'] ||
$values['eyear'])
- {
- $values['edate'] =
mktime(12,0,0,$values['emonth'],$values['eday'],$values['eyear']);
- }
$values['edate'] = intval($values['edate']);
- if ($values['pemonth'] || $values['peday'] ||
$values['peyear'])
- {
- $values['pedate'] =
mktime(12,0,0,$values['pemonth'],$values['peday'],$values['peyear']);
- }
-
- if ($values['psmonth'] || $values['psday'] ||
$values['psyear'])
- {
- $values['psdate'] =
mktime(12,0,0,$values['psmonth'],$values['psday'],$values['psyear']);
- }
-
if (!$values['previous'] && $values['parent'])
{
$values['previous'] =
$this->return_value('previous',$values['parent']);
@@ -1488,7 +1468,9 @@
}
}
+ //echo 'start boprojects: save_project ->';
//_debug_array($values);
+ //echo 'end boprojects: save_project';
$values['project_name'] = $values['title'] . ' [' .
$values['number'] . ']';
if (intval($values['project_id']) > 0)
@@ -1555,7 +1537,7 @@
}
unset($async);
- _debug_array($values['employees']);
+ //_debug_array($values['employees']);
if (is_array($values['employees']))
{
$this->soprojects->delete_acl($values['project_id']);
@@ -1620,23 +1602,19 @@
{
$error[] = lang('title can not exceed 250
characters in length');
}
- if ($values['emonth'] || $values['eday'] ||
$values['eyear'])
+ if (intval($values['edate']) == 0)
{
- if (!
checkdate($values['emonth'],$values['eday'],$values['eyear']))
- {
- $error[] = lang('You have entered an
invalid date due');
- }
+ $error[] = lang('please specify the date due');
}
-
- $pro_edate =
$this->return_value('edate',$values['project_id']);
-
- if ($pro_edate > 0)
+ else
{
- $checkdate =
mktime(12,0,0,$values['emonth'],$values['eday'],$values['eyear']);
-
- if ($checkdate > $pro_edate)
+ $pro_edate =
$this->return_value('edate',$values['project_id']);
+ if ($pro_edate > 0)
{
- $error[] = lang('ending date can not be
after projects date due');
+ if ($values['edate'] > $pro_edate)
+ {
+ $error[] = lang('end date can
not be after projects date due');
+ }
}
}
if(is_array($error))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] projects/inc/class.boprojects.inc.php, 1.142,
nomail <=