diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 5887de9b4f4..b6bc517fd5d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -555,6 +555,20 @@ if (empty($reshook)) } } + // Reopen + elseif ($action == 'confirm_reopen' && $user->rights->ficheinter->creer) + { + $result = $object->setStatut(Fichinter::STATUS_VALIDATED); + if ($result > 0) + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else { + $mesg = $object->error; + } + } + /* * Mise a jour d'une ligne d'intervention */ @@ -1099,6 +1113,12 @@ if ($action == 'create') $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify', '', 0, 1); } + // Confirm back to open + if ($action == 'reopen') + { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Reopen'), $langs->trans('ConfirmReopenIntervention', $object->ref), 'confirm_reopen', '', 0, 1); + } + // Confirm deletion of line if ($action == 'ask_deleteline') { @@ -1596,6 +1616,15 @@ if ($action == 'create') print ''; } + // Reopen + if ($object->statut > Fichinter::STATUS_CLOSED) + { + if ($user->rights->ficheinter->creer) + { + print '
'; + } else print ''; + } + // Send if (empty($user->socid)) { if ($object->statut > Fichinter::STATUS_DRAFT) diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index e5936f8246e..51079fca278 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -64,3 +64,5 @@ InterLineDuration=Line duration intervention InterLineDesc=Line description intervention RepeatableIntervention=Template of intervention ToCreateAPredefinedIntervention=To create a predefined or recurring intervention, create a common intervention and convert it into intervention template +Reopen=Reopen +ConfirmReopenIntervention=Are you sure you want to open back the intervention %s?