Qual: Removed deprecated feature

This commit is contained in:
Laurent Destailleur 2011-06-08 12:48:05 +00:00
parent bc1c2bbae5
commit bc25b7bd2c
17 changed files with 0 additions and 87 deletions

View File

@ -931,12 +931,6 @@ class Form
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang='". $langs->getDefaultLang() ."'";
}
$sql.= ' WHERE p.entity IN (0,'.(! empty($conf->entities['product']) ? $conf->entities['product'] : $conf->entity).')';
if (empty($user->rights->produit->hidden) && empty($user->rights->service->hidden)) $sql.=' AND p.hidden=0';
else
{
if (empty($user->rights->produit->hidden)) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
if (empty($user->rights->service->hidden)) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
}
if($finished == 0)
{
$sql.= " AND p.finished = ".$finished;

View File

@ -74,8 +74,6 @@ class box_produits extends ModeleBoxes {
$sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= ' WHERE p.entity IN (0,'.(! empty($conf->entities['product']) ? $conf->entities['product'] : $conf->entity).')';
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 (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
$sql.= $db->order('p.datec', 'DESC');

View File

@ -81,8 +81,6 @@ class box_services_vendus extends ModeleBoxes {
$sql.= ")";
$sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND s.entity = ".$conf->entity;
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)';
$sql.= " AND c.rowid = cd.fk_contrat";
$sql.= " AND cd.fk_product = p.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;

View File

@ -116,13 +116,6 @@ class modProduct extends DolibarrModules
$this->rights[$r][4] = 'supprimer';
$r++;
$this->rights[$r][0] = 36; // id de la permission
$this->rights[$r][1] = 'Voir/gérer les produits cachés'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecated)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'hidden';
$r++;
$this->rights[$r][0] = 38; // Must be same permission than in service module
$this->rights[$r][1] = 'Exporter les produits';
$this->rights[$r][2] = 'r';

View File

@ -109,13 +109,6 @@ class modService extends DolibarrModules
$this->rights[$r][4] = 'supprimer';
$r++;
$this->rights[$r][0] = 536; // id de la permission
$this->rights[$r][1] = 'Voir/gérer les services cachés'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecated)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'hidden';
$r++;
$this->rights[$r][0] = 538; // Must be same permission than in product module
$this->rights[$r][1] = 'Exporter les services';
$this->rights[$r][2] = 'r';

View File

@ -152,7 +152,6 @@ class ProductService extends Product
}
$sql.= " WHERE p.entity = ".$conf->entity;
if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ
if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
if ($sall)
{
$sql.= " AND (p.ref like '%".$this->db->escape($sall)."%' OR p.label like '%".$this->db->escape($sall)."%' OR p.description like '%".$this->db->escape($sall)."%' OR p.note like '%".$this->db->escape($sall)."%')";

View File

@ -2775,8 +2775,6 @@ class Product extends CommonObject
$sql = "SELECT count(p.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.fk_product_type <> 1";
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)';
$sql.= ' AND p.entity IN (0,'.(! empty($conf->entities['product']) ? $conf->entities['product'] : $conf->entity).')';
$resql=$this->db->query($sql);

View File

@ -67,8 +67,6 @@ class Service extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.fk_product_type = 1";
$sql.= " AND p.entity = ".$conf->entity;
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)';
$resql=$this->db->query($sql);
if ($resql)

View File

@ -760,23 +760,6 @@ if ($action == 'create' && ($user->rights->produit->creer || $user->rights->serv
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
print '</td></tr>';
// Hidden
/*
if (($_GET["type"] != 1 && $user->rights->produit->hidden)
|| ($_GET["type"] == 1 && $user->rights->service->hidden))
{
print '<tr><td>'.$langs->trans("Hidden").'</td><td>';
print $html->selectyesno('hidden',$product->hidden);
print '</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans("Hidden").'</td><td>';
print yn("No");
print '</td></tr>';
}
*/
// Note (invisible sur facture, propales...)
print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td>';
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");

View File

@ -168,12 +168,6 @@ $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.
$sql.= " p.tms as datem";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.entity IN (0,".(! empty($conf->entities['product']) ? $conf->entities['product'] : $conf->entity).")";
if (empty($user->rights->produit->hidden) && empty($user->rights->service->hidden)) $sql.=' AND p.hidden=0';
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;
$sql.= $db->order("p.tms","DESC");
$sql.= $db->plimit($max,0);

View File

@ -150,15 +150,6 @@ if ($_GET["fourn_id"] > 0) // The DISTINCT is used to avoid duplicate from this
}
$sql.= ' WHERE p.entity IN (0,'.(! empty($conf->entities['product']) ? $conf->entities['product'] : $conf->entity).')';
if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ
if (!$user->rights->produit->hidden && !$user->rights->service->hidden)
{
$sql.=' AND p.hidden=0';
}
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 ($sall)
{
$sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";

View File

@ -102,8 +102,6 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd";
$sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.rowid = pd.fk_product";
$sql.= " AND p.entity = ".$conf->entity;
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 (isset($_GET['type'])) $sql.= " AND fk_product_type = ".$_GET['type'];
$sql.= " GROUP BY (p.rowid)";
$sql.= $db->order($sortfield,$sortorder);

View File

@ -107,15 +107,6 @@ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql.= ') LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product';
$sql.= " WHERE p.entity = ".$conf->entity;
if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ
if (!$user->rights->produit->hidden && !$user->rights->service->hidden)
{
$sql.=' AND p.hidden=0';
}
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 ($sall)
{
$sql.= " AND (p.ref like '%".$db->escape($sall)."%' OR p.label like '%".$db->escape($sall)."%' OR p.description like '%".$db->escape($sall)."%' OR p.note like '%".$db->escape($sall)."%')";

View File

@ -359,8 +359,6 @@ class Entrepot extends CommonObject
$sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * ps.pmp) as value";
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p";
$sql .= " WHERE ps.fk_entrepot = ".$this->id." AND ps.fk_product=p.rowid";
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)';
//print $sql;
$result = $this->db->query($sql) ;

View File

@ -356,15 +356,6 @@ else
$sql.= " WHERE ps.fk_product = p.rowid";
$sql.= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse)
$sql.= " AND ps.fk_entrepot = ".$entrepot->id;
if (!$user->rights->produit->hidden && !$user->rights->service->hidden)
{
$sql.=' AND p.hidden=0';
}
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)';
}
$sql.= $db->order($sortfield,$sortorder);
dol_syslog('List products sql='.$sql);

View File

@ -117,8 +117,6 @@ $sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE m.fk_product = p.rowid";
$sql.= " AND m.fk_entrepot = s.rowid";
$sql.= " AND s.entity = ".$conf->entity;
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 (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0";
$sql.= $db->order("datem","DESC");
$sql.= $db->plimit($max,0);

View File

@ -87,8 +87,6 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON m.fk_user_author = u.rowid";
$sql.= " WHERE m.fk_product = p.rowid";
$sql.= " AND m.fk_entrepot = s.rowid";
$sql.= " AND s.entity = ".$conf->entity;
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 (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0";
if ($_GET["id"])
{