Qual: Remove deprecated code
This commit is contained in:
parent
3edc470f73
commit
c0521a20a9
@ -38,19 +38,7 @@ accessforbidden();
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
/*if ($_POST["action"] == 'STOCK_USERSTOCK')
|
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "STOCK_USERSTOCK", $_POST["STOCK_USERSTOCK"],'chaine',0,'',$conf->entity);
|
|
||||||
//On desactive l'autocreation si l'option "stock personnel" est desactivee
|
|
||||||
if ($_POST["STOCK_USERSTOCK"] == 0)
|
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", 0,'chaine',0,'',$conf->entity);
|
|
||||||
}
|
|
||||||
Header("Location: stock.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
if ($_POST["action"] == 'STOCK_USERSTOCK_AUTOCREATE')
|
if ($_POST["action"] == 'STOCK_USERSTOCK_AUTOCREATE')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", $_POST["STOCK_USERSTOCK_AUTOCREATE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", $_POST["STOCK_USERSTOCK_AUTOCREATE"],'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if ($conf->stock->enabled)
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
$disabled=0;
|
$disabled=0;
|
||||||
if (! empty($conf->global->CASHDESK_ID_WAREHOUSE)) $disabled=1; // If a particular stock is defined, we disable choice
|
if (! empty($conf->global->CASHDESK_ID_WAREHOUSE)) $disabled=1; // If a particular stock is defined, we disable choice
|
||||||
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'warehouseid','',!$disabled,$disabled);
|
$formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'warehouseid','',!$disabled,$disabled);
|
||||||
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|||||||
@ -1057,7 +1057,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
|
||||||
$html->select_date('','re','','','',"crea_commande");
|
$html->select_date('','re','','','',"crea_commande",1,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date de livraison
|
// Date de livraison
|
||||||
@ -1070,7 +1070,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
|
|||||||
{
|
{
|
||||||
$datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
$datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||||
}
|
}
|
||||||
$html->select_date($datedelivery,'liv_','','','',"crea_commande");
|
$html->select_date($datedelivery,'liv_','','','',"crea_commande",1,1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Delivery address
|
// Delivery address
|
||||||
@ -2114,7 +2114,7 @@ else
|
|||||||
if ($user->rights->expedition->creer)
|
if ($user->rights->expedition->creer)
|
||||||
{
|
{
|
||||||
// Chargement des permissions
|
// Chargement des permissions
|
||||||
$error = $user->load_entrepots();
|
/*$error = $user->load_entrepots(); deprecated
|
||||||
if (sizeof($user->entrepots) === 1)
|
if (sizeof($user->entrepots) === 1)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$_GET['id'].'&action=create&commande_id='.$_GET["id"].'&entrepot_id='.$user->entrepots[0]['id'].'">';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$_GET['id'].'&action=create&commande_id='.$_GET["id"].'&entrepot_id='.$user->entrepots[0]['id'].'">';
|
||||||
@ -2122,9 +2122,9 @@ else
|
|||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{*/
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$_GET['id'].'">'.$langs->trans('ShipProduct').'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$_GET['id'].'">'.$langs->trans('ShipProduct').'</a>';
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2162,7 +2162,7 @@ else
|
|||||||
if ($user->rights->commande->annuler && $nb_expedition == 0)
|
if ($user->rights->commande->annuler && $nb_expedition == 0)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=cancel"';
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=cancel"';
|
||||||
print '>'.$langs->trans('CancelOrder').'</a>';
|
print '>'.$langs->trans('Cancel').'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@
|
|||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/expedition/class/expedition.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/order.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||||
if ($conf->product->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
if ($conf->product->enabled || $conf->service->enabled) require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
|
||||||
@ -52,8 +53,6 @@ $socid=0;
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
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();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -121,6 +120,7 @@ if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
|
|||||||
|
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
$formproduct = new FormProduct($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$sql.= ' cd.date_start,';
|
$sql.= ' cd.date_start,';
|
||||||
$sql.= ' cd.date_end,';
|
$sql.= ' cd.date_end,';
|
||||||
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
|
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
|
||||||
$sql.= ' p.description as product_desc';
|
$sql.= ' p.description as product_desc, p.fk_product_type as product_type';
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
|
$sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||||
$sql.= " WHERE cd.fk_commande = ".$commande->id;
|
$sql.= " WHERE cd.fk_commande = ".$commande->id;
|
||||||
@ -476,8 +476,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Qty ordered
|
||||||
print '<td align="center">'.$objp->qty.'</td>';
|
print '<td align="center">'.$objp->qty.'</td>';
|
||||||
|
|
||||||
|
// Qty already shipped
|
||||||
$qtyProdCom=$objp->qty;
|
$qtyProdCom=$objp->qty;
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
// Nb of sending products for this line of order
|
// Nb of sending products for this line of order
|
||||||
@ -485,10 +487,18 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print $quantite_livree;
|
print $quantite_livree;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
$reste_a_livrer[$objp->fk_product] = $objp->qty - $quantite_livree;
|
// Qty remaind to ship
|
||||||
$reste_a_livrer_total += $reste_a_livrer[$objp->fk_product];
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $reste_a_livrer[$objp->fk_product];
|
if ($objp->product_type == 0)
|
||||||
|
{
|
||||||
|
$reste_a_livrer[$objp->fk_product] = $objp->qty - $quantite_livree;
|
||||||
|
$reste_a_livrer_total += $reste_a_livrer[$objp->fk_product];
|
||||||
|
print $reste_a_livrer[$objp->fk_product];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '0 ('.$langs->trans("Service").')';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
@ -610,21 +620,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
print '<td>'.$langs->trans("WarehouseSource").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
$result=$formproduct->selectWarehouses(-1,'entrepot_id','',1);
|
||||||
if (sizeof($user->entrepots) === 1)
|
if ($result <= 0)
|
||||||
{
|
|
||||||
$uentrepot = array();
|
|
||||||
$uentrepot[$user->entrepots[0]['id']] = $user->entrepots[0]['label'];
|
|
||||||
$html->select_array("entrepot_id",$uentrepot);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$html->select_array("entrepot_id",$entrepot->list_array());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sizeof($entrepot->list_array()) <= 0)
|
|
||||||
{
|
{
|
||||||
print ' No warehouse defined, <a href="'.DOL_URL_ROOT.'/product/stock/fiche.php?action=create">add one</a>';
|
print ' No warehouse defined, <a href="'.DOL_URL_ROOT.'/product/stock/fiche.php?action=create">add one</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -267,16 +267,16 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Warehouse
|
// Warehouse
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if (sizeof($user->entrepots) === 1)
|
/*if (sizeof($user->entrepots) === 1) deprecated
|
||||||
{
|
{
|
||||||
$uentrepot = array();
|
$uentrepot = array();
|
||||||
$uentrepot[$user->entrepots[0]['id']] = $user->entrepots[0]['label'];
|
$uentrepot[$user->entrepots[0]['id']] = $user->entrepots[0]['label'];
|
||||||
print $html->selectarray("entrepot_".$i, $uentrepot, '', $disabled, 0, 0, 0, '', 0, 0, $disabled);
|
print $html->selectarray("entrepot_".$i, $uentrepot, '', $disabled, 0, 0, 0, '', 0, 0, $disabled);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{*/
|
||||||
print $html->selectarray("entrepot_".$i, $entrepot->list_array(), '', $disabled, 0, 0, 0, '', 0, 0, $disabled);
|
print $html->selectarray("entrepot_".$i, $entrepot->list_array(), '', $disabled, 0, 0, 0, '', 0, 0, $disabled);
|
||||||
}
|
//}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
-- ============================================================================
|
|
||||||
-- Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
--
|
|
||||||
-- 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
|
|
||||||
-- the Free Software Foundation; either version 2 of the License, or
|
|
||||||
-- (at your option) any later version.
|
|
||||||
--
|
|
||||||
-- This program is distributed in the hope that it will be useful,
|
|
||||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
-- GNU General Public License for more details.
|
|
||||||
--
|
|
||||||
-- You should have received a copy of the GNU General Public License
|
|
||||||
-- along with this program; if not, write to the Free Software
|
|
||||||
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
--
|
|
||||||
-- $Id$
|
|
||||||
-- ============================================================================
|
|
||||||
|
|
||||||
create table llx_user_entrepot
|
|
||||||
(
|
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
fk_entrepot integer UNSIGNED, -- pointe sur llx_entrepot
|
|
||||||
fk_user integer UNSIGNED, -- pointe sur llx_user
|
|
||||||
consult smallint UNSIGNED,
|
|
||||||
send smallint UNSIGNED
|
|
||||||
)type=innodb;
|
|
||||||
@ -53,16 +53,17 @@ function stock_prepare_head($entrepot)
|
|||||||
$h++;
|
$h++;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Disabled because will never be implemented. Table always empty.
|
||||||
if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER)
|
if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER)
|
||||||
{
|
{
|
||||||
// Add the constant STOCK_USE_WAREHOUSE_BY_USER in cont table to use this feature.
|
|
||||||
// Should not be enabled by defaut because does not work yet correctly because
|
// Should not be enabled by defaut because does not work yet correctly because
|
||||||
// there is no way to add values in the table llx_user_entrepot
|
// personnal stocks are not tagged into table llx_entrepot
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id;
|
$head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id;
|
||||||
$head[$h][1] = $langs->trans("Users");
|
$head[$h][1] = $langs->trans("Users");
|
||||||
$head[$h][2] = 'user';
|
$head[$h][2] = 'user';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
|
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
|
|||||||
@ -96,6 +96,7 @@ class FormProduct
|
|||||||
* \param filtertype For filtre
|
* \param filtertype For filtre
|
||||||
* \param empty 1=Can be empty, 0 if not
|
* \param empty 1=Can be empty, 0 if not
|
||||||
* \param disabled 1=Select is disabled
|
* \param disabled 1=Select is disabled
|
||||||
|
* \return int <0 if KO, Nb of product in list if OK
|
||||||
*/
|
*/
|
||||||
function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0,$disabled=0)
|
function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0,$disabled=0)
|
||||||
{
|
{
|
||||||
@ -118,6 +119,8 @@ class FormProduct
|
|||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
if ($disabled) print '<input type="hidden" name="'.$htmlname.'" value="'.$selected.'">';
|
if ($disabled) print '<input type="hidden" name="'.$htmlname.'" value="'.$selected.'">';
|
||||||
|
|
||||||
|
return sizeof($this->cache_warehouses);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@ -20,10 +20,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/product/stock/user.php
|
* \file htdocs/product/stock/user.php
|
||||||
* \ingroup stock
|
* \ingroup stock
|
||||||
* \brief Page to link dolibarr users with warehouses
|
* \brief Page to link dolibarr users with warehouses
|
||||||
* \version $Id$
|
* \version $Id$
|
||||||
|
* \deprecated This page is never called. Feature will never be developped.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../../main.inc.php");
|
require("../../main.inc.php");
|
||||||
|
|||||||
@ -1697,9 +1697,10 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Charge la liste des entrepots pour l'utilisateur
|
* \brief Charge la liste ->entrepots[] des entrepots pour l'utilisateur
|
||||||
* \return int 0 si ok, <> 0 si erreur
|
* \return int 0 si ok, <> 0 si erreur
|
||||||
*/
|
*/
|
||||||
|
/* deprecated
|
||||||
function load_entrepots()
|
function load_entrepots()
|
||||||
{
|
{
|
||||||
$err=0;
|
$err=0;
|
||||||
@ -1729,7 +1730,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Charge les informations d'ordre info dans l'objet user
|
* \brief Charge les informations d'ordre info dans l'objet user
|
||||||
@ -1792,7 +1793,7 @@ class User extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return number of existing users
|
* \brief Return number of existing users
|
||||||
* \param limitToActive limit to active users
|
* \param limitToActive limit to active users
|
||||||
@ -1801,12 +1802,12 @@ class User extends CommonObject
|
|||||||
function getNbOfUsers($limitToActive=0)
|
function getNbOfUsers($limitToActive=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT count(rowid) as nb";
|
$sql = "SELECT count(rowid) as nb";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
$sql.= " WHERE entity = ".$conf->entity;
|
||||||
if ($limitToActive) $sql.= " AND statut = 1";
|
if ($limitToActive) $sql.= " AND statut = 1";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user