';
// Ref
print "";
print '| '.$langs->trans("Ref").' | ';
- print $html->showrefnav($deplacement,'id','',1,'rowid','ref','');
+ print $html->showrefnav($object,'id','',1,'rowid','ref','');
print ' |
';
// Type
- print '| '.$langs->trans("Type").' | '.$langs->trans($deplacement->type).' |
';
+ print '| '.$langs->trans("Type").' | '.$langs->trans($object->type).' |
';
// Who
print '| '.$langs->trans("Person").' | ';
$userfee=new User($db);
- $userfee->fetch($deplacement->fk_user);
+ $userfee->fetch($object->fk_user);
print $userfee->getNomUrl(1);
print ' |
';
// Date
print '| '.$langs->trans("Date").' | ';
- print dol_print_date($deplacement->date,'day');
+ print dol_print_date($object->date,'day');
print ' |
';
// Km/Price
- print '| '.$langs->trans("FeesKilometersOrAmout").' | '.$deplacement->km.' |
';
+ print '| '.$langs->trans("FeesKilometersOrAmout").' | '.$object->km.' |
';
// Where
print '| '.$langs->trans("CompanyVisited").' | ';
@@ -392,7 +382,7 @@ else
print '';
if ($_GET['action'] != 'classify')
{
- print 'id.'">';
+ print ' | id.'">';
print img_edit($langs->trans('SetProject'),1);
print ' | ';
}
@@ -400,18 +390,18 @@ else
print '';
if ($_GET['action'] == 'classify')
{
- $html->form_project($_SERVER['PHP_SELF'].'?id='.$deplacement->id, $deplacement->socid, $deplacement->fk_project,'projectid');
+ $html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'projectid');
}
else
{
- $html->form_project($_SERVER['PHP_SELF'].'?id='.$deplacement->id, $deplacement->socid, $deplacement->fk_project,'none');
+ $html->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project,'none');
}
print ' | ';
print '
';
}
// Statut
- print '| '.$langs->trans("Status").' | '.$deplacement->getLibStatut(4).' |
';
+ print '| '.$langs->trans("Status").' | '.$object->getLibStatut(4).' |
';
print "
";
@@ -434,7 +424,7 @@ else
print '';
-if ($_GET["action"] != 'create' && $_GET["action"] != 'edit')
+if ($action != 'create' && $action != 'edit')
{
if ($user->rights->deplacement->creer)
{
diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php
index 46220223823..995ae8966c4 100644
--- a/htdocs/compta/deplacement/index.php
+++ b/htdocs/compta/deplacement/index.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
- * Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2005-2009 Regis Houssin
+/* Copyright (C) 2003 Rodolphe Quiedeville
+ * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2004 Eric Seigne
+ * Copyright (C) 2005-2011 Regis Houssin
*
* 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
@@ -32,7 +32,7 @@ $langs->load("users");
$langs->load("trips");
// Security check
-$socid = $_GET["socid"]?$_GET["socid"]:'';
+$socid = GETPOST('socid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'deplacement','','');
diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php
new file mode 100644
index 00000000000..788759148e9
--- /dev/null
+++ b/htdocs/compta/deplacement/info.php
@@ -0,0 +1,64 @@
+
+ * 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 trip
+ * \brief Page to show a trip information
+ */
+
+require("../../main.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/trip.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
+require_once(DOL_DOCUMENT_ROOT."/compta/deplacement/class/deplacement.class.php");
+
+$langs->load("trips");
+
+// Security check
+$id = GETPOST('id');
+if ($user->societe_id) $socid=$user->societe_id;
+$result = restrictedArea($user, 'deplacement', $id, '');
+
+
+/*
+ * View
+ */
+
+llxHeader();
+
+if ($id)
+{
+ $object = new Deplacement($db);
+ $object->fetch($id);
+ $object->info($id);
+
+ $head = trip_prepare_head($object);
+
+ dol_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip');
+
+ print '| ';
+ dol_print_object_info($object);
+ print ' |
';
+
+ print ' ';
+}
+
+$db->close();
+
+llxFooter();
+?>
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index 8ac93658241..5a74877adc3 100755
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2004-2011 Laurent Destailleur