dolibarr 21.0.0-alpha
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
350 // Show logo for company
351 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyLogo").'</td>';
352 print '<td class="left">';
353 if (!empty($conf->use_javascript_ajax)) {
354 print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO');
355 } else {
356 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
357 print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, getDolGlobalInt('TICKET_SHOW_COMPANY_LOGO'));
358 }
359 print '</td>';
360 print '<td class="center width75">';
361 print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help');
362 print '</td>';
363 print '</tr>';
364
365 // show footer for company
366 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyFooter").'</td>';
367 print '<td class="left">';
368 if ($conf->use_javascript_ajax) {
369 print ajax_constantonoff('TICKET_SHOW_COMPANY_FOOTER');
370 } else {
371 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
372 print $form->selectarray("TICKET_SHOW_COMPANY_FOOTER", $arrval, $conf->global->TICKET_SHOW_COMPANY_FOOTER);
373 }
374 print '</td>';
375 print '<td class="center width75">';
376 print $form->textwithpicto('', $langs->trans("TicketsShowCompanyFooterHelp"), 1, 'help');
377 print '</td>';
378 print '</tr>';
379
380 // Show progression
381 print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowProgression").'</td>';
382 print '<td class="left">';
383 if (!empty($conf->use_javascript_ajax)) {
384 print ajax_constantonoff('TICKET_SHOW_PROGRESSION');
385 } else {
386 if (!getDolGlobalInt('TICKET_SHOW_PROGRESSION')) {
387 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
388 } else {
389 print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_SHOW_PROGRESSION&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
390 }
391 }
392 print '</td>';
393 print '<td class="center width75">';
394 print $form->textwithpicto('', $langs->trans("TicketsShowProgressionHelp"), 1, 'help');
395 print '</td>';
396 print '</tr>';
397
398 // Also send to main email address
399 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
400 print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
401 print '<td class="left">';
402 if (!empty($conf->use_javascript_ajax)) {
403 print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
404 } else {
405 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
406 print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, getDolGlobalInt('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS'));
407 }
408 print '</td>';
409 print '<td class="center width75">';
410 print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
411 print '</td>';
412 print '</tr>';
413 }
414
415 if (empty($conf->use_javascript_ajax)) {
416 print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
417 print '</tr>';
418 }
419
420 if (!getDolGlobalInt('FCKEDITOR_ENABLE_MAIL')) {
421 print '<tr>';
422 print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
423 print "</tr>\n";
424 }
425
426 // Interface topic
427 $url_interface = getDolGlobalString("TICKET_PUBLIC_INTERFACE_TOPIC");
428 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTopicLabelAdmin").'</label>';
429 print '</td><td>';
430 print '<input type="text" name="TICKET_PUBLIC_INTERFACE_TOPIC" value="'.$url_interface.'" size="40" ></td>';
431 print '</td>';
432 print '<td class="center width75">';
433 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
434 print '</td></tr>';
435
436 // Text on home page
437 $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
438 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
439 print '</td><td>';
440 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
441 $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70);
442 $doleditor->Create();
443 print '</td>';
444 print '<td class="center">';
445 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
446 print '</td></tr>';
447
448 // Text to help to enter a ticket
449 $public_text_help_message = getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'));
450 print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
451 print '</td><td>';
452 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
453 $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);
454 $doleditor->Create();
455 print '</td>';
456 print '<td class="center">';
457 print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
458 print '</td></tr>';
459
460 // Url public interface
461 $url_interface = getDolGlobalString("TICKET_URL_PUBLIC_INTERFACE");
462 print '<tr><td>'.$langs->trans("UrlPublicInterfaceLabelAdmin").'</label>';
463 print '</td><td>';
464 print '<input type="text" class="minwidth500" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$url_interface.'" placeholder="https://..."></td>';
465 print '</td>';
466 print '<td class="center">';
467 print $form->textwithpicto('', $langs->trans("UrlPublicInterfaceHelpAdmin"), 1, 'help');
468 print '</td></tr>';
469
470 print '</table>';
471
472 print '<br><br>';
473
474 print load_fiche_titre($langs->trans("Emails"));
475
476 print '<div class="div-table-responsive-no-min">';
477 print '<table class="noborder centpercent">';
478
479 // Activate email creation to user
480 print '<tr class="pair"><td>';
481 print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
482 print '</td>';
483 print '<td class="left">';
484 if ($conf->use_javascript_ajax) {
485 print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
486 } else {
487 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
488 print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, getDolGlobalInt('TICKET_DISABLE_CUSTOMER_MAILS'));
489 }
490 print '</td>';
491 print '</tr>';
492
493 // Text of email after creatio of a ticket
494 $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
495 print '<tr><td>';
496 print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
497 print '</label>';
498 print '</td><td>';
499 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
500 $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
501 $doleditor->Create();
502 print '</td>';
503 print '</tr>';
504
505 // Activate email notification when a new message is added
506 print '<tr class="pair"><td>';
507 print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
508 print '</td>';
509 print '<td class="left">';
510 if ($conf->use_javascript_ajax) {
511 print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
512 } else {
513 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
514 print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED"));
515 }
516 print '</td>';
517 print '</tr>';
518
519 // Send notification when a new message is added to a email if a user is not assigned to the ticket
520 print '<tr><td>';
521 print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
522 print '</td><td>';
523 print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL").'" size="40" ></td>';
524 print '</td>';
525 print '</tr>';
526
527 print '</table>';
528 print '</div>';
529
530 print $form->buttonsSaveCancel("Save", '');
531
532 print '</form>';
533}
534
535// End of page
536llxFooter();
537$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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
llxFooter()
Footer empty.
Definition document.php:107
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 a 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.