From 45a7ec5d818edff1b9b0a10353ecbff5bb0a76e9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Oct 2011 08:44:34 +0200 Subject: [PATCH] Fix: uniform code --- htdocs/compta/deplacement/fiche.php | 36 +++++++++++------------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 12cfd81ac65..cc6f20e5454 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -70,12 +70,7 @@ if ($action == 'add' && $user->rights->deplacement->creer) { $error=0; - $dated=dol_mktime(12, 0, 0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); - - $object->date = $dated; + $object->date = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $object->km = $_POST["km"]; $object->type = $_POST["type"]; $object->socid = $_POST["socid"]; @@ -105,7 +100,7 @@ if ($action == 'add' && $user->rights->deplacement->creer) if ($id > 0) { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=".$id); + Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else @@ -132,14 +127,12 @@ if ($action == 'update' && $user->rights->deplacement->creer) { $result = $object->fetch($id); - $object->date = dol_mktime(12, 0 , 0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); - $object->km = $_POST["km"]; - $object->type = $_POST["type"]; - $object->fk_user = $_POST["fk_user"]; - $object->socid = $_POST["socid"]; + $object->date = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + $object->km = $_POST["km"]; + $object->type = $_POST["type"]; + $object->fk_user = $_POST["fk_user"]; + $object->socid = $_POST["socid"]; + $result = $object->update($user); if ($result > 0) @@ -187,10 +180,7 @@ if ($action == 'create') dol_htmloutput_errors($mesg); - $datec = dol_mktime(12, 0, 0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); + $datec = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); print '
' . "\n"; print ''; @@ -200,12 +190,12 @@ if ($action == 'create') print ""; print ''.$langs->trans("Type").''; - print $html->select_type_fees($_POST["type"]?$_POST["type"]:$_GET["type"],'type',1); + print $html->select_type_fees(GETPOST("type"),'type',1); print ''; print ""; print ''.$langs->trans("Person").''; - print $html->select_users($_POST["fk_user"]?$_POST["fk_user"]:$_GET["fk_user"],'fk_user',1); + print $html->select_users(GETPOST("fk_user"),'fk_user',1); print ''; print ""; @@ -214,12 +204,12 @@ if ($action == 'create') print ''; // Km - print ''.$langs->trans("FeesKilometersOrAmout").''; + print ''.$langs->trans("FeesKilometersOrAmout").''; // Company print ""; print ''.$langs->trans("CompanyVisited").''; - print $html->select_societes($_POST["socid"]?$_POST["socid"]:$_GET["socid"],'socid','',1); + print $html->select_societes(GETPOST("socid"),'socid','',1); print ''; // Public note