';
-
- print '| '.$langs->trans("ThirdPartyName").' | ';
- print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom','','&type='.$type);
- print ' |
';
-
- // Alias names (commercial, trademark or alias names)
- print '| '.$langs->trans('AliasNames').' | ';
- print $soc->name_alias;
- print " |
";
-
- if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
- {
- print '| '.$langs->trans('Prefix').' | '.$soc->prefix_comm.' |
';
- }
-
- if ($soc->client)
- {
- print '| ';
- print $langs->trans('CustomerCode').' | ';
- print $soc->code_client;
- if ($soc->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')';
- print ' |
';
- }
-
- if ($soc->fournisseur)
- {
- print '| ';
- print $langs->trans('SupplierCode').' | ';
- print $soc->code_fournisseur;
- if ($soc->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')';
- print ' |
';
- }
-
- if (! empty($conf->barcode->enabled))
- {
- print '| '.$langs->trans('Gencod').' | '.$soc->barcode.' |
';
- }
-
- // Address
- print '| '.$langs->trans('Address').' | ';
- dol_print_address($soc->address,'gmap','thirdparty',$soc->id);
- print ' |
';
-
- // Zip / Town
- print '| '.$langs->trans('Zip').' | '.$soc->zip." | ";
- print ''.$langs->trans('Town').' | '.$soc->town." |
";
-
- // Country
- if ($soc->country)
- {
- print '| '.$langs->trans('Country').' | ';
- //$img=picto_from_langcode($soc->country_code);
- $img='';
- print ($img?$img.' ':'');
- print $soc->country;
- print ' |
';
- }
-
- // EMail
- print '| '.$langs->trans('EMail').' | ';
- print dol_print_email($soc->email,0,$soc->id,'AC_EMAIL');
- print ' |
';
-
- // Web
- print '| '.$langs->trans('Web').' | ';
- print dol_print_url($soc->url);
- print ' |
';
-
- // Phone
- print '| '.$langs->trans('Phone').' | '.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').' | ';
- print ''.$langs->trans('Fax').' | '.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').' |
';
-
- print '
';
-
- dol_fiche_end();
-
- if ($soc->client) formCategory($db,$soc,2,$socid,$user->rights->societe->creer);
-
- if ($soc->client && $soc->fournisseur) print '';
-
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print '';
- print $form->showrefnav($member,'id','','1','rowid','ref','','&type='.$type);
- print ' |
';
-
- // Login
- if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
- {
- print '| '.$langs->trans("Login").' / '.$langs->trans("Id").' | '.$member->login.' |
';
- }
-
- // Morphy
- print '| '.$langs->trans("Nature").' | '.$member->getmorphylib().' | ';
- /*print '';
- print $form->showphoto('memberphoto',$member);
- print ' | ';*/
- print '
';
-
- // Type
- print '| '.$langs->trans("Type").' | '.$membert->getNomUrl(1)." |
\n";
-
- // Company
- print '| '.$langs->trans("Company").' | '.$member->societe.' |
';
-
- // Civility
- print '| '.$langs->trans("UserTitle").' | '.$member->getCivilityLabel().' | ';
- print '
';
-
- // Lastname
- print '| '.$langs->trans("Lastname").' | '.$member->lastname.' | ';
- print '
';
-
- // Firstname
- print '| '.$langs->trans("Firstname").' | '.$member->firstname.' | ';
- print '
';
-
- // Status
- print '| '.$langs->trans("Status").' | '.$member->getLibStatut(4).' |
';
-
- print '
';
-
- dol_fiche_end();
-
- formCategory($db,$member,3,0,$user->rights->adherent->creer);
- }
- if ($type == Categorie::TYPE_CONTACT)
- {
- $langs->load("contact");
-
- /*
- * Category card for contact
- */
- require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
- require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-
- // Produit
- $object = new Contact($db);
- $result = $object->fetch($id, $ref);
- $object->fetch_thirdparty();
-
- llxHeader("","",$langs->trans("Contact"));
-
-
- $head=contact_prepare_head($object);
- $titre=$langs->trans("ContactsAddresses");
- $picto='contact';
- dol_fiche_head($head, 'category', $titre,0,$picto);
-
- $rowspan=5;
- if (! empty($conf->societe->enabled)) $rowspan++;
-
- print '';
-
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- print '';
- print $form->showrefnav($object,'rowid');
- print ' |
';
-
- // Name
- print '| '.$langs->trans("Lastname").' / '.$langs->trans("Label").' | '.$object->lastname.' | ';
- print ''.$langs->trans("Firstname").' | '.$object->firstname.' |
';
-
- // Company
- if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
- {
- print '| '.$langs->trans("Company").' | ';
- if (!empty($object->thirdparty->id))
- {
- print $object->thirdparty->getNomUrl(1);
- }
- else
- {
- print $langs->trans("ContactNotLinkedToCompany");
- }
- print ' |
';
- }
-
- // Civility
- print '| '.$langs->trans("UserTitle").' | ';
- print $object->getCivilityLabel();
- print ' |
';
-
- // Role
- print '| '.$langs->trans("PostOrFunction").' | '.$object->poste.' | ';
-
- // Address
- print '
| '.$langs->trans("Address").' | ';
- dol_print_address($object->address,'gmap','contact',$object->id);
- print ' |
';
-
- // Zip/Town
- print '| '.$langs->trans("Zip").' / '.$langs->trans("Town").' | ';
- print $object->zip;
- if ($object->zip) print ' ';
- print $object->town.' |
';
-
- // Country
- print '| '.$langs->trans("Country").' | ';
- $img=picto_from_langcode($object->country_code);
- if ($img) print $img.' ';
- print $object->country;
- print ' |
';
-
- // State
- if (empty($conf->global->SOCIETE_DISABLE_STATE))
- {
- print '| '.$langs->trans('State').' | '.$object->state.' | ';
- }
-
- // Phone
- print '
| '.$langs->trans("PhonePro").' | '.dol_print_phone($object->phone_pro,$object->country_code,$object->id,$object->socid,'AC_TEL').' | ';
- print ''.$langs->trans("PhonePerso").' | '.dol_print_phone($object->phone_perso,$object->country_code,$object->id,$object->socid,'AC_TEL').' |
';
-
- print '| '.$langs->trans("PhoneMobile").' | '.dol_print_phone($object->phone_mobile,$object->country_code,$object->id,$object->socid,'AC_TEL').' | ';
- print ''.$langs->trans("Fax").' | '.dol_print_phone($object->fax,$object->country_code,$object->id,$object->socid,'AC_FAX').' |
';
-
- // Email
- print '| '.$langs->trans("EMail").' | '.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').' | ';
- if (! empty($conf->mailing->enabled))
- {
- $langs->load("mails");
- print ''.$langs->trans("NbOfEMailingsReceived").' | ';
- print ''.$object->getNbOfEMailings().' | ';
- }
- else
- {
- print ' | ';
- }
- print '
';
-
- // Instant message and no email
- print '| '.$langs->trans("IM").' | '.$object->jabberid.' | ';
- if (!empty($conf->mailing->enabled))
- {
- print ''.$langs->trans("No_Email").' | '.yn($object->no_email).' | ';
- }
- else
- {
- print ' | ';
- }
- print '
';
-
- print '| '.$langs->trans("ContactVisibility").' | ';
- print $object->LibPubPriv($object->priv);
- print ' |
';
-
- // Note Public
- print '| '.$langs->trans("NotePublic").' | ';
- print nl2br($object->note_public);
- print ' |
';
-
- // Note Private
- print '| '.$langs->trans("NotePrivate").' | ';
- print nl2br($object->note_private);
- print ' |
';
-
- // Other attributes
- $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
- $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
- if (empty($reshook) && ! empty($extrafields->attribute_label))
- {
- print $object->showOptionals($extrafields);
- }
-
- print '
';
-
- dol_fiche_end();
-
- formCategory($db,$object,4,$socid, $user->rights->societe->creer);
- }
-
- if ($type == Categorie::TYPE_PROJECT)
- {
- $langs->load("products");
-
- /*
- * Category card for product
- */
- require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
- require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
-
- // Product
- $product = new Product($db);
- $result = $product->fetch($id, $ref);
-
- llxHeader("","",$langs->trans("Project"));
-
-
- $head=project_prepare_head($product);
- $titre=$langs->trans("Project");
- $picto=($object->public?'projectpub':'project');
- dol_fiche_head($head, 'category', $titre,0,$picto);
-
-
- print '';
-
- $linkback = ''.$langs->trans("BackToList").'';
-
- // Ref
- print '| '.$langs->trans("Ref").' | ';
- // Define a complementary filter for search of next/prev ref.
- if (! $user->rights->projet->all->lire)
- {
- $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
- $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
- }
- print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
- print ' |
';
-
- // Label
- print '| '.$langs->trans("Label").' | '.$object->title.' |
';
-
- // Third party
- print '| '.$langs->trans("ThirdParty").' | ';
- if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project');
- else print' ';
- print ' |
';
-
- // Visibility
- print '| '.$langs->trans("Visibility").' | ';
- if ($object->public) print $langs->trans('SharedProject');
- else print $langs->trans('PrivateProject');
- print ' |
';
-
- // Statut
- print '| '.$langs->trans("Status").' | '.$object->getLibStatut(4).' |
';
-
- // Date start
- print '| '.$langs->trans("DateStart").' | ';
- print dol_print_date($object->date_start,'day');
- print ' |
';
-
- // Date end
- print '| '.$langs->trans("DateEnd").' | ';
- print dol_print_date($object->date_end,'day');
- print ' |
';
-
- formCategory($db,$product,0,$socid,($user->rights->projet->creer));
- }
-}
-
-
-/**
- * Function to output a form to add object into a category
- *
- * @param DoliDb $db Database handler
- * @param Object $object Object we want to see categories it can be classified into
- * @param int $typeid Type of category (0, 1, 2, 3)
- * @param int $socid Id thirdparty
- * @param int $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify'
- * @return int 0
- */
-function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1)
-{
- global $user,$langs,$form,$bc;
-
- $title='NotDefined';
- 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");
- if ($typeid == Categorie::TYPE_PROJECT) $title = $langs->trans("ProjectsCategoriesShort");
-
- $linktocreate='';
- if ($showclassifyform && $user->rights->categorie->creer)
- {
- $linktocreate='id.'&type='.$typeid).'">';
- $linktocreate.=$langs->trans("CreateCat").' ';
- $linktocreate.=img_picto($langs->trans("Create"),'filenew');
- $linktocreate.="";
- }
-
- print '
';
- print load_fiche_titre($title,$linktocreate,'');
-
- // Form to add record into a category
- if ($showclassifyform)
- {
- print '';
- print '
';
- }
-
-
- $c = new Categorie($db);
- $cats = $c->containing($object->id,$typeid);
-
- if (count($cats) > 0)
- {
- 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");
- if ($typeid == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectIsInCategories");
- print "\n";
- print '';
- print '| '.$title.': |
';
-
- $var = true;
- foreach ($cats as $cat)
- {
- $ways = $cat->print_all_ways();
-
- foreach ($ways as $way)
- {
- $var = ! $var;
- print "";
-
- // Categorie
- print "| ".img_object('','category').' '.$way." | ";
-
- // Link to delete from category
- print '';
- $permission=0;
- 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 ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer;
- if ($permission)
- {
- print "id."&type=".$typeid."&removecat=".$cat->id."'>";
- print img_delete($langs->trans("DeleteFromCat")).' ';
- print $langs->trans("DeleteFromCat")."";
- }
- else
- {
- print ' ';
- }
- print " | ";
-
- print "
\n";
- }
- }
- print "
\n";
- }
- else if ($cats < 0)
- {
- print $langs->trans("ErrorUnknown");
- }
- else
- {
- 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");
- if ($typeid == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectHasNoCategory");
- print $title;
- print "
";
- }
- return 0;
-}
-
-llxFooter();
-
-$db->close();
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 0f427381d15..7a459c17cb9 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -113,17 +113,6 @@ function societe_prepare_head(Societe $object)
$head[$h][2] = 'project';
$h++;
}
- //show categorie tab
- /*if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
- {
- require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
- $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';
- $h++;
- }*/
// Tab to link resources
if (! empty($conf->resource->enabled) && ! empty($conf->global->RESOURCE_ON_THIRDPARTIES))
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 6252811fff2..cf825a50e28 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -3175,7 +3175,7 @@ class Product extends CommonObject
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
- if ($option == 'supplier') {
+ if ($option == 'supplier' || $option == 'category') {
$link = 'id.$linkclose;
$linkend='';
- } else if ($option == 'category') {
- $link = 'id.$linkclose;
$linkend='';
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 3bd03e0673e..d318e132f92 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1855,7 +1855,7 @@ class Societe extends CommonObject
$label.= '';
- if ($option == 'customer' || $option == 'compta')
+ if ($option == 'customer' || $option == 'compta' || $option == 'category' || $option == 'category_supplier')
{
$label.= '
' . $langs->trans("ShowCustomer") . '';
$link = '
';
$link = '';
- $link = '';
- $link = '';