35 global $db, $langs, $conf, $user;
40 $head[$tab][0] = DOL_URL_ROOT.
'/contact/card.php?id='.$object->id;
41 $head[$tab][1] = $langs->trans(
"Contact");
42 $head[$tab][2] =
'card';
45 if ((!empty($conf->ldap->enabled) && !empty($conf->global->LDAP_CONTACT_ACTIVE))
46 && (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || !empty($user->admin)))
50 $head[$tab][0] = DOL_URL_ROOT.
'/contact/ldap.php?id='.$object->id;
51 $head[$tab][1] = $langs->trans(
"LDAPCard");
52 $head[$tab][2] =
'ldap';
56 $head[$tab][0] = DOL_URL_ROOT.
'/contact/perso.php?id='.$object->id;
57 $head[$tab][1] = $langs->trans(
"PersonalInformations");
58 $head[$tab][2] =
'perso';
62 if (!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
64 $head[$tab][0] = DOL_URL_ROOT.
'/contact/consumption.php?id='.$object->id;
65 $head[$tab][1] = $langs->trans(
"Referers");
66 $head[$tab][2] =
'consumption';
77 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
78 $nbNote = (empty($object->note_private) ? 0 : 1) + (empty($object->note_public) ? 0 : 1);
79 $head[$tab][0] = DOL_URL_ROOT.
'/contact/note.php?id='.$object->id;
80 $head[$tab][1] = $langs->trans(
"Note");
81 if ($nbNote > 0) $head[$tab][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
82 $head[$tab][2] =
'note';
86 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
87 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
89 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
90 $nbLinks =
Link::count($db, $object->element, $object->id);
91 $head[$tab][0] = DOL_URL_ROOT.
'/contact/document.php?id='.$object->id;
92 $head[$tab][1] = $langs->trans(
"Documents");
93 if (($nbFiles + $nbLinks) > 0) $head[$tab][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
94 $head[$tab][2] =
'documents';
98 $head[$tab][0] = DOL_URL_ROOT.
'/contact/agenda.php?id='.$object->id;
99 $head[$tab][1] .= $langs->trans(
"Events");
100 if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
102 $head[$tab][1] .=
'/';
103 $head[$tab][1] .= $langs->trans(
"Agenda");
105 $head[$tab][2] =
'agenda';
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
static count($db, $objecttype, $objectid)
Return nb of links.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).