diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7987555e569..18add332294 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -611,7 +611,7 @@ if (empty($reshook)) // prevent browser refresh from closing proposal several times if ($object->statut == Propal::STATUS_VALIDATED) { - $result=$object->cloture($user, GETPOST('statut'), GETPOST('note')); + $result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note_private','alpha')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1686,6 +1686,18 @@ if ($action == 'create') $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ClonePropal'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } + if ($action == 'statut') + { + //Form to close proposal (signed or not) + $formquestion = array( + array('type' => 'select','name' => 'statut','label' => $langs->trans("CloseAs"),'values' => array(2=>$object->labelstatut [2],3=>$object->labelstatut [3])), + //array('type' => 'other','name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '')); + array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => $object->note_private)); + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'setstatut', $formquestion, '', 1, 250); + + } + // Confirm delete else if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1); @@ -2213,35 +2225,6 @@ if ($action == 'create') dol_fiche_end(); - if ($action == 'statut') - { - /* - * Form to close proposal (signed or not) - */ - $form_close = '
'; - $form_close .= ''; - $form_close .= ''; - $form_close .= ''; - $form_close .= ''; - $form_close .= ''; - $form_close .= '
' . $langs->trans("CloseAs") . ''; - $form_close .= ''; - $form_close .= ''; - $form_close .= '
' . $langs->trans('Note') . '
'; - $form_close .= ''; - $form_close .= '   '; - $form_close .= ' '; - $form_close .= '
'; - - print $form_close; - } - /* * Boutons Actions */ @@ -2253,7 +2236,7 @@ if ($action == 'create') // modified by hook if (empty($reshook)) { - if ($action != 'statut' && $action != 'editline') + if ($action != 'editline') { // Validate if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)