31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
"/core/class/html.formcategory.class.php";
33require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
34require_once DOL_DOCUMENT_ROOT.
"/core/lib/ticket.lib.php";
35require_once DOL_DOCUMENT_ROOT.
"/ticket/class/ticket.class.php";
47$langs->loadLangs(array(
"admin",
"ticket"));
55$value =
GETPOST(
'value',
'alpha');
56$action =
GETPOST(
'action',
'aZ09');
57$modulepart =
GETPOST(
'modulepart',
'aZ09');
59$label =
GETPOST(
'label',
'alpha');
60$scandir =
GETPOST(
'scan_dir',
'alpha');
68 Ticket::STATUS_IN_PROGRESS => $langs->trans(
"InProgress"),
69 Ticket::STATUS_NOT_READ => $langs->trans(
"NotRead"),
70 Ticket::STATUS_READ => $langs->trans(
"Read"),
71 Ticket::STATUS_ASSIGNED => $langs->trans(
"Assigned"),
72 Ticket::STATUS_NEED_MORE_INFO => $langs->trans(
"NeedMoreInformationShort"),
73 Ticket::STATUS_WAITING => $langs->trans(
"Waiting"),
74 Ticket::STATUS_CLOSED => $langs->trans(
"SolvedClosed")
81include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
83if (GETPOSTISSET(
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION')) {
84 $param_disable_email =
GETPOST(
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION',
'alpha');
85 $res =
dolibarr_set_const(
$db,
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION', $param_disable_email,
'chaine', 0,
'',
$conf->entity);
92if ($action ==
'updateMask') {
93 $maskconstticket =
GETPOST(
'maskconstticket',
'aZ09');
94 $maskticket =
GETPOST(
'maskticket',
'alpha');
98 if ($maskconstticket && preg_match(
'/_MASK$/', $maskconstticket)) {
111} elseif ($action ==
'set') {
114} elseif ($action ==
'del') {
121} elseif (preg_match(
'/set_(.*)/', $action, $reg)) {
123 $value = GETPOSTISSET($code) ?
GETPOSTINT($code) : 1;
128} elseif (preg_match(
'/del_(.*)/', $action, $reg)) {
134} elseif ($action ==
'setdoc') {
139 $conf->global->TICKET_ADDON_PDF = $value;
147} elseif ($action ==
'setmod') {
152} elseif ($action ==
'setvarworkflow') {
154 if (empty(
$conf->use_javascript_ajax)) {
155 $param_auto_read =
GETPOST(
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND',
'alpha');
156 $res =
dolibarr_set_const(
$db,
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', $param_auto_read,
'chaine', 0,
'',
$conf->entity);
161 $param_auto_assign =
GETPOST(
'TICKET_AUTO_ASSIGN_USER_CREATE',
'alpha');
167 $param_auto_notify_close =
GETPOST(
'TICKET_NOTIFY_AT_CLOSING',
'alpha');
174 $param_limit_view =
GETPOST(
'TICKET_LIMIT_VIEW_ASSIGNED_ONLY',
'alpha');
180 $param_status =
GETPOST(
'TICKET_SET_STATUS_ON_ANSWER');
186 $param_delay_first_response =
GETPOSTINT(
'delay_first_response');
187 $res =
dolibarr_set_const(
$db,
'TICKET_DELAY_BEFORE_FIRST_RESPONSE', $param_delay_first_response,
'chaine', 0,
'',
$conf->entity);
192 $param_delay_between_responses =
GETPOSTINT(
'delay_between_responses');
193 $res =
dolibarr_set_const(
$db,
'TICKET_DELAY_SINCE_LAST_RESPONSE', $param_delay_between_responses,
'chaine', 0,
'',
$conf->entity);
197} elseif ($action ==
'setvar') {
198 include_once DOL_DOCUMENT_ROOT.
"/core/lib/files.lib.php";
200 $notification_email =
GETPOST(
'TICKET_NOTIFICATION_EMAIL_FROM',
'alpha');
201 $notification_email_description =
"Email of user allowed to send ticket replies from Dolibarr";
202 if (!empty($notification_email)) {
203 $res =
dolibarr_set_const(
$db,
'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email,
'chaine', 0, $notification_email_description,
$conf->entity);
211 $notification_email_replyto =
GETPOST(
'TICKET_NOTIFICATION_EMAIL_REPLYTO',
'alpha');
212 $notification_email_replyto_description =
"Email that must appears as the sender of ticket replies sent from Dolibarr";
213 if (!empty($notification_email)) {
214 $res =
dolibarr_set_const(
$db,
'TICKET_NOTIFICATION_EMAIL_REPLYTO', $notification_email_replyto,
'chaine', 0, $notification_email_replyto_description,
$conf->entity);
223 $notification_email_to =
GETPOST(
'TICKET_NOTIFICATION_EMAIL_TO',
'alpha');
224 $notification_email_to_description =
"Notified e-mail for ticket replies sent from Dolibarr";
225 if (!empty($notification_email_to)) {
226 $res =
dolibarr_set_const(
$db,
'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to,
'chaine', 0, $notification_email_to_description,
$conf->entity);
228 $res =
dolibarr_set_const(
$db,
'TICKET_NOTIFICATION_EMAIL_TO',
'',
'chaine', 0, $notification_email_to_description,
$conf->entity);
234 $notification_email_template =
GETPOST(
'TICKET_NOTIFICATION_EMAIL_TEMPLATE',
'alpha');
235 $notification_email_template_description =
'Template email for ticket create notification';
236 if (!empty($notification_email_to)) {
237 $res =
dolibarr_set_const(
$db,
'TICKET_NOTIFICATION_EMAIL_TEMPLATE', $notification_email_template,
'chaine', 0, $notification_email_template_description,
$conf->entity);
239 $res =
dolibarr_set_const(
$db,
'TICKET_NOTIFICATION_EMAIL_TEMPLATE',
'',
'chaine', 0, $notification_email_template_description,
$conf->entity);
245 $mail_intro =
GETPOST(
'TICKET_MESSAGE_MAIL_INTRO',
'restricthtml');
246 $mail_intro_description =
"Introduction text of ticket replies sent from Dolibarr";
247 if (!empty($mail_intro)) {
248 $res =
dolibarr_set_const(
$db,
'TICKET_MESSAGE_MAIL_INTRO', $mail_intro,
'chaine', 0, $mail_intro_description,
$conf->entity);
256 $mail_signature =
GETPOST(
'TICKET_MESSAGE_MAIL_SIGNATURE',
'restricthtml');
257 $signature_description =
"Signature of ticket replies sent from Dolibarr";
258 if (!empty($mail_signature)) {
259 $res =
dolibarr_set_const(
$db,
'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature,
'chaine', 0, $signature_description,
$conf->entity);
278$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
284$help_url =
'EN:Module_Ticket|FR:Module_Ticket_FR';
285$page_name =
'TicketSetup';
286llxHeader(
'', $langs->trans($page_name), $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-ticket');
289$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
296print
dol_get_fiche_head($head,
'settings', $langs->trans(
"Module56000Name"), -1,
"ticket");
298print
'<span class="opacitymedium">'.$langs->trans(
"TicketSetupDictionaries").
'</span> : <a href="'.DOL_URL_ROOT.
'/admin/dict.php">'.$langs->trans(
"ClickHereToGoTo", $langs->transnoentitiesnoconv(
"DictionarySetup")).
'</a><br>';
309print
'<div class="div-table-responsive-no-min">';
310print
'<table class="noborder centpercent">';
311print
'<tr class="liste_titre">';
312print
'<td width="100">'.$langs->trans(
"Name").
'</td>';
313print
'<td>'.$langs->trans(
"Description").
'</td>';
314print
'<td>'.$langs->trans(
"Example").
'</td>';
315print
'<td align="center" width="60">'.$langs->trans(
"Activated").
'</td>';
316print
'<td align="center" width="40">'.$langs->trans(
"ShortInfo").
'</td>';
321foreach ($dirmodels as $reldir) {
325 $handle = opendir($dir);
326 if (is_resource($handle)) {
327 while (($file = readdir($handle)) !==
false) {
328 if (preg_match(
'/^(mod_.*)\.php$/i', $file, $reg)) {
330 $classname = substr($file, 4);
332 include_once $dir.
'/'.$file.
'.php';
334 $module =
new $file();
335 '@phan-var-force ModeleNumRefTicket $module';
339 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
343 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
347 if ($module->isEnabled()) {
348 print
'<tr class="oddeven"><td>'.$module->name.
"</td><td>\n";
349 print $module->info($langs);
353 print
'<td class="nowrap">';
354 $tmp = $module->getExample();
355 if (preg_match(
'/^Error/', $tmp)) {
356 $langs->load(
"errors");
357 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
358 } elseif ($tmp ==
'NotConfigured') {
359 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
366 print
'<td class="center">';
368 print
img_picto($langs->trans(
"Activated"),
'switch_on');
370 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.newToken().
'&value=mod_'.$classname.
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
375 $ticket->initAsSpecimen();
379 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
380 $nextval = $module->getNextValue(
$mysoc, $ticket);
381 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
382 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
384 $htmltooltip .= $nextval.
'<br>';
386 $htmltooltip .= $langs->trans($module->error).
'<br>';
390 print
'<td class="center">';
391 print $formcategory->textwithpicto(
'', $htmltooltip, 1,
'0');
418$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
419$sql .=
" WHERE type = '".$db->escape($type).
"'";
420$sql .=
" AND entity = ".((int)
$conf->entity);
421$resql =
$db->query($sql);
424 $num_rows =
$db->num_rows($resql);
425 while ($i < $num_rows) {
426 $array =
$db->fetch_array($resql);
427 if (is_array($array)) {
428 array_push($def, $array[0]);
437print
'<div class="div-table-responsive-no-min">';
438print
'<table class="noborder cenpercent">'.
"\n";
439print
'<tr class="liste_titre">'.
"\n";
440print
'<td>'.$langs->trans(
"Name").
'</td>';
441print
'<td>'.$langs->trans(
"Description").
'</td>';
442print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
443print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
444print
'<td class="center" width="50">'.$langs->trans(
"Preview").
'</td>';
445print
'<td class="center" width="40">'.$langs->trans(
"ShortInfo").
'</td>';
450foreach ($dirmodels as $reldir) {
451 foreach (array(
'',
'/doc') as $valdir) {
452 $realpath = $reldir.
"core/modules/ticket".$valdir;
456 $handle = opendir($dir);
457 if (is_resource($handle)) {
459 while (($file = readdir($handle)) !==
false) {
465 foreach ($filelist as $file) {
466 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
467 if (file_exists($dir.
'/'.$file)) {
468 $name = substr($file, 4,
dol_strlen($file) - 16);
469 $classname = substr($file, 0,
dol_strlen($file) - 12);
471 require_once $dir.
'/'.$file;
472 $module =
new $classname(
$db);
473 '@phan-var-force ModelePDFTicket $module';
475 $modulequalified = 1;
476 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
477 $modulequalified = 0;
479 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
480 $modulequalified = 0;
483 if ($modulequalified) {
484 print
'<tr class="oddeven"><td width="100">';
485 print(empty($module->name) ? $name : $module->
name);
487 if (method_exists($module,
'info')) {
488 print $module->info($langs);
490 print $module->description;
495 if (in_array($name, $def)) {
496 print
'<td class="center">'.
"\n";
497 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.urlencode($name).
'">';
498 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
502 print
'<td class="center">'.
"\n";
503 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.newToken().
'&value='.urlencode($name).
'&scan_dir='.urlencode($module->scandir).
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
508 print
'<td class="center">';
510 print
img_picto($langs->trans(
"Default"),
'on');
512 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
517 print
'<td class="center">';
518 if ($module->type ==
'pdf') {
519 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.urlencode($name).
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
521 print
img_object($langs->transnoentitiesnoconv(
"PreviewNotAvailable"),
'generic');
526 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
527 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
528 if ($module->type ==
'pdf') {
529 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
531 $htmltooltip .=
'<br>'.$langs->trans(
"Path").
': '.preg_replace(
'/^\//',
'', $realpath).
'/'.$file;
533 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
534 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
535 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
541 print
'<td class="center">';
542 print $formcategory->textwithpicto(
'', $htmltooltip, 1,
'0');
559print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" enctype="multipart/form-data" >';
560print
'<input type="hidden" name="token" value="'.newToken().
'">';
561print
'<input type="hidden" name="action" value="setvarworkflow">';
562print
'<input type="hidden" name="page_y" value="">';
569print
'<div class="div-table-responsive-no-min">';
570print
'<table class="noborder centpercent">';
572print
'<tr class="liste_titre">';
573print
'<td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td>';
574print
'<td></td>'.
"\n";
575print
'<td class="center" width="40"></td>';
579print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketsAutoReadTicket").
'</td>';
580print
'<td class="left">';
581if (
$conf->use_javascript_ajax) {
582 print ajax_constantonoff(
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND');
584 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
585 print $formcategory->selectarray(
"TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND", $arrval,
getDolGlobalString(
'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND'));
588print
'<td class="center">';
589print $formcategory->textwithpicto(
'', $langs->trans(
"TicketsAutoReadTicketHelp"), 1,
'help');
594print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketsAutoReadTicketWhenAssign").
'</td>';
595print
'<td class="left">';
596if (
$conf->use_javascript_ajax) {
597 print ajax_constantonoff(
'TICKET_AUTO_READ_WHEN_ASSIGN');
599 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
600 print $formcategory->selectarray(
"TICKET_AUTO_READ_WHEN_ASSIGN", $arrval,
getDolGlobalString(
'TICKET_AUTO_READ_WHEN_ASSIGN'));
603print
'<td class="center">';
604print $formcategory->textwithpicto(
'', $langs->trans(
"TicketsAutoReadTicketWhenAssignHelp"), 1,
'help');
610print
'<tr class="oddeven">';
611print
'<td><label for="TICKET_AUTO_ASSIGN_USER_CREATE" class="block">'.$langs->trans(
"TicketsAutoAssignTicket").
'</label></td>';
612print
'<td class="left">';
613print
'<input class="maxwidth50" type="text" id="TICKET_AUTO_ASSIGN_USER_CREATE" name="TICKET_AUTO_ASSIGN_USER_CREATE" value="'.getDolGlobalInt(
'TICKET_AUTO_ASSIGN_USER_CREATE').
'">';
615print
'<td class="center">';
616print $formcategory->textwithpicto(
'', $langs->trans(
"TicketsAutoAssignTicketHelp"), 1,
'help');
621print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketAutoChangeStatusOnAnswer").
'</td>';
622print
'<td class="left">';
623print $formcategory->selectarray(
"TICKET_SET_STATUS_ON_ANSWER", $statuslist,
getDolGlobalString(
'TICKET_SET_STATUS_ON_ANSWER'), 1);
625print
'<td class="center">';
626print $formcategory->textwithpicto(
'', $langs->trans(
"TicketAutoChangeStatusOnAnswerHelp"), 1,
'help');
630print
'<tr class="oddeven">';
631print
'<td><label for="delay_first_response" class="block">'.$langs->trans(
"TicketsDelayBeforeFirstAnswer").
"</label></td>";
632print
'<td class="left">
633 <input type="number" value="'.getDolGlobalString(
'TICKET_DELAY_BEFORE_FIRST_RESPONSE').
'" id="delay_first_response" name="delay_first_response" class="width50">
635print
'<td class="center">';
636print $formcategory->textwithpicto(
'', $langs->trans(
"TicketsDelayBeforeFirstAnswerHelp"), 1,
'help');
640print
'<tr class="oddeven">';
641print
'<td><label for="delay_between_responses" class="block">'.$langs->trans(
"TicketsDelayBetweenAnswers").
"</label></td>";
642print
'<td class="left">
643 <input type="number" value="'.getDolGlobalString(
'TICKET_DELAY_SINCE_LAST_RESPONSE').
'" id="delay_between_responses" name="delay_between_responses" class="width50">
645print
'<td class="center">';
646print $formcategory->textwithpicto(
'', $langs->trans(
"TicketsDelayBetweenAnswersHelp"), 1,
'help');
652print $formcategory->buttonsSaveCancel(
"Save",
'', array(), 0,
'reposition');
667print
'<table class="noborder centpercent">';
669print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'" enctype="multipart/form-data" >';
670print
'<input type="hidden" name="token" value="'.newToken().
'">';
671print
'<input type="hidden" name="action" value="setvar">';
672print
'<input type="hidden" name="page_y" value="">';
674print
'<tr class="liste_titre">';
675print
'<td>'.$langs->trans(
"Parameter").
'</td>';
677print
'<td class="center" width="40"></td>';
682 print
'<td colspan="2"><div class="info">'.$langs->trans(
"TicketCkEditorEmailNotActivated").
'</div></td>';
683 print
'<td class="center" width="40"></td>';
688print
'<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_FROM" class="block">'.$langs->trans(
"TicketEmailNotificationFrom").
'</label></td>';
689print
'<td class="left">';
690print
img_picto(
'',
'email',
'class="pictofixedwidth"');
691print
'<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_FROM" name="TICKET_NOTIFICATION_EMAIL_FROM" value="' .
getDolGlobalString(
'TICKET_NOTIFICATION_EMAIL_FROM').
'"></td>';
692print
'<td class="center">';
693print $formcategory->textwithpicto(
'', $langs->trans(
"TicketEmailNotificationFromHelp"), 1,
'help');
698print
'<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_REPLYTO" class="block">'.$langs->trans(
"TicketEmailNotificationReplyTo").
'</label></td>';
699print
'<td class="left">';
700print
img_picto(
'',
'email',
'class="pictofixedwidth"');
701print
'<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_REPLYTO" name="TICKET_NOTIFICATION_EMAIL_REPLYTO" value="' .
getDolGlobalString(
'TICKET_NOTIFICATION_EMAIL_REPLYTO').
'"></td>';
702print
'<td class="center">';
703print $formcategory->textwithpicto(
'', $langs->trans(
"TicketEmailNotificationReplyToHelp"), 1,
'help');
707print
'<tr class="oddeven"><td class="titlefieldmiddle"><label for="TICKET_SEND_INTERNAL_CC" class="block">';
708print $form->textwithpicto($langs->trans(
"TicketSendToInternalCC"), $langs->trans(
"TicketSendToInternalCCHelp")).
'</label></td>';
710print
img_picto(
'',
'email',
'class="pictofixedwidth"');
711print
'<input class="minwidth200" name="TICKET_SEND_INTERNAL_CC" value="'.getDolGlobalString(
'TICKET_SEND_INTERNAL_CC').
'">';
720print
'<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_TO" class="block">'.$langs->trans(
"TicketEmailNotificationTo").
'</label></td>';
721print
'<td class="left">';
722print
img_picto(
'',
'email',
'class="pictofixedwidth"');
723print
'<input type="text" class="minwidth200" id="TICKET_NOTIFICATION_EMAIL_TO" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.getDolGlobalString(
'TICKET_NOTIFICATION_EMAIL_TO').
'"></td>';
724print
'<td class="center">';
725print $formcategory->textwithpicto(
'', $langs->trans(
"TicketEmailNotificationToHelp"), 1,
'help');
729include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
732$formmail->fetchAllEMailTemplate(
'ticket_send', $user,
null, -1);
733$arrayofmessagename = array();
734if (is_array($formmail->lines_model)) {
735 foreach ($formmail->lines_model as $modelmail) {
738 if (!empty($arrayofmessagename[$modelmail->label])) {
739 $moreonlabel =
' <span class="opacitymedium">('.$langs->trans(
"SeveralLangugeVariatFound").
')</span>';
742 $arrayofmessagename[$modelmail->label.
':ticket_send'] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)).$moreonlabel;
747print
'<tr class="oddeven"><td><label for="TICKET_NOTIFICATION_EMAIL_TEMPLATE" class="block">'.$langs->trans(
'TicketEmailNotificationTemplate').
'</label></td>';
748print
'<td class="left">';
749print $form->selectarray(
'TICKET_NOTIFICATION_EMAIL_TEMPLATE', $arrayofmessagename,
getDolGlobalString(
'TICKET_NOTIFICATION_EMAIL_TEMPLATE'),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
750print
'<td class="center">';
751print $formcategory->textwithpicto(
'', $langs->trans(
'TicketEmailNotificationTemplateHelp'), 1,
'help');
756print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketAutoCheckNotifyThirdParty").
'</td>';
757print
'<td class="left">';
758if (
$conf->use_javascript_ajax) {
759 print ajax_constantonoff(
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION');
761 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
762 print $formcategory->selectarray(
"TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION", $arrval,
getDolGlobalString(
'TICKET_CHECK_NOTIFY_THIRDPARTY_AT_CREATION'));
765print
'<td class="center">';
766print $formcategory->textwithpicto(
'', $langs->trans(
"TicketAutoCheckNotifyThirdPartyHelp"), 1,
'help');
771print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketsAutoNotifyClose").
'</td>';
772print
'<td class="left">';
773if (
$conf->use_javascript_ajax) {
774 print ajax_constantonoff(
'TICKET_NOTIFY_AT_CLOSING');
776 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
777 print $formcategory->selectarray(
"TICKET_NOTIFY_AT_CLOSING", $arrval,
getDolGlobalString(
'TICKET_NOTIFY_AT_CLOSING'));
780print
'<td class="center">';
781print $formcategory->textwithpicto(
'', $langs->trans(
"TicketsAutoNotifyCloseHelp"), 1,
'help');
787print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketMessageMailIntro");
789require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
790$doleditor =
new DolEditor(
'TICKET_MESSAGE_MAIL_INTRO', $mail_intro,
'100%', 90,
'dolibarr_mailings',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_MAIL'), ROWS_2,
'70');
793print
'<td class="center">';
794print $formcategory->textwithpicto(
'', $langs->trans(
"TicketMessageMailIntroHelpAdmin"), 1,
'help');
799print
'<tr class="oddeven"><td>'.$langs->trans(
"TicketMessageMailFooter").
'</label>';
801require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
802$doleditor =
new DolEditor(
'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature,
'100%', 90,
'dolibarr_mailings',
'',
false,
true,
getDolGlobalInt(
'FCKEDITOR_ENABLE_MAIL'), ROWS_2,
'70');
805print
'<td class="center">';
806print $formcategory->textwithpicto(
'', $langs->trans(
"TicketMessageMailFooterHelpAdmin"), 1,
'help');
811print $formcategory->buttonsSaveCancel(
"Save",
'', array(), 0,
'reposition');
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage a WYSIWYG editor.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
Class to generate the form for creating a new ticket.
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
ticketAdminPrepareHead()
Build tabs for admin page.