dolibarr  13.0.2
ticket.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 $error = 0;
46 
47 
48 /*
49  * Actions
50  */
51 
52 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
53 
54 if ($action == 'updateMask') {
55  $maskconstticket = GETPOST('maskconstticket', 'alpha');
56  $maskticket = GETPOST('maskticket', 'alpha');
57 
58  if ($maskconstticket) {
59  $res = dolibarr_set_const($db, $maskconstticket, $maskticket, 'chaine', 0, '', $conf->entity);
60  }
61 
62  if (!($res > 0)) {
63  $error++;
64  }
65 
66  if (!$error)
67  {
68  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
69  } else {
70  setEventMessages($langs->trans("Error"), null, 'errors');
71  }
72 }
73 
74 // Activate a model
75 elseif ($action == 'set') {
76  $ret = addDocumentModel($value, $type, $label, $scandir);
77 } elseif ($action == 'del') {
78  $ret = delDocumentModel($value, $type);
79  if ($ret > 0)
80  {
81  if ($conf->global->TICKET_ADDON_PDF == "$value") dolibarr_del_const($db, 'TICKET_ADDON_PDF', $conf->entity);
82  }
83 }
84 
85 // Set default model
86 elseif ($action == 'setdoc') {
87  if (dolibarr_set_const($db, "TICKET_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
88  {
89  // The constant that was read before the new set
90  // We therefore requires a variable to have a coherent view
91  $conf->global->TICKET_ADDON_PDF = $value;
92  }
93 
94  // On active le modele
95  $ret = delDocumentModel($value, $type);
96  if ($ret > 0)
97  {
98  $ret = addDocumentModel($value, $type, $label, $scandir);
99  }
100 }
101 
102 elseif ($action == 'setmod') {
103  // TODO Verifier si module numerotation choisi peut etre active
104  // par appel methode canBeActivated
105 
106  dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity);
107 } elseif ($action == 'setvar') {
108  include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
109 
110  $notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha');
111  if (!empty($notification_email)) {
112  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity);
113  } else {
114  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity);
115  }
116  if (!($res > 0)) {
117  $error++;
118  }
119 
120  // altairis : differentiate notification email FROM and TO
121  $notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha');
122  if (!empty($notification_email_to)) {
123  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity);
124  } else {
125  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity);
126  }
127  if (!($res > 0)) {
128  $error++;
129  }
130 
131  $mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'restricthtml');
132  if (!empty($mail_intro)) {
133  $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
134  } else {
135  $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText'), 'chaine', 0, '', $conf->entity);
136  }
137  if (!($res > 0)) {
138  $error++;
139  }
140 
141  $mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'restricthtml');
142  if (!empty($mail_signature)) {
143  $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
144  } else {
145  $res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailSignatureText'), 'chaine', 0, '', $conf->entity);
146  }
147  if (!($res > 0)) {
148  $error++;
149  }
150 }
151 
152 if ($action == 'setvarother') {
153  $param_must_exists = GETPOST('TICKET_EMAIL_MUST_EXISTS', 'alpha');
154  $res = dolibarr_set_const($db, 'TICKET_EMAIL_MUST_EXISTS', $param_must_exists, 'chaine', 0, '', $conf->entity);
155  if (!($res > 0)) {
156  $error++;
157  }
158 
159  $param_disable_email = GETPOST('TICKET_DISABLE_NOTIFICATION_MAILS', 'alpha');
160  $res = dolibarr_set_const($db, 'TICKET_DISABLE_NOTIFICATION_MAILS', $param_disable_email, 'chaine', 0, '', $conf->entity);
161  if (!($res > 0)) {
162  $error++;
163  }
164 
165  if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
166  {
167  $param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha');
168  $res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
169  if (!($res > 0)) {
170  $error++;
171  }
172  }
173 
174  if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
175  {
176  $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
177  $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
178  if (!($res > 0)) {
179  $error++;
180  }
181  }
182 
183  $param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
184  $res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
185  if (!($res > 0)) {
186  $error++;
187  }
188 
189  $param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha');
190  $res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity);
191  if (!($res > 0)) {
192  $error++;
193  }
194 }
195 
196 
197 
198 /*
199  * View
200  */
201 
202 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
203 
204 $form = new Form($db);
205 
206 $help_url = "FR:Module_Ticket";
207 $page_name = "TicketSetup";
208 llxHeader('', $langs->trans($page_name), $help_url);
209 
210 // Subheader
211 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
212 
213 print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
214 
215 // Configuration header
216 $head = ticketAdminPrepareHead();
217 
218 print dol_get_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticket");
219 
220 print '<span class="opacitymedium">'.$langs->trans("TicketSetupDictionaries").'</span> : <a href="'.DOL_URL_ROOT.'/admin/dict.php">'.$langs->trans("ClickHereToGoTo", $langs->transnoentitiesnoconv("DictionarySetup")).'</a><br>';
221 
223 
224 
225 /*
226  * Tickets numbering model
227  */
228 
229 print load_fiche_titre($langs->trans("TicketNumberingModules"), '', '');
230 
231 print '<div class="div-table-responsive-no-min">';
232 print '<table class="noborder centpercent">';
233 print '<tr class="liste_titre">';
234 print '<td width="100">'.$langs->trans("Name").'</td>';
235 print '<td>'.$langs->trans("Description").'</td>';
236 print '<td>'.$langs->trans("Example").'</td>';
237 print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
238 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
239 print "</tr>\n";
240 
241 clearstatcache();
242 
243 foreach ($dirmodels as $reldir) {
244  $dir = dol_buildpath($reldir."core/modules/ticket");
245 
246  if (is_dir($dir)) {
247  $handle = opendir($dir);
248  if (is_resource($handle)) {
249  while (($file = readdir($handle)) !== false) {
250  if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) {
251  $file = $reg[1];
252  $classname = substr($file, 4);
253 
254  include_once $dir.'/'.$file.'.php';
255 
256  $module = new $file;
257 
258  // Show modules according to features level
259  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
260  continue;
261  }
262 
263  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
264  continue;
265  }
266 
267  if ($module->isEnabled()) {
268  print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
269  print $module->info();
270  print '</td>';
271 
272  // Show example of numbering model
273  print '<td class="nowrap">';
274  $tmp = $module->getExample();
275  if (preg_match('/^Error/', $tmp)) {
276  $langs->load("errors");
277  print '<div class="error">'.$langs->trans($tmp).'</div>';
278  } elseif ($tmp == 'NotConfigured') {
279  print $langs->trans($tmp);
280  } else {
281  print $tmp;
282  }
283 
284  print '</td>'."\n";
285 
286  print '<td class="center">';
287  if ($conf->global->TICKET_ADDON == 'mod_'.$classname) {
288  print img_picto($langs->trans("Activated"), 'switch_on');
289  } else {
290  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;token='.newToken().'&amp;value=mod_'.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
291  }
292  print '</td>';
293 
294  $ticket = new Ticket($db);
295  $ticket->initAsSpecimen();
296 
297  // Info
298  $htmltooltip = '';
299  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
300  $nextval = $module->getNextValue($mysoc, $ticket);
301  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
302  $htmltooltip .= ''.$langs->trans("NextValue").': ';
303  if ($nextval) {
304  $htmltooltip .= $nextval.'<br>';
305  } else {
306  $htmltooltip .= $langs->trans($module->error).'<br>';
307  }
308  }
309 
310  print '<td class="center">';
311  print $form->textwithpicto('', $htmltooltip, 1, 0);
312  print '</td>';
313 
314  print '</tr>';
315  }
316  }
317  }
318  closedir($handle);
319  }
320  }
321 }
322 
323 print '</table>';
324 print '</div>';
325 print '<br>';
326 
327 
328 
329 /*
330  * Document templates generators
331  */
332 
333 print load_fiche_titre($langs->trans("TicketsModelModule"), '', '');
334 
335 // Load array def with activated templates
336 $def = array();
337 $sql = "SELECT nom";
338 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
339 $sql .= " WHERE type = '".$db->escape($type)."'";
340 $sql .= " AND entity = ".$conf->entity;
341 $resql = $db->query($sql);
342 if ($resql)
343 {
344  $i = 0;
345  $num_rows = $db->num_rows($resql);
346  while ($i < $num_rows)
347  {
348  $array = $db->fetch_array($resql);
349  array_push($def, $array[0]);
350  $i++;
351  }
352 } else {
353  dol_print_error($db);
354 }
355 
356 
357 print '<div class="div-table-responsive-no-min">';
358 print "<table class=\"noborder\" width=\"100%\">\n";
359 print "<tr class=\"liste_titre\">\n";
360 print '<td>'.$langs->trans("Name").'</td>';
361 print '<td>'.$langs->trans("Description").'</td>';
362 print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
363 print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
364 print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
365 print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
366 print "</tr>\n";
367 
368 clearstatcache();
369 
370 foreach ($dirmodels as $reldir)
371 {
372  foreach (array('', '/doc') as $valdir)
373  {
374  $realpath = $reldir."core/modules/ticket".$valdir;
375  $dir = dol_buildpath($realpath);
376 
377  if (is_dir($dir))
378  {
379  $handle = opendir($dir);
380  if (is_resource($handle))
381  {
382  while (($file = readdir($handle)) !== false)
383  {
384  $filelist[] = $file;
385  }
386  closedir($handle);
387  arsort($filelist);
388 
389  foreach ($filelist as $file)
390  {
391  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
392  {
393  if (file_exists($dir.'/'.$file))
394  {
395  $name = substr($file, 4, dol_strlen($file) - 16);
396  $classname = substr($file, 0, dol_strlen($file) - 12);
397 
398  require_once $dir.'/'.$file;
399  $module = new $classname($db);
400 
401  $modulequalified = 1;
402  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
403  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
404 
405  if ($modulequalified)
406  {
407  print '<tr class="oddeven"><td width="100">';
408  print (empty($module->name) ? $name : $module->name);
409  print "</td><td>\n";
410  if (method_exists($module, 'info')) print $module->info($langs);
411  else print $module->description;
412  print '</td>';
413 
414  // Active
415  if (in_array($name, $def))
416  {
417  print '<td class="center">'."\n";
418  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
419  print img_picto($langs->trans("Enabled"), 'switch_on');
420  print '</a>';
421  print '</td>';
422  } else {
423  print '<td class="center">'."\n";
424  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
425  print "</td>";
426  }
427 
428  // Default
429  print '<td class="center">';
430  if ($conf->global->TICKET_ADDON_PDF == $name)
431  {
432  print img_picto($langs->trans("Default"), 'on');
433  } else {
434  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
435  }
436  print '</td>';
437 
438  // Info
439  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
440  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
441  if ($module->type == 'pdf')
442  {
443  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
444  }
445  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
446 
447  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
448  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
449  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
450  //$htmltooltip .= '<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
451  //$htmltooltip .= '<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
452  //$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
453 
454 
455  print '<td class="center">';
456  print $form->textwithpicto('', $htmltooltip, 1, 0);
457  print '</td>';
458 
459  // Preview
460  print '<td class="center">';
461  if ($module->type == 'pdf')
462  {
463  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
464  } else {
465  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
466  }
467  print '</td>';
468 
469  print "</tr>\n";
470  }
471  }
472  }
473  }
474  }
475  }
476  }
477 }
478 
479 print '</table>';
480 print '</div><br>';
481 
482 
483 if (!$conf->use_javascript_ajax) {
484  print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
485  print '<input type="hidden" name="token" value="'.newToken().'">';
486  print '<input type="hidden" name="action" value="setvarother">';
487 }
488 
489 print load_fiche_titre($langs->trans("Other"), '', '');
490 print '<table class="noborder centpercent">';
491 
492 print '<tr class="liste_titre">';
493 print '<td>'.$langs->trans("Parameter").'</td>';
494 print '<td></td>';
495 print '<td></td>';
496 print "</tr>\n";
497 
498 // Auto assign ticket at user who created it
499 print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
500 print '<td class="left">';
501 if ($conf->use_javascript_ajax) {
502  print ajax_constantonoff('TICKET_AUTO_ASSIGN_USER_CREATE');
503 } else {
504  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
505  print $form->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE);
506 }
507 print '</td>';
508 print '<td class="center">';
509 print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help');
510 print '</td>';
511 print '</tr>';
512 
513 print '</table><br>';
514 
515 if (!$conf->use_javascript_ajax) {
516  print '</form>';
517 }
518 
519 // Admin var of module
520 print load_fiche_titre($langs->trans("Notification"), '', '');
521 
522 print '<table class="noborder centpercent">';
523 
524 print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
525 print '<input type="hidden" name="token" value="'.newToken().'">';
526 print '<input type="hidden" name="action" value="setvar">';
527 
528 print '<tr class="liste_titre">';
529 print '<td colspan="3">'.$langs->trans("Email").'</td>';
530 print "</tr>\n";
531 
532 if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
533  print '<tr>';
534  print '<td colspan="3"><div class="info">'.$langs->trans("TicketCkEditorEmailNotActivated").'</div></td>';
535  print "</tr>\n";
536 }
537 
538 // @todo Use module notification instead...
539 
540 // Email d'envoi des notifications
541 print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationFrom").'</td>';
542 print '<td class="left">';
543 print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_FROM" value="'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'"></td>';
544 print '<td class="center">';
545 print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help');
546 print '</td>';
547 print '</tr>';
548 
549 // Email for notification of TICKET_CREATE
550 print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").' ('.$langs->trans("Creation").')</td>';
551 print '<td class="left">';
552 print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
553 print '<td class="center">';
554 print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
555 print '</td>';
556 print '</tr>';
557 
558 // Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation)
559 if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
560 {
561  print '<tr class="oddeven"><td>'.$langs->trans("TicketsEmailAlsoSendToMainAddress").'</td>';
562  print '<td class="left">';
563  if ($conf->use_javascript_ajax) {
564  print ajax_constantonoff('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS');
565  } else {
566  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
567  print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS);
568  }
569  print '</td>';
570  print '<td class="center">';
571  print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help');
572  print '</td>';
573  print '</tr>';
574 }
575 
576 // Texte d'introduction
577 $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText');
578 print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin").' ('.$langs->trans("Responses").')';
579 print '</td><td>';
580 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
581 $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
582 $doleditor->Create();
583 print '</td>';
584 print '<td class="center">';
585 print $form->textwithpicto('', $langs->trans("TicketMessageMailIntroHelpAdmin"), 1, 'help');
586 print '</td></tr>';
587 
588 // Texte de signature
589 $mail_signature = $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE : $langs->trans('TicketMessageMailSignatureText');
590 print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailSignatureLabelAdmin").'</label>';
591 print '</td><td>';
592 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
593 $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
594 $doleditor->Create();
595 print '</td>';
596 print '<td class="center">';
597 print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelpAdmin"), 1, 'help');
598 print '</td></tr>';
599 
600 print '</table>';
601 
602 print '<div class="center">';
603 print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
604 print '</div>';
605 
606 print '</form>';
607 
608 // End of page
609 llxFooter();
610 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1748
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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:575
addDocumentModel($name, $type, $label= '', $description= '')
Add document model used by doc generator.
Definition: admin.lib.php:1717
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Class to manage ticket.
llxHeader()
Empty header.
Definition: wrapper.php:45
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
ticketAdminPrepareHead()
Build tabs for admin page.
Definition: ticket.lib.php:31
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:499
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
Definition: ajax.lib.php:503
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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 ...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name &#39;newtoken&#39;.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage a WYSIWYG editor.
llxFooter()
Empty footer.
Definition: wrapper.php:59