Added types constants to categories

This commit is contained in:
Raphaël Doursenaud 2015-05-23 18:52:31 +02:00
parent 995a2c127d
commit ee808cdfd7
27 changed files with 309 additions and 273 deletions

View File

@ -8,6 +8,7 @@
* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -1584,7 +1585,8 @@ class Adherent extends CommonObject
}
if ($option == 'category')
{
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose;
$type = Categorie::TYPE_MEMBER;
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type='.$type.$linkclose;
$linkend='</a>';
}

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -210,7 +210,7 @@ if ($resql)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1);
$moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
if ($moreforfilter)

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -50,14 +51,14 @@ $parent=GETPOST('parent');
if ($origin)
{
if ($type == 0) $idProdOrigin = $origin;
if ($type == 1) $idSupplierOrigin = $origin;
if ($type == 2) $idCompanyOrigin = $origin;
if ($type == 3) $idMemberOrigin = $origin;
if ($type == 4) $idContactOrigin = $origin;
if ($type == Categorie::TYPE_PRODUCT) $idProdOrigin = $origin;
if ($type == Categorie::TYPE_SUPPLIER) $idSupplierOrigin = $origin;
if ($type == Categorie::TYPE_CUSTOMER) $idCompanyOrigin = $origin;
if ($type == Categorie::TYPE_MEMBER) $idMemberOrigin = $origin;
if ($type == Categorie::TYPE_CONTACT) $idContactOrigin = $origin;
}
if ($catorigin && $type == 0) $idCatOrigin = $catorigin;
if ($catorigin && $type == Categorie::TYPE_PRODUCT) $idCatOrigin = $catorigin;
$object = new Categorie($db);

View File

@ -6,6 +6,7 @@
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -46,40 +47,40 @@ $dbtablename = '';
// For categories on third parties
if (! empty($socid)) $id = $socid;
if (! isset($type)) $type = 0;
if ($type == 1 || $type == 2) $socid = $id;
if (! isset($type)) $type = Categorie::TYPE_PRODUCT;
if ($type == Categorie::TYPE_SUPPLIER || $type == Categorie::TYPE_CUSTOMER) $socid = $id;
if ($id || $ref)
{
if ($type == 0) {
if ($type == Categorie::TYPE_PRODUCT) {
$elementtype = 'product';
$objecttype = 'produit|service&categorie';
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
$dbtablename = 'product';
$fieldid = isset($ref)?'ref':'rowid';
}
elseif ($type == 1) {
elseif ($type == Categorie::TYPE_SUPPLIER) {
$elementtype = 'fournisseur';
$objecttype = 'societe&categorie';
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
$dbtablename = '&societe';
$fieldid = 'rowid';
}
elseif ($type == 2) {
elseif ($type == Categorie::TYPE_CUSTOMER) {
$elementtype = 'societe';
$objecttype = 'societe&categorie';
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
$dbtablename = '&societe';
$fieldid = 'rowid';
}
elseif ($type == 3) {
elseif ($type == Categorie::TYPE_MEMBER) {
$elementtype = 'member';
$objecttype = 'adherent&categorie';
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
$dbtablename = 'adherent';
$fieldid = ! empty($ref)?'ref':'rowid';
}
elseif ($type == 4) {
elseif ($type == Categorie::TYPE_CONTACT) {
$elementtype = 'societe';
$objecttype = 'contact';
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
@ -109,34 +110,34 @@ if (empty($reshook))
// Remove element from category
if ($removecat > 0)
{
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$object = new Product($db);
$result = $object->fetch($id, $ref);
$elementtype = 'product';
}
if ($type==1 && $user->rights->societe->creer)
if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
{
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
$object = new Fournisseur($db);
$result = $object->fetch($objectid);
$elementtype = 'fournisseur';
}
if ($type==2 && $user->rights->societe->creer)
if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{
$object = new Societe($db);
$result = $object->fetch($objectid);
$elementtype = 'societe';
}
if ($type == 3 && $user->rights->adherent->creer)
if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$object = new Adherent($db);
$result = $object->fetch($objectid);
$elementtype = 'member';
}
if ($type == 4 && $user->rights->societe->creer)
if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
{
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$object = new Contact($db);
@ -157,34 +158,34 @@ if (empty($reshook))
// Add object into a category
if ($parent > 0)
{
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$object = new Product($db);
$result = $object->fetch($id, $ref);
$elementtype = 'product';
}
if ($type==1 && $user->rights->societe->creer)
if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
{
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
$object = new Fournisseur($db);
$result = $object->fetch($objectid);
$elementtype = 'fournisseur';
}
if ($type==2 && $user->rights->societe->creer)
if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{
$object = new Societe($db);
$result = $object->fetch($objectid);
$elementtype = 'societe';
}
if ($type==3 && $user->rights->adherent->creer)
if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$object = new Adherent($db);
$result = $object->fetch($objectid);
$elementtype = 'member';
}
if ($type == 4 && $user->rights->societe->creer)
if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer)
{
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$object = new Contact($db);
@ -324,7 +325,7 @@ if ($socid)
}
else if ($id || $ref)
{
if ($type == 0)
if ($type == Categorie::TYPE_PRODUCT)
{
$langs->load("products");
@ -377,7 +378,7 @@ else if ($id || $ref)
formCategory($db,$product,0,$socid,($user->rights->produit->creer || $user->rights->service->creer));
}
if ($type == 3)
if ($type == Categorie::TYPE_MEMBER)
{
$langs->load("members");
@ -455,7 +456,7 @@ else if ($id || $ref)
formCategory($db,$member,3,0,$user->rights->adherent->creer);
}
if ($type == 4)
if ($type == Categorie::TYPE_CONTACT)
{
$langs->load("contact");
@ -618,16 +619,16 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
{
global $user,$langs,$form,$bc;
if ($typeid == 0) $title = $langs->trans("ProductsCategoriesShort");
if ($typeid == 1) $title = $langs->trans("SuppliersCategoriesShort");
if ($typeid == 2) $title = $langs->trans("CustomersProspectsCategoriesShort");
if ($typeid == 3) $title = $langs->trans("MembersCategoriesShort");
if ($typeid == 4) $title = $langs->trans("ContactCategoriesShort");
if ($typeid == Categorie::TYPE_PRODUCT) $title = $langs->trans("ProductsCategoriesShort");
if ($typeid == Categorie::TYPE_SUPPLIER) $title = $langs->trans("SuppliersCategoriesShort");
if ($typeid == Categorie::TYPE_CUSTOMER) $title = $langs->trans("CustomersProspectsCategoriesShort");
if ($typeid == Categorie::TYPE_MEMBER) $title = $langs->trans("MembersCategoriesShort");
if ($typeid == Categorie::TYPE_CONTACT) $title = $langs->trans("ContactCategoriesShort");
$linktocreate='';
if ($showclassifyform && $user->rights->categorie->creer)
{
$linktocreate='<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&amp;origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==1||$typeid==2)?'socid':'id').'='.$object->id.'&type='.$typeid).'">';
$linktocreate='<a href="'.DOL_URL_ROOT.'/categories/card.php?action=create&amp;origin='.$object->id.'&type='.$typeid.'&urlfrom='.urlencode($_SERVER["PHP_SELF"].'?'.(($typeid==Categorie::TYPE_SUPPLIER||$typeid==Categorie::TYPE_CUSTOMER)?'socid':'id').'='.$object->id.'&type='.$typeid).'">';
$linktocreate.=$langs->trans("CreateCat").' ';
$linktocreate.=img_picto($langs->trans("Create"),'filenew');
$linktocreate.="</a>";
@ -662,11 +663,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
if (count($cats) > 0)
{
if ($typeid == 0) $title=$langs->trans("ProductIsInCategories");
if ($typeid == 1) $title=$langs->trans("CompanyIsInSuppliersCategories");
if ($typeid == 2) $title=$langs->trans("CompanyIsInCustomersCategories");
if ($typeid == 3) $title=$langs->trans("MemberIsInCategories");
if ($typeid == 4) $title=$langs->trans("ContactIsInCategories");
if ($typeid == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductIsInCategories");
if ($typeid == Categorie::TYPE_SUPPLIER) $title=$langs->trans("CompanyIsInSuppliersCategories");
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyIsInCustomersCategories");
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberIsInCategories");
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactIsInCategories");
print "\n";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$title.':</td></tr>';
@ -687,11 +688,11 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
// Link to delete from category
print '<td align="right">';
$permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == 4) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
if ($permission)
{
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removecat=".$cat->id."'>";
@ -715,18 +716,17 @@ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
}
else
{
if ($typeid == 0) $title=$langs->trans("ProductHasNoCategory");
if ($typeid == 1) $title=$langs->trans("CompanyHasNoCategory");
if ($typeid == 2) $title=$langs->trans("CompanyHasNoCategory");
if ($typeid == 3) $title=$langs->trans("MemberHasNoCategory");
if ($typeid == 4) $title=$langs->trans("ContactHasNoCategory");
if ($typeid == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductHasNoCategory");
if ($typeid == Categorie::TYPE_SUPPLIER) $title=$langs->trans("CompanyHasNoCategory");
if ($typeid == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CompanyHasNoCategory");
if ($typeid == Categorie::TYPE_MEMBER) $title=$langs->trans("MemberHasNoCategory");
if ($typeid == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactHasNoCategory");
print $title;
print "<br/>";
}
return 0;
}
llxFooter();
$db->close();

View File

@ -1,13 +1,14 @@
<?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Davoleau Brice <brice.davoleau@gmail.com>
* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -40,6 +41,13 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
*/
class Categorie extends CommonObject
{
// Categories types
const TYPE_PRODUCT = 0;
const TYPE_SUPPLIER = 1;
const TYPE_CUSTOMER = 2;
const TYPE_MEMBER = 3;
const TYPE_CONTACT = 4;
public $element='category';
public $table_element='categories';
@ -1166,11 +1174,17 @@ class Categorie extends CommonObject
$cats = array();
$typeid=-1; $table='';
if ($type == '0' || $type == 'product') { $typeid=0; $table='product'; $type='product'; }
else if ($type == '1' || $type == 'supplier') { $typeid=1; $table='soc'; $type='fournisseur'; }
else if ($type == '2' || $type == 'customer') { $typeid=2; $table='soc'; $type='societe'; }
else if ($type == '3' || $type == 'member') { $typeid=3; $table='member'; $type='member'; }
else if ($type == '4' || $type == 'contact') { $typeid=4; $table='socpeople'; $type='contact'; }
if ($type == '0' || $type == 'product') {
$typeid=self::TYPE_PRODUCT; $table='product'; $type='product';
} else if ($type == '1' || $type == 'supplier') {
$typeid=self::TYPE_SUPPLIER; $table='soc'; $type='fournisseur';
} else if ($type == '2' || $type == 'customer') {
$typeid=self::TYPE_CUSTOMER; $table='soc'; $type='societe';
} else if ($type == '3' || $type == 'member') {
$typeid=self::TYPE_MEMBER; $table='member'; $type='member';
} else if ($type == '4' || $type == 'contact') {
$typeid=self::TYPE_CONTACT; $table='socpeople'; $type='contact';
}
$sql = "SELECT ct.fk_categorie, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_".$type." as ct, ".MAIN_DB_PREFIX."categorie as c";
@ -1220,11 +1234,11 @@ class Categorie extends CommonObject
$cats = array();
$typeid=-1;
if ($type == 0 || $type == 'product') { $typeid=0; }
else if ($type == 1 || $type == 'supplier') { $typeid=1; }
else if ($type == 2 || $type == 'customer') { $typeid=2; }
else if ($type == 3 || $type == 'member') { $typeid=3; }
else if ($type == 4 || $type == 'contact') { $typeid=4; }
if ($type == 0 || $type == 'product') { $typeid=self::TYPE_PRODUCT; }
else if ($type == 1 || $type == 'supplier') { $typeid=self::TYPE_SUPPLIER; }
else if ($type == 2 || $type == 'customer') { $typeid=self::TYPE_CUSTOMER; }
else if ($type == 3 || $type == 'member') { $typeid=self::TYPE_MEMBER; }
else if ($type == 4 || $type == 'contact') { $typeid=self::TYPE_CONTACT; }
// Generation requete recherche
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
@ -1550,7 +1564,7 @@ class Categorie extends CommonObject
$this->specimen=1;
$this->description = 'This is a description';
$this->socid = 1;
$this->type = 0;
$this->type = self::TYPE_PRODUCT;
}
/**

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -35,7 +36,7 @@ $langs->load("categories");
if (! $user->rights->categorie->lire) accessforbidden();
$id=GETPOST('id','int');
$type=(GETPOST('type') ? GETPOST('type') : 0);
$type=(GETPOST('type') ? GETPOST('type') : Categorie::TYPE_PRODUCT);
$catname=GETPOST('catname','alpha');
$section=(GETPOST('section')?GETPOST('section'):0);
@ -47,12 +48,12 @@ $section=(GETPOST('section')?GETPOST('section'):0);
$categstatic = new Categorie($db);
$form = new Form($db);
if ($type == 0) $title=$langs->trans("ProductsCategoriesArea");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoriesArea");
elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea");
elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea");
elseif ($type == 4) $title=$langs->trans("ContactsCategoriesArea");
else $title=$langs->trans("CategoriesArea");
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoriesArea");
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoriesArea");
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoriesArea");
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoriesArea");
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactsCategoriesArea");
else $title=$langs->trans("CategoriesArea");
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -93,11 +94,11 @@ $form = new Form($db);
if ($object->id)
{
$title=$langs->trans("ProductsCategoryShort");
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
$head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'photos', $title, 0, 'category');

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -143,12 +144,12 @@ llxHeader("","",$langs->trans("Translation"));
$form = new Form($db);
$formadmin=new FormAdmin($db);
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category");
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'translation', $title, 0, 'category');

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -70,33 +71,33 @@ $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Remove element from category
if ($id > 0 && $removeelem > 0)
{
if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer))
if ($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$tmpobject = new Product($db);
$result = $tmpobject->fetch($removeelem);
$elementtype = 'product';
}
else if ($type==1 && $user->rights->societe->creer)
else if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
{
$tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem);
$elementtype = 'fournisseur';
}
else if ($type==2 && $user->rights->societe->creer)
else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
{
$tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem);
$elementtype = 'societe';
}
else if ($type == 3 && $user->rights->adherent->creer)
else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$tmpobject = new Adherent($db);
$result = $tmpobject->fetch($removeelem);
$elementtype = 'member';
}
else if ($type == 4 && $user->rights->societe->creer) {
else if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$tmpobject = new Contact($db);
@ -121,7 +122,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
}
}
if ($type==0 && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer))
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$newobject = new Product($db);
@ -158,12 +159,12 @@ $form = new Form($db);
llxHeader("","",$langs->trans("Categories"));
if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category");
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort");
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type);
@ -283,7 +284,7 @@ else
}
// List of products or services (type is type of category)
if ($object->type == 0)
if ($object->type == Categorie::TYPE_PRODUCT)
{
$prods = $object->getObjectsInCateg("product");
if ($prods < 0)
@ -292,7 +293,7 @@ if ($object->type == 0)
}
else
{
$showclassifyform=1; $typeid=0;
$showclassifyform=1; $typeid=Categorie::TYPE_PRODUCT;
// Form to add record into a category
if ($showclassifyform)
@ -334,10 +335,10 @@ if ($object->type == 0)
print '<td align="right">';
$typeid=$object->type;
$permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission)
{
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$prod->id."'>";
@ -356,7 +357,7 @@ if ($object->type == 0)
}
}
if ($object->type == 1)
if ($object->type == Categorie::TYPE_SUPPLIER)
{
$socs = $object->getObjectsInCateg("supplier");
if ($socs < 0)
@ -384,10 +385,10 @@ if ($object->type == 1)
print '<td align="right">';
$typeid=$object->type;
$permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission)
{
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>";
@ -407,7 +408,7 @@ if ($object->type == 1)
}
}
if($object->type == 2)
if($object->type == Categorie::TYPE_CUSTOMER)
{
$socs = $object->getObjectsInCateg("customer");
if ($socs < 0)
@ -438,10 +439,10 @@ if($object->type == 2)
print '<td align="right">';
$typeid=$object->type;
$permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission)
{
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$soc->id."'>";
@ -461,7 +462,7 @@ if($object->type == 2)
}
// List of members
if ($object->type == 3)
if ($object->type == Categorie::TYPE_MEMBER)
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@ -493,10 +494,10 @@ if ($object->type == 3)
print '<td align="right">';
$typeid=$object->type;
$permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($permission)
{
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$member->id."'>";
@ -515,7 +516,7 @@ if ($object->type == 3)
}
//Categorie contact
if($object->type == 4)
if($object->type == Categorie::TYPE_CONTACT)
{
$contacts = $object->getObjectsInCateg("contact");
if ($contacts < 0)
@ -544,11 +545,11 @@ if($object->type == 4)
print '<td align="right">';
$typeid=$object->type;
$permission=0;
if ($typeid == 0) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == 4) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer);
if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer;
if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer;
if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer;
if ($permission)
{
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$contact->id."'>";

View File

@ -1,11 +1,12 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -299,7 +300,7 @@ if ($resql)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1);
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
// If the user can view prospects other than his'

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -245,7 +246,7 @@ if ($modecompta == 'CREANCES-DETTES')
// Category filter
print '<tr class="liste_titre">';
print '<td>';
print $langs->trans("Category") . ': ' . $formother->select_categories(0, $selected_cat, 'search_categ', true);
print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', true);
print ' ';
print $langs->trans("SubCats") . '? ';
print '<input type="checkbox" name="subcat" value="yes"';

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -313,7 +314,7 @@ print "<table class=\"noborder\" width=\"100%\">";
// Category filter
print '<tr class="liste_titre">';
print '<td>';
print $langs->trans("Category") . ': ' . $formother->select_categories(2, $selected_cat, 'search_categ', true);
print $langs->trans("Category") . ': ' . $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', true);
print ' ';
print $langs->trans("SubCats") . '? ';
print '<input type="checkbox" name="subcat" value="yes"';

View File

@ -1,12 +1,12 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -276,7 +276,7 @@ if ($result)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(4,$search_categ,'search_categ',1);
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CONTACT,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
if ($moreforfilter)

View File

@ -1,21 +1,21 @@
<?php
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* 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-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
/* Copyright (c) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* 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-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@ -4593,7 +4593,7 @@ class Form
if ($rendermode == 0)
{
$cate_arbo = $this->select_all_categories(0, '', 'parent', 64, 0, 1);
$cate_arbo = $this->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
foreach($categories as $c) {
$arrayselected[] = $c->id;
}

View File

@ -1,13 +1,14 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -83,8 +84,8 @@ function societe_prepare_head(Societe $object)
//show categorie tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
$type = 2;
if ($object->fournisseur) $type = 1;
$type = Categorie::TYPE_CUSTOMER;
if ($object->fournisseur) $type = Categorie::TYPE_SUPPLIER;
$head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$object->id."&type=".$type;
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -88,7 +89,7 @@ function contact_prepare_head(Contact $object)
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
$type = 4;
$type = Categorie::TYPE_CONTACT;
$head[$tab][0] = DOL_URL_ROOT.'/categories/categorie.php?id='.$object->id."&type=".$type;
$head[$tab][1] = $langs->trans('Categories');
$head[$tab][2] = 'category';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -70,7 +71,8 @@ function member_prepare_head(Adherent $object)
// Show category tab
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=3';
$type = Categorie::TYPE_MEMBER;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';
$h++;

View File

@ -6,7 +6,7 @@
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
*
@ -1099,7 +1099,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categstatic=new Categorie($db);
// recovering the list of all the categories linked to product
$tblcateg=$categstatic->containing($idprod,0);
$tblcateg=$categstatic->containing($idprod, Categorie::TYPE_PRODUCT);
foreach ($tblcateg as $cate)
{
// Adding the descriptions if they are filled

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -60,7 +61,8 @@ function product_prepare_head($object)
/* No more required. Replaced with new multiselect component
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)
{
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=0';
$type = Categorie::TYPE_PRODUCT;
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type='.$type;
$head[$h][1] = $langs->trans('Categories');
$head[$h][2] = 'category';
$h++;

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -168,7 +169,7 @@ if ($resql)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(1,$search_categ,'search_categ',1);
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_SUPPLIER,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
if ($moreforfilter)

View File

@ -11,7 +11,8 @@
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Cédric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -974,7 +975,7 @@ else
// Categories
print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(0, '', 'parent', 64, 0, 1);
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, 250);
print "</td></tr>";
@ -1265,9 +1266,9 @@ else
// Categories
print '<tr><td valign="top">'.$langs->trans("Categories").'</td><td colspan="3">';
$cate_arbo = $form->select_all_categories(0, '', 'parent', 64, 0, 1);
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id,0);
$cats = $c->containing($object->id,Categorie::TYPE_PRODUCT);
foreach($cats as $cat) {
$arrayselected[] = $cat->id;
}

View File

@ -1,10 +1,11 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -473,7 +474,7 @@ if ($id > 0 || ! empty($ref))
if (! empty($conf->categorie->enabled))
{
print '<tr><td>'.$langs->trans("CategoryFilter").' &nbsp; </td>';
print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(0, $parent).'</td></tr>';
print '<td class="maxwidthonsmartphone">'.$form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'</td></tr>';
}
print '</table>';
print '</form>';

View File

@ -1,15 +1,15 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Adolfo segura <adolfo.segura@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Adolfo segura <adolfo.segura@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -292,7 +292,7 @@ else
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ',1);
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
if ($moreforfilter)

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -221,7 +222,7 @@ if ($resql)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ');
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
}
$moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>';

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -233,7 +234,7 @@ if ($resql)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ');
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
}
//$moreforfilter.=$langs->trans("StockTooLow").' <input type="checkbox" name="toolowstock" value="1"'.($toolowstock?' checked':'').'>';

View File

@ -1,16 +1,17 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -1334,11 +1335,11 @@ class Societe extends CommonObject
// Fill $toute_categs array with an array of (type => array of ("Categorie" instance))
if ($this->client || $this->prospect)
{
$toute_categs ['societe'] = $static_cat->containing($this->id,2);
$toute_categs ['societe'] = $static_cat->containing($this->id,Categorie::TYPE_CUSTOMER);
}
if ($this->fournisseur)
{
$toute_categs ['fournisseur'] = $static_cat->containing($this->id,1);
$toute_categs ['fournisseur'] = $static_cat->containing($this->id,Categorie::TYPE_SUPPLIER);
}
// Remove each "Categorie"
@ -2747,7 +2748,7 @@ class Societe extends CommonObject
$this->SupplierCategories = array();
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE type = 1";
$sql.= " WHERE type = ".Categorie::TYPE_SUPPLIER;
$resql=$this->db->query($sql);
if ($resql)

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*
* 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
@ -311,7 +311,7 @@ if ($resql)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(2,$search_categ,'search_categ');
$moreforfilter.=$htmlother->select_categories(Categories::TYPE_CUSTOMER,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
// If the user can view prospects other than his'