This commit is contained in:
VESSILLER 2022-11-27 01:06:40 +01:00
parent 7884216197
commit ad07fdfd79
2 changed files with 8 additions and 6 deletions

View File

@ -127,12 +127,14 @@ class FormTicket
/** /**
* Show the form to input ticket * Show the form to input ticket
* *
* @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end() * @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end()
* @param string $mode Mode ('create' or 'edit') * @param string $mode Mode ('create' or 'edit')
* @param int $public 1=If we show the form for the public interface * @param int $public 1=If we show the form for the public interface
* @param Contact|null $with_contact [=NULL] Contact to link to this ticket if exists
* @param string $action [=''] Action in card
* @return void * @return void
*/ */
public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0) public function showForm($withdolfichehead = 0, $mode = 'edit', $public = 0, Contact $with_contact = null, $action = '')
{ {
global $conf, $langs, $user, $hookmanager; global $conf, $langs, $user, $hookmanager;
@ -441,7 +443,7 @@ class FormTicket
// Other attributes // Other attributes
$parameters = array(); $parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $this->action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $ticketstat, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) { if (empty($reshook)) {
print $ticketstat->showOptionals($extrafields, 'create'); print $ticketstat->showOptionals($extrafields, 'create');
} }

View File

@ -700,7 +700,7 @@ if ($action == 'create' || $action == 'presend') {
$formticket->withextrafields = 1; $formticket->withextrafields = 1;
$formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid')); $formticket->param = array('origin' => GETPOST('origin'), 'originid' => GETPOST('originid'));
$formticket->showForm(1, 'create', 0); $formticket->showForm(1, 'create', 0, null, $action);
/*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) { /*} elseif ($action == 'edit' && $user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
$formticket = new FormTicket($db); $formticket = new FormTicket($db);