35 global $langs, $conf, $user;
39 $head[$h][0] =
dol_buildpath(
'/resource/card.php', 1).
'?id='.$object->id;
40 $head[$h][1] = $langs->trans(
"ResourceCard");
41 $head[$h][2] =
'resource';
44 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');
49 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
51 $head[$h][2] =
'contact';
61 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
63 if (!empty($object->note_private)) {
66 if (!empty($object->note_public)) {
69 $head[$h][0] = DOL_URL_ROOT.
'/resource/note.php?id='.$object->id;
70 $head[$h][1] = $langs->trans(
'Notes');
72 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
74 $head[$h][2] =
'note';
78 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
80 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
81 $head[$h][0] = DOL_URL_ROOT.
'/resource/document.php?id='.$object->id;
82 $head[$h][1] = $langs->trans(
"Documents");
84 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFiles.
'</span>';
86 $head[$h][2] =
'documents';
89 $head[$h][0] = DOL_URL_ROOT.
'/resource/agenda.php?id='.$object->id;
90 $head[$h][1] = $langs->trans(
"Events");
91 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
93 $head[$h][1] .= $langs->trans(
"Agenda");
95 $head[$h][2] =
'agenda';
118 global $conf, $db, $langs, $user;
121 $extrafields->fetch_name_optionals_label(
'resource');
126 $head[$h][0] = DOL_URL_ROOT.
'/admin/resource.php';
127 $head[$h][1] = $langs->trans(
"ResourceSetup");
128 $head[$h][2] =
'general';
137 $head[$h][0] = DOL_URL_ROOT.
'/admin/resource_extrafields.php';
138 $head[$h][1] = $langs->trans(
"ExtraFields");
139 $nbExtrafields = $extrafields->attributes[
'resource'][
'count'];
140 if ($nbExtrafields > 0) {
141 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
143 $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.
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).