From 26a4575c10738ba14b14b9c3116a018758e2e72b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 30 Jan 2010 08:26:16 +0000 Subject: [PATCH] Fix: bad links Fix: prepare for the expedition from a propal --- htdocs/commande/commande.class.php | 4 +++- htdocs/expedition/{commande.php => shipment.php} | 10 ++++------ htdocs/lib/order.lib.php | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) rename htdocs/expedition/{commande.php => shipment.php} (98%) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index ac6c3079a9b..2d1349f2998 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1697,8 +1697,10 @@ class Commande extends CommonObject { dol_syslog('Commande::set_ref_client this->id='.$this->id.', ref_client='.$ref_client); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET ref_client = '.(empty($ref_client) ? 'NULL' : '\''.addslashes($ref_client).'\''); + $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET'; + $sql.= ' ref_client = '.(empty($ref_client) ? 'NULL' : '\''.addslashes($ref_client).'\''); $sql.= ' WHERE rowid = '.$this->id; + if ($this->db->query($sql) ) { $this->ref_client = $ref_client; diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/shipment.php similarity index 98% rename from htdocs/expedition/commande.php rename to htdocs/expedition/shipment.php index dc578c83c67..bd3126ea568 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/shipment.php @@ -21,7 +21,7 @@ // Code identique a /expedition/fiche.php /** - * \file htdocs/expedition/commande.php + * \file htdocs/expedition/shipment.php * \ingroup expedition * \version $Id$ */ @@ -35,8 +35,6 @@ require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php"); -if (!$user->rights->commande->lire) accessforbidden(); - $langs->load('orders'); $langs->load("companies"); $langs->load("bills"); @@ -50,7 +48,7 @@ $action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action' // Security check $socid=0; if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,'commande',$id,''); +$result=restrictedArea($user,'commande',$id); // Chargement des permissions $error = $user->load_entrepots(); @@ -158,7 +156,7 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET["action"] == 'cloture') { - $ret=$html->form_confirm("commande.php?id=".$_GET["id"],$langs->trans("CloseOrder"),$langs->trans("ConfirmCloseOrder"),"confirm_cloture"); + $ret=$html->form_confirm($_SERVER['PHP_SELF']."?id=".$_GET["id"],$langs->trans("CloseOrder"),$langs->trans("ConfirmCloseOrder"),"confirm_cloture"); if ($ret == 'html') print '
'; } @@ -185,7 +183,7 @@ if ($id > 0 || ! empty($ref)) print ''; if ($user->rights->commande->creer && $_GET['action'] == 'RefCustomerOrder') { - print '
'; + print ''; print ''; print ''; print ''; diff --git a/htdocs/lib/order.lib.php b/htdocs/lib/order.lib.php index fd3e95b87cd..95a89feae21 100644 --- a/htdocs/lib/order.lib.php +++ b/htdocs/lib/order.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2010 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 @@ -45,7 +46,7 @@ function commande_prepare_head($commande) if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)) { - $head[$h][0] = DOL_URL_ROOT.'/expedition/commande.php?id='.$commande->id; + $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$commande->id; if ($conf->expedition_bon->enabled) $text=$langs->trans("Sendings"); if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings"); $head[$h][1] = $text;