';
print '| ';
print $langs->trans("ClassifyInCategory").' ';
@@ -295,7 +339,9 @@ function formCategory($db,$object,$type,$typeid)
if ($user->rights->categorie->creer)
{
print ' | ';
- print ''.$langs->trans("NewCat").'';
+ print "id.'&type='.$typeid)."'>";
+ print img_picto($langs->trans("Create"),'filenew');
+ print "";
print ' | ';
}
print '
';
@@ -305,13 +351,15 @@ function formCategory($db,$object,$type,$typeid)
$c = new Categorie($db);
- $cats = $c->containing($object->id,$type,$typeid);
+ $cats = $c->containing($object->id,$typeid);
if (sizeof($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("MemberIsInCustomersCategories");
+ print "\n";
print '';
print '| '.$title.': |
';
@@ -333,12 +381,13 @@ function formCategory($db,$object,$type,$typeid)
// Lien supprimer
print '';
$permission=0;
- if ($type == 'fournisseur') $permission=$user->rights->societe->creer;
- if ($type == 'societe') $permission=$user->rights->societe->creer;
- if ($type == 'product') $permission=($user->rights->produit->creer || $user->rights->service->creer);
+ 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 ($permission)
{
- print "";
+ print "id.(empty($_REQUEST["socid"])?"&typeid=".$typeid:'')."&removecat=".$cat->id."'>";
print img_delete($langs->trans("DeleteFromCat")).' ';
print $langs->trans("DeleteFromCat")."";
}
@@ -362,6 +411,7 @@ function formCategory($db,$object,$type,$typeid)
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");
print $title;
print " ";
}
diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php
index 62265838efa..8eb51645b80 100644
--- a/htdocs/categories/fiche.php
+++ b/htdocs/categories/fiche.php
@@ -55,13 +55,14 @@ if ($_REQUEST['origin'])
if ($_GET['type'] == 0) $idProdOrigin = $_REQUEST['origin'];
if ($_GET['type'] == 1) $idSupplierOrigin = $_REQUEST['origin'];
if ($_GET['type'] == 2) $idCompanyOrigin = $_REQUEST['origin'];
+ if ($_GET['type'] == 3) $idMemberOrigin = $_REQUEST['origin'];
}
if ($_REQUEST['catorigin'])
{
if ($_GET['type'] == 0) $idCatOrigin = $_REQUEST['catorigin'];
}
-
+$urlfrom=isset($_REQUEST["urlfrom"])?$_REQUEST["urlfrom"]:'';
/*
@@ -73,7 +74,12 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
// Action ajout d'une categorie
if ($_POST["cancel"])
{
- if ($idProdOrigin)
+ if ($urlfrom)
+ {
+ header("Location: ".$urlfrom);
+ exit;
+ }
+ else if ($idProdOrigin)
{
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?id='.$idProdOrigin.'&type='.$_GET["type"]);
exit;
@@ -88,6 +94,11 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idSupplierOrigin.'&type='.$_GET["type"]);
exit;
}
+ else if ($idMemberOrigin)
+ {
+ header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$_GET["type"]);
+ exit;
+ }
else if ($idCatOrigin)
{
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCatOrigin.'&type='.$_GET["type"]);
@@ -139,22 +150,32 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer)
// Action confirmation de creation categorie
if ($_GET["action"] == 'confirmed')
{
- if ($idProdOrigin)
+ if ($urlfrom)
+ {
+ header("Location: ".$urlfrom);
+ exit;
+ }
+ else if ($idProdOrigin)
{
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?id='.$idProdOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
exit;
}
- if ($idCompanyOrigin)
+ else if ($idCompanyOrigin)
{
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idCompanyOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
exit;
}
- if ($idSupplierOrigin)
+ else if ($idSupplierOrigin)
{
header("Location: ".DOL_URL_ROOT.'/categories/categorie.php?socid='.$idSupplierOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
exit;
}
- if ($idCatOrigin)
+ else if ($idMemberOrigin)
+ {
+ header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$_GET["type"]);
+ exit;
+ }
+ else if ($idCatOrigin)
{
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCatOrigin.'&mesg='.urlencode($langs->trans("CatCreated")));
exit;
@@ -182,10 +203,10 @@ if ($user->rights->categorie->creer)
{
print ' | ';
print nl2br($c->description);
print ' | ';
-// Visibility
-/*
-if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
-{
- if ($c->socid)
- {
- $soc = new Societe($db);
- $soc->fetch($c->socid);
-
- print '| ';
- print $langs->trans("AssignedToTheCustomer").' | ';
- print $soc->getNomUrl(1);
- print ' |
';
-
- $catsMeres = $c->get_meres ();
-
- if ($catsMeres < 0)
- {
- dol_print_error();
- }
- else if (count($catsMeres) > 0)
- {
- print '| ';
- print $langs->trans("CategoryContents").' | ';
- print ($c->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
- print ' |
';
- }
- }
- else
- {
- print '| ';
- print $langs->trans("CategoryContents").' | ';
- print ($c->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
- print ' |
';
- }
-}
-else
-{
- print '| ';
- print $langs->trans("CategoryContents").' | ';
- print ($c->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
- print ' |
';
-}
-*/
-
print '
';
print '';
@@ -214,7 +171,15 @@ else
{
print "
";
print "\n";
- print "| ".$langs->trans("SubCats")." |
\n";
+ print "| ".$langs->trans("SubCats").' | ';
+ if ($user->rights->categorie->creer)
+ {
+ print "id.'&type='.$type)."'>";
+ print img_picto($langs->trans("Create"),'filenew');
+ print "";
+ }
+ print " | ";
+ print "
\n";
if (sizeof ($cats) > 0)
{
$var=true;
@@ -226,7 +191,7 @@ else
print "\t\t";
print "".$cat->label."";
print " | \n";
- print "\t\t".$cat->description." | \n";
+ print "\t\t".''.$cat->description." | \n";
/*
if ($cat->visible == 1)
@@ -247,24 +212,9 @@ else
print "| ".$langs->trans("NoSubCat")." |
";
}
print "
\n";
-
- /*
- * Boutons actions
- */
- if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
- {
- print "";
- }
}
-
+// List of products
if ($c->type == 0)
{
@@ -379,6 +329,46 @@ if($c->type == 2)
}
}
+// List of members
+if ($c->type == 3)
+{
+
+ $prods = $c->get_type ("member","Member");
+ if ($prods < 0)
+ {
+ dol_print_error($db,$c->error);
+ }
+ else
+ {
+ print "
";
+ print "\n";
+ print "| ".$langs->trans("Member")." |
\n";
+
+ if (sizeof ($prods) > 0)
+ {
+ $i = 0;
+ $var=true;
+ foreach ($prods as $prod)
+ {
+ $i++;
+ $var=!$var;
+ print "\t\n";
+ print '| ';
+ print img_object($langs->trans("ShowMember"),"member");
+ print " ".$prod->ref." | \n";
+ print ''.$prod->libelle." | \n";
+ print ''.$prod->description." | \n";
+ print "
\n";
+ }
+ }
+ else
+ {
+ print "| ".$langs->trans("ThisCategoryHasNoMember")." |
";
+ }
+ print "
\n";
+ }
+}
+
$db->close();
llxFooter('$Date$ - $Revision$');
diff --git a/htdocs/fourn/product/categorie.php b/htdocs/fourn/product/categorie.php
index 381f1d7ae6a..486ac3c84a2 100644
--- a/htdocs/fourn/product/categorie.php
+++ b/htdocs/fourn/product/categorie.php
@@ -120,7 +120,7 @@ if ($_GET["id"])
print "
';
print '| ';
$cat = new Categorie ($db);
- $way = $cat->print_primary_way($product->id," > ",'fourn/product/liste.php');
+ $way = $cat->print_primary_way($product->id," > ",'fourn/product/liste.php', 1);
if ($way == "")
{
- print "Ce produit n'appartient � aucune cat�gorie";
+ print "Ce produit n'appartient a aucune categorie";
}
else
{
diff --git a/htdocs/includes/menus/barre_left/eldy.lib.php b/htdocs/includes/menus/barre_left/eldy.lib.php
index e63f34b58f4..06797f69f4e 100644
--- a/htdocs/includes/menus/barre_left/eldy.lib.php
+++ b/htdocs/includes/menus/barre_left/eldy.lib.php
@@ -821,6 +821,18 @@ function print_left_eldy_menu($db,$menu_array)
$newmenu->add(DOL_URL_ROOT."/adherents/liste.php?leftmenu=members&statut=-1,1&mainmenu=members",$langs->trans("NewSubscription"),1,$user->rights->adherent->cotisation->creer);
$newmenu->add(DOL_URL_ROOT."/adherents/cotisations.php?leftmenu=members",$langs->trans("List"),1,$user->rights->adherent->cotisation->lire);
+
+ if ($conf->categorie->enabled)
+ {
+ $langs->load("categories");
+ $newmenu->add(DOL_URL_ROOT."/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 0, $user->rights->categorie->lire);
+ if ($user->societe_id == 0)
+ {
+ $newmenu->add(DOL_URL_ROOT."/categories/fiche.php?action=create&type=3", $langs->trans("NewCat"), 1, $user->rights->categorie->creer);
+ }
+ //if ($leftmenu=="cat") $newmenu->add(DOL_URL_ROOT."/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
+ }
+
if ($conf->banque->enabled)
{
$langs->load("bills");
@@ -846,6 +858,8 @@ function print_left_eldy_menu($db,$menu_array)
$newmenu->add(DOL_URL_ROOT."/adherents/index.php?leftmenu=setup&mainmenu=members",$langs->trans("Setup"),0,$user->rights->adherent->configurer);
$newmenu->add(DOL_URL_ROOT."/adherents/type.php?leftmenu=setup&",$langs->trans("MembersTypes"),1,$user->rights->adherent->configurer);
$newmenu->add(DOL_URL_ROOT."/adherents/options.php?leftmenu=setup&",$langs->trans("MembersAttributes"),1,$user->rights->adherent->configurer);
+
+
}
}
diff --git a/htdocs/includes/triggers/interface_modCommande_Ecotax.class.php-NORUN b/htdocs/includes/triggers/interface_modCommande_Ecotax.class.php-NORUN
index be5e95a6334..fbf2263d55f 100644
--- a/htdocs/includes/triggers/interface_modCommande_Ecotax.class.php-NORUN
+++ b/htdocs/includes/triggers/interface_modCommande_Ecotax.class.php-NORUN
@@ -277,7 +277,7 @@ class InterfaceEcotax
}
$c = new Categorie($this->db);
$cats = array();
- $cats = $c->containing($product_id);
+ $cats = $c->containing($product_id,0);
$found=0;
if (count($cats)==0) {
return 0;
diff --git a/htdocs/install/mysql/tables/llx_categorie_member.key.sql b/htdocs/install/mysql/tables/llx_categorie_member.key.sql
new file mode 100644
index 00000000000..7e12e06beb7
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_categorie_member.key.sql
@@ -0,0 +1,28 @@
+-- ============================================================================
+-- Copyright (C) 2005 Brice Davoleau
+-- Copyright (C) 2005 Matthieu Valleton
+-- Copyright (C) 2005-2010 Laurent Destailleur
+--
+-- 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
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+--
+-- $Id$
+-- ============================================================================
+
+ALTER TABLE llx_categorie_member ADD PRIMARY KEY (fk_categorie, fk_member);
+ALTER TABLE llx_categorie_member ADD INDEX idx_categorie_member_fk_categorie (fk_categorie);
+ALTER TABLE llx_categorie_member ADD INDEX idx_categorie_member_fk_member (fk_member);
+
+ALTER TABLE llx_categorie_member ADD CONSTRAINT fk_categorie_member_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
+ALTER TABLE llx_categorie_member ADD CONSTRAINT fk_categorie_member_member_rowid FOREIGN KEY (fk_member) REFERENCES llx_adherent (rowid);
diff --git a/htdocs/install/mysql/tables/llx_categorie_member.sql b/htdocs/install/mysql/tables/llx_categorie_member.sql
new file mode 100644
index 00000000000..b0d2fca86ae
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_categorie_member.sql
@@ -0,0 +1,26 @@
+-- ============================================================================
+-- Copyright (C) 2005 Brice Davoleau
+-- Copyright (C) 2005-2010 Matthieu Valleton
+--
+-- 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
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+--
+-- $Id$
+-- ============================================================================
+
+create table llx_categorie_member
+(
+ fk_categorie integer NOT NULL,
+ fk_member integer NOT NULL
+)type=innodb;
diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang
index 52b78fec724..d8b5e957811 100644
--- a/htdocs/langs/en_US/categories.lang
+++ b/htdocs/langs/en_US/categories.lang
@@ -16,6 +16,7 @@ ProductsCategoriesArea=Products/Services' categories area
SuppliersCategoriesArea=Suppliers' categories area
CustomersCategoriesArea=Customers' categories area
ThirdPartyCategoriesArea=Third parties' categories area
+MembersCategoriesArea=Members' categories area
MainCats=Main categories
SubCats=Subcategories
CatStatistics=Statistics
@@ -69,13 +70,16 @@ NoCategoriesDefined=No category defined
SuppliersCategoryShort=Suppliers category
CustomersCategoryShort=Customers category
ProductsCategoryShort=Products category
+MembersCategoryShort=Members category
SuppliersCategoriesShort=Suppliers categories
CustomersCategoriesShort=Customers categories
CustomersProspectsCategoriesShort=Custo./Prosp. categories
ProductsCategoriesShort=Products categories
+MembersCategoriesShort=Members categories
ThisCategoryHasNoProduct=This category does not contain any product.
ThisCategoryHasNoSupplier=This category does not contain any supplier.
ThisCategoryHasNoCustomer=This category does not contain any customer.
+ThisCategoryHasNoMember=This category does not contain any member.
AssignedToCustomer=Assigned to a customer
AssignedToTheCustomer=Assigned to the customer
InternalCategory=Internal category
diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang
index c0d636f1a6e..c45bbf532d5 100644
--- a/htdocs/langs/fr_FR/categories.lang
+++ b/htdocs/langs/fr_FR/categories.lang
@@ -16,6 +16,7 @@ ProductsCategoriesArea=Espace des catégories de produits et services
SuppliersCategoriesArea=Espace des catégories de tiers fournisseurs
CustomersCategoriesArea=Espace des catégories de tiers clients ou prospects
ThirdPartyCategoriesArea=Espace des catégories de tiers
+MembersCategoriesArea=Espace des catégories d'adhérents
MainCats=Catégories principales
SubCats=Sous-catégories
CatStatistics=Statistiques
@@ -69,13 +70,16 @@ NoCategoriesDefined=Aucune catégorie définie
SuppliersCategoryShort=Catégorie fournisseurs
CustomersCategoryShort=Catégorie clients
ProductsCategoryShort=Catégorie produits
+MembersCategoryShort=Catégorie adhérent
SuppliersCategoriesShort=Catégories fournisseurs
CustomersCategoriesShort=Catégories clients
CustomersProspectsCategoriesShort=Catégories clients/prospects
ProductsCategoriesShort=Catégories produits
+MembersCategoriesShort=Catégories adhérents
ThisCategoryHasNoProduct=Cette catégorie ne contient aucun produit.
ThisCategoryHasNoSupplier=Cette catégorie ne contient aucun fournisseur.
ThisCategoryHasNoCustomer=Cette catégorie ne contient aucun client.
+ThisCategoryHasNoMember=Cette catégorie ne contient aucun adhérent.
AssignedToCustomer=Attribuer à un client
AssignedToTheCustomer=Attribué au client
InternalCategory=Catégorie interne
diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php
index 196f563a001..50bd4eaa829 100644
--- a/htdocs/societe.class.php
+++ b/htdocs/societe.class.php
@@ -806,11 +806,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,'societe',2);
+ $toute_categs ['societe'] = $static_cat->containing($this->id,2);
}
if ($this->fournisseur)
{
- $toute_categs ['fournisseur'] = $static_cat->containing($this->id,'fournisseur',1);
+ $toute_categs ['fournisseur'] = $static_cat->containing($this->id,1);
}
// Remove each "Categorie"
diff --git a/htdocs/theme/eldy/eldy.css.php b/htdocs/theme/eldy/eldy.css.php
index 0762cc221dc..592edf08b6f 100644
--- a/htdocs/theme/eldy/eldy.css.php
+++ b/htdocs/theme/eldy/eldy.css.php
@@ -449,7 +449,7 @@ a.help:hover { font-size:px; font-family:
div.blockvmenupair
{
- width:160px;
+ width:164px;
border-right: 1px solid #555555;
border-bottom: 1px solid #555555;
font-family: helvetica, verdana, arial, sans-serif;
@@ -469,7 +469,7 @@ div.blockvmenupair
div.blockvmenuimpair
{
- width:160px;
+ width:164px;
border-right: 1px solid #555555;
border-bottom: 1px solid #555555;
font-family: helvetica, verdana, arial, sans-serif;
@@ -489,7 +489,7 @@ div.blockvmenuimpair
div.help
{
- width:160px;
+ width:164px;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
background: #f0f0f0;
|