This commit is contained in:
Florian HENRY 2022-01-07 11:29:43 +01:00
parent aa64b9c524
commit 61fc81732c
3 changed files with 12 additions and 0 deletions

View File

@ -284,3 +284,4 @@ PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with al
SelectLinesOfTimeSpentToInvoice=Select lines of time spent that are unbilled, then bulk action "Generate Invoice" to bill them
ProjectTasksWithoutTimeSpent=Project tasks without time spent
FormForNewLeadDesc=Thanks to fill the following form to contact us. You can also send us an email directly to <b>%s</b>.
StartDateCannotBeAfterEndDate=End date cannot be before start date

View File

@ -165,6 +165,11 @@ class Task extends CommonObject
$this->label = trim($this->label);
$this->description = trim($this->description);
if (!empty($this->date_start) && !empty($this->date_end) && $this->date_start > $this->date_end) {
$this->errors[] = $langs->trans('StartDateCannotBeAfterEndDate');
return -1;
}
// Check parameters
// Put here code to add control on parameters values
@ -384,6 +389,11 @@ class Task extends CommonObject
$this->budget_amount = trim($this->budget_amount);
}
if (!empty($this->date_start) && !empty($this->date_end) && $this->date_start > $this->date_end) {
$this->errors[] = $langs->trans('StartDateCannotBeAfterEndDate');
return -1;
}
// Check parameters
// Put here code to add control on parameters values

View File

@ -117,6 +117,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) {
$result = $object->update($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
}
}
} else {