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 '