card.php 18 KB

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