notification.php 18 KB

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