fichinter.php 21 KB

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