Finnalise categorie contact

This commit is contained in:
Florian Henry 2013-07-30 17:24:27 +02:00
parent 44b3ebbeb4
commit 60bb595248
6 changed files with 21 additions and 3 deletions

View File

@ -334,6 +334,17 @@ class Categorie
$error++; $error++;
} }
} }
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
// Delete category // Delete category
if (! $error) if (! $error)

View File

@ -50,6 +50,7 @@ if ($type == 0) $title=$langs->trans("ProductsCategoriesArea");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoriesArea"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoriesArea");
elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea"); elseif ($type == 2) $title=$langs->trans("CustomersCategoriesArea");
elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea"); elseif ($type == 3) $title=$langs->trans("MembersCategoriesArea");
elseif ($type == 4) $title=$langs->trans("ContactsCategoriesArea");
else $title=$langs->trans("CategoriesArea"); else $title=$langs->trans("CategoriesArea");
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');

View File

@ -94,6 +94,7 @@ if ($object->id)
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
$head = categories_prepare_head($object,$type); $head = categories_prepare_head($object,$type);
dol_fiche_head($head, 'photos', $title, 0, 'category'); dol_fiche_head($head, 'photos', $title, 0, 'category');

View File

@ -125,7 +125,7 @@ if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort"); elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort"); elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
elseif ($type == 3) $title=$langs->trans("MembersCategoryShort"); elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
elseif ($type == 3) $title=$langs->trans("ContactCategoryShort"); elseif ($type == 4) $title=$langs->trans("ContactCategoriesShort");
else $title=$langs->trans("Category"); else $title=$langs->trans("Category");
$head = categories_prepare_head($object,$type); $head = categories_prepare_head($object,$type);
@ -445,6 +445,7 @@ if ($object->type == 3)
} }
} }
//Categorie contact
if($object->type == 4) if($object->type == 4)
{ {
$contacts = $object->get_type("socpeople","Contact",'contact',"socpeople"); $contacts = $object->get_type("socpeople","Contact",'contact',"socpeople");
@ -478,7 +479,7 @@ if($object->type == 4)
if ($typeid == 1) $permission=$user->rights->societe->creer; if ($typeid == 1) $permission=$user->rights->societe->creer;
if ($typeid == 2) $permission=$user->rights->societe->creer; if ($typeid == 2) $permission=$user->rights->societe->creer;
if ($typeid == 3) $permission=$user->rights->adherent->creer; if ($typeid == 3) $permission=$user->rights->adherent->creer;
if ($typeid == 4) $permission=$user->rights->contact->creer; if ($typeid == 4) $permission=$user->rights->societe->creer;
if ($permission) if ($permission)
{ {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$contact->id."'>"; print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid)?'id':'socid')."=".$object->id."&amp;type=".$typeid."&amp;removeelem=".$contact->id."'>";
@ -491,7 +492,7 @@ if($object->type == 4)
} }
else else
{ {
print "<tr ".$bc[false]."><td>".$langs->trans("ThisCategoryHasNoCustomer")."</td></tr>"; print "<tr ".$bc[false]."><td>".$langs->trans("ThisCategoryHasNoContact")."</td></tr>";
} }
print "</table>\n"; print "</table>\n";
} }

View File

@ -17,6 +17,7 @@ SuppliersCategoriesArea=Suppliers categories area
CustomersCategoriesArea=Customers categories area CustomersCategoriesArea=Customers categories area
ThirdPartyCategoriesArea=Third parties categories area ThirdPartyCategoriesArea=Third parties categories area
MembersCategoriesArea=Members categories area MembersCategoriesArea=Members categories area
ContactsCategoriesArea=Contacts categories area
MainCats=Main categories MainCats=Main categories
SubCats=Subcategories SubCats=Subcategories
CatStatistics=Statistics CatStatistics=Statistics
@ -86,6 +87,7 @@ ThisCategoryHasNoProduct=This category does not contain any product.
ThisCategoryHasNoSupplier=This category does not contain any supplier. ThisCategoryHasNoSupplier=This category does not contain any supplier.
ThisCategoryHasNoCustomer=This category does not contain any customer. ThisCategoryHasNoCustomer=This category does not contain any customer.
ThisCategoryHasNoMember=This category does not contain any member. ThisCategoryHasNoMember=This category does not contain any member.
ThisCategoryHasNoContact=This category does not contain any contact.
AssignedToCustomer=Assigned to a customer AssignedToCustomer=Assigned to a customer
AssignedToTheCustomer=Assigned to the customer AssignedToTheCustomer=Assigned to the customer
InternalCategory=Internal category InternalCategory=Internal category

View File

@ -17,6 +17,7 @@ SuppliersCategoriesArea=Espace des catégories de tiers fournisseurs
CustomersCategoriesArea=Espace des catégories de tiers clients ou prospects CustomersCategoriesArea=Espace des catégories de tiers clients ou prospects
ThirdPartyCategoriesArea=Espace des catégories de tiers ThirdPartyCategoriesArea=Espace des catégories de tiers
MembersCategoriesArea=Espace des catégories d'adhérents MembersCategoriesArea=Espace des catégories d'adhérents
ContactsCategoriesArea=Espace des catégories des contacts
MainCats=Catégories principales MainCats=Catégories principales
SubCats=Sous-catégories SubCats=Sous-catégories
CatStatistics=Statistiques CatStatistics=Statistiques
@ -86,6 +87,7 @@ ThisCategoryHasNoProduct=Cette catégorie ne contient aucun produit.
ThisCategoryHasNoSupplier=Cette catégorie ne contient aucun fournisseur. ThisCategoryHasNoSupplier=Cette catégorie ne contient aucun fournisseur.
ThisCategoryHasNoCustomer=Cette catégorie ne contient aucun client. ThisCategoryHasNoCustomer=Cette catégorie ne contient aucun client.
ThisCategoryHasNoMember=Cette catégorie ne contient aucun adhérent. ThisCategoryHasNoMember=Cette catégorie ne contient aucun adhérent.
ThisCategoryHasNoContact=Cette catégorie ne contient aucun contact.
AssignedToCustomer=Attribuer à un client AssignedToCustomer=Attribuer à un client
AssignedToTheCustomer=Attribué au client AssignedToTheCustomer=Attribué au client
InternalCategory=Catégorie interne InternalCategory=Catégorie interne