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)))
45 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
46 $head[$h][0] = DOL_URL_ROOT.
'/resource/contact.php?id='.$object->id;
47 $head[$h][1] = $langs->trans(
'ContactsAddresses');
48 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
49 $head[$h][2] =
'contact';
59 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
62 if (!empty($object->note_private)) $nbNote++;
63 if (!empty($object->note_public)) $nbNote++;
64 $head[$h][0] = DOL_URL_ROOT.
'/resource/note.php?id='.$object->id;
65 $head[$h][1] = $langs->trans(
'Notes');
66 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
67 $head[$h][2] =
'note';
71 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
73 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
74 $head[$h][0] = DOL_URL_ROOT.
'/resource/document.php?id='.$object->id;
75 $head[$h][1] = $langs->trans(
"Documents");
76 if ($nbFiles > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFiles.
'</span>';
77 $head[$h][2] =
'documents';
80 $head[$h][0] = DOL_URL_ROOT.
'/resource/agenda.php?id='.$object->id;
81 $head[$h][1] = $langs->trans(
"Events");
82 if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
85 $head[$h][1] .= $langs->trans(
"Agenda");
87 $head[$h][2] =
'agenda';
108 global $langs, $conf, $user;
113 $head[$h][0] = DOL_URL_ROOT.
'/admin/resource.php';
114 $head[$h][1] = $langs->trans(
"ResourceSetup");
115 $head[$h][2] =
'general';
124 $head[$h][0] = DOL_URL_ROOT.
'/admin/resource_extrafields.php';
125 $head[$h][1] = $langs->trans(
"ExtraFields");
126 $head[$h][2] =
'attributes';
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
resource_prepare_head($object)
Prepare head for tabs.
resource_admin_prepare_head()
Prepare head for admin tabs.
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.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).