rename constant PROPAL_CLOSE_AS_SIGNED to PROPAL_SKIP_ACCEPT_REFUSE

This commit is contained in:
Christophe Battarel 2021-08-03 10:31:37 +02:00
parent 57729dfc83
commit 14567fb115

View File

@ -1914,7 +1914,7 @@ if ($action == 'create') {
if ($action == 'closeas') { if ($action == 'closeas') {
//Form to close proposal (signed or not) //Form to close proposal (signed or not)
$formquestion = array(); $formquestion = array();
if (empty($conf->global->PROPAL_CLOSE_AS_SIGNED)) { if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED))); $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
} }
$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace) $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
@ -1927,7 +1927,7 @@ if ($action == 'create') {
)); ));
} }
if (empty($conf->global->PROPAL_CLOSE_AS_SIGNED)) { if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
} else { } else {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), $text, 'confirm_closeas', $formquestion, '', 1, 250); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
@ -2599,14 +2599,22 @@ if ($action == 'create') {
} }
} }
// Close as accepted/refused if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
if ($object->statut == Propal::STATUS_VALIDATED) { // Close as accepted/refused
if ($usercanclose) { if ($object->statut == Propal::STATUS_VALIDATED) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"'; if ($usercanclose) {
print '>'.$langs->trans('SetAcceptedRefused').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
} else { print '>'.$langs->trans('SetAcceptedRefused').'</a>';
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"'; } else {
print '>'.$langs->trans('SetAcceptedRefused').'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
}
}
} else {
// Set not signed (close)
if ($object->statut == Propal::STATUS_DRAFT && $usercanclose) {
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=closeas' . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close') . '"';
print '>' . $langs->trans('Close') . '</a>';
} }
} }