Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 22.0
This commit is contained in:
commit
448385ceb2
3 changed files with 33 additions and 26 deletions
|
|
@ -165,8 +165,10 @@ ModifyDateEnd = New planned end date
|
|||
ModifyMoDate = Date modification validated for %s
|
||||
ErrorEmptyChangeDate = Please define a date
|
||||
ConfirmMassChangeDateEnd = Confirmation of mass modification of the planned end date
|
||||
ErrorModifyMoDateStart = You must choose a start date earlier than the current start date. %s
|
||||
ErrorModifyMoDateStart = You must choose a start date earlier than the current end date. %s
|
||||
ErrorModifyMoDateEnd = You must choose an end date later than the start date. %s
|
||||
ErrorCancelMo=Error updating cancellation
|
||||
ErrorModifyMoDate=Error updating date modification
|
||||
ErrorObjectMustNotBeFinishedToModifyDateEnd = Object %s must not be finished to modify the end date.
|
||||
ErrorObjectMustNotBeFinishedToModifyDateStart = Object %s must not be finished to modify the start date.
|
||||
UseSearchToSelectBom=Wait until a key is pressed before loading content of Boms combo list.<br>This may improve performance if you have a large number of projects, but it is less convenient.
|
||||
|
|
|
|||
|
|
@ -165,8 +165,10 @@ ModifyDateEnd = Nouvelle date de fin prévue
|
|||
ModifyMoDate = Modification de la date validée pour %s
|
||||
ErrorEmptyChangeDate = Veuillez définir une date
|
||||
ConfirmMassChangeDateEnd = Confirmation de la modification massive de la date de fin prévue
|
||||
ErrorModifyMoDateStart = Vous devez choisir une date de début antérieure à la date de début actuelle. %s
|
||||
ErrorModifyMoDateStart = Vous devez choisir une date de début antérieure à la date de fin actuelle. %s
|
||||
ErrorModifyMoDateEnd = Vous devez choisir une date de fin postérieure à la date de début. %s
|
||||
ErrorCancelMo=Erreur lors de la mise à jour de l'annulation
|
||||
ErrorModifyMoDate=Erreur lors de la mise à jour de la modification de la date
|
||||
UseSearchToSelectBom=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des nomenclatures (Cela peut augmenter les performances si vous avez un grand nombre de nomenclatures, mais cela est moins convivial)
|
||||
ErrorObjectMustNotBeFinishedToModifyDateEnd = L'objet %s ne doit pas être fabriqué pour modifier la date de fin.
|
||||
ErrorObjectMustNotBeFinishedToModifyDateStart = L'objet %s ne doit pas être fabriqué pour modifier la date de début.
|
||||
UseSearchToSelectBom=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des nomenclatures (Cela peut augmenter les performances si vous avez un grand nombre de nomenclatures, mais cela est moins convivial)
|
||||
|
|
|
|||
|
|
@ -253,34 +253,37 @@ if (empty($reshook)) {
|
|||
if (!empty($toselect)) {
|
||||
foreach ($toselect as $key => $idMo) {
|
||||
if ($objMo->fetch($idMo)) {
|
||||
if ($objMo->status == Mo::STATUS_DRAFT) {
|
||||
if (!empty($changeDate)) {
|
||||
if ($action == 'changedatestart_confirm') { // Test on permission not required
|
||||
if ($newDate < $objMo->date_end_planned) {
|
||||
$objMo->date_start_planned = $newDate;
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorModifyMoDateStart', $objMo->ref), null, 'errors');
|
||||
break;
|
||||
}
|
||||
} elseif ($action == 'changedateend_confirm') { // Test on permission not required
|
||||
if ($newDate > $objMo->date_start_planned) {
|
||||
$objMo->date_end_planned = $newDate;
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorModifyMoDateEnd', $objMo->ref), null, 'errors');
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($objMo->update($user)) {
|
||||
setEventMessages($langs->trans('ModifyMoDate', $objMo->ref), null, 'mesgs');
|
||||
if (in_array($action, array('changedatestart_confirm', 'changedateend_confirm'), true) && $objMo->status == Mo::STATUS_PRODUCED) {
|
||||
$errorKey = $action == 'changedatestart_confirm'
|
||||
? 'ErrorObjectMustNotBeFinishedToModifyDateStart'
|
||||
: 'ErrorObjectMustNotBeFinishedToModifyDateEnd';
|
||||
setEventMessages($langs->trans($errorKey, $objMo->ref), null, 'errors');
|
||||
continue;
|
||||
}
|
||||
if (!empty($changeDate)) {
|
||||
if ($action == 'changedatestart_confirm') { // Test on permission not required
|
||||
if (empty($objMo->date_end_planned) || $newDate < $objMo->date_end_planned) {
|
||||
$objMo->date_start_planned = $newDate;
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorModifyMoDate', $objMo->ref), null, 'errors');
|
||||
setEventMessages($langs->trans('ErrorModifyMoDateStart', $objMo->ref), null, 'errors');
|
||||
break;
|
||||
}
|
||||
} elseif ($action == 'changedateend_confirm') { // Test on permission not required
|
||||
if ($newDate > $objMo->date_start_planned) {
|
||||
$objMo->date_end_planned = $newDate;
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorModifyMoDateEnd', $objMo->ref), null, 'errors');
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($objMo->update($user)) {
|
||||
setEventMessages($langs->trans('ModifyMoDate', $objMo->ref), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorEmptyChangeDate'), null, 'errors');
|
||||
break;
|
||||
setEventMessages($langs->trans('ErrorModifyMoDate', $objMo->ref), null, 'errors');
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans('ErrorObjectMustHaveStatusDraftToModifyDate', $objMo->ref), null, 'errors');
|
||||
setEventMessages($langs->trans('ErrorEmptyChangeDate'), null, 'errors');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue