début ajout possibilité de déterminer si le contenu d'une catégorie sera visible ou
non dans la liste des produits/services, ceci afin de pouvoir cacher les sous-produits par exemple.
This commit is contained in:
parent
c3804bdac3
commit
c329cdfacd
@ -924,10 +924,14 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '<tr '.$bc[$var].">\n";
|
print '<tr '.$bc[$var].">\n";
|
||||||
print '<td><textarea cols="50" name="np_desc" rows="'.ROWS_2.'"></textarea></td>';
|
print '<td><textarea cols="50" name="np_desc" rows="'.ROWS_2.'"></textarea></td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if($societe->tva_assuj == "0")
|
if($societe->tva_assuj == "0")
|
||||||
print '<input type="hidden" name="np_tva_tx" value="0">0';
|
{
|
||||||
else
|
print '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||||
$html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe);
|
||||||
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td align="right"><input type="text" size="5" name="np_price"></td>';
|
print '<td align="right"><input type="text" size="5" name="np_price"></td>';
|
||||||
print '<td align="right"><input type="text" size="2" value="1" name="qty"></td>';
|
print '<td align="right"><input type="text" size="2" value="1" name="qty"></td>';
|
||||||
@ -948,11 +952,15 @@ if ($_GET['propalid'] > 0)
|
|||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
// multiprix
|
// multiprix
|
||||||
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||||
$html->select_produits('','idprod','',$conf->produit->limit_size,$societe->price_level);
|
{
|
||||||
else
|
$html->select_produits('','idprod','',$conf->produit->limit_size,$societe->price_level);
|
||||||
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
||||||
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<textarea cols="50" name="np_desc" rows="'.ROWS_2.'"></textarea>';
|
print '<textarea cols="50" name="np_desc" rows="'.ROWS_2.'"></textarea>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -606,11 +607,21 @@ class Form
|
|||||||
*/
|
*/
|
||||||
function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0)
|
function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20,$price_level=0)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf,$user;
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration";
|
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p ";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product as p ";
|
||||||
|
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
||||||
|
{
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||||
|
$sql .= ", ".MAIN_DB_PREFIX."categorie as c";
|
||||||
|
}
|
||||||
$sql.= " WHERE p.envente = 1";
|
$sql.= " WHERE p.envente = 1";
|
||||||
|
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
|
||||||
|
{
|
||||||
|
$sql .= " AND cp.fk_product = p.rowid";
|
||||||
|
$sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1";
|
||||||
|
}
|
||||||
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype;
|
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype;
|
||||||
$sql.= " ORDER BY p.nbvente DESC";
|
$sql.= " ORDER BY p.nbvente DESC";
|
||||||
if ($limit) $sql.= " LIMIT $limit";
|
if ($limit) $sql.= " LIMIT $limit";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user