Fix: bad links

Fix: prepare for the expedition from a propal
This commit is contained in:
Regis Houssin 2010-01-30 08:26:16 +00:00
parent 7d10f8533e
commit 26a4575c10
3 changed files with 9 additions and 8 deletions

View File

@ -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;

View File

@ -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 '<br>';
}
@ -185,7 +183,7 @@ if ($id > 0 || ! empty($ref))
print '</td><td colspan="3">';
if ($user->rights->commande->creer && $_GET['action'] == 'RefCustomerOrder')
{
print '<form action="fiche.php?id='.$id.'" method="post">';
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_ref_client">';
print '<input type="text" class="flat" size="20" name="ref_client" value="'.$commande->ref_client.'">';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
*
* 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;