New allow to reopen interventions

This commit is contained in:
Sekan, Tobias 2020-09-25 08:10:48 +02:00
parent 85fc471d3d
commit 00951a8144
2 changed files with 33 additions and 0 deletions

View File

@ -555,6 +555,21 @@ 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 +1114,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')
{
@ -1568,6 +1589,15 @@ if ($action == 'create')
print '</a></div>';
}
// Reopen
if ($object->statut > Fichinter::STATUS_CLOSED)
{
if ($user->rights->ficheinter->creer)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans('Reopen').'</a></div>';
} else print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Reopen').'</a></div>';
}
// Send
if (empty($user->socid)) {
if ($object->statut > Fichinter::STATUS_DRAFT)

View File

@ -64,3 +64,6 @@ 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
Reopen=Reopen
ConfirmReopenIntervention=Are you sure you want to open back the intervention <b>%s</b>?