diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 68f256e2009..aa5acd273d6 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -26,6 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/html.formcategory.class.php"; // Load translation files required by the page $langs->loadLangs(array("admin", "ticket")); @@ -157,6 +158,14 @@ if ($action == 'setvarworkflow') { } } +if ($action == 'setvarworkflowother' || $action == 'setvarworkflow') { + $param_ticket_product_category = GETPOST('product_category_id', 'int'); + $res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } +} + if ($action == 'setvarother') { $param_must_exists = GETPOST('TICKET_EMAIL_MUST_EXISTS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_EMAIL_MUST_EXISTS', $param_must_exists, 'chaine', 0, '', $conf->entity); @@ -219,7 +228,7 @@ if ($action == 'setvarother') { $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); -$form = new Form($db); +$form = new FormCategory($db); $help_url = "FR:Module_Ticket"; $page_name = "TicketSetup"; @@ -489,8 +498,7 @@ foreach ($dirmodels as $reldir) { print ''; print '
'; - -if (!$conf->use_javascript_ajax) { +if (empty($conf->use_javascript_ajax)) { print '
'; print ''; print ''; @@ -551,10 +559,33 @@ print $form->textwithpicto('', $langs->trans("TicketsAutoNotifyCloseHelp"), 1, ' print ''; print ''; -if (!$conf->use_javascript_ajax) { - print '
'; +// Choose which product category is used for tickets +if ($conf->use_javascript_ajax) { + print '
'; + print ''; + print ''; } +print ''.$langs->trans("TicketChooseProductCategory").''; +print ''; + $form->selectProductCategory($conf->global->TICKET_PRODUCT_CATEGORY, 'product_category_id'); + if ($conf->use_javascript_ajax) { + print ajax_combobox('select_'.$htmlname); + } +print ''; +print ''; +print $form->textwithpicto('', $langs->trans("TicketChooseProductCategoryHelp"), 1, 'help'); +print ''; +print ''; + +print '
'; + +print '
'; +print ''; +print '
'; + +print '
'; + // Define wanted maximum time elapsed before answers to tickets print '
'; print ''; diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 204f7c0ed60..edd54911bad 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -145,6 +145,8 @@ TicketsDelayBetweenAnswersHelp=If an unresolved ticket that has already received TicketsAutoNotifyClose=Automatically notify thirdparty when closing a ticket TicketsAutoNotifyCloseHelp=When closing a ticket, you will be proposed to send a message to one of thirdparty's contacts. On mass closing, a message will be sent to one contact of the thirdparty linked to the ticket. TicketWrongContact=Provided contact is not part of current ticket contacts. Email not sent. +TicketChooseProductCategory=Product category for ticket support +TicketChooseProductCategoryHelp=Select the product category of ticket support. This will be used to automatically link a contract to a ticket. # # Index & list page