triggers.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. require '../main.inc.php';
  22. require_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
  23. // Load translation files required by the page
  24. $langs->load("admin");
  25. if (!$user->admin) {
  26. accessforbidden();
  27. }
  28. $sortfield = 'file';
  29. $sortorder = 'ASC';
  30. /*
  31. * Action
  32. */
  33. // None
  34. /*
  35. * View
  36. */
  37. llxHeader("", "");
  38. $form = new Form($db);
  39. print load_fiche_titre($langs->trans("TriggersAvailable"), '', 'title_setup');
  40. print '<span class="opacitymedium">'.$langs->trans("TriggersDesc")."</span><br>";
  41. print "<br>\n";
  42. $interfaces = new Interfaces($db);
  43. $triggers = $interfaces->getTriggersList();
  44. $param = ''; $align = '';
  45. print '<div class="div-table-responsive-no-min">';
  46. print '<table class="noborder">';
  47. print '<tr class="liste_titre">';
  48. print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, '', $sortfield, $sortorder, '', 1)."\n";
  49. print getTitleFieldOfList($langs->trans("File"), 0, $_SERVER["PHP_SELF"], 'file', "", $param, ($align ? 'align="'.$align.'"' : ''), $sortfield, $sortorder, '', 1)."\n";
  50. print getTitleFieldOfList($langs->trans("Active"), 0, $_SERVER["PHP_SELF"], 'active', "", $param, 'align="center"', $sortfield, $sortorder, '', 1)."\n";
  51. print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], 'none', "", $param, ($align ? 'align="'.$align.'"' : ''), $sortfield, $sortorder, '', 1)."\n";
  52. print '</tr>';
  53. foreach ($triggers as $trigger) {
  54. print '<tr class="oddeven">';
  55. print '<td class=" width="32">'.$trigger['picto'].'</td>';
  56. print '<td>'.$trigger['file'].'</td>';
  57. print '<td class="center">'.$trigger['status'].'</td>';
  58. print '<td>';
  59. $text = $trigger['info'];
  60. $text .= "<br>\n<strong>".$langs->trans("File")."</strong>:<br>\n".$trigger['relpath'];
  61. //$text.="\n".$langs->trans("ExternalModule",$trigger['isocreorexternal']);
  62. print $form->textwithpicto('', $text);
  63. print '</td>';
  64. print '</tr>';
  65. }
  66. print '</table>';
  67. print '</div>';
  68. // End of page
  69. llxFooter();
  70. $db->close();