';
$disabled=0;
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 '';
print '
';
print "";
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 5a2cbbda924..f435ca75520 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1057,7 +1057,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
// Date
print '
\n";
}
diff --git a/htdocs/install/mysql/tables/llx_user_entrepot.sql b/htdocs/install/mysql/tables/llx_user_entrepot.sql
deleted file mode 100644
index a9eb820102b..00000000000
--- a/htdocs/install/mysql/tables/llx_user_entrepot.sql
+++ /dev/null
@@ -1,28 +0,0 @@
--- ============================================================================
--- Copyright (C) 2006 Rodolphe Quiedeville
---
--- 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;
diff --git a/htdocs/lib/stock.lib.php b/htdocs/lib/stock.lib.php
index 2b7c76f37ae..a47fd697434 100644
--- a/htdocs/lib/stock.lib.php
+++ b/htdocs/lib/stock.lib.php
@@ -53,16 +53,17 @@ function stock_prepare_head($entrepot)
$h++;
*/
+ /* Disabled because will never be implemented. Table always empty.
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
- // 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][1] = $langs->trans("Users");
$head[$h][2] = 'user';
$h++;
}
+ */
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id;
$head[$h][1] = $langs->trans("Info");
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index 477c0d3bd39..150515cacc8 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -96,6 +96,7 @@ class FormProduct
* \param filtertype For filtre
* \param empty 1=Can be empty, 0 if not
* \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)
{
@@ -118,6 +119,8 @@ class FormProduct
}
print '';
if ($disabled) print '';
+
+ return sizeof($this->cache_warehouses);
}
/**
diff --git a/htdocs/product/stock/user.php b/htdocs/product/stock/user.php
index c771fe9d476..f9289916b16 100644
--- a/htdocs/product/stock/user.php
+++ b/htdocs/product/stock/user.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2008 Laurent Destailleur
+ * Copyright (C) 2004-2010 Laurent Destailleur
* Copyright (C) 2005 Simon Tosser
* Copyright (C) 2005-2006 Regis Houssin
*
@@ -20,10 +20,11 @@
*/
/**
- * \file htdocs/product/stock/user.php
- * \ingroup stock
- * \brief Page to link dolibarr users with warehouses
- * \version $Id$
+ * \file htdocs/product/stock/user.php
+ * \ingroup stock
+ * \brief Page to link dolibarr users with warehouses
+ * \version $Id$
+ * \deprecated This page is never called. Feature will never be developped.
*/
require("../../main.inc.php");
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 8517c2c0f78..84d5a979302 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.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
*/
+ /* deprecated
function load_entrepots()
{
$err=0;
@@ -1729,7 +1730,7 @@ class User extends CommonObject
}
return $err;
}
-
+*/
/*
* \brief Charge les informations d'ordre info dans l'objet user
@@ -1792,7 +1793,7 @@ class User extends CommonObject
return -1;
}
}
-
+
/**
* \brief Return number of existing users
* \param limitToActive limit to active users
@@ -1801,12 +1802,12 @@ class User extends CommonObject
function getNbOfUsers($limitToActive=0)
{
global $conf;
-
+
$sql = "SELECT count(rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."user";
$sql.= " WHERE entity = ".$conf->entity;
if ($limitToActive) $sql.= " AND statut = 1";
-
+
$resql=$this->db->query($sql);
if ($resql)
{