fichinter.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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@capnetworks.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-2017 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 <http://www.gnu.org/licenses/>.
  23. */
  24. /**
  25. * \file htdocs/admin/fichinter.php
  26. * \ingroup fichinter
  27. * \brief Setup page of module Interventions
  28. */
  29. require '../main.inc.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  32. require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
  33. require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
  34. $langs->load("admin");
  35. $langs->load("errors");
  36. $langs->load("interventions");
  37. $langs->load('other');
  38. if (! $user->admin) accessforbidden();
  39. $action = GETPOST('action','alpha');
  40. $value = GETPOST('value','alpha');
  41. $label = GETPOST('label','alpha');
  42. $scandir = GETPOST('scandir','alpha');
  43. $type='ficheinter';
  44. /*
  45. * Actions
  46. */
  47. if ($action == 'updateMask')
  48. {
  49. $maskconst=GETPOST('maskconst','alpha');
  50. $maskvalue=GETPOST('maskvalue','alpha');
  51. if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
  52. if (! $res > 0) $error++;
  53. if (! $error)
  54. {
  55. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  56. }
  57. else
  58. {
  59. setEventMessages($langs->trans("Error"), null, 'errors');
  60. }
  61. }
  62. else if ($action == 'specimen') // For fiche inter
  63. {
  64. $modele= GETPOST('module','alpha');
  65. $inter = new Fichinter($db);
  66. $inter->initAsSpecimen();
  67. // Search template files
  68. $file=''; $classname=''; $filefound=0;
  69. $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
  70. foreach($dirmodels as $reldir)
  71. {
  72. $file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php",0);
  73. if (file_exists($file))
  74. {
  75. $filefound=1;
  76. $classname = "pdf_".$modele;
  77. break;
  78. }
  79. }
  80. if ($filefound)
  81. {
  82. require_once $file;
  83. $module = new $classname($db);
  84. if ($module->write_file($inter,$langs) > 0)
  85. {
  86. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
  87. return;
  88. }
  89. else
  90. {
  91. setEventMessages($module->error, $module->errors, 'errors');
  92. dol_syslog($module->error, LOG_ERR);
  93. }
  94. }
  95. else
  96. {
  97. setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
  98. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  99. }
  100. }
  101. // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
  102. if ($action == 'setModuleOptions')
  103. {
  104. $post_size=count($_POST);
  105. $db->begin();
  106. for($i=0;$i < $post_size;$i++)
  107. {
  108. if (array_key_exists('param'.$i,$_POST))
  109. {
  110. $param=GETPOST("param".$i,'alpha');
  111. $value=GETPOST("value".$i,'alpha');
  112. if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
  113. if (! $res > 0) $error++;
  114. }
  115. }
  116. if (! $error)
  117. {
  118. $db->commit();
  119. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  120. }
  121. else
  122. {
  123. $db->rollback();
  124. setEventMessages($langs->trans("Error"), null, 'errors');
  125. }
  126. }
  127. // Activate a model
  128. else if ($action == 'set')
  129. {
  130. $ret = addDocumentModel($value, $type, $label, $scandir);
  131. }
  132. else if ($action == 'del')
  133. {
  134. $ret = delDocumentModel($value, $type);
  135. if ($ret > 0)
  136. {
  137. if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity);
  138. }
  139. }
  140. // Set default model
  141. else if ($action == 'setdoc')
  142. {
  143. if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
  144. {
  145. // La constante qui a ete lue en avant du nouveau set
  146. // on passe donc par une variable pour avoir un affichage coherent
  147. $conf->global->FICHEINTER_ADDON_PDF = $value;
  148. }
  149. // On active le modele
  150. $ret = delDocumentModel($value, $type);
  151. if ($ret > 0)
  152. {
  153. $ret = addDocumentModel($value, $type, $label, $scandir);
  154. }
  155. }
  156. else if ($action == 'setmod')
  157. {
  158. // TODO Verifier si module numerotation choisi peut etre active
  159. // par appel methode canBeActivated
  160. dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
  161. }
  162. else if ($action == 'set_FICHINTER_FREE_TEXT')
  163. {
  164. $freetext= GETPOST('FICHINTER_FREE_TEXT'); // No alpha here, we want exact string
  165. $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
  166. if (! $res > 0) $error++;
  167. if (! $error)
  168. {
  169. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  170. }
  171. else
  172. {
  173. setEventMessages($langs->trans("Error"), null, 'errors');
  174. }
  175. }
  176. else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
  177. {
  178. $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
  179. $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
  180. if (! $res > 0) $error++;
  181. if (! $error)
  182. {
  183. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  184. }
  185. else
  186. {
  187. setEventMessages($langs->trans("Error"), null, 'errors');
  188. }
  189. }
  190. elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
  191. {
  192. $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha');
  193. $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on' ? 1 : 0),'bool',0,'',$conf->entity);
  194. if (! $res > 0) $error++;
  195. if (! $error)
  196. {
  197. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  198. }
  199. else
  200. {
  201. setEventMessages($langs->trans("Error"), null, 'errors');
  202. }
  203. } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
  204. $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
  205. $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
  206. $conf->entity);
  207. if (!$res > 0) {
  208. $error++;
  209. }
  210. if (!$error) {
  211. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  212. } else {
  213. setEventMessages($langs->trans("Error"), null, 'errors');
  214. }
  215. }
  216. /*
  217. * View
  218. */
  219. $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
  220. llxHeader();
  221. $form=new Form($db);
  222. $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  223. print load_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'title_setup');
  224. $head=fichinter_admin_prepare_head();
  225. dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
  226. // Interventions numbering model
  227. print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'','');
  228. print '<table class="noborder" width="100%">';
  229. print '<tr class="liste_titre">';
  230. print '<td width="100">'.$langs->trans("Name").'</td>';
  231. print '<td>'.$langs->trans("Description").'</td>';
  232. print '<td>'.$langs->trans("Example").'</td>';
  233. print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
  234. print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
  235. print "</tr>\n";
  236. clearstatcache();
  237. foreach ($dirmodels as $reldir)
  238. {
  239. $dir = dol_buildpath($reldir."core/modules/fichinter/");
  240. if (is_dir($dir))
  241. {
  242. $handle = opendir($dir);
  243. if (is_resource($handle))
  244. {
  245. while (($file = readdir($handle))!==false)
  246. {
  247. if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
  248. {
  249. $file = $reg[1];
  250. $classname = substr($file,4);
  251. require_once $dir.$file.'.php';
  252. $module = new $file;
  253. if ($module->isEnabled())
  254. {
  255. // Show modules according to features level
  256. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
  257. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
  258. print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
  259. print $module->info();
  260. print '</td>';
  261. // Show example of numbering model
  262. print '<td class="nowrap">';
  263. $tmp=$module->getExample();
  264. if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
  265. elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
  266. else print $tmp;
  267. print '</td>'."\n";
  268. print '<td align="center">';
  269. if ($conf->global->FICHEINTER_ADDON == $classname)
  270. {
  271. print img_picto($langs->trans("Activated"),'switch_on');
  272. }
  273. else
  274. {
  275. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
  276. }
  277. print '</td>';
  278. $ficheinter=new Fichinter($db);
  279. $ficheinter->initAsSpecimen();
  280. // Info
  281. $htmltooltip='';
  282. $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  283. $nextval=$module->getNextValue($mysoc,$ficheinter);
  284. if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
  285. $htmltooltip.=''.$langs->trans("NextValue").': ';
  286. if ($nextval) {
  287. if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
  288. $nextval = $langs->trans($nextval);
  289. $htmltooltip.=$nextval.'<br>';
  290. } else {
  291. $htmltooltip.=$langs->trans($module->error).'<br>';
  292. }
  293. }
  294. print '<td align="center">';
  295. print $form->textwithpicto('',$htmltooltip,1,0);
  296. print '</td>';
  297. print '</tr>';
  298. }
  299. }
  300. }
  301. closedir($handle);
  302. }
  303. }
  304. }
  305. print '</table><br>';
  306. /*
  307. * Documents models for Interventions
  308. */
  309. print load_fiche_titre($langs->trans("TemplatePDFInterventions"),'','');
  310. // Defini tableau def des modeles
  311. $type='ficheinter';
  312. $def = array();
  313. $sql = "SELECT nom";
  314. $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
  315. $sql.= " WHERE type = '".$type."'";
  316. $sql.= " AND entity = ".$conf->entity;
  317. $resql=$db->query($sql);
  318. if ($resql)
  319. {
  320. $i = 0;
  321. $num_rows=$db->num_rows($resql);
  322. while ($i < $num_rows)
  323. {
  324. $array = $db->fetch_array($resql);
  325. array_push($def, $array[0]);
  326. $i++;
  327. }
  328. }
  329. else
  330. {
  331. dol_print_error($db);
  332. }
  333. print '<table class="noborder" width="100%">';
  334. print '<tr class="liste_titre">';
  335. print '<td>'.$langs->trans("Name").'</td>';
  336. print '<td>'.$langs->trans("Description").'</td>';
  337. print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
  338. print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
  339. print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
  340. print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
  341. print "</tr>\n";
  342. clearstatcache();
  343. foreach ($dirmodels as $reldir)
  344. {
  345. $dir = dol_buildpath($reldir."core/modules/fichinter/doc/");
  346. if (is_dir($dir))
  347. {
  348. $handle=opendir($dir);
  349. if (is_resource($handle))
  350. {
  351. while (($file = readdir($handle))!==false)
  352. {
  353. $filelist[]=$file;
  354. }
  355. closedir($handle);
  356. arsort($filelist);
  357. foreach($filelist as $file)
  358. {
  359. if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
  360. {
  361. if (file_exists($dir.'/'.$file))
  362. {
  363. $name = substr($file, 4, dol_strlen($file) -16);
  364. $classname = substr($file, 0, dol_strlen($file) -12);
  365. require_once $dir.'/'.$file;
  366. $module = new $classname($db);
  367. $modulequalified=1;
  368. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
  369. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
  370. if ($modulequalified)
  371. {
  372. print '<tr class="oddeven"><td width="100">';
  373. print (empty($module->name)?$name:$module->name);
  374. print "</td><td>\n";
  375. if (method_exists($module,'info')) print $module->info($langs);
  376. else print $module->description;
  377. print '</td>';
  378. // Active
  379. if (in_array($name, $def))
  380. {
  381. print "<td align=\"center\">\n";
  382. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
  383. print img_picto($langs->trans("Enabled"),'switch_on');
  384. print '</a>';
  385. print "</td>";
  386. }
  387. else
  388. {
  389. print "<td align=\"center\">\n";
  390. print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
  391. print "</td>";
  392. }
  393. // Default
  394. print "<td align=\"center\">";
  395. if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
  396. {
  397. print img_picto($langs->trans("Default"),'on');
  398. }
  399. else
  400. {
  401. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  402. }
  403. print '</td>';
  404. // Info
  405. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  406. $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
  407. $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  408. $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  409. $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
  410. $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
  411. $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
  412. $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
  413. $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
  414. print '<td align="center">';
  415. print $form->textwithpicto('',$htmltooltip,-1,0);
  416. print '</td>';
  417. // Preview
  418. print '<td align="center">';
  419. if ($module->type == 'pdf')
  420. {
  421. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>';
  422. }
  423. else
  424. {
  425. print img_object($langs->trans("PreviewNotAvailable"),'generic');
  426. }
  427. print '</td>';
  428. print '</tr>';
  429. }
  430. }
  431. }
  432. }
  433. }
  434. }
  435. }
  436. print '</table>';
  437. print "<br>";
  438. /*
  439. * Other options
  440. *
  441. */
  442. print load_fiche_titre($langs->trans("OtherOptions"),'','');
  443. print '<table class="noborder" width="100%">';
  444. print '<tr class="liste_titre">';
  445. print '<td>'.$langs->trans("Parameter").'</td>';
  446. print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
  447. print "<td>&nbsp;</td>\n";
  448. print "</tr>\n";
  449. $substitutionarray=pdf_getSubstitutionArray($langs);
  450. $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
  451. $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
  452. foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
  453. $htmltext.='</i>';
  454. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  455. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  456. print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
  457. print '<tr class="oddeven"><td colspan="2">';
  458. print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext).'<br>';
  459. $variablename='FICHINTER_FREE_TEXT';
  460. if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
  461. {
  462. print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
  463. }
  464. else
  465. {
  466. include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  467. $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
  468. print $doleditor->Create();
  469. }
  470. print '</td><td align="right">';
  471. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  472. print "</td></tr>\n";
  473. print '</form>';
  474. //Use draft Watermark
  475. print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
  476. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  477. print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
  478. print '<tr class="oddeven"><td>';
  479. print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext).'<br>';
  480. print '</td><td>';
  481. print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
  482. print '</td><td align="right">';
  483. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  484. print "</td></tr>\n";
  485. print '</form>';
  486. // print products on fichinter
  487. $var=! $var;
  488. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  489. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  490. print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
  491. print '<tr class="oddeven"><td>';
  492. print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
  493. print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
  494. if ($conf->global->FICHINTER_PRINT_PRODUCTS)
  495. print 'checked ';
  496. print '/>';
  497. print '</td><td align="right">';
  498. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  499. print "</td></tr>\n";
  500. // Use services duration
  501. print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
  502. print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
  503. print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
  504. print '<tr class="oddeven">';
  505. print '<td>';
  506. print $langs->trans("UseServicesDurationOnFichinter");
  507. print '</td>';
  508. print '<td align="center">';
  509. print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"' . ($conf->global->FICHINTER_USE_SERVICE_DURATION?' checked':'') . '>';
  510. print '</td>';
  511. print '<td align="right">';
  512. print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
  513. print '</td>';
  514. print '</tr>';
  515. print '</form>';
  516. print '</table>';
  517. print '<br>';
  518. llxFooter();
  519. $db->close();