dolibarr 20.0.2
ticket_public.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2018 Jean-François FERRY <hello@librethic.io>
3 * Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Load Dolibarr environment
26require '../main.inc.php';
27require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
28require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
29require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php";
30
31// Load translation files required by the page
32$langs->loadLangs(array("admin", "ticket"));
33
34// Access control
35if (!$user->admin) {
37}
38
39// Parameters
40$value = GETPOST('value', 'alpha');
41$action = GETPOST('action', 'aZ09');
42$label = GETPOST('label', 'alpha');
43$scandir = GETPOST('scandir', 'alpha');
44$type = 'ticket';
45
46
47/*
48 * Actions
49 */
50$error = 0;
51$errors = array();
52
53if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
54 if (GETPOST('value')) {
55 $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
56 } else {
57 $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity);
58 }
59 if (!($res > 0)) {
60 $error++;
61 $errors[] = $db->lasterror();
62 }
63} elseif ($action == 'setvar') {
64 include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
65
66 if (GETPOSTISSET('TICKET_ENABLE_PUBLIC_INTERFACE')) { // only for no js case
67 $param_enable_public_interface = GETPOST('TICKET_ENABLE_PUBLIC_INTERFACE', 'alpha');
68 $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', $param_enable_public_interface, 'chaine', 0, '', $conf->entity);
69 if (!($res > 0)) {
70 $error++;
71 $errors[] = $db->lasterror();
72 }
73 }
74
75 if (GETPOSTISSET('TICKET_SHOW_COMPANY_LOGO')) { // only for no js case
76 $param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
77 $res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
78 if (!($res > 0)) {
79 $error++;
80 $errors[] = $db->lasterror();
81 }
82 }
83
84 $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alphanohtml');
85 if (!empty($topic_interface)) {
86 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
87 } else {
88 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
89 }
90 if (!($res > 0)) {
91 $error++;
92 $errors[] = $db->lasterror();
93 }
94
95 $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
96 if (GETPOSTISSET('TICKET_PUBLIC_TEXT_HOME')) {
97 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
98 } else {
99 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
100 }
101 if (!($res > 0)) {
102 $error++;
103 $errors[] = $db->lasterror();
104 }
105
106 $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
107 if (!empty($text_help)) {
108 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
109 } else {
110 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
111 }
112 if (!($res > 0)) {
113 $error++;
114 $errors[] = $db->lasterror();
115 }
116
117 $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
118 if (!empty($mail_new_ticket)) {
119 $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
120 } else {
121 $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
122 }
123 if (!($res > 0)) {
124 $error++;
125 $errors[] = $db->lasterror();
126 }
127
128 $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
129 if (!empty($url_interface)) {
130 $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
131 } else {
132 $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
133 }
134 if (!($res > 0)) {
135 $error++;
136 $errors[] = $db->lasterror();
137 }
138
139 $param_public_notification_new_message_default_email = GETPOST('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', 'alpha');
140 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', $param_public_notification_new_message_default_email, 'chaine', 0, '', $conf->entity);
141 if (!($res > 0)) {
142 $error++;
143 $errors[] = $db->lasterror();
144 }
145
146 // For compatibility when javascript is not enabled
147 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($conf->use_javascript_ajax)) {
148 $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
149 $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
150 if (!($res > 0)) {
151 $error++;
152 $errors[] = $db->lasterror();
153 }
154 }
155} elseif (preg_match('/set_(.*)/', $action, $reg)) {
156 $code = $reg[1];
157 $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1;
158 if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
159 $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
160 $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
161 if (!($res > 0)) {
162 $error++;
163 }
164 } else {
165 $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
166 if (!($res > 0)) {
167 $error++;
168 }
169 if (!$error) {
170 if ($code == 'TICKET_EMAIL_MUST_EXISTS') {
171 $res = dolibarr_del_const($db, 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST', $conf->entity);
172 if (!($res > 0)) {
173 $error++;
174 $errors[] = $db->lasterror();
175 }
176 } elseif ($code == 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST') {
177 $res = dolibarr_del_const($db, 'TICKET_EMAIL_MUST_EXISTS', $conf->entity);
178 if (!($res > 0)) {
179 $error++;
180 $errors[] = $db->lasterror();
181 }
182 }
183 }
184 }
185} elseif (preg_match('/del_(.*)/', $action, $reg)) {
186 $code = $reg[1];
187 $res = dolibarr_del_const($db, $code, $conf->entity);
188 if (!($res > 0)) {
189 $error++;
190 $errors[] = $db->lasterror();
191 }
192}
193
194if ($action != '') {
195 if (!$error) {
196 $db->commit();
197 setEventMessage($langs->trans('SetupSaved'));
198 header("Location: " . $_SERVER['PHP_SELF']);
199 exit;
200 } else {
201 $db->rollback();
202 setEventMessages('', $errors, 'errors');
203 }
204}
205
206
207/*
208 * View
209 */
210
211$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
212
213$form = new Form($db);
214
215$help_url = "FR:Module_Ticket";
216$page_name = "TicketSetup";
217llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ticket_public');
218
219// Subheader
220$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
221
222print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
223
224// Configuration header
225$head = ticketAdminPrepareHead();
226
227print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
228
229$param = '';
230
231print '<br>';
232
233$enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
234if (!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
235 // Button off, click to enable
236 $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&token='.newToken().'&value=1'.$param.'">';
237 $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
238 $enabledisablehtml .= '</a>';
239} else {
240 // Button on, click to disable
241 $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&token='.newToken().'&value=0'.$param.'">';
242 $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
243 $enabledisablehtml .= '</a>';
244}
245print $enabledisablehtml;
246print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ? 0 : 1).'">';
247
248print dol_get_fiche_end();
249
250
251
252if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
253 print '<br>';
254
255
256 // Define $urlwithroot
257 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
258 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
259 //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
260
261 print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> :<br>';
262 print '<div class="urllink">';
263 print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">';
264 print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
265 print '</div>';
266 print ajax_autoselect('publicurlmember');
267
268
269 print '<br><br>';
270
271
272 print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
273 print '<input type="hidden" name="token" value="'.newToken().'">';
274 print '<input type="hidden" name="action" value="setvar">';
275
276 print '<div class="div-table-responsive-no-min">';
277 print '<table class="noborder centpercent">';
278 print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td>';
279 print '<td class="left">';
280 print '</td>';
281 print '<td class="center width75">';
282 print '</td>';
283 print '</tr>';
284
285 // Enable Captcha code
286 print '<tr class="oddeven">';
287 print '<td>'.$langs->trans("TicketUseCaptchaCode").'</td>';
288 print '<td class="left">';
289 if (function_exists("imagecreatefrompng")) {
290 if (!empty($conf->use_javascript_ajax)) {
291 print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET');
292 } else {
293 if (!getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
294 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
295 } else {
296 print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
297 }
298 }
299 } else {
300 $desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
301 print $desc;
302 }
303 print '</td>';
304 print '<td class="center width75">';
305 print $form->textwithpicto('', $langs->trans("TicketUseCaptchaCodeHelp"), 1, 'help');
306 print '</td>';
307 print '</tr>';
308
309 // Check if email exists
310 print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailMustExist").'</td>';
311 print '<td class="left">';
312 if (!getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS')) {
313 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
314 } else {
315 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
316 }
317 print '</td>';
318 print '<td class="center width75">';
319 print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'help');
320 print '</td>';
321 print '</tr>';
322
323 // Auto fill the contact found from email
324 // This option is a serious security hole. it allows to any non logged perso, to get the database of contacts or to check if an email is a customer or not. We must keep it as hidden option only.
325 /*
326 print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
327 print '<td class="left">';
328 if (!getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST')) {
329 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
330 } else {
331 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
332 }
333 print '</td>';
334 print '<td class="center width75">';
335 print $form->textwithpicto('', $langs->trans("TicketCreateThirdPartyWithContactIfNotExistHelp"), 1, 'help');
336 print '</td>';
337 print '</tr>';
338 */
339
340 /*if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2)
341 {
342 // Show logo for module
343 print '<tr class="oddeven"><td>' . $langs->trans("TicketsShowModuleLogo") . '</td>';
344 print '<td class="left">';
345 if ($conf->use_javascript_ajax) {
346 print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO');
347 } else {
348 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
349 print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_MODULE_LOGO'));
350 }
351 print '</td>';
352 print '<td class="center">';
353 print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
354 print '</td>';
355 print '</tr>';
356 }*/
357
358 // Show logo for company
359 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyLogo").'</td>';
360 print '<td class="left">';
361 if (!empty($conf->use_javascript_ajax)) {
362 print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO');
363 } else {
364 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
365 print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO'));
366 }
367 print '</td>';
368 print '<td class="center width75">';
369 print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help');
370 print '</td>';
371 print '</tr>';
372
373 // show footer for company
374 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyFooter").'</td>';
375 print '<td class="left">';
376 if ($conf->use_javascript_ajax) {
377 print ajax_constantonoff('TICKET_SHOW_COMPANY_FOOTER');
378 } else {
379 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
380 print $form->selectarray("TICKET_SHOW_COMPANY_FOOTER", $arrval, $conf->global->TICKET_SHOW_COMPANY_FOOTER);
381 }
382 print '</td>';
383 print '<td class="center width75">';
384 print $form->textwithpicto('', $langs->trans("TicketsShowCompanyFooterHelp"), 1, 'help');
385 print '</td>';
386 print '</tr>';
387
388 // Show progression
389 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowProgression").'</td>';
390 print '<td class="left">';
391 if (!empty($conf->use_javascript_ajax)) {
392 print ajax_constantonoff('TICKET_SHOW_PROGRESSION');
393 } else {
394 if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) {
395 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
396 } else {
397 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
398 }
399 }
400 print '</td>';
401 print '<td class="center width75">';
402 print $form->textwithpicto('', $langs->trans("TicketsShowProgressionHelp"), 1, 'help');
403 print '</td>';
404 print '</tr>';
405
406 if (empty($conf->use_javascript_ajax)) {
407 print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
408 print '</tr>';
409 }
410
411 if (!getDolGlobalInt('FCKEDITOR_ENABLE_MAIL')) {
412 print '<tr>';
413 print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
414 print "</tr>\n";
415 }
416
417 // Interface topic
418 $url_interface = getDolGlobalString("TICKET_PUBLIC_INTERFACE_TOPIC");
419 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTopicLabelAdmin").'</label>';
420 print '</td><td>';
421 print '<input type="text" name="TICKET_PUBLIC_INTERFACE_TOPIC" value="'.$url_interface.'" size="40" ></td>';
422 print '</td>';
423 print '<td class="center width75">';
424 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
425 print '</td></tr>';
426
427 // Text on home page
428 $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
429 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
430 print '</td><td>';
431 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
432 $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70);
433 $doleditor->Create();
434 print '</td>';
435 print '<td class="center">';
436 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
437 print '</td></tr>';
438
439 // Text to help to enter a ticket
440 $public_text_help_message = getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'));
441 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
442 print '</td><td>';
443 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
444 $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70);
445 $doleditor->Create();
446 print '</td>';
447 print '<td class="center">';
448 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
449 print '</td></tr>';
450
451 // Url public interface
452 $url_interface = getDolGlobalString("TICKET_URL_PUBLIC_INTERFACE");
453 print '<tr><td>'.$langs->trans("UrlPublicInterfaceLabelAdmin").'</label>';
454 print '</td><td>';
455 print '<input type="text" class="minwidth500" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$url_interface.'" placeholder="https://..."></td>';
456 print '</td>';
457 print '<td class="center">';
458 print $form->textwithpicto('', $langs->trans("UrlPublicInterfaceHelpAdmin"), 1, 'help');
459 print '</td></tr>';
460
461 print '</table>';
462
463 print '<br><br>';
464
465 print load_fiche_titre($langs->trans("Emails"));
466
467 print '<div class="div-table-responsive-no-min">';
468 print '<table class="noborder centpercent">';
469
470 // Text of email after creatio of a ticket
471 $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
472 print '<tr><td>';
473 print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
474 print '</label>';
475 print '</td><td>';
476 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
477 $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
478 $doleditor->Create();
479 print '</td>';
480 print '</tr>';
481
482 // Activate email notification when a new message is added
483 print '<tr class="pair"><td>';
484 print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
485 print '</td>';
486 print '<td class="left">';
487 if ($conf->use_javascript_ajax) {
488 print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
489 } else {
490 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
491 print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED"));
492 }
493 print '</td>';
494 print '</tr>';
495
496 // Send notification when a new message is added to a email if a user is not assigned to the ticket
497 print '<tr><td>';
498 print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
499 print '</td><td>';
500 print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL").'" size="40" ></td>';
501 print '</td>';
502 print '</tr>';
503
504 // Also send to main email address
505 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
506 print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress");
507 print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
508 print '</td>';
509 print '<td class="left">';
510 if (!empty($conf->use_javascript_ajax)) {
511 print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
512 } else {
513 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
514 print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'));
515 }
516 print '</td>';
517 print '</tr>';
518 }
519
520 print '</table>';
521 print '</div>';
522
523 print $form->buttonsSaveCancel("Save", '');
524
525 print '</form>';
526}
527
528// End of page
529llxFooter();
530$db->close();
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.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session object.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.