dolibarr  16.0.5
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 require '../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
27 require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
28 require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php";
29 
30 // Load translation files required by the page
31 $langs->loadLangs(array("admin", "ticket"));
32 
33 // Access control
34 if (!$user->admin) {
36 }
37 
38 // Parameters
39 $value = GETPOST('value', 'alpha');
40 $action = GETPOST('action', 'aZ09');
41 $label = GETPOST('label', 'alpha');
42 $scandir = GETPOST('scandir', 'alpha');
43 $type = 'ticket';
44 
45 
46 /*
47  * Actions
48  */
49 $error = 0;
50 $errors = array();
51 
52 if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
53  if (GETPOST('value')) {
54  $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
55  } else {
56  $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity);
57  }
58  if (!($res > 0)) {
59  $error++;
60  $errors[] = $db->lasterror();
61  }
62 } elseif ($action == 'setvar') {
63  include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
64 
65  if (GETPOSTISSET('TICKET_ENABLE_PUBLIC_INTERFACE')) { // only for no js case
66  $param_enable_public_interface = GETPOST('TICKET_ENABLE_PUBLIC_INTERFACE', 'alpha');
67  $res = dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', $param_enable_public_interface, 'chaine', 0, '', $conf->entity);
68  if (!($res > 0)) {
69  $error++;
70  $errors[] = $db->lasterror();
71  }
72  }
73 
74  if (GETPOSTISSET('TICKET_DISABLE_CUSTOMER_MAILS')) { // only for no js case
75  $param_disable_email = GETPOST('TICKET_DISABLE_CUSTOMER_MAILS', 'alpha');
76  $res = dolibarr_set_const($db, 'TICKET_DISABLE_CUSTOMER_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity);
77  if (!($res > 0)) {
78  $error++;
79  $errors[] = $db->lasterror();
80  }
81  }
82 
83  if (GETPOSTISSET('TICKET_SHOW_COMPANY_LOGO')) { // only for no js case
84  $param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
85  $res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
86  if (!($res > 0)) {
87  $error++;
88  $errors[] = $db->lasterror();
89  }
90  }
91 
92  $topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alphanohtml');
93  if (!empty($topic_interface)) {
94  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
95  } else {
96  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
97  }
98  if (!($res > 0)) {
99  $error++;
100  $errors[] = $db->lasterror();
101  }
102 
103  $text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
104  if (GETPOSTISSET('TICKET_PUBLIC_TEXT_HOME')) {
105  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
106  } else {
107  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
108  }
109  if (!($res > 0)) {
110  $error++;
111  $errors[] = $db->lasterror();
112  }
113 
114  $text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
115  if (!empty($text_help)) {
116  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
117  } else {
118  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
119  }
120  if (!($res > 0)) {
121  $error++;
122  $errors[] = $db->lasterror();
123  }
124 
125  $mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
126  if (!empty($mail_new_ticket)) {
127  $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
128  } else {
129  $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
130  }
131  if (!($res > 0)) {
132  $error++;
133  $errors[] = $db->lasterror();
134  }
135 
136  $url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
137  if (!empty($url_interface)) {
138  $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
139  } else {
140  $res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
141  }
142  if (!($res > 0)) {
143  $error++;
144  $errors[] = $db->lasterror();
145  }
146 
147  $param_public_notification_new_message_default_email = GETPOST('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', 'alpha');
148  $res = dolibarr_set_const($db, 'TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', $param_public_notification_new_message_default_email, 'chaine', 0, '', $conf->entity);
149  if (!($res > 0)) {
150  $error++;
151  $errors[] = $db->lasterror();
152  }
153 
154  // For compatibility when javascript is not enabled
155  if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($conf->use_javascript_ajax)) {
156  $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
157  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
158  if (!($res > 0)) {
159  $error++;
160  $errors[] = $db->lasterror();
161  }
162  }
163 } elseif (preg_match('/set_(.*)/', $action, $reg)) {
164  $code = $reg[1];
165  $value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1;
166  if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
167  $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
168  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
169  if (!($res > 0)) {
170  $error++;
171  }
172  } else {
173  $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
174  if (!($res > 0)) {
175  $error++;
176  }
177  if (!$error) {
178  if ($code == 'TICKET_EMAIL_MUST_EXISTS') {
179  $res = dolibarr_del_const($db, 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST', $conf->entity);
180  if (!($res > 0)) {
181  $error++;
182  $errors[] = $db->lasterror();
183  }
184  } elseif ($code == 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST') {
185  $res = dolibarr_del_const($db, 'TICKET_EMAIL_MUST_EXISTS', $conf->entity);
186  if (!($res > 0)) {
187  $error++;
188  $errors[] = $db->lasterror();
189  }
190  }
191  }
192  }
193 } elseif (preg_match('/del_(.*)/', $action, $reg)) {
194  $code = $reg[1];
195  $res = dolibarr_del_const($db, $code, $conf->entity);
196  if (!($res > 0)) {
197  $error++;
198  $errors[] = $db->lasterror();
199  }
200 }
201 
202 if ($action != '') {
203  if (!$error) {
204  $db->commit();
205  setEventMessage($langs->trans('SetupSaved'));
206  header("Location: " . $_SERVER['PHP_SELF']);
207  exit;
208  } else {
209  $db->rollback();
210  setEventMessages('', $errors, 'errors');
211  }
212 }
213 
214 
215 /*
216  * View
217  */
218 
219 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
220 
221 $form = new Form($db);
222 
223 $help_url = "FR:Module_Ticket";
224 $page_name = "TicketSetup";
225 llxHeader('', $langs->trans($page_name), $help_url);
226 
227 // Subheader
228 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
229 
230 print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
231 
232 // Configuration header
233 $head = ticketAdminPrepareHead();
234 
235 print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
236 
237 print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php?entity='.$conf->entity.'" target="_blank" rel="noopener noreferrer">'.dol_buildpath('/public/ticket/index.php?entity='.$conf->entity, 2).'</a>';
238 
239 print dol_get_fiche_end();
240 
241 $param = '';
242 
243 $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
244 if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
245  // Button off, click to enable
246  $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&token='.newToken().'&value=1'.$param.'">';
247  $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
248  $enabledisablehtml .= '</a>';
249 } else {
250  // Button on, click to disable
251  $enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setTICKET_ENABLE_PUBLIC_INTERFACE&token='.newToken().'&value=0'.$param.'">';
252  $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
253  $enabledisablehtml .= '</a>';
254 }
255 print $enabledisablehtml;
256 print '<input type="hidden" id="TICKET_ENABLE_PUBLIC_INTERFACE" name="TICKET_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">';
257 
258 print '<br><br>';
259 
260 if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
261  print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
262  print '<input type="hidden" name="token" value="'.newToken().'">';
263  print '<input type="hidden" name="action" value="setvar">';
264 
265  print '<div class="div-table-responsive-no-min">';
266  print '<table class="noborder centpercent">';
267  print '<tr class="liste_titre"><td>'.$langs->trans("Parameters").'</td>';
268  print '<td class="left">';
269  print '</td>';
270  print '<td class="center width75">';
271  print '</td>';
272  print '</tr>';
273 
274  // Enable Captcha code
275  print '<tr class="oddeven">';
276  print '<td>'.$langs->trans("TicketUseCaptchaCode").'</td>';
277  print '<td class="left">';
278  if (function_exists("imagecreatefrompng")) {
279  if (!empty($conf->use_javascript_ajax)) {
280  print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET');
281  } else {
282  if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA_TICKET)) {
283  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
284  } else {
285  print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
286  }
287  }
288  } else {
289  $desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
290  print $desc;
291  }
292  print '</td>';
293  print '<td class="center width75">';
294  print $form->textwithpicto('', $langs->trans("TicketUseCaptchaCodeHelp"), 1, 'help');
295  print '</td>';
296  print '</tr>';
297 
298  // Check if email exists
299  print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailMustExist").'</td>';
300  print '<td class="left">';
301  if (empty(getDolGlobalInt('TICKET_EMAIL_MUST_EXISTS'))) {
302  print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Disabled'), 'switch_off') . '</a>';
303  } else {
304  print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_TICKET_EMAIL_MUST_EXISTS&token='.newToken().'">' . img_picto($langs->trans('Enabled'), 'switch_on') . '</a>';
305  }
306  print '</td>';
307  print '<td class="center width75">';
308  print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'help');
309  print '</td>';
310  print '</tr>';
311 
312  // Create third-party with contact if email not linked to a contact
313  print '<tr class="oddeven"><td>'.$langs->trans("TicketCreateThirdPartyWithContactIfNotExist").'</td>';
314  print '<td class="left">';
315  if (empty(getDolGlobalInt('TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST'))) {
316  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>';
317  } else {
318  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>';
319  }
320  print '</td>';
321  print '<td class="center width75">';
322  print $form->textwithpicto('', $langs->trans("TicketCreateThirdPartyWithContactIfNotExistHelp"), 1, 'help');
323  print '</td>';
324  print '</tr>';
325 
326  /*if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
327  {
328  // Show logo for module
329  print '<tr class="oddeven"><td>' . $langs->trans("TicketsShowModuleLogo") . '</td>';
330  print '<td class="left">';
331  if ($conf->use_javascript_ajax) {
332  print ajax_constantonoff('TICKET_SHOW_MODULE_LOGO');
333  } else {
334  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
335  print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKET_SHOW_MODULE_LOGO);
336  }
337  print '</td>';
338  print '<td class="center">';
339  print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
340  print '</td>';
341  print '</tr>';
342  }*/
343 
344  // Show logo for company
345  print '<tr class="oddeven"><td>'.$langs->trans("TicketsShowCompanyLogo").'</td>';
346  print '<td class="left">';
347  if ($conf->use_javascript_ajax) {
348  print ajax_constantonoff('TICKET_SHOW_COMPANY_LOGO');
349  } else {
350  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
351  print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, $conf->global->TICKET_SHOW_COMPANY_LOGO);
352  }
353  print '</td>';
354  print '<td class="center width75">';
355  print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help');
356  print '</td>';
357  print '</tr>';
358 
359  // Also send to main email address
360  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
361  print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
362  print '<td class="left">';
363  if ($conf->use_javascript_ajax) {
364  print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
365  } else {
366  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
367  print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
368  }
369  print '</td>';
370  print '<td class="center width75">';
371  print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp", $langs->transnoentitiesnoconv("TicketEmailNotificationTo").' ('.$langs->transnoentitiesnoconv("Creation").')', $langs->trans("Settings")), 1, 'help');
372  print '</td>';
373  print '</tr>';
374  }
375 
376  if (!$conf->use_javascript_ajax) {
377  print '<tr class="impair"><td colspan="3" align="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'"></td>';
378  print '</tr>';
379  }
380 
381  if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
382  print '<tr>';
383  print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
384  print "</tr>\n";
385  }
386 
387  // Interface topic
388  $url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC;
389  print '<tr><td>'.$langs->trans("TicketPublicInterfaceTopicLabelAdmin").'</label>';
390  print '</td><td>';
391  print '<input type="text" name="TICKET_PUBLIC_INTERFACE_TOPIC" value="'.$conf->global->TICKET_PUBLIC_INTERFACE_TOPIC.'" size="40" ></td>';
392  print '</td>';
393  print '<td class="center width75">';
394  print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
395  print '</td></tr>';
396 
397  // Text on home page
398  $public_text_home = getDolGlobalString('TICKET_PUBLIC_TEXT_HOME', '<span class="opacitymedium">'.$langs->trans("TicketPublicDesc").'</span>');
399  print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
400  print '</td><td>';
401  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
402  $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
403  $doleditor->Create();
404  print '</td>';
405  print '<td class="center">';
406  print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help');
407  print '</td></tr>';
408 
409  // Text to help to enter a ticket
410  $public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe');
411  print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
412  print '</td><td>';
413  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
414  $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
415  $doleditor->Create();
416  print '</td>';
417  print '<td class="center">';
418  print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
419  print '</td></tr>';
420 
421  // Url public interface
422  $url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
423  print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
424  print '</td><td>';
425  print '<input type="text" class="minwidth500" name="TICKET_URL_PUBLIC_INTERFACE" value="'.$conf->global->TICKET_URL_PUBLIC_INTERFACE.'"></td>';
426  print '</td>';
427  print '<td class="center">';
428  print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
429  print '</td></tr>';
430 
431  print '</table>';
432 
433  print '<br><br>';
434 
435  print load_fiche_titre($langs->trans("Emails"));
436 
437  print '<div class="div-table-responsive-no-min">';
438  print '<table class="noborder centpercent">';
439 
440  // Activate email creation to user
441  print '<tr class="pair"><td>';
442  print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
443  print '</td>';
444  print '<td class="left">';
445  if ($conf->use_javascript_ajax) {
446  print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
447  } else {
448  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
449  print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS);
450  }
451  print '</td>';
452  print '</tr>';
453 
454  // Text of email after creatio of a ticket
455  $mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody');
456  print '<tr><td>';
457  print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
458  print '</label>';
459  print '</td><td>';
460  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
461  $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
462  $doleditor->Create();
463  print '</td>';
464  print '</tr>';
465 
466  // Activate email notification when a new message is added
467  print '<tr class="pair"><td>';
468  print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
469  print '</td>';
470  print '<td class="left">';
471  if ($conf->use_javascript_ajax) {
472  print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
473  } else {
474  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
475  print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED);
476  }
477  print '</td>';
478  print '</tr>';
479 
480  // Send notification when a new message is added to a email if a user is not assigned to the ticket
481  print '<tr><td>';
482  print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
483  print '</td><td>';
484  print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.$conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL.'" size="40" ></td>';
485  print '</td>';
486  print '</tr>';
487 
488  print '</table>';
489  print '</div>';
490 
491  print $form->buttonsSaveCancel("Save", '');
492 
493  print '</form>';
494 }
495 
496 // End of page
497 llxFooter();
498 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5190
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:484
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
$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:116
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:3866
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:8094
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:573
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:1808
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10864
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2004
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:627
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:386
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8123
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
getDolGlobalInt
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
Definition: functions.lib.php:93
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30