fichinter.php 21 KB

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