34 global $langs, $conf, $user;
38 $head[$h][0] =
dol_buildpath(
'/resource/card.php', 1).
'?id='.$object->id;
39 $head[$h][1] = $langs->trans(
"ResourceCard");
40 $head[$h][2] =
'resource';
43 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && (empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_USER) || empty($conf->global->RESOURCE_HIDE_ADD_CONTACT_THIPARTY))) {
44 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
45 $head[$h][0] = DOL_URL_ROOT.
'/resource/contact.php?id='.$object->id;
46 $head[$h][1] = $langs->trans(
'ContactsAddresses');
48 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
50 $head[$h][2] =
'contact';
60 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
62 if (!empty($object->note_private)) {
65 if (!empty($object->note_public)) {
68 $head[$h][0] = DOL_URL_ROOT.
'/resource/note.php?id='.$object->id;
69 $head[$h][1] = $langs->trans(
'Notes');
71 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
73 $head[$h][2] =
'note';
77 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
79 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
80 $head[$h][0] = DOL_URL_ROOT.
'/resource/document.php?id='.$object->id;
81 $head[$h][1] = $langs->trans(
"Documents");
83 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFiles.
'</span>';
85 $head[$h][2] =
'documents';
88 $head[$h][0] = DOL_URL_ROOT.
'/resource/agenda.php?id='.$object->id;
89 $head[$h][1] = $langs->trans(
"Events");
90 if (
isModEnabled(
'agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
92 $head[$h][1] .= $langs->trans(
"Agenda");
94 $head[$h][2] =
'agenda';
117 global $langs, $conf, $user;
122 $head[$h][0] = DOL_URL_ROOT.
'/admin/resource.php';
123 $head[$h][1] = $langs->trans(
"ResourceSetup");
124 $head[$h][2] =
'general';
133 $head[$h][0] = DOL_URL_ROOT.
'/admin/resource_extrafields.php';
134 $head[$h][1] = $langs->trans(
"ExtraFields");
135 $head[$h][2] =
'attributes';
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
isModEnabled($module)
Is Dolibarr module enabled.
resource_admin_prepare_head()
Prepare head for admin tabs.
resource_prepare_head($object)
Prepare head for tabs.