dolibarr 20.0.0
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_DISABLE_CUSTOMER_MAILS')) { // only for no js case
76 $param_disable_email = GETPOST('TICKET_DISABLE_CUSTOMER_MAILS', 'alpha');
77 $res = dolibarr_set_const($db, 'TICKET_DISABLE_CUSTOMER_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity);
78 if (!($res > 0)) {
79 $error++;
80 $errors[] = $db->lasterror();
81 }
82 }
83
84 if (GETPOSTISSET('TICKET_SHOW_COMPANY_LOGO')) { // only for no js case
85 $param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
86 $res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
87 if (!($res > 0)) {
88 $error++;
89 $errors[] = $db->lasterror();
90 }
91 }
92
93 $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alphanohtml');
94 if (!empty($topic_interface)) {
95 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
96 } else {
97 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
98 }
99 if (!($res > 0)) {
100 $error++;
101 $errors[] = $db->lasterror();
102 }
103
104 $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
105 if (GETPOSTISSET('TICKET_PUBLIC_TEXT_HOME')) {
106 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
107 } else {
108 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
109 }
110 if (!($res > 0)) {
111 $error++;
112 $errors[] = $db->lasterror();
113 }
114
115 $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
116 if (!empty($text_help)) {
117 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
118 } else {
119 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
120 }
121 if (!($res > 0)) {
122 $error++;
123 $errors[] = $db->lasterror();
124 }
125
126 $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
127 if (!empty($mail_new_ticket)) {
128 $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
129 } else {
130 $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
131 }
132 if (!($res > 0)) {
133 $error++;
134 $errors[] = $db->lasterror();
135 }
136
137 $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
138 if (!empty($url_interface)) {
139 $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
140 } else {
141 $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
142 }
143 if (!($res > 0)) {
144 $error++;
145 $errors[] = $db->lasterror();
146 }
147
148 $param_public_notification_new_message_default_email = GETPOST('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', 'alpha');
149 $res = dolibarr_set_const($db, 'TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', $param_public_notification_new_message_default_email, 'chaine', 0, '', $conf->entity);
150 if (!($res > 0)) {
151 $error++;
152 $errors[] = $db->lasterror();
153 }
154
155 // For compatibility when javascript is not enabled
156 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($conf->use_javascript_ajax)) {
157 $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
158 $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
159 if (!($res > 0)) {
160 $error++;
161 $errors[] = $db->lasterror();
162 }
163 }
164} elseif (preg_match('/set_(.*)/', $action, $reg)) {
165 $code = $reg[1];
166 $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1;
167 if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
168 $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
169 $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
170 if (!($res > 0)) {
171 $error++;
172 }
173 } else {
174 $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
175 if (!($res > 0)) {
176 $error++;
177 }
178 if (!$error) {
179 if ($code == 'TICKET_EMAIL_MUST_EXISTS') {
180 $res = dolibarr_del_const($db, 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST', $conf->entity);
181 if (!($res > 0)) {
182 $error++;
183 $errors[] = $db->lasterror();
184 }
185 } elseif ($code == 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST') {
186 $res = dolibarr_del_const($db, 'TICKET_EMAIL_MUST_EXISTS', $conf->entity);
187 if (!($res > 0)) {
188 $error++;
189 $errors[] = $db->lasterror();
190 }
191 }
192 }
193 }
194} elseif (preg_match('/del_(.*)/', $action, $reg)) {
195 $code = $reg[1];
196 $res = dolibarr_del_const($db, $code, $conf->entity);
197 if (!($res > 0)) {
198 $error++;
199 $errors[] = $db->lasterror();
200 }
201}
202
203if ($action != '') {
204 if (!$error) {
205 $db->commit();
206 setEventMessage($langs->trans('SetupSaved'));
207 header("Location: " . $_SERVER['PHP_SELF']);
208 exit;
209 } else {
210 $db->rollback();
211 setEventMessages('', $errors, 'errors');
212 }
213}
214
215
216/*
217 * View
218 */
219
220$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
221
222$form = new Form($db);
223
224$help_url = "FR:Module_Ticket";
225$page_name = "TicketSetup";
226llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ticket_public');
227
228// Subheader
229$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
230
231print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
232
233// Configuration header
234$head = ticketAdminPrepareHead();
235
236print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
237
238$param = '';
239
240print '<br>';
241
242$enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
243if (!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
244 // Button off, click to enable
245 $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&token='.newToken().'&value=1'.$param.'">';
246 $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
247 $enabledisablehtml .= '</a>';
248} else {
249 // Button on, click to disable
250 $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&token='.newToken().'&value=0'.$param.'">';
251 $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
252 $enabledisablehtml .= '</a>';
253}
254print $enabledisablehtml;
255print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ? 0 : 1).'">';
256
257print dol_get_fiche_end();
258
259
260
261if (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) {
262 print '<br>';
263
264
265 // Define $urlwithroot
266 $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
267 $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
268 //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
269
270 print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> :<br>';
271 print '<div class="urllink">';
272 print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">';
273 print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/ticket/index.php?entity='.$conf->entity.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
274 print '</div>';
275 print ajax_autoselect('publicurlmember');
276
277
278 print '<br><br>';
279
280
281 print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
282 print '<input type="hidden" name="token" value="'.newToken().'">';
283 print '<input type="hidden" name="action" value="setvar">';
284
285 print '<div class="div-table-responsive-no-min">';
286 print '<table class="noborder centpercent">';
287 print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td>';
288 print '<td class="left">';
289 print '</td>';
290 print '<td class="center width75">';
291 print '</td>';
292 print '</tr>';
293
294 // Enable Captcha code
295 print '<tr class="oddeven">';
296 print '<td>'.$langs->trans("TicketUseCaptchaCode").'</td>';
297 print '<td class="left">';
298 if (function_exists("imagecreatefrompng")) {
299 if (!empty($conf->use_javascript_ajax)) {
300 print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET');
301 } else {
302 if (!getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
303 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
304 } else {
305 print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
306 }
307 }
308 } else {
309 $desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
310 print $desc;
311 }
312 print '</td>';
313 print '<td class="center width75">';
314 print $form->textwithpicto('', $langs->trans("TicketUseCaptchaCodeHelp"), 1, 'help');
315 print '</td>';
316 print '</tr>';
317
318 // Check if email exists
319 print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailMustExist").'</td>';
320 print '<td class="left">';
321 if (!getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS')) {
322 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
323 } else {
324 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
325 }
326 print '</td>';
327 print '<td class="center width75">';
328 print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'help');
329 print '</td>';
330 print '</tr>';
331
332 // Auto fill the contact found from email
333 // 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.
334 /*
335 print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
336 print '<td class="left">';
337 if (!getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST')) {
338 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>';
339 } else {
340 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>';
341 }
342 print '</td>';
343 print '<td class="center width75">';
344 print $form->textwithpicto('', $langs->trans("TicketCreateThirdPartyWithContactIfNotExistHelp"), 1, 'help');
345 print '</td>';
346 print '</tr>';
347 */
348
349 /*if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2)
350 {
351 // Show logo for module
352 print '<tr class="oddeven"><td>' . $langs->trans("TicketsShowModuleLogo") . '</td>';
353 print '<td class="left">';
354 if ($conf->use_javascript_ajax) {
355 print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO');
356 } else {
357 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
358 print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_MODULE_LOGO'));
359 }
360 print '</td>';
361 print '<td class="center">';
362 print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
363 print '</td>';
364 print '</tr>';
365 }*/
366
367 // Show logo for company
368 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyLogo").'</td>';
369 print '<td class="left">';
370 if (!empty($conf->use_javascript_ajax)) {
371 print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO');
372 } else {
373 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
374 print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO'));
375 }
376 print '</td>';
377 print '<td class="center width75">';
378 print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help');
379 print '</td>';
380 print '</tr>';
381
382 // show footer for company
383 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyFooter").'</td>';
384 print '<td class="left">';
385 if ($conf->use_javascript_ajax) {
386 print ajax_constantonoff('TICKET_SHOW_COMPANY_FOOTER');
387 } else {
388 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
389 print $form->selectarray("TICKET_SHOW_COMPANY_FOOTER", $arrval, $conf->global->TICKET_SHOW_COMPANY_FOOTER);
390 }
391 print '</td>';
392 print '<td class="center width75">';
393 print $form->textwithpicto('', $langs->trans("TicketsShowCompanyFooterHelp"), 1, 'help');
394 print '</td>';
395 print '</tr>';
396
397 // Show progression
398 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowProgression").'</td>';
399 print '<td class="left">';
400 if (!empty($conf->use_javascript_ajax)) {
401 print ajax_constantonoff('TICKET_SHOW_PROGRESSION');
402 } else {
403 if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) {
404 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
405 } else {
406 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
407 }
408 }
409 print '</td>';
410 print '<td class="center width75">';
411 print $form->textwithpicto('', $langs->trans("TicketsShowProgressionHelp"), 1, 'help');
412 print '</td>';
413 print '</tr>';
414
415 // Also send to main email address
416 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
417 print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
418 print '<td class="left">';
419 if (!empty($conf->use_javascript_ajax)) {
420 print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
421 } else {
422 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
423 print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'));
424 }
425 print '</td>';
426 print '<td class="center width75">';
427 print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
428 print '</td>';
429 print '</tr>';
430 }
431
432 if (empty($conf->use_javascript_ajax)) {
433 print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
434 print '</tr>';
435 }
436
437 if (!getDolGlobalInt('FCKEDITOR_ENABLE_MAIL')) {
438 print '<tr>';
439 print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
440 print "</tr>\n";
441 }
442
443 // Interface topic
444 $url_interface = getDolGlobalString("TICKET_PUBLIC_INTERFACE_TOPIC");
445 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTopicLabelAdmin").'</label>';
446 print '</td><td>';
447 print '<input type="text" name="TICKET_PUBLIC_INTERFACE_TOPIC" value="'.$url_interface.'" size="40" ></td>';
448 print '</td>';
449 print '<td class="center width75">';
450 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
451 print '</td></tr>';
452
453 // Text on home page
454 $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
455 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
456 print '</td><td>';
457 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
458 $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70);
459 $doleditor->Create();
460 print '</td>';
461 print '<td class="center">';
462 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
463 print '</td></tr>';
464
465 // Text to help to enter a ticket
466 $public_text_help_message = getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'));
467 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
468 print '</td><td>';
469 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
470 $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);
471 $doleditor->Create();
472 print '</td>';
473 print '<td class="center">';
474 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
475 print '</td></tr>';
476
477 // Url public interface
478 $url_interface = getDolGlobalString("TICKET_URL_PUBLIC_INTERFACE");
479 print '<tr><td>'.$langs->trans("UrlPublicInterfaceLabelAdmin").'</label>';
480 print '</td><td>';
481 print '<input type="text" class="minwidth500" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$url_interface.'" placeholder="https://..."></td>';
482 print '</td>';
483 print '<td class="center">';
484 print $form->textwithpicto('', $langs->trans("UrlPublicInterfaceHelpAdmin"), 1, 'help');
485 print '</td></tr>';
486
487 print '</table>';
488
489 print '<br><br>';
490
491 print load_fiche_titre($langs->trans("Emails"));
492
493 print '<div class="div-table-responsive-no-min">';
494 print '<table class="noborder centpercent">';
495
496 // Activate email creation to user
497 print '<tr class="pair"><td>';
498 print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
499 print '</td>';
500 print '<td class="left">';
501 if ($conf->use_javascript_ajax) {
502 print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
503 } else {
504 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
505 print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS'));
506 }
507 print '</td>';
508 print '</tr>';
509
510 // Text of email after creatio of a ticket
511 $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
512 print '<tr><td>';
513 print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
514 print '</label>';
515 print '</td><td>';
516 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
517 $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
518 $doleditor->Create();
519 print '</td>';
520 print '</tr>';
521
522 // Activate email notification when a new message is added
523 print '<tr class="pair"><td>';
524 print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
525 print '</td>';
526 print '<td class="left">';
527 if ($conf->use_javascript_ajax) {
528 print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
529 } else {
530 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
531 print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED"));
532 }
533 print '</td>';
534 print '</tr>';
535
536 // Send notification when a new message is added to a email if a user is not assigned to the ticket
537 print '<tr><td>';
538 print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
539 print '</td><td>';
540 print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL").'" size="40" ></td>';
541 print '</td>';
542 print '</tr>';
543
544 print '</table>';
545 print '</div>';
546
547 print $form->buttonsSaveCancel("Save", '');
548
549 print '</form>';
550}
551
552// End of page
553llxFooter();
554$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.