notification.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.org>
  4. * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
  5. * Copyright (C) 2015 Bahfir Abbes <contact@dolibarrpar.org>
  6. * Copyright (C) 2020 Thibault FOUCART <suport@ptibogxiv.net>
  7. * Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. */
  22. /**
  23. * \file htdocs/admin/notification.php
  24. * \ingroup notification
  25. * \brief Page to setup notification module
  26. */
  27. require '../main.inc.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
  31. // Load translation files required by the page
  32. $langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails'));
  33. // Security check
  34. if (!$user->admin) {
  35. accessforbidden();
  36. }
  37. $action = GETPOST('action', 'aZ09');
  38. $error = 0;
  39. /*
  40. * Actions
  41. */
  42. // Action to update or add a constant
  43. if ($action == 'settemplates' && $user->admin) {
  44. $db->begin();
  45. if (!$error && is_array($_POST)) {
  46. $reg = array();
  47. foreach ($_POST as $key => $val) {
  48. if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) {
  49. continue;
  50. }
  51. $triggername = $reg[1];
  52. $constvalue = GETPOST($key, 'alpha');
  53. $consttype = 'emailtemplate:xxx';
  54. $tmparray = explode(':', $constvalue);
  55. if (!empty($tmparray[0]) && !empty($tmparray[1])) {
  56. $constvalue = $tmparray[0];
  57. $consttype = 'emailtemplate:'.$tmparray[1];
  58. //var_dump($constvalue);
  59. //var_dump($consttype);
  60. $res = dolibarr_set_const($db, $triggername.'_TEMPLATE', $constvalue, $consttype, 0, '', $conf->entity);
  61. if ($res < 0) {
  62. $error++;
  63. break;
  64. }
  65. } else {
  66. $res = dolibarr_del_const($db, $triggername.'_TEMPLATE', $conf->entity);
  67. }
  68. }
  69. }
  70. if (!$error) {
  71. $db->commit();
  72. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  73. } else {
  74. $db->rollback();
  75. setEventMessages($langs->trans("Error"), null, 'errors');
  76. }
  77. }
  78. if ($action == 'setvalue' && $user->admin) {
  79. $db->begin();
  80. $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
  81. if ($result < 0) {
  82. $error++;
  83. }
  84. $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE", GETPOST("notif_disable", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
  85. if ($result < 0) {
  86. $error++;
  87. }
  88. if (!$error) {
  89. $db->commit();
  90. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  91. } else {
  92. $db->rollback();
  93. setEventMessages($langs->trans("Error"), null, 'errors');
  94. }
  95. }
  96. if ($action == 'setfixednotif' && $user->admin) {
  97. $db->begin();
  98. if (!$error && is_array($_POST)) {
  99. $reg = array();
  100. foreach ($_POST as $key => $val) {
  101. if (!preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) {
  102. continue;
  103. }
  104. $newval = '';
  105. $newkey = '';
  106. $shortkey = preg_replace('/_key$/', '', $key);
  107. //print $shortkey.'<br>';
  108. if (preg_match('/^NOTIF_(.*)_old_(.*)_key/', $key, $reg)) {
  109. dolibarr_del_const($db, 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.$reg[2], $conf->entity);
  110. $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
  111. $newval = GETPOST($shortkey.'_key');
  112. //print $newkey.' - '.$newval.'<br>';
  113. } elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg)) {
  114. // Add a new entry
  115. $newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
  116. $newval = GETPOST($shortkey.'_key');
  117. }
  118. if ($newkey && $newval) {
  119. $result = dolibarr_set_const($db, $newkey, $newval, 'chaine', 0, '', $conf->entity);
  120. }
  121. }
  122. }
  123. if (!$error) {
  124. $db->commit();
  125. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  126. } else {
  127. $db->rollback();
  128. setEventMessages($langs->trans("Error"), null, 'errors');
  129. }
  130. }
  131. /*
  132. * View
  133. */
  134. $form = new Form($db);
  135. $notify = new Notify($db);
  136. llxHeader('', $langs->trans("NotificationSetup"));
  137. $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
  138. print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_setup');
  139. print '<span class="opacitymedium">';
  140. print $langs->trans("NotificationsDesc").'<br>';
  141. print $langs->trans("NotificationsDescUser").'<br>';
  142. if (!empty($conf->societe->enabled)) {
  143. print $langs->trans("NotificationsDescContact").'<br>';
  144. }
  145. print $langs->trans("NotificationsDescGlobal").'<br>';
  146. print '</span>';
  147. print '<br>';
  148. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  149. print '<input type="hidden" name="token" value="'.newToken().'">';
  150. print '<input type="hidden" name="action" value="setvalue">';
  151. print '<div class="div-table-responsive">';
  152. print '<table class="noborder centpercent">';
  153. print '<tr class="liste_titre">';
  154. print '<td>'.$langs->trans("Parameter").'</td>';
  155. print '<td>'.$langs->trans("Value").'</td>';
  156. print "</tr>\n";
  157. print '<tr class="oddeven"><td>';
  158. print $langs->trans("NotificationEMailFrom").'</td>';
  159. print '<td>';
  160. print img_picto('', 'email', 'class="pictofixedwidth"');
  161. print '<input class="width150 quatrevingtpercentminusx" type="email" name="email_from" value="'.getDolGlobalString('NOTIFICATION_EMAIL_FROM').'">';
  162. if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->global->NOTIFICATION_EMAIL_FROM)) {
  163. print ' '.img_warning($langs->trans("ErrorBadEMail"));
  164. }
  165. print '</td>';
  166. print '</tr>';
  167. print '<tr class="oddeven"><td>';
  168. print $langs->trans("NotificationDisableConfirmMessageContact").'</td>';
  169. print '<td>';
  170. if ($conf->use_javascript_ajax) {
  171. print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT');
  172. } else {
  173. $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
  174. print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_CONTACT'));
  175. }
  176. print '</td>';
  177. print '</tr>';
  178. print '<tr class="oddeven"><td>';
  179. print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
  180. print '<td>';
  181. if ($conf->use_javascript_ajax) {
  182. print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER');
  183. } else {
  184. $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
  185. print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER'));
  186. }
  187. print '</td>';
  188. print '</tr>';
  189. print '<tr class="oddeven"><td>';
  190. print $langs->trans("NotificationDisableConfirmMessageFix").'</td>';
  191. print '<td>';
  192. if ($conf->use_javascript_ajax) {
  193. print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX');
  194. } else {
  195. $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
  196. print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, getDolGlobalString('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX'));
  197. }
  198. print '</td>';
  199. print '</tr>';
  200. print '</table>';
  201. print '</div>';
  202. print $form->buttonsSaveCancel("Save", '');
  203. print '</form>';
  204. print '<br><br>';
  205. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  206. print '<input type="hidden" name="token" value="'.newToken().'">';
  207. print '<input type="hidden" name="action" value="settemplates">';
  208. // Notification per contacts
  209. $title = $langs->trans("TemplatesForNotifications");
  210. print load_fiche_titre($title, '', 'email');
  211. // Load array of available notifications
  212. $notificationtrigger = new InterfaceNotification($db);
  213. $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
  214. // Editing global variables not related to a specific theme
  215. $constantes = array();
  216. foreach ($listofnotifiedevents as $notifiedevent) {
  217. $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
  218. $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
  219. $model = $notifiedevent['elementtype'];
  220. if ($notifiedevent['elementtype'] == 'order_supplier') {
  221. $elementLabel = $langs->trans('SupplierOrder');
  222. } elseif ($notifiedevent['elementtype'] == 'propal') {
  223. $elementLabel = $langs->trans('Proposal');
  224. } elseif ($notifiedevent['elementtype'] == 'facture') {
  225. $elementLabel = $langs->trans('Bill');
  226. } elseif ($notifiedevent['elementtype'] == 'commande') {
  227. $elementLabel = $langs->trans('Order');
  228. } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
  229. $elementLabel = $langs->trans('Intervention');
  230. } elseif ($notifiedevent['elementtype'] == 'shipping') {
  231. $elementLabel = $langs->trans('Shipping');
  232. } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
  233. $elementLabel = $langs->trans('ExpenseReport');
  234. }
  235. if ($notifiedevent['elementtype'] == 'propal') {
  236. $model = 'propal_send';
  237. } elseif ($notifiedevent['elementtype'] == 'commande') {
  238. $model = 'order_send';
  239. } elseif ($notifiedevent['elementtype'] == 'facture') {
  240. $model = 'facture_send';
  241. } elseif ($notifiedevent['elementtype'] == 'shipping') {
  242. $model = 'shipping_send';
  243. } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
  244. $model = 'fichinter_send';
  245. } elseif ($notifiedevent['elementtype'] == 'expensereport') {
  246. $model = 'expensereport_send';
  247. } elseif ($notifiedevent['elementtype'] == 'order_supplier') {
  248. $model = 'order_supplier_send';
  249. // } elseif ($notifiedevent['elementtype'] == 'invoice_supplier') $model = 'invoice_supplier_send';
  250. } elseif ($notifiedevent['elementtype'] == 'member') {
  251. $model = 'member';
  252. }
  253. $constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
  254. }
  255. $helptext = '';
  256. form_constantes($constantes, 3, $helptext, 'EmailTemplate');
  257. print $form->buttonsSaveCancel("Save", '');
  258. /*
  259. } else {
  260. print '<table class="noborder centpercent">';
  261. print '<tr class="liste_titre">';
  262. print '<td>'.$langs->trans("Label").'</td>';
  263. //print '<td class="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
  264. print "</tr>\n";
  265. print '<tr class="oddeven">';
  266. print '<td>';
  267. $i = 0;
  268. foreach ($listofnotifiedevents as $notifiedevent) {
  269. $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
  270. $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
  271. if ($notifiedevent['elementtype'] == 'order_supplier') {
  272. $elementLabel = $langs->trans('SupplierOrder');
  273. } elseif ($notifiedevent['elementtype'] == 'propal') {
  274. $elementLabel = $langs->trans('Proposal');
  275. } elseif ($notifiedevent['elementtype'] == 'facture') {
  276. $elementLabel = $langs->trans('Bill');
  277. } elseif ($notifiedevent['elementtype'] == 'commande') {
  278. $elementLabel = $langs->trans('Order');
  279. } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
  280. $elementLabel = $langs->trans('Intervention');
  281. } elseif ($notifiedevent['elementtype'] == 'shipping') {
  282. $elementLabel = $langs->trans('Shipping');
  283. } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
  284. $elementLabel = $langs->trans('ExpenseReport');
  285. }
  286. if ($i) {
  287. print ', ';
  288. }
  289. print $label;
  290. $i++;
  291. }
  292. print '</td></tr>';
  293. print '</table>';
  294. print '<div class="opacitymedium">';
  295. print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
  296. if (!empty($conf->societe->enabled)) {
  297. print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
  298. }
  299. print '</div>';
  300. }
  301. */
  302. print '</form>';
  303. print '<br><br>';
  304. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  305. print '<input type="hidden" name="token" value="'.newToken().'">';
  306. print '<input type="hidden" name="action" value="setfixednotif">';
  307. print '<input type="hidden" name="page_y" value="">';
  308. print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', 'email');
  309. print '<div class="info">';
  310. print $langs->trans("Note").':<br>';
  311. print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
  312. if (!empty($conf->societe->enabled)) {
  313. print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
  314. }
  315. print '</div>';
  316. print '<div class="div-table-responsive">';
  317. print '<table class="noborder centpercent">';
  318. print '<tr class="liste_titre">';
  319. print '<td>'.$langs->trans("Module").'</td>';
  320. print '<td>'.$langs->trans("Code").'</td>';
  321. print '<td>'.$langs->trans("Label").'</td>';
  322. print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
  323. print '<td>'.$langs->trans("Threshold").'</td>';
  324. print '<td></td>';
  325. print "</tr>\n";
  326. foreach ($listofnotifiedevents as $notifiedevent) {
  327. $label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
  328. $elementPicto = $notifiedevent['elementtype'];
  329. $elementLabel = $langs->trans(ucfirst($notifiedevent['elementtype']));
  330. // Special cases
  331. if ($notifiedevent['elementtype'] == 'order_supplier') {
  332. $elementPicto = 'supplier_order';
  333. $elementLabel = $langs->trans('SupplierOrder');
  334. } elseif ($notifiedevent['elementtype'] == 'propal') {
  335. $elementLabel = $langs->trans('Proposal');
  336. } elseif ($notifiedevent['elementtype'] == 'facture') {
  337. $elementPicto = 'bill';
  338. $elementLabel = $langs->trans('Bill');
  339. } elseif ($notifiedevent['elementtype'] == 'commande') {
  340. $elementPicto = 'order';
  341. $elementLabel = $langs->trans('Order');
  342. } elseif ($notifiedevent['elementtype'] == 'ficheinter') {
  343. $elementPicto = 'intervention';
  344. $elementLabel = $langs->trans('Intervention');
  345. } elseif ($notifiedevent['elementtype'] == 'shipping') {
  346. $elementPicto = 'shipment';
  347. $elementLabel = $langs->trans('Shipping');
  348. } elseif ($notifiedevent['elementtype'] == 'expensereport' || $notifiedevent['elementtype'] == 'expense_report') {
  349. $elementPicto = 'expensereport';
  350. $elementLabel = $langs->trans('ExpenseReport');
  351. }
  352. $labelfortrigger = 'AmountHT';
  353. $codehasnotrigger = 0;
  354. if (preg_match('/^HOLIDAY/', $notifiedevent['code'])) {
  355. $codehasnotrigger++;
  356. }
  357. print '<tr class="oddeven">';
  358. print '<td>';
  359. print img_picto('', $elementPicto, 'class="pictofixedwidth"');
  360. print $elementLabel;
  361. print '</td>';
  362. print '<td>'.$notifiedevent['code'].'</td>';
  363. print '<td><span class="opacitymedium">'.$label.'</span></td>';
  364. print '<td>';
  365. $inputfieldalreadyshown = 0;
  366. // Notification with threshold
  367. foreach ($conf->global as $key => $val) {
  368. if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
  369. continue;
  370. }
  371. $param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
  372. $value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ?GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : $conf->global->$param;
  373. $s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
  374. $arrayemail = explode(',', $value);
  375. $showwarning = 0;
  376. foreach ($arrayemail as $keydet => $valuedet) {
  377. $valuedet = trim($valuedet);
  378. if (!empty($valuedet) && !isValidEmail($valuedet, 1)) {
  379. $showwarning++;
  380. }
  381. }
  382. if ((!empty($conf->global->$param)) && $showwarning) {
  383. $s .= ' '.img_warning($langs->trans("ErrorBadEMail"));
  384. }
  385. print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
  386. print '<br>';
  387. $inputfieldalreadyshown++;
  388. }
  389. // New entry input fields
  390. if (empty($inputfieldalreadyshown) || !$codehasnotrigger) {
  391. $s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
  392. print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
  393. }
  394. print '</td>';
  395. print '<td>';
  396. // Notification with threshold
  397. $inputfieldalreadyshown = 0;
  398. foreach ($conf->global as $key => $val) {
  399. if ($val == '' || !preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) {
  400. continue;
  401. }
  402. if (!$codehasnotrigger) {
  403. print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
  404. print '<br>';
  405. $inputfieldalreadyshown++;
  406. }
  407. }
  408. // New entry input fields
  409. if (!$codehasnotrigger) {
  410. print $langs->trans($labelfortrigger).' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
  411. }
  412. print '</td>';
  413. print '<td>';
  414. // TODO Add link to show message content
  415. print '</td>';
  416. print '</tr>';
  417. }
  418. print '</table>';
  419. print '</div>';
  420. print $form->buttonsSaveCancel("Save", '');
  421. print '</form>';
  422. // End of page
  423. llxFooter();
  424. $db->close();