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