Fix: Move table in wrong repository
This commit is contained in:
parent
a1ceca54c5
commit
359038d2e5
@ -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_product_subproduct
|
|
||||||
(
|
|
||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
fk_product integer NOT NULL, -- id du produit maitre
|
|
||||||
fk_product_subproduct integer NOT NULL, -- id du sous-produit
|
|
||||||
UNIQUE(fk_product, fk_product_subproduct)
|
|
||||||
)type=innodb;
|
|
||||||
|
|
||||||
@ -1657,9 +1657,11 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Remplit le tableau des sous-produits
|
* \brief Remplit le tableau des sous-produits
|
||||||
* \return int < 0 si erreur, > 0 si ok
|
* \return int < 0 si erreur, > 0 si ok
|
||||||
|
* \remark Not used. Used by module droitpret only.
|
||||||
*/
|
*/
|
||||||
function load_subproduct()
|
function load_subproduct()
|
||||||
{
|
{
|
||||||
@ -1688,9 +1690,10 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Lie un sous produit au produit/service
|
* \brief Lie un sous produit au produit/service
|
||||||
* \param id_sub Id du produit a lier
|
* \param id_sub Id du produit a lier
|
||||||
* \return int < 0 si erreur, > 0 si ok
|
* \return int < 0 si erreur, > 0 si ok
|
||||||
|
* \remark Not used. Used by module droitpret only.
|
||||||
*/
|
*/
|
||||||
function add_subproduct($id_sub)
|
function add_subproduct($id_sub)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -167,11 +167,15 @@ $max=15;
|
|||||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.envente,";
|
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.envente,";
|
||||||
$sql.= " p.tms as datem";
|
$sql.= " p.tms as datem";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_subproduct as sp ON p.rowid = sp.fk_product_subproduct";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_subproduct as sp ON p.rowid = sp.fk_product_subproduct"; // Exclude record that are subproduct for module ???
|
||||||
$sql.= " WHERE sp.fk_product_subproduct IS NULL";
|
$sql.= " WHERE sp.fk_product_subproduct IS NULL";
|
||||||
$sql.= " AND p.entity = ".$conf->entity;
|
$sql.= " AND p.entity = ".$conf->entity;
|
||||||
if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
|
if (empty($user->rights->produit->hidden) && empty($user->rights->service->hidden)) $sql.=' AND p.hidden=0';
|
||||||
if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
|
else
|
||||||
|
{
|
||||||
|
if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
|
||||||
|
if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
|
||||||
|
}
|
||||||
if ($type != '') $sql.= " AND p.fk_product_type = ".$type;
|
if ($type != '') $sql.= " AND p.fk_product_type = ".$type;
|
||||||
$sql.= $db->order("p.tms","DESC");
|
$sql.= $db->order("p.tms","DESC");
|
||||||
$sql.= $db->plimit($max,0);
|
$sql.= $db->plimit($max,0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user