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
19/**
20 *     \file        admin/ticket.php
21 *     \ingroup     ticket
22 *     \brief       Page to setup module ticket
23 */
24
25require '../main.inc.php';
26require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
27require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
28require_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
34if (!$user->admin) {
35	accessforbidden();
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
52include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
53
54if ($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
75elseif ($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
86elseif ($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
102elseif ($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
152if ($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";
208llxHeader('', $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
213print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
214
215// Configuration header
216$head = ticketAdminPrepareHead();
217
218print dol_get_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticket");
219
220print '<span class="opacitymedium">'.$langs->trans("TicketSetupDictionaries").'</span> : <a href="'.DOL_URL_ROOT.'/admin/dict.php">'.$langs->trans("ClickHereToGoTo", $langs->transnoentitiesnoconv("DictionarySetup")).'</a><br>';
221
222print dol_get_fiche_end();
223
224
225/*
226 * Tickets numbering model
227 */
228
229print load_fiche_titre($langs->trans("TicketNumberingModules"), '', '');
230
231print '<div class="div-table-responsive-no-min">';
232print '<table class="noborder centpercent">';
233print '<tr class="liste_titre">';
234print '<td width="100">'.$langs->trans("Name").'</td>';
235print '<td>'.$langs->trans("Description").'</td>';
236print '<td>'.$langs->trans("Example").'</td>';
237print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
238print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
239print "</tr>\n";
240
241clearstatcache();
242
243foreach ($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
323print '</table>';
324print '</div>';
325print '<br>';
326
327
328
329/*
330 * Document templates generators
331 */
332
333print 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);
342if ($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
357print '<div class="div-table-responsive-no-min">';
358print "<table class=\"noborder\" width=\"100%\">\n";
359print "<tr class=\"liste_titre\">\n";
360print '<td>'.$langs->trans("Name").'</td>';
361print '<td>'.$langs->trans("Description").'</td>';
362print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
363print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
364print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
365print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
366print "</tr>\n";
367
368clearstatcache();
369
370foreach ($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
479print '</table>';
480print '</div><br>';
481
482
483if (!$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
489print load_fiche_titre($langs->trans("Other"), '', '');
490print '<table class="noborder centpercent">';
491
492print '<tr class="liste_titre">';
493print '<td>'.$langs->trans("Parameter").'</td>';
494print '<td></td>';
495print '<td></td>';
496print "</tr>\n";
497
498// Auto assign ticket at user who created it
499print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoAssignTicket").'</td>';
500print '<td class="left">';
501if ($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}
507print '</td>';
508print '<td class="center">';
509print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help');
510print '</td>';
511print '</tr>';
512
513print '</table><br>';
514
515if (!$conf->use_javascript_ajax) {
516	print '</form>';
517}
518
519// Admin var of module
520print load_fiche_titre($langs->trans("Notification"), '', '');
521
522print '<table class="noborder centpercent">';
523
524print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
525print '<input type="hidden" name="token" value="'.newToken().'">';
526print '<input type="hidden" name="action" value="setvar">';
527
528print '<tr class="liste_titre">';
529print '<td colspan="3">'.$langs->trans("Email").'</td>';
530print "</tr>\n";
531
532if (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
541print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationFrom").'</td>';
542print '<td class="left">';
543print '<input type="text" class="minwidth200" name="TICKET_NOTIFICATION_EMAIL_FROM" value="'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'"></td>';
544print '<td class="center">';
545print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help');
546print '</td>';
547print '</tr>';
548
549// Email for notification of TICKET_CREATE
550print '<tr class="oddeven"><td>'.$langs->trans("TicketEmailNotificationTo").' ('.$langs->trans("Creation").')</td>';
551print '<td class="left">';
552print '<input type="text" name="TICKET_NOTIFICATION_EMAIL_TO" value="'.(!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? $conf->global->TICKET_NOTIFICATION_EMAIL_TO : '').'"></td>';
553print '<td class="center">';
554print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help');
555print '</td>';
556print '</tr>';
557
558// Also send to TICKET_NOTIFICATION_EMAIL_TO for responses (not only creation)
559if ($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');
578print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin").' ('.$langs->trans("Responses").')';
579print '</td><td>';
580require_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();
583print '</td>';
584print '<td class="center">';
585print $form->textwithpicto('', $langs->trans("TicketMessageMailIntroHelpAdmin"), 1, 'help');
586print '</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');
590print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailSignatureLabelAdmin").'</label>';
591print '</td><td>';
592require_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();
595print '</td>';
596print '<td class="center">';
597print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelpAdmin"), 1, 'help');
598print '</td></tr>';
599
600print '</table>';
601
602print '<div class="center">';
603print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
604print '</div>';
605
606print '</form>';
607
608// End of page
609llxFooter();
610$db->close();
611