diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php new file mode 100644 index 0000000000000000000000000000000000000000..9760e68e753d34a3adbca6841c703bba8ce9813c --- /dev/null +++ b/htdocs/admin/tools/listevents.php @@ -0,0 +1,137 @@ +<?php +/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + \file htdocs/compta/clients.php + \ingroup compta + \brief Page accueil des clients + \version $Id$ +*/ + +require_once("./pre.inc.php"); + +if (! $user->admin) + accessforbidden(); + +$langs->load("companies"); + +$page=$_GET["page"]; +$sortorder=$_GET["sortorder"]; +$sortfield=$_GET["sortfield"]; + +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="dateevent"; +if ($page == -1) { $page = 0 ; } +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + + +llxHeader(); + +// S�curit� acc�s client +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + + +/* + * Mode Liste + * + */ + +$sql = "SELECT e.rowid, e.type, ".$db->pdate("e.dateevent")." as dateevent,"; +$sql.= " e.fk_user, e.label, e.description"; +$sql.= " FROM ".MAIN_DB_PREFIX."events as e"; + +$sql .= " ORDER BY $sortfield $sortorder"; +$sql .= $db->plimit($conf->liste_limit+1, $offset); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows($result); + $i = 0; + + print_barre_liste($langs->trans("ListOfEvents"), $page, "listevents.php","",$sortfield,$sortorder,'',$num); + + print '<table class="liste" width="100%">'; + print '<tr class="liste_titre">'; + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"e.type","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"e.fk_user","","",'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"e.label","","",'align="left"',$sortfield,$sortorder); + print '<td> </td>'; + print "</tr>\n"; + +/* + // Lignes des champs de filtre + print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; + print '<tr class="liste_titre">'; + + print '<td class="liste_titre"> </td>'; + + print '<td class="liste_titre"> </td>'; + + print '<td align="left" class="liste_titre">'; + print '<input class="flat" type="text" size="10" name="search_compta" value="'.$_GET["search_user"].'">'; + print '</td>'; + + print '<td align="left" class="liste_titre">'; + print '<input class="flat" type="text" size="10" name="search_compta" value="'.$_GET["search_label"].'">'; + print '</td>'; + + print '<td align="right" class="liste_titre">'; + print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">'; + print '</td>'; + + print "</tr>\n"; + print '</form>'; +*/ + $var=True; + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object(); + + $var=!$var; + + print "<tr $bc[$var]>"; + print '<td align="left" nowrap="nowrap">'.dolibarr_print_date($obj->dateevent,'dayhour').'</td>'; + print '<td>'.$obj->type.'</td>'; + print '<td>'.$obj->fk_user.'</td>'; + print '<td>'.$obj->label.'</td>'; +// print '<td>'.$obj->description.'</td>'; + print '<td> </td>'; + print "</tr>\n"; + $i++; + } + print "</table>"; + $db->free(); +} +else +{ + dolibarr_print_error($db); +} + +$db->close(); + +llxFooter('$Date$ révision $Revision$'); +?> diff --git a/htdocs/admin/tools/pre.inc.php b/htdocs/admin/tools/pre.inc.php index 48676e9c7b5caac54f34128c4ef11cd802715bc7..20f82ceb450ac34348ef26c9327e8be4dddc28ca 100644 --- a/htdocs/admin/tools/pre.inc.php +++ b/htdocs/admin/tools/pre.inc.php @@ -14,15 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/admin/tools/pre.inc.php \brief Fichier gestionnaire menu page outils - \version $Revision$ + \version $Id$ */ require("../../main.inc.php"); @@ -41,7 +38,9 @@ function llxHeader($head = "", $urlp = "") $menu->add(DOL_URL_ROOT."/admin/tools/index.php", "SystemTools"); $menu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup")); $menu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore")); + $menu->add_submenu(DOL_URL_ROOT."/admin/tools/update.php", $langs->trans("Upgrade")); $menu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge")); + $menu->add_submenu(DOL_URL_ROOT."/admin/tools/listevents.php", $langs->trans("Audit")); left_menu($menu->liste); } diff --git a/htdocs/comm/prospect/prospects.php b/htdocs/comm/prospect/prospects.php index e3092e0fea0a871256d50640cf732fc4b2a12859..3ae9dab08e10be08cbb5726fe322ecef65049da3 100644 --- a/htdocs/comm/prospect/prospects.php +++ b/htdocs/comm/prospect/prospects.php @@ -15,16 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/comm/prospect/prospects.php \ingroup prospect \brief Page de la liste des prospects - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); diff --git a/htdocs/core/events.class.php b/htdocs/core/events.class.php index d5a9fe7d5d7730615b485228fd3e15840e25471b..0ba0d01e990cf984a1a1993da09746c8ebbd1850 100644 --- a/htdocs/core/events.class.php +++ b/htdocs/core/events.class.php @@ -90,7 +90,6 @@ class Events // extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."events("; - $sql.= "id,"; $sql.= "type,"; $sql.= "dateevent,"; $sql.= "fk_user,"; @@ -100,7 +99,6 @@ class Events // extends CommonObject $sql.= ") VALUES ("; - $sql.= " '".$this->id."',"; $sql.= " '".$this->type."',"; $sql.= " ".$this->db->idate($this->dateevent).","; $sql.= " '".$user->id."',"; @@ -151,12 +149,10 @@ class Events // extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."events SET"; - $sql.= " id='".$this->id."',"; $sql.= " type='".$this->type."',"; $sql.= " dateevent=".$this->db->idate($this->dateevent).","; $sql.= " label='".addslashes($this->label)."',"; $sql.= " description='".addslashes($this->description)."'"; - $sql.= " WHERE rowid=".$this->id; @@ -185,7 +181,6 @@ class Events // extends CommonObject $sql = "SELECT"; $sql.= " t.rowid,"; - $sql.= " t.id,"; $sql.= " ".$this->db->pdate('t.tms').","; $sql.= " t.type,"; $sql.= " ".$this->db->pdate('t.dateevent').","; @@ -206,7 +201,6 @@ class Events // extends CommonObject $this->id = $obj->rowid; - $this->id = $obj->id; $this->tms = $obj->tms; $this->type = $obj->type; $this->dateevent = $obj->dateevent; diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 306dc864d395e7c06e67eff84bafd1c8ee08c52a..0473848dfbe86fc38a242945ff06ba7eef6b56e9 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -152,8 +152,9 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/admin/tools/index.php?leftmenu=admintools", $langs->trans("SystemTools")); if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup"),1); if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore"),1); - if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"),1); if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/update.php", $langs->trans("Upgrade"),1); + if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"),1); + if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/listevents.php", $langs->trans("Audit"),1); if ($leftmenu=="admintools" && function_exists('eaccelerator_info')) $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/eaccelerator.php", $langs->trans("EAccelerator"),1); } diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 61ad5c81bf4eb00c37cd31d7c905fce142cc71b5..c3dc0e275ea599fce523d76f20ed56f8a3043d37 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -154,8 +154,9 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/admin/tools/index.php?leftmenu=admintools", $langs->trans("SystemTools")); if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_export.php", $langs->trans("Backup"),1); if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore"),1); - if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"),1); if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/update.php", $langs->trans("Upgrade"),1); + if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"),1); + if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/listevents.php", $langs->trans("Audit"),1); if ($leftmenu=="admintools" && function_exists('eaccelerator_info')) $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/eaccelerator.php", $langs->trans("EAccelerator"),1); } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 17bf5c336b5a763940d2a0e66d024c3debd82e74..cecc516a889beb3eeb17d213356f8638787b52bf 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -516,6 +516,8 @@ SetupDescription4=<b>Modules</b> setup is required because Dolibarr is not a sim EventsSetup=Setup for events logs LogEvents=Events Audit=Audit +ListEvents=Audit events +ListOfEvents=List of events LogEventDesc=You can enable here log for some common events in the dolibarr event table. AreaForAdminOnly=Those features can be used by <b>administrator users</b> only. Administrator features and help are identified in Dolibarr by the following picto: SystemInfoDesc=System information is miscellanous technical information you get in read only mode and visible for administrators only. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index dc7913184f88ae0d80959571a538cf3fcb1219bc..ae93aeea6bb6ca8043d66c6716e2ee57cdbe2d4c 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -515,6 +515,8 @@ SetupDescription4=La configuration <b>Modules</b> est indispensable car Dolibarr EventsSetup=Configuration du tra�age des �venements LogEvents=Ev�nements Audit=Audit +ListEvents=Audit �v�nements +ListOfEvents=Liste des �v�nements LogEventDesc=Vous pouvez activer ici, le tra�age de l'historique des ev�nements dans la table des ev�nements Dolibarr. AreaForAdminOnly=Ces fonctions ne sont accessibles qu'� un utilisateur administrateur. La fonction d'administrateur et les aides pour les administrateurs sont identifi�es dans Dolibarr par le picto suivant: SystemInfoDesc=Les informations syst�mes sont des informations techniques diverses accessibles en lecture seule aux administrateurs uniquement. diff --git a/mysql/migration/2.2.0-2.4.0.sql b/mysql/migration/2.2.0-2.4.0.sql index 6a0e96810f3fbefa1f4ecd06ff725d1696731cc2..227fac81abfbd4dbb7d578255fbf6e1a8bdbdf8b 100644 --- a/mysql/migration/2.2.0-2.4.0.sql +++ b/mysql/migration/2.2.0-2.4.0.sql @@ -178,7 +178,7 @@ ALTER TABLE llx_actioncomm add column fk_user_done integer after fk_user_action drop table if exists llx_events; create table llx_events ( - id integer AUTO_INCREMENT PRIMARY KEY, + rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, -- date creation/modification type varchar(32) NOT NULL, -- action type dateevent datetime, -- date event diff --git a/mysql/tables/llx_events.sql b/mysql/tables/llx_events.sql index d3440eada55f5eefac1c0759bed39026a9835397..904dc9eda645b07ec08287199fc2b6d434497a24 100644 --- a/mysql/tables/llx_events.sql +++ b/mysql/tables/llx_events.sql @@ -23,7 +23,7 @@ create table llx_events ( - id integer AUTO_INCREMENT PRIMARY KEY, + rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, -- date creation/modification type varchar(32) NOT NULL, -- action type dateevent datetime, -- date event