From 130a9f2e6efd4ea3b5e2b14e5d5c5bd70e18f8e0 Mon Sep 17 00:00:00 2001 From: Spangaro Alexandre Date: Sun, 23 Oct 2011 10:06:01 +0200 Subject: [PATCH] Add page "info" for trip --- htdocs/compta/deplacement/fiche.php | 5 ++ htdocs/compta/deplacement/info.php | 79 +++++++++++++++++++ htdocs/compta/deplacement/note.php | 5 ++ .../install/mysql/tables/llx_deplacement.sql | 1 + 4 files changed, 90 insertions(+) create mode 100644 htdocs/compta/deplacement/info.php diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index ce36b404709..f8bb30cff04 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -274,6 +274,11 @@ else $head[$h][1] = $langs->trans("Note"); $head[$h][2] = 'note'; $h++; + + $head[$h][0] = DOL_URL_ROOT."/compta/deplacement/info.php?id=$deplacement->id"; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php new file mode 100644 index 00000000000..60b5e199bd8 --- /dev/null +++ b/htdocs/compta/deplacement/info.php @@ -0,0 +1,79 @@ + + * Copyright (C) 2004-2005 Laurent Destailleur + * + * 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, see . + */ + +/** + * \file htdocs/compta/deplacement/info.php + * \ingroup facture + * \brief Page to show a trip information + */ + +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/compta/deplacement/class/deplacement.class.php"); + +$langs->load("trips"); + +/* + * View + */ +llxHeader(); + +if ($id) +{ + $deplacement = new Deplacement($db); + $deplacement->fetch($_GET["id"], $user); + $deplacement->info($_GET["id"]); + if ($deplacement > 0) + { + if ($mesg) print $mesg."
"; + + $h=0; + + $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/fiche.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/note.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans("Note"); + $head[$h][2] = 'note'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/info.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + + dol_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip'); + + print '
'; + dol_print_object_info($deplacement); + print '
'; + + print ''; + } + else + { + dol_print_error($db); + } +} + +$db->close(); + +llxFooter(); +?> diff --git a/htdocs/compta/deplacement/note.php b/htdocs/compta/deplacement/note.php index 2ef51313192..1aaf5005f5f 100644 --- a/htdocs/compta/deplacement/note.php +++ b/htdocs/compta/deplacement/note.php @@ -116,6 +116,11 @@ if ($id > 0 || ! empty($ref)) $head[$h][1] = $langs->trans("Note"); $head[$h][2] = 'note'; $h++; + + $head[$h][0] = DOL_URL_ROOT."/compta/deplacement/info.php?id=$deplacement->id"; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; dol_fiche_head($head, 'note', $langs->trans("TripCard"), 0, 'trip'); diff --git a/htdocs/install/mysql/tables/llx_deplacement.sql b/htdocs/install/mysql/tables/llx_deplacement.sql index ee508bd3a1f..02560f47ab2 100644 --- a/htdocs/install/mysql/tables/llx_deplacement.sql +++ b/htdocs/install/mysql/tables/llx_deplacement.sql @@ -28,6 +28,7 @@ create table llx_deplacement dated datetime, fk_user integer NOT NULL, fk_user_author integer, + fk_user_modif integer, -- utilisateur qui a modifie l'info type varchar(12) NOT NULL, fk_statut integer DEFAULT 1 NOT NULL, km real,