dbut ajout possibilit de dterminer si le contenu d'une catgorie 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:
Regis Houssin 2006-03-31 15:06:28 +00:00
parent c3804bdac3
commit c329cdfacd
2 changed files with 29 additions and 10 deletions

View File

@ -924,10 +924,14 @@ if ($_GET['propalid'] > 0)
print '<tr '.$bc[$var].">\n";
print '<td><textarea cols="50" name="np_desc" rows="'.ROWS_2.'"></textarea></td>';
print '<td align="center">';
if($societe->tva_assuj == "0")
print '<input type="hidden" name="np_tva_tx" value="0">0';
else
$html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe);
if($societe->tva_assuj == "0")
{
print '<input type="hidden" name="np_tva_tx" value="0">0';
}
else
{
$html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe);
}
print "</td>\n";
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>';
@ -948,11 +952,15 @@ if ($_GET['propalid'] > 0)
print '<tr '.$bc[$var].'>';
print '<td colspan="2">';
// multiprix
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);
// multiprix
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);
}
print '<br>';
print '<textarea cols="50" name="np_desc" rows="'.ROWS_2.'"></textarea>';
print '</td>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* 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>
*
* 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)
{
global $langs,$conf;
global $langs,$conf,$user;
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration";
$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";
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;
$sql.= " ORDER BY p.nbvente DESC";
if ($limit) $sql.= " LIMIT $limit";