card.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <?php
  2. /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
  5. * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
  6. * Copyright (C) 2016 Abbes Bahfir <contact@dolibarrpar.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. * \file htdocs/user/notify/card.php
  23. * \ingroup user notification
  24. * \brief Tab for notifications of third party
  25. */
  26. // Load Dolibarr environment
  27. require '../../main.inc.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
  32. // Load translation files required by page
  33. $langs->loadLangs(array('companies', 'mails', 'admin', 'other', 'errors'));
  34. $id = GETPOST("id", 'int');
  35. $ref = GETPOST('ref', 'alpha');
  36. $action = GETPOST('action', 'aZ09');
  37. $actionid = GETPOST('actionid', 'int');
  38. $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
  39. $sortfield = GETPOST('sortfield', 'aZ09comma');
  40. $sortorder = GETPOST('sortorder', 'aZ09comma');
  41. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  42. if (!$sortorder) {
  43. $sortorder = "DESC";
  44. }
  45. if (!$sortfield) {
  46. $sortfield = "n.daten";
  47. }
  48. if (empty($page) || $page == -1) {
  49. $page = 0;
  50. }
  51. $offset = $limit * $page;
  52. $pageprev = $page - 1;
  53. $pagenext = $page + 1;
  54. $now = dol_now();
  55. // Security check
  56. $object = new User($db);
  57. if ($id > 0 || !empty($ref)) {
  58. $result = $object->fetch($id, $ref, '', 1);
  59. $object->getrights();
  60. }
  61. $permissiontoadd = (($object->id == $user->id) || (!empty($user->rights->user->user->lire)));
  62. // Security check
  63. if ($user->socid) {
  64. $id = $user->socid;
  65. }
  66. $result = restrictedArea($user, 'user', '', '', 'user');
  67. /*
  68. * Actions
  69. */
  70. if (GETPOST('cancel', 'alpha')) {
  71. $action = 'list';
  72. }
  73. // Add a notification
  74. if ($action == 'add') {
  75. $error = 0;
  76. if ($actionid <= 0) {
  77. setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
  78. $error++;
  79. $action = 'create';
  80. }
  81. if (!$error) {
  82. $db->begin();
  83. $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
  84. $sql .= " WHERE fk_user=".((int) $id)." AND fk_action=".((int) $actionid);
  85. if ($db->query($sql)) {
  86. $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec, fk_user, fk_action)";
  87. $sql .= " VALUES ('".$db->idate($now)."', ".((int) $id).", ".((int) $actionid).")";
  88. if (!$db->query($sql)) {
  89. $error++;
  90. dol_print_error($db);
  91. }
  92. } else {
  93. dol_print_error($db);
  94. }
  95. if (!$error) {
  96. $db->commit();
  97. } else {
  98. $db->rollback();
  99. $action = 'create';
  100. }
  101. }
  102. }
  103. // Remove a notification
  104. if ($action == 'delete') {
  105. $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".GETPOST("actid", "int");
  106. $db->query($sql);
  107. }
  108. /*
  109. * View
  110. */
  111. $form = new Form($db);
  112. $object = new User($db);
  113. $result = $object->fetch($id, '', '', 1);
  114. $object->getrights();
  115. $title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
  116. if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
  117. $title = $object->name.' - '.$langs->trans("Notification");
  118. }
  119. $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
  120. llxHeader('', $title, $help_url);
  121. if ($result > 0) {
  122. $langs->load("other");
  123. $head = user_prepare_head($object);
  124. print dol_get_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user');
  125. $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  126. $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
  127. $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
  128. $morehtmlref .= '</a>';
  129. dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, '');
  130. print '<div class="fichecenter">';
  131. print '<div class="underbanner clearboth"></div>';
  132. print '<table class="border centpercent tableforfield">';
  133. // Login
  134. print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
  135. if (!empty($object->ldap_sid) && $object->statut == 0) {
  136. print '<td class="error">';
  137. print $langs->trans("LoginAccountDisableInDolibarr");
  138. print '</td>';
  139. } else {
  140. print '<td>';
  141. $addadmin = '';
  142. if (property_exists($object, 'admin')) {
  143. if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
  144. $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
  145. } elseif (!empty($object->admin)) {
  146. $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
  147. }
  148. }
  149. print showValueWithClipboardCPButton($object->login).$addadmin;
  150. print '</td>';
  151. }
  152. print '</tr>'."\n";
  153. /*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
  154. print '<td colspan="3">';
  155. $nbofrecipientemails=0;
  156. $notify=new Notify($db);
  157. $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
  158. foreach($tmparray as $tmpkey => $tmpval)
  159. {
  160. $nbofrecipientemails++;
  161. }
  162. print $nbofrecipientemails;
  163. print '</td></tr>';*/
  164. print '</table>';
  165. print '</div>';
  166. print dol_get_fiche_end();
  167. print "\n";
  168. // Help
  169. print '<span class="opacitymedium">';
  170. print '<br>'.$langs->trans("NotificationsDesc");
  171. print '<br>'.$langs->trans("NotificationsDescUser");
  172. print '<br>'.$langs->trans("NotificationsDescContact");
  173. print '<br>'.$langs->trans("NotificationsDescGlobal");
  174. print '</span>';
  175. print '<br><br><br>'."\n";
  176. // Add notification form
  177. // print load_fiche_titre($langs->trans("AddNewNotification"), '', '');
  178. print '<form action="'.$_SERVER["PHP_SELF"].'?id='.urlencode($id).'" method="POST">';
  179. print '<input type="hidden" name="token" value="'.newToken().'">';
  180. print '<input type="hidden" name="action" value="add">';
  181. $param = "&id=".urlencode($id);
  182. // Line with titles
  183. /* print '<table width="100%" class="noborder">';
  184. print '<tr class="liste_titre">';
  185. print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
  186. print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
  187. print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
  188. print_liste_field_titre('');
  189. print "</tr>\n";
  190. print '</table>';
  191. print '<br>';
  192. */
  193. // List of notifications enabled for contacts
  194. $sql = "SELECT n.rowid, n.type,";
  195. $sql .= " a.code, a.label,";
  196. $sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.statut as status";
  197. $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
  198. $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
  199. $sql .= " ".MAIN_DB_PREFIX."user c";
  200. $sql .= " WHERE a.rowid = n.fk_action";
  201. $sql .= " AND c.rowid = n.fk_user";
  202. $sql .= " AND c.rowid = ".((int) $object->id);
  203. $sql .= " AND c.entity IN (".getEntity('user').')';
  204. $resql = $db->query($sql);
  205. if ($resql) {
  206. $num = $db->num_rows($resql);
  207. } else {
  208. dol_print_error($db);
  209. }
  210. $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
  211. $title = $langs->trans("ListOfActiveNotifications");
  212. // List of active notifications
  213. //print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', '');
  214. print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limit, 0, 0, 1);
  215. // Line with titles
  216. print '<table width="100%" class="noborder">';
  217. print '<tr class="liste_titre">';
  218. print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
  219. print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
  220. print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
  221. print_liste_field_titre('', '', '');
  222. print '</tr>';
  223. if ($action == 'create') {
  224. // $listofemails=$object->thirdparty_and_contact_email_array();
  225. if ($object->email) {
  226. $actions = array();
  227. // Load array of available notifications
  228. $notificationtrigger = new InterfaceNotification($db);
  229. $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
  230. foreach ($listofnotifiedevents as $notifiedevent) {
  231. $label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
  232. $actions[$notifiedevent['rowid']] = $label;
  233. }
  234. print '<tr class="oddeven nohover"><td>';
  235. print $object->getNomUrl(1);
  236. if (isValidEmail($object->email)) {
  237. print ' &lt;'.$object->email.'&gt;';
  238. } else {
  239. $langs->load("errors");
  240. print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email);
  241. }
  242. print '</td>';
  243. print '<td>';
  244. print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
  245. print '</td>';
  246. print '<td>';
  247. $type = array('email'=>$langs->trans("EMail"));
  248. print $form->selectarray("typeid", $type);
  249. print '</td>';
  250. print '<td class="nowraponall">';
  251. print '<input type="submit" class="button button-add" value="'.$langs->trans("Add").'">';
  252. print '&nbsp;';
  253. print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
  254. print '</td>';
  255. print '</tr>';
  256. } else {
  257. print '<tr class="oddeven"><td colspan="4">';
  258. print $langs->trans("YouMustAssignUserMailFirst");
  259. print '</td></tr>';
  260. }
  261. } else {
  262. if ($num) {
  263. $i = 0;
  264. $userstatic = new user($db);
  265. while ($i < $num) {
  266. $obj = $db->fetch_object($resql);
  267. $userstatic->id = $obj->userid;
  268. $userstatic->lastname = $obj->lastname;
  269. $userstatic->firstname = $obj->firstname;
  270. $userstatic->email = $obj->email;
  271. $userstatic->statut = $obj->status;
  272. print '<tr class="oddeven">';
  273. print '<td>'.$userstatic->getNomUrl(1);
  274. if ($obj->type == 'email') {
  275. if (isValidEmail($obj->email)) {
  276. print ' &lt;'.$obj->email.'&gt;';
  277. } else {
  278. $langs->load("errors");
  279. print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email);
  280. }
  281. }
  282. print '</td>';
  283. print '<td>';
  284. $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
  285. print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
  286. print '</td>';
  287. print '<td>';
  288. if ($obj->type == 'email') {
  289. print $langs->trans("Email");
  290. }
  291. if ($obj->type == 'sms') {
  292. print $langs->trans("SMS");
  293. }
  294. print '</td>';
  295. print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
  296. print '</tr>';
  297. $i++;
  298. }
  299. $db->free($resql);
  300. } else {
  301. print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
  302. }
  303. // List of notifications enabled for fixed email
  304. /*
  305. foreach($conf->global as $key => $val) {
  306. if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
  307. print '<tr class="oddeven"><td>';
  308. $listtmp=explode(',', $val);
  309. $first=1;
  310. foreach($listtmp as $keyemail => $valemail) {
  311. if (! $first) print ', ';
  312. $first=0;
  313. $valemail=trim($valemail);
  314. //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
  315. if (isValidEmail($valemail, 1)) {
  316. if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
  317. else print ' &lt;'.$valemail.'&gt;';
  318. } else {
  319. print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
  320. }
  321. }
  322. print '</td>';
  323. print '<td>';
  324. $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
  325. $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
  326. $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
  327. print $label;
  328. if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
  329. print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
  330. }
  331. print '</td>';
  332. print '<td>';
  333. print $langs->trans("Email");
  334. print '</td>';
  335. print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
  336. print '</tr>';
  337. }*/
  338. /*if ($user->admin) {
  339. print '<tr class="oddeven"><td colspan="4">';
  340. print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
  341. print '</td></tr>';
  342. }*/
  343. }
  344. print '</table>';
  345. print '</form>';
  346. print '<br><br>'."\n";
  347. // List
  348. $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
  349. $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.statut as status,";
  350. $sql .= " a.code, a.label";
  351. $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
  352. $sql .= " ".MAIN_DB_PREFIX."notify as n";
  353. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
  354. $sql .= " WHERE a.rowid = n.fk_action";
  355. $sql .= " AND n.fk_user = ".((int) $object->id);
  356. $sql .= $db->order($sortfield, $sortorder);
  357. // Count total nb of records
  358. $nbtotalofrecords = '';
  359. if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
  360. $result = $db->query($sql);
  361. $nbtotalofrecords = $db->num_rows($result);
  362. if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
  363. $page = 0;
  364. $offset = 0;
  365. }
  366. }
  367. $sql .= $db->plimit($limit + 1, $offset);
  368. $resql = $db->query($sql);
  369. if ($resql) {
  370. $num = $db->num_rows($resql);
  371. } else {
  372. dol_print_error($db);
  373. }
  374. $param = '&id='.$object->id;
  375. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  376. $param .= '&contextpage='.$contextpage;
  377. }
  378. if ($limit > 0 && $limit != $conf->liste_limit) {
  379. $param .= '&limit='.$limit;
  380. }
  381. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
  382. if (isset($optioncss) && $optioncss != '') {
  383. print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  384. }
  385. print '<input type="hidden" name="token" value="'.newToken().'">';
  386. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  387. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  388. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  389. print '<input type="hidden" name="page" value="'.$page.'">';
  390. print '<input type="hidden" name="id" value="'.$object->id.'">';
  391. // List of notifications done
  392. print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit);
  393. // Line with titles
  394. print '<table width="100%" class="noborder">';
  395. print '<tr class="liste_titre">';
  396. print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
  397. print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
  398. print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
  399. //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
  400. print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
  401. print '</tr>';
  402. if ($num) {
  403. $i = 0;
  404. $userstatic = new User($db);
  405. while ($i < $num) {
  406. $obj = $db->fetch_object($resql);
  407. print '<tr class="oddeven"><td>';
  408. if ($obj->id > 0) {
  409. $userstatic->id = $obj->id;
  410. $userstatic->lastname = $obj->lastname;
  411. $userstatic->firstname = $obj->firstname;
  412. $userstatic->statut = $obj->status;
  413. $userstatic->email = $obj->email;
  414. print $userstatic->getNomUrl(1);
  415. print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
  416. } else {
  417. print $obj->email;
  418. }
  419. print '</td>';
  420. print '<td>';
  421. $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
  422. print $label;
  423. print '</td>';
  424. print '<td>';
  425. if ($obj->type == 'email') {
  426. print $langs->trans("Email");
  427. }
  428. if ($obj->type == 'sms') {
  429. print $langs->trans("Sms");
  430. }
  431. print '</td>';
  432. // TODO Add link to object here for other types
  433. /*print '<td>';
  434. if ($obj->object_type == 'order') {
  435. $orderstatic->id=$obj->object_id;
  436. $orderstatic->ref=...
  437. print $orderstatic->getNomUrl(1);
  438. }
  439. print '</td>';*/
  440. // print
  441. print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
  442. print '</tr>';
  443. $i++;
  444. }
  445. $db->free($resql);
  446. } else {
  447. print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
  448. }
  449. print '</table>';
  450. print '</form>';
  451. } else {
  452. dol_print_error('', 'RecordNotFound');
  453. }
  454. // End of page
  455. llxFooter();
  456. $db->close();