diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 7fc2467de08..59f1a85803f 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -20,6 +20,12 @@ * $Source$ * */ + +/*! + \file htdocs/compta/deplacement/fiche.php + \brief Page fiche d'un déplacement +*/ + require("./pre.inc.php"); $mesg = ''; @@ -45,13 +51,13 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) $deplacement->userid = $user->id; //$_POST["km"]; $id = $deplacement->create($user); - if ($_POST["id"]) + if ($id) { - Header ( "Location: fiche.php?id=".$_POST["id"]); + Header ( "Location: fiche.php?id=".$id); } else { - print "Error"; + dolibarr_print_error($db); } } @@ -136,6 +142,8 @@ else $html = new Form($db); $html->form_confirm("fiche.php?id=".$_GET["id"],"Supprimer ce déplacement","Etes-vous sűr de vouloir supprimer ce déplacement ?","confirm_delete"); + + print '
'; } @@ -147,7 +155,7 @@ else print ''; print ''; - print ''; + print '
'; $soc = new Societe($db); $soc->fetch($deplacement->socid); diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index b8518be9fe9..2b5b50ccd4e 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004 Eric Seigne * * 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 @@ -21,9 +21,18 @@ * $Source$ * */ + +/*! + \file htdocs/compta/deplacement/index.php + \brief Page liste des déplacements +*/ + require("./pre.inc.php"); require("../../tva.class.php"); +$langs->load("companies"); +$langs->load("users"); + llxHeader(); /* @@ -71,13 +80,13 @@ if ( $db->query($sql) ) print ""; print_liste_field_titre($langs->trans("Date"),"index.php","d.dated","","&socidp=$socidp",'',$sortfield); print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","&socidp=$socidp",'',$sortfield); - print_liste_field_titre($langs->trans("User"),"index.php","u.name","","&socidp=$socidp",'',$sortfield); + print_liste_field_titre($langs->trans("Person"),"index.php","u.name","","&socidp=$socidp",'',$sortfield); print "\n"; $var=True; while ($i < $num) { - $objp = $db->fetch_object($i); + $objp = $db->fetch_object(); $soc = new Societe($db); $soc->fetch($objp->idp); $var=!$var; @@ -85,7 +94,7 @@ if ( $db->query($sql) ) print ''; print ''; - print ''; + print ''; print "\n"; @@ -97,8 +106,7 @@ if ( $db->query($sql) ) } else { - print $db->error(); - print "

$sql"; + dolibarr_print_error($db); } $db->close();

'.dolibarr_print_date($objp->dd).'' . $soc->nom_url . ''.$objp->firstname.' '.$objp->name.''.$objp->firstname.' '.$objp->name.'