expensereport.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. <?php
  2. /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2015 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-2022 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/expensereport.php
  26. * \ingroup expensereport
  27. * \brief Setup page of module ExpenseReport
  28. */
  29. // Load Dolibarr environment
  30. require '../main.inc.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  32. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  33. require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
  34. require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
  35. // Load translation files required by the page
  36. $langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
  37. if (!$user->admin) {
  38. accessforbidden();
  39. }
  40. $action = GETPOST('action', 'aZ09');
  41. $value = GETPOST('value', 'alpha');
  42. $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
  43. $label = GETPOST('label', 'alpha');
  44. $scandir = GETPOST('scan_dir', 'alpha');
  45. $type = 'expensereport';
  46. /*
  47. * Actions
  48. */
  49. include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
  50. if ($action == 'updateMask') {
  51. $maskconst = GETPOST('maskconst', 'aZ09');
  52. $maskvalue = GETPOST('maskvalue', 'alpha');
  53. if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
  54. $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
  55. }
  56. if (!($res > 0)) {
  57. $error++;
  58. }
  59. if (!$error) {
  60. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  61. } else {
  62. setEventMessages($langs->trans("Error"), null, 'errors');
  63. }
  64. } elseif ($action == 'specimen') { // For fiche expensereport
  65. $modele = GETPOST('module', 'alpha');
  66. $expensespecimen = new ExpenseReport($db);
  67. $expensespecimen->initAsSpecimen();
  68. $expensespecimen->status = 0; // Force statut draft to show watermark
  69. // Search template files
  70. $file = '';
  71. $classname = '';
  72. $filefound = 0;
  73. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  74. foreach ($dirmodels as $reldir) {
  75. $file = dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0);
  76. if (file_exists($file)) {
  77. $filefound = 1;
  78. $classname = "pdf_".$modele;
  79. break;
  80. }
  81. }
  82. if ($filefound) {
  83. require_once $file;
  84. $module = new $classname($db);
  85. if ($module->write_file($expensespecimen, $langs) > 0) {
  86. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
  87. return;
  88. } else {
  89. setEventMessages($module->error, $module->errors, 'errors');
  90. dol_syslog($module->error, LOG_ERR);
  91. }
  92. } else {
  93. setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
  94. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  95. }
  96. } elseif ($action == 'set') {
  97. // Activate a model
  98. $ret = addDocumentModel($value, $type, $label, $scandir);
  99. if ($ret > 0 && !getDolGlobalString('EXPENSEREPORT_ADDON_PDF')) {
  100. dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity);
  101. }
  102. } elseif ($action == 'del') {
  103. $ret = delDocumentModel($value, $type);
  104. if ($ret > 0) {
  105. if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") {
  106. dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF', $conf->entity);
  107. }
  108. }
  109. } elseif ($action == 'setdoc') {
  110. // Set default model
  111. if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
  112. // La constante qui a ete lue en avant du nouveau set
  113. // on passe donc par une variable pour avoir un affichage coherent
  114. $conf->global->EXPENSEREPORT_ADDON_PDF = $value;
  115. }
  116. // On active le modele
  117. $ret = delDocumentModel($value, $type);
  118. if ($ret > 0) {
  119. $ret = addDocumentModel($value, $type, $label, $scandir);
  120. }
  121. } elseif ($action == 'setmod') {
  122. // TODO Verifier si module numerotation choisi peut etre active
  123. // par appel methode canBeActivated
  124. dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity);
  125. } elseif ($action == 'setoptions') {
  126. $db->begin();
  127. $freetext = GETPOST('EXPENSEREPORT_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
  128. $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
  129. $draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
  130. $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
  131. $res3 = 0;
  132. if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
  133. $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
  134. }
  135. $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
  136. $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
  137. $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
  138. $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
  139. if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
  140. $error++;
  141. }
  142. if (!$error) {
  143. $db->commit();
  144. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  145. } else {
  146. $db->rollback();
  147. setEventMessages($langs->trans("Error"), null, 'errors');
  148. }
  149. }
  150. /*
  151. * View
  152. */
  153. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  154. llxHeader('', $langs->trans("ExpenseReportsSetup"));
  155. $form = new Form($db);
  156. $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
  157. print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
  158. $head = expensereport_admin_prepare_head();
  159. print dol_get_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip');
  160. /*
  161. * Expense report numbering model
  162. */
  163. print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', '');
  164. print '<table class="noborder centpercent">';
  165. print '<tr class="liste_titre">';
  166. print '<td>'.$langs->trans("Name").'</td>';
  167. print '<td>'.$langs->trans("Description").'</td>';
  168. print '<td class="nowrap">'.$langs->trans("Example").'</td>';
  169. print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
  170. print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
  171. print '</tr>'."\n";
  172. clearstatcache();
  173. foreach ($dirmodels as $reldir) {
  174. $dir = dol_buildpath($reldir."core/modules/expensereport/");
  175. if (is_dir($dir)) {
  176. $handle = opendir($dir);
  177. if (is_resource($handle)) {
  178. while (($file = readdir($handle)) !== false) {
  179. if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
  180. $file = substr($file, 0, dol_strlen($file) - 4);
  181. require_once $dir.$file.'.php';
  182. $module = new $file($db);
  183. // Show modules according to features level
  184. if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
  185. continue;
  186. }
  187. if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
  188. continue;
  189. }
  190. if ($module->isEnabled()) {
  191. print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
  192. print $module->info($langs);
  193. print '</td>';
  194. // Show example of numbering model
  195. print '<td class="nowrap">';
  196. $tmp = $module->getExample();
  197. if (preg_match('/^Error/', $tmp)) {
  198. $langs->load("errors");
  199. print '<div class="error">'.$langs->trans($tmp).'</div>';
  200. } elseif ($tmp == 'NotConfigured') {
  201. print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
  202. } else {
  203. print $tmp;
  204. }
  205. print '</td>'."\n";
  206. print '<td class="center">';
  207. if ($conf->global->EXPENSEREPORT_ADDON == $file) {
  208. print img_picto($langs->trans("Activated"), 'switch_on');
  209. } else {
  210. print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
  211. print img_picto($langs->trans("Disabled"), 'switch_off');
  212. print '</a>';
  213. }
  214. print '</td>';
  215. $exp = new ExpenseReport($db);
  216. $exp->initAsSpecimen();
  217. // Info
  218. $htmltooltip = '';
  219. $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  220. $nextval = $module->getNextValue($exp);
  221. if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
  222. $htmltooltip .= ''.$langs->trans("NextValue").': ';
  223. if ($nextval) {
  224. if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
  225. $nextval = $langs->trans($nextval);
  226. }
  227. $htmltooltip .= $nextval.'<br>';
  228. } else {
  229. $htmltooltip .= $langs->trans($module->error).'<br>';
  230. }
  231. }
  232. print '<td class="center">';
  233. print $form->textwithpicto('', $htmltooltip, 1, 0);
  234. print '</td>';
  235. print "</tr>\n";
  236. }
  237. }
  238. }
  239. closedir($handle);
  240. }
  241. }
  242. }
  243. print "</table><br>\n";
  244. /*
  245. * Documents models for ExpenseReport
  246. */
  247. print load_fiche_titre($langs->trans("TemplatePDFExpenseReports"), '', '');
  248. // Defini tableau def des modeles
  249. $type = 'expensereport';
  250. $def = array();
  251. $sql = "SELECT nom";
  252. $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
  253. $sql .= " WHERE type = '".$db->escape($type)."'";
  254. $sql .= " AND entity = ".$conf->entity;
  255. $resql = $db->query($sql);
  256. if ($resql) {
  257. $i = 0;
  258. $num_rows = $db->num_rows($resql);
  259. while ($i < $num_rows) {
  260. $array = $db->fetch_array($resql);
  261. array_push($def, $array[0]);
  262. $i++;
  263. }
  264. } else {
  265. dol_print_error($db);
  266. }
  267. print '<table class="noborder centpercent">';
  268. print '<tr class="liste_titre">';
  269. print '<td>'.$langs->trans("Name").'</td>';
  270. print '<td>'.$langs->trans("Description").'</td>';
  271. print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
  272. print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
  273. print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
  274. print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
  275. print "</tr>\n";
  276. clearstatcache();
  277. foreach ($dirmodels as $reldir) {
  278. $dir = dol_buildpath($reldir."core/modules/expensereport/doc");
  279. if (is_dir($dir)) {
  280. $handle = opendir($dir);
  281. if (is_resource($handle)) {
  282. while (($file = readdir($handle)) !== false) {
  283. $filelist[] = $file;
  284. }
  285. closedir($handle);
  286. arsort($filelist);
  287. foreach ($filelist as $file) {
  288. if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
  289. if (file_exists($dir.'/'.$file)) {
  290. $name = substr($file, 4, dol_strlen($file) - 16);
  291. $classname = substr($file, 0, dol_strlen($file) - 12);
  292. require_once $dir.'/'.$file;
  293. $module = new $classname($db);
  294. $modulequalified = 1;
  295. if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
  296. $modulequalified = 0;
  297. }
  298. if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
  299. $modulequalified = 0;
  300. }
  301. if ($modulequalified) {
  302. print '<tr class="oddeven"><td width="100">';
  303. print(empty($module->name) ? $name : $module->name);
  304. print "</td><td>\n";
  305. if (method_exists($module, 'info')) {
  306. print $module->info($langs);
  307. } else {
  308. print $module->description;
  309. }
  310. print '</td>';
  311. // Active
  312. if (in_array($name, $def)) {
  313. print '<td class="center">'."\n";
  314. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
  315. print img_picto($langs->trans("Enabled"), 'switch_on');
  316. print '</a>';
  317. print "</td>";
  318. } else {
  319. print '<td class="center">'."\n";
  320. 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>';
  321. print "</td>";
  322. }
  323. // Default
  324. print '<td class="center">';
  325. if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") {
  326. print img_picto($langs->trans("Default"), 'on');
  327. } else {
  328. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
  329. }
  330. print '</td>';
  331. // Info
  332. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  333. $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
  334. $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  335. $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  336. $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
  337. $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
  338. $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
  339. $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
  340. $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
  341. print '<td class="center">';
  342. print $form->textwithpicto('', $htmltooltip, -1, 0);
  343. print '</td>';
  344. // Preview
  345. print '<td class="center">';
  346. if ($module->type == 'pdf') {
  347. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
  348. } else {
  349. print img_object($langs->trans("PreviewNotAvailable"), 'generic');
  350. }
  351. print '</td>';
  352. print '</tr>';
  353. }
  354. }
  355. }
  356. }
  357. }
  358. }
  359. }
  360. print '</table>';
  361. print '<br>';
  362. /*
  363. * Other options
  364. */
  365. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  366. print '<input type="hidden" name="token" value="'.newToken().'">';
  367. print '<input type="hidden" name="action" value="setoptions">';
  368. print load_fiche_titre($langs->trans("OtherOptions"), '', '');
  369. print '<table class="noborder centpercent">';
  370. print '<tr class="liste_titre">';
  371. print '<td>'.$langs->trans("Parameter").'</td>';
  372. print '<td class="center" width="60"></td>';
  373. print "</tr>\n";
  374. $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
  375. $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
  376. $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
  377. foreach ($substitutionarray as $key => $val) {
  378. $htmltext .= $key.'<br>';
  379. }
  380. $htmltext .= '</i>';
  381. print '<tr class="oddeven"><td colspan="2">';
  382. print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
  383. $variablename = 'EXPENSEREPORT_FREE_TEXT';
  384. if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
  385. print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
  386. } else {
  387. include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  388. $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
  389. print $doleditor->Create();
  390. }
  391. print '</td></tr>'."\n";
  392. // Use draft Watermark
  393. print '<tr class="oddeven"><td colspan="2">';
  394. print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
  395. print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
  396. print '</td></tr>'."\n";
  397. if (isModEnabled('project')) {
  398. print '<tr class="oddeven"><td>';
  399. print $langs->trans('ProjectIsRequiredOnExpenseReports');
  400. print '</td><td class="right">';
  401. print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', !getDolGlobalString('EXPENSEREPORT_PROJECT_IS_REQUIRED') ? 0 : 1, 1);
  402. print '</td></tr>';
  403. }
  404. print '<tr class="oddeven"><td>';
  405. print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
  406. print '</td><td class="right">';
  407. print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', !getDolGlobalString('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH') ? 0 : 1, 1);
  408. print '</td></tr>';
  409. print '<tr class="oddeven"><td>';
  410. print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
  411. print '</td><td class="right">';
  412. print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', !getDolGlobalString('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY') ? 0 : 1, 1);
  413. print '</td></tr>';
  414. print '</table>';
  415. print $form->buttonsSaveCancel("Save", '');
  416. print '</form>';
  417. print dol_get_fiche_end();
  418. // End of page
  419. llxFooter();
  420. $db->close();