1<?php
2/* Copyright (C) 2003-2004 Rodolphe Quiedeville         <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur          <eldy@users.sourceforge.net>
4 * Copyright (C) 2004      Sebastien Di Cintio          <sdicintio@ressource-toi.org>
5 * Copyright (C) 2004      Benoit Mortier               <benoit.mortier@opensides.be>
6 * Copyright (C) 2005-2014 Regis Houssin                <regis.houssin@inodbox.com>
7 * Copyright (C) 2008      Raphael Bertrand (Resultic)  <raphael.bertrand@resultic.fr>
8 * Copyright (C) 2011-2013 Juanjo Menent			    <jmenent@2byte.es>
9 * Copyright (C) 2011-2018 Philippe Grand			    <philippe.grand@atoo-net.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
25/**
26 *	\file       htdocs/admin/fichinter.php
27 *	\ingroup    fichinter
28 *	\brief      Setup page of module Interventions
29 */
30
31require '../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
36
37// Load translation files required by the page
38$langs->loadLangs(array('admin', 'errors', 'interventions', 'other'));
39
40if (!$user->admin) accessforbidden();
41
42$action = GETPOST('action', 'aZ09');
43$value = GETPOST('value', 'alpha');
44$label = GETPOST('label', 'alpha');
45$scandir = GETPOST('scan_dir', 'alpha');
46$type = 'ficheinter';
47
48
49/*
50 * Actions
51 */
52
53include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
54
55if ($action == 'updateMask')
56{
57	$maskconst = GETPOST('maskconst', 'alpha');
58	$maskvalue = GETPOST('maskvalue', 'alpha');
59	if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
60
61	if (!($res > 0)) $error++;
62
63 	if (!$error)
64	{
65		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
66	} else {
67		setEventMessages($langs->trans("Error"), null, 'errors');
68	}
69} elseif ($action == 'specimen') // For fiche inter
70{
71	$modele = GETPOST('module', 'alpha');
72
73	$inter = new Fichinter($db);
74	$inter->initAsSpecimen();
75
76	// Search template files
77	$file = ''; $classname = ''; $filefound = 0;
78	$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
79	foreach ($dirmodels as $reldir)
80	{
81		$file = dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0);
82		if (file_exists($file))
83		{
84			$filefound = 1;
85			$classname = "pdf_".$modele;
86			break;
87		}
88	}
89
90	if ($filefound)
91	{
92		require_once $file;
93
94		$module = new $classname($db);
95
96		if ($module->write_file($inter, $langs) > 0)
97		{
98			header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
99			return;
100		} else {
101			setEventMessages($module->error, $module->errors, 'errors');
102			dol_syslog($module->error, LOG_ERR);
103		}
104	} else {
105		setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
106		dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
107	}
108}
109
110// Activate a model
111elseif ($action == 'set')
112{
113	$ret = addDocumentModel($value, $type, $label, $scandir);
114} elseif ($action == 'del')
115{
116	$ret = delDocumentModel($value, $type);
117	if ($ret > 0)
118	{
119		if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
120	}
121}
122
123// Set default model
124elseif ($action == 'setdoc')
125{
126	if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
127	{
128		// La constante qui a ete lue en avant du nouveau set
129		// on passe donc par une variable pour avoir un affichage coherent
130		$conf->global->FICHEINTER_ADDON_PDF = $value;
131	}
132
133	// On active le modele
134	$ret = delDocumentModel($value, $type);
135	if ($ret > 0)
136	{
137		$ret = addDocumentModel($value, $type, $label, $scandir);
138	}
139} elseif ($action == 'setmod')
140{
141	// TODO Verifier si module numerotation choisi peut etre active
142	// par appel methode canBeActivated
143
144	dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
145} elseif ($action == 'set_FICHINTER_FREE_TEXT')
146{
147	$freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
148	$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
149
150	if (!($res > 0)) $error++;
151
152 	if (!$error)
153	{
154		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
155	} else {
156		setEventMessages($langs->trans("Error"), null, 'errors');
157	}
158} elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
159{
160	$draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
161	$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
162
163	if (!($res > 0)) $error++;
164
165 	if (!$error)
166	{
167		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
168	} else {
169		setEventMessages($langs->trans("Error"), null, 'errors');
170	}
171} elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
172{
173	$val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha');
174	$res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
175
176	if (!($res > 0)) $error++;
177
178 	if (!$error)
179	{
180		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
181	} else {
182		setEventMessages($langs->trans("Error"), null, 'errors');
183	}
184} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
185	$val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
186	$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
187
188	if (!($res > 0)) {
189		$error++;
190	}
191
192	if (!$error) {
193		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
194	} else {
195		setEventMessages($langs->trans("Error"), null, 'errors');
196	}
197} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
198	$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
199	$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
200
201	if (!($res > 0)) {
202		$error++;
203	}
204
205	if (!$error) {
206		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
207	} else {
208		setEventMessages($langs->trans("Error"), null, 'errors');
209	}
210} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
211	$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
212	$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
213
214	if (!($res > 0)) {
215		$error++;
216	}
217
218	if (!$error) {
219		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
220	} else {
221		setEventMessages($langs->trans("Error"), null, 'errors');
222	}
223}
224
225
226
227/*
228 * View
229 */
230
231$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
232
233llxHeader();
234
235$form = new Form($db);
236
237$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
238print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
239
240
241$head = fichinter_admin_prepare_head();
242
243print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
244
245// Interventions numbering model
246
247print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
248
249print '<table class="noborder centpercent">';
250print '<tr class="liste_titre">';
251print '<td width="100">'.$langs->trans("Name").'</td>';
252print '<td>'.$langs->trans("Description").'</td>';
253print '<td>'.$langs->trans("Example").'</td>';
254print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
255print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
256print "</tr>\n";
257
258clearstatcache();
259
260foreach ($dirmodels as $reldir)
261{
262	$dir = dol_buildpath($reldir."core/modules/fichinter/");
263
264	if (is_dir($dir))
265	{
266		$handle = opendir($dir);
267		if (is_resource($handle))
268		{
269			while (($file = readdir($handle)) !== false)
270			{
271				if (preg_match('/^(mod_.*)\.php$/i', $file, $reg))
272				{
273					$file = $reg[1];
274					$classname = substr($file, 4);
275
276					require_once $dir.$file.'.php';
277
278					$module = new $file;
279
280					if ($module->isEnabled())
281					{
282						// Show modules according to features level
283						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
284						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
285
286
287						print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
288						print $module->info();
289						print '</td>';
290
291						// Show example of numbering model
292						print '<td class="nowrap">';
293						$tmp = $module->getExample();
294						if (preg_match('/^Error/', $tmp)) {
295							$langs->load("errors");
296							print '<div class="error">'.$langs->trans($tmp).'</div>';
297						} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
298						else print $tmp;
299						print '</td>'."\n";
300
301						print '<td class="center">';
302						if ($conf->global->FICHEINTER_ADDON == $classname)
303						{
304							print img_picto($langs->trans("Activated"), 'switch_on');
305						} else {
306							print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;token='.newToken().'&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
307						}
308						print '</td>';
309
310						$ficheinter = new Fichinter($db);
311						$ficheinter->initAsSpecimen();
312
313						// Info
314						$htmltooltip = '';
315						$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
316						$nextval = $module->getNextValue($mysoc, $ficheinter);
317						if ("$nextval" != $langs->trans("NotAvailable")) {   // Keep " on nextval
318							$htmltooltip .= ''.$langs->trans("NextValue").': ';
319							if ($nextval) {
320								if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
321									$nextval = $langs->trans($nextval);
322								$htmltooltip .= $nextval.'<br>';
323							} else {
324								$htmltooltip .= $langs->trans($module->error).'<br>';
325							}
326						}
327						print '<td class="center">';
328						print $form->textwithpicto('', $htmltooltip, 1, 0);
329						print '</td>';
330
331						print '</tr>';
332					}
333				}
334			}
335			closedir($handle);
336		}
337	}
338}
339
340print '</table><br>';
341
342
343/*
344 *  Documents models for Interventions
345 */
346
347print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
348
349// Defini tableau def des modeles
350$type = 'ficheinter';
351$def = array();
352$sql = "SELECT nom";
353$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
354$sql .= " WHERE type = '".$db->escape($type)."'";
355$sql .= " AND entity = ".$conf->entity;
356$resql = $db->query($sql);
357if ($resql)
358{
359	$i = 0;
360	$num_rows = $db->num_rows($resql);
361	while ($i < $num_rows)
362	{
363		$array = $db->fetch_array($resql);
364		array_push($def, $array[0]);
365		$i++;
366	}
367} else {
368	dol_print_error($db);
369}
370
371
372print '<table class="noborder centpercent">';
373print '<tr class="liste_titre">';
374print '<td>'.$langs->trans("Name").'</td>';
375print '<td>'.$langs->trans("Description").'</td>';
376print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
377print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
378print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
379print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
380print "</tr>\n";
381
382clearstatcache();
383
384foreach ($dirmodels as $reldir)
385{
386	$realpath = $reldir."core/modules/fichinter/doc";
387	$dir = dol_buildpath($realpath);
388
389	if (is_dir($dir))
390	{
391		$handle = opendir($dir);
392		if (is_resource($handle))
393		{
394			while (($file = readdir($handle)) !== false)
395			{
396				$filelist[] = $file;
397			}
398			closedir($handle);
399			arsort($filelist);
400
401			foreach ($filelist as $file)
402			{
403				if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
404				{
405					if (file_exists($dir.'/'.$file))
406					{
407						$name = substr($file, 4, dol_strlen($file) - 16);
408						$classname = substr($file, 0, dol_strlen($file) - 12);
409
410						require_once $dir.'/'.$file;
411						$module = new $classname($db);
412
413						$modulequalified = 1;
414						if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
415						if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
416
417						if ($modulequalified)
418						{
419							print '<tr class="oddeven"><td width="100">';
420							print (empty($module->name) ? $name : $module->name);
421							print "</td><td>\n";
422							if (method_exists($module, 'info')) print $module->info($langs);
423							else print $module->description;
424							print '</td>';
425
426							// Active
427							if (in_array($name, $def))
428							{
429								print "<td align=\"center\">\n";
430								print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
431								print img_picto($langs->trans("Enabled"), 'switch_on');
432								print '</a>';
433								print "</td>";
434							} else {
435								print "<td align=\"center\">\n";
436								print '<a 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>';
437								print "</td>";
438							}
439
440							// Default
441							print "<td align=\"center\">";
442							if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
443							{
444								print img_picto($langs->trans("Default"), 'on');
445							} else {
446								print '<a 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>';
447							}
448							print '</td>';
449
450							// Info
451							$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
452							$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
453							$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
454							$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
455
456							$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
457							$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
458							$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
459							$htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
460							$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
461							$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
462							print '<td class="center">';
463							print $form->textwithpicto('', $htmltooltip, -1, 0);
464							print '</td>';
465
466							// Preview
467							print '<td class="center">';
468							if ($module->type == 'pdf')
469							{
470								print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
471							} else {
472								print img_object($langs->trans("PreviewNotAvailable"), 'generic');
473							}
474							print '</td>';
475
476							print '</tr>';
477						}
478					}
479				}
480			}
481		}
482	}
483}
484
485print '</table>';
486print "<br>";
487
488/*
489 * Other options
490 */
491
492print load_fiche_titre($langs->trans("OtherOptions"), '', '');
493print '<table class="noborder centpercent">';
494print '<tr class="liste_titre">';
495print '<td>'.$langs->trans("Parameter").'</td>';
496print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
497print "<td>&nbsp;</td>\n";
498print "</tr>\n";
499
500$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
501$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
502$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
503foreach ($substitutionarray as $key => $val)	$htmltext .= $key.'<br>';
504$htmltext .= '</i>';
505
506print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
507print '<input type="hidden" name="token" value="'.newToken().'">';
508print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
509print '<tr class="oddeven"><td colspan="2">';
510print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
511$variablename = 'FICHINTER_FREE_TEXT';
512if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
513{
514	print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
515} else {
516	include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
517	$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
518	print $doleditor->Create();
519}
520print '</td><td class="right">';
521print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
522print "</td></tr>\n";
523print '</form>';
524
525//Use draft Watermark
526print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
527print '<input type="hidden" name="token" value="'.newToken().'">';
528print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
529print '<tr class="oddeven"><td>';
530print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
531print '</td><td>';
532print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
533print '</td><td class="right">';
534print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
535print "</td></tr>\n";
536print '</form>';
537// print products on fichinter
538print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
539print '<input type="hidden" name="token" value="'.newToken().'">';
540print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
541print '<tr class="oddeven"><td>';
542print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
543print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
544if ($conf->global->FICHINTER_PRINT_PRODUCTS)
545	print 'checked ';
546print '/>';
547print '</td><td class="right">';
548print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
549print "</td></tr>\n";
550print '</form>';
551// Use services duration
552print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
553print '<input type="hidden" name="token" value="'.newToken().'">';
554print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
555print '<tr class="oddeven">';
556print '<td>';
557print $langs->trans("UseServicesDurationOnFichinter");
558print '</td>';
559print '<td class="center">';
560print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.($conf->global->FICHINTER_USE_SERVICE_DURATION ? ' checked' : '').'>';
561print '</td>';
562print '<td class="right">';
563print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
564print '</td>';
565print '</tr>';
566print '</form>';
567// Use duration
568print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
569print '<input type="hidden" name="token" value="'.newToken().'">';
570print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
571print '<tr class="oddeven">';
572print '<td>';
573print $langs->trans("UseDurationOnFichinter");
574print '</td>';
575print '<td class="center">';
576print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.($conf->global->FICHINTER_WITHOUT_DURATION ? ' checked' : '').'>';
577print '</td>';
578print '<td class="right">';
579print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
580print '</td>';
581print '</tr>';
582print '</form>';
583// use date without hour
584print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
585print '<input type="hidden" name="token" value="'.newToken().'">';
586print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
587print '<tr class="oddeven">';
588print '<td>';
589print $langs->trans("UseDateWithoutHourOnFichinter");
590print '</td>';
591print '<td class="center">';
592print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.($conf->global->FICHINTER_DATE_WITHOUT_HOUR ? ' checked' : '').'>';
593print '</td>';
594print '<td class="right">';
595print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
596print '</td>';
597print '</tr>';
598print '</form>';
599
600print '</table>';
601
602print '<br>';
603
604// End of page
605llxFooter();
606$db->close();
607