diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a25088ecd9a..fdfd89306e6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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; diff --git a/htdocs/includes/boxes/box_produits.php b/htdocs/includes/boxes/box_produits.php index 24578ddb36a..6228576869b 100644 --- a/htdocs/includes/boxes/box_produits.php +++ b/htdocs/includes/boxes/box_produits.php @@ -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'); diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php index 4c02aef332d..fde238eac4d 100644 --- a/htdocs/includes/boxes/box_services_vendus.php +++ b/htdocs/includes/boxes/box_services_vendus.php @@ -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; diff --git a/htdocs/includes/modules/modProduct.class.php b/htdocs/includes/modules/modProduct.class.php index 1dc401ffed0..360e5a518c1 100644 --- a/htdocs/includes/modules/modProduct.class.php +++ b/htdocs/includes/modules/modProduct.class.php @@ -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'; diff --git a/htdocs/includes/modules/modService.class.php b/htdocs/includes/modules/modService.class.php index e49c9ca17ab..7a0a51ec6e8 100644 --- a/htdocs/includes/modules/modService.class.php +++ b/htdocs/includes/modules/modService.class.php @@ -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'; diff --git a/htdocs/product/canvas/service/product.service.class.php b/htdocs/product/canvas/service/product.service.class.php index cde84e16fb6..d948c714cb1 100644 --- a/htdocs/product/canvas/service/product.service.class.php +++ b/htdocs/product/canvas/service/product.service.class.php @@ -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)."%')"; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e7eb13ffd12..95f10501e9f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -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); diff --git a/htdocs/product/class/service.class.php b/htdocs/product/class/service.class.php index a67a78466ec..683d6778445 100644 --- a/htdocs/product/class/service.class.php +++ b/htdocs/product/class/service.class.php @@ -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) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 8b63cc059c4..9e35c4c352e 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -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 ''; - // Hidden - /* - if (($_GET["type"] != 1 && $user->rights->produit->hidden) - || ($_GET["type"] == 1 && $user->rights->service->hidden)) - { - print '