dolibarr  17.0.3
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
26 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
28 require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
29 require_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
35 if (!$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 
53 if ($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 ($conf->global->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) ? GETPOST($code, 'int') : 1;
167  if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->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 
203 if ($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";
226 llxHeader('', $langs->trans($page_name), $help_url);
227 
228 // Subheader
229 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
230 
231 print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
232 
233 // Configuration header
234 $head = ticketAdminPrepareHead();
235 
236 print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
237 
238 $param = '';
239 
240 print '<br>';
241 
242 $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
243 if (empty($conf->global->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 }
254 print $enabledisablehtml;
255 print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">';
256 
257 print dol_get_fiche_end();
258 
259 
260 
261 if (!empty($conf->global->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 (empty($conf->global->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 ($conf->global->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, $conf->global->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 ($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, $conf->global->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  // Also send to main email address
383  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
384  print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
385  print '<td class="left">';
386  if ($conf->use_javascript_ajax) {
387  print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
388  } else {
389  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
390  print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
391  }
392  print '</td>';
393  print '<td class="center width75">';
394  print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
395  print '</td>';
396  print '</tr>';
397  }
398 
399  if (!$conf->use_javascript_ajax) {
400  print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
401  print '</tr>';
402  }
403 
404  if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
405  print '<tr>';
406  print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
407  print "</tr>\n";
408  }
409 
410  // Interface topic
411  $url_interface = getDolGlobalString("TICKET_PUBLIC_INTERFACE_TOPIC");
412  print '<tr><td>'.$langs->trans("TicketPublicInterfaceTopicLabelAdmin").'</label>';
413  print '</td><td>';
414  print '<input type="text" name="TICKET_PUBLIC_INTERFACE_TOPIC" value="'.$url_interface.'" size="40" ></td>';
415  print '</td>';
416  print '<td class="center width75">';
417  print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
418  print '</td></tr>';
419 
420  // Text on home page
421  $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
422  print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
423  print '</td><td>';
424  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
425  $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70);
426  $doleditor->Create();
427  print '</td>';
428  print '<td class="center">';
429  print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
430  print '</td></tr>';
431 
432  // Text to help to enter a ticket
433  $public_text_help_message = getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'));
434  print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
435  print '</td><td>';
436  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
437  $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);
438  $doleditor->Create();
439  print '</td>';
440  print '<td class="center">';
441  print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
442  print '</td></tr>';
443 
444  // Url public interface
445  $url_interface = getDolGlobalString("TICKET_URL_PUBLIC_INTERFACE");
446  print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
447  print '</td><td>';
448  print '<input type="text" class="minwidth500" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$url_interface.'"></td>';
449  print '</td>';
450  print '<td class="center">';
451  print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
452  print '</td></tr>';
453 
454  print '</table>';
455 
456  print '<br><br>';
457 
458  print load_fiche_titre($langs->trans("Emails"));
459 
460  print '<div class="div-table-responsive-no-min">';
461  print '<table class="noborder centpercent">';
462 
463  // Activate email creation to user
464  print '<tr class="pair"><td>';
465  print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
466  print '</td>';
467  print '<td class="left">';
468  if ($conf->use_javascript_ajax) {
469  print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
470  } else {
471  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
472  print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS);
473  }
474  print '</td>';
475  print '</tr>';
476 
477  // Text of email after creatio of a ticket
478  $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
479  print '<tr><td>';
480  print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
481  print '</label>';
482  print '</td><td>';
483  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
484  $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
485  $doleditor->Create();
486  print '</td>';
487  print '</tr>';
488 
489  // Activate email notification when a new message is added
490  print '<tr class="pair"><td>';
491  print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
492  print '</td>';
493  print '<td class="left">';
494  if ($conf->use_javascript_ajax) {
495  print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
496  } else {
497  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
498  print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED"));
499  }
500  print '</td>';
501  print '</tr>';
502 
503  // Send notification when a new message is added to a email if a user is not assigned to the ticket
504  print '<tr><td>';
505  print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
506  print '</td><td>';
507  print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL").'" size="40" ></td>';
508  print '</td>';
509  print '</tr>';
510 
511  print '</table>';
512  print '</div>';
513 
514  print $form->buttonsSaveCancel("Save", '');
515 
516  print '</form>';
517 }
518 
519 // End of page
520 llxFooter();
521 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:70
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:556
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5360
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:520
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4024
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
ticketAdminPrepareHead
ticketAdminPrepareHead()
Build tabs for admin page.
Definition: ticket.lib.php:31
setEventMessage
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
Definition: functions.lib.php:8436
ajax_constantonoff
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='')
On/off button for constant.
Definition: ajax.lib.php:600
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1858
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:82
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:11290
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2054
dolibarr_set_const
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).
Definition: admin.lib.php:632
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:421
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:53
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8465
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
Definition: security.lib.php:1120
ajax_autoselect
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
Definition: functions.lib.php:10083
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
Definition: functions.lib.php:96
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30