diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index a012820a743..0535b19b607 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 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 @@ -46,19 +47,19 @@ if ($action == 'add') $action = ''; } -if ($HTTP_POST_VARS["action"] == 'miseenservice') +if ($_POST["action"] == 'miseenservice') { $contrat = new Contrat($db); $contrat->id = $id; $contrat->fetch($id); $contrat->mise_en_service($user, - mktime($HTTP_POST_VARS["rehour"], - $HTTP_POST_VARS["remin"], + mktime($_POST["rehour"], + $_POST["remin"], 0, - $HTTP_POST_VARS["remonth"], - $HTTP_POST_VARS["reday"], - $HTTP_POST_VARS["reyear"]), - $HTTP_POST_VARS["duration"] + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"]), + $_POST["duration"] ); } @@ -73,14 +74,14 @@ if ($action == 'update' && $cancel <> 'Annuler') { $product = new Product($db); - $product->ref = $HTTP_POST_VARS["ref"]; - $product->libelle = $HTTP_POST_VARS["libelle"]; - $product->price = $HTTP_POST_VARS["price"]; - $product->tva_tx = $HTTP_POST_VARS["tva_tx"]; - $product->description = $HTTP_POST_VARS["desc"]; - $product->envente = $HTTP_POST_VARS["statut"]; - $product->duration_value = $HTTP_POST_VARS["duration_value"]; - $product->duration_unit = $HTTP_POST_VARS["duration_unit"]; + $product->ref = $_POST["ref"]; + $product->libelle = $_POST["libelle"]; + $product->price = $_POST["price"]; + $product->tva_tx = $_POST["tva_tx"]; + $product->description = $_POST["desc"]; + $product->envente = $_POST["statut"]; + $product->duration_value = $_POST["duration_value"]; + $product->duration_unit = $_POST["duration_unit"]; if ( $product->update($id, $user)) { @@ -145,17 +146,8 @@ else print ''; print ""; - print ''; - print ''; + print ''; + print ''; if ($contrat->factureid) { print ''; @@ -166,6 +158,16 @@ else print ''; } + print ''; if ($request == 'miseenservice') { print ''; @@ -212,28 +214,19 @@ else /* */ /* ************************************************************************** */ -print '
Service'.$contrat->product->label_url.''; - if ($contrat->enservice) - { - print "En service"; - } - else - { - print "Ce contrat n'est pas en service"; - } - print '
Service'.($contrat->product->ref).' - '.($contrat->product->libelle).'
Société'.$contrat->societe->nom_url.'Société'.$contrat->societe->nom_url.'
Etat'; + if ($contrat->enservice) + { + print "En service"; + } + else + { + print "Ce contrat n'est pas en service"; + } + print '
'; -print ''; -if ($contrat->enservice) +print '
'; +print '
'; + +if (! $contrat->enservice) { - print '
'; + print 'Mise en service'; } -else +elseif ($contrat->enservice == 1) { - print ''; + print 'Clôturer'; } -print ''; -print ''; -if ($contrat->enservice == 1) -{ - print ''; -} -else -{ - print ''; -} -print '
--[Mise en service]--[Clôturer]-

'; +print ''; $db->close();