Skip to content

Commit

Permalink
Module RequestManager: task Dolibarr#1039 Corrrection lors de la crea…
Browse files Browse the repository at this point in the history
…tion d'une demande fille lorsque la demande mère à une date d'échéance infèrieur à la date actuelle
  • Loading branch information
kkhelifa-opendsi authored and Alexis LAURIER committed Jan 6, 2021
1 parent 3e11959 commit 1cd069a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions htdocs/custom/requestmanager/class/requestmanager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public function create(User $user, $notrigger = false)
$error++;
}
if ($this->date_deadline > 0 && $this->date_deadline < $now) {
$this->errors[] = $langs->trans("RequestManagerErrorDeadlineDateInferiorAtCreateDate");
$this->errors[] = $langs->trans("RequestManagerErrorDeadlineDateMustBeGreaterThanCreateDate");
$error++;
}
if (empty($this->statut)) {
Expand Down Expand Up @@ -1672,7 +1672,7 @@ public function update(User $user, $notrigger = false)
$error++;
}
if ($this->date_deadline > 0 && $this->date_deadline < $this->date_creation) {
$this->errors[] = $langs->trans("RequestManagerErrorDeadlineDateInferiorAtCreateDate");
$this->errors[] = $langs->trans("RequestManagerErrorDeadlineDateMustBeGreaterThanCreateDate");
$error++;
}
if (!is_array($this->requester_ids)) {
Expand Down Expand Up @@ -1852,6 +1852,7 @@ function createSubRequest($new_request_type, User $user, $notrigger = false)

$requestChild->fk_parent = $this->id;
$requestChild->fk_type = $new_request_type;
$requestChild->date_deadline = 0;
$requestChild->context['createSubRequest'] = 'createSubRequest';

// Fetch extrafields
Expand Down

0 comments on commit 1cd069a

Please sign in to comment.