From 403fda125b1a79e87f593d32fbd5a85c2c1712d3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Apr 2006 11:28:02 +0000 Subject: [PATCH] =?UTF-8?q?D=E9but=20ajout=20de=20la=20gestion=20des=20adr?= =?UTF-8?q?esses=20de=20livraison?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/adresse_livraison.php | 10 ++++++++++ htdocs/commande/fiche.php | 2 +- htdocs/html.form.class.php | 7 ++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/adresse_livraison.php b/htdocs/comm/adresse_livraison.php index 57f13d70c12..740ecd3778e 100644 --- a/htdocs/comm/adresse_livraison.php +++ b/htdocs/comm/adresse_livraison.php @@ -47,6 +47,8 @@ if (! $user->rights->societe->creer) } $idl = isset($_GET["idl"])?$_GET["idl"]:''; +$origin = isset($_GET["origin"])?$_GET["origin"]:''; +$originid = isset($_GET["originid"])?$_GET["originid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:''; if (! $socid && ($_REQUEST["action"] != 'create' && $_REQUEST["action"] != 'add' && $_REQUEST["action"] != 'update')) accessforbidden(); @@ -98,8 +100,16 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update') if ($result >= 0) { + if ($origin == commande) + { + Header("Location: ../commande/fiche.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); + exit; + } + else + { Header("Location: adresse_livraison.php?socid=".$socid); exit; + } } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 6da2a199fa7..f3532d29039 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -739,7 +739,7 @@ else print ''; if ($_GET['action'] == 'editdelivery_adress') { - $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id'); + $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id); } else { diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 69c4a97a9ad..eaf6b6de592 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1584,9 +1584,10 @@ class Form * \param page Page * \param selected Id condition présélectionnée * \param htmlname Nom du formulaire select - * \param addempty Ajoute entrée vide + * \param origin origine de l'appel pour pouvoir créer un retour + * \param id id de l'origine */ - function form_adresse_livraison($page, $selected='', $socid, $htmlname='adresse_livraison_id') + function form_adresse_livraison($page, $selected='', $socid, $htmlname='adresse_livraison_id', $origin='', $id) { global $langs,$conf; if ($htmlname != "none") @@ -1602,7 +1603,7 @@ class Form if ($numaddress==0) { $langs->load("companies"); - print '   '.$langs->trans("AddAddress").''; + print '   '.$langs->trans("AddAddress").''; } print ''; }