triggers.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/admin/triggers.php
  19. * \brief Page to view triggers
  20. */
  21. // Load Dolibarr environment
  22. require '../main.inc.php';
  23. require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
  24. // Load translation files required by the page
  25. $langs->load("admin");
  26. if (!$user->admin) {
  27. accessforbidden();
  28. }
  29. $sortfield = 'file';
  30. $sortorder = 'ASC';
  31. /*
  32. * Action
  33. */
  34. // None
  35. /*
  36. * View
  37. */
  38. llxHeader("", "");
  39. $form = new Form($db);
  40. print load_fiche_titre($langs->trans("TriggersAvailable"), '', 'title_setup');
  41. print '<span class="opacitymedium">'.$langs->trans("TriggersDesc")."</span><br>";
  42. print "<br>\n";
  43. $interfaces = new Interfaces($db);
  44. $triggers = $interfaces->getTriggersList();
  45. $param = ''; $align = '';
  46. print '<div class="div-table-responsive-no-min">';
  47. print '<table class="noborder">';
  48. print '<tr class="liste_titre">';
  49. print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, '', $sortfield, $sortorder, '', 1)."\n";
  50. print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align ? 'align="'.$align.'"' : ''), $sortfield, $sortorder, '', 1)."\n";
  51. print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'active', "", $param, 'align="center"', $sortfield, $sortorder, '', 1)."\n";
  52. print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align ? 'align="'.$align.'"' : ''), $sortfield, $sortorder, '', 1)."\n";
  53. print '</tr>';
  54. foreach ($triggers as $trigger) {
  55. print '<tr class="oddeven">';
  56. print '<td class=" width="32">'.$trigger['picto'].'</td>';
  57. print '<td>'.$trigger['file'].'</td>';
  58. print '<td class="center">'.$trigger['status'].'</td>';
  59. print '<td>';
  60. $text = $trigger['info'];
  61. $text .= "<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
  62. //$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
  63. print $form->textwithpicto('', $text);
  64. print '</td>';
  65. print '</tr>';
  66. }
  67. print '</table>';
  68. print '</div>';
  69. // End of page
  70. llxFooter();
  71. $db->close();