36 global $langs,
$conf, $user;
41 $head[$h][1] = $langs->trans(
"ResourceCard");
42 $head[$h][2] =
'resource';
46 $nbContact = count(
$object->liste_contact(-1,
'internal')) + count(
$object->liste_contact(-1,
'external'));
47 $head[$h][0] = DOL_URL_ROOT.
'/resource/contact.php?id='.
$object->id;
48 $head[$h][1] = $langs->trans(
'ContactsAddresses');
50 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
52 $head[$h][2] =
'contact';
64 if (!empty(
$object->note_private)) {
67 if (!empty(
$object->note_public)) {
70 $head[$h][0] = DOL_URL_ROOT.
'/resource/note.php?id='.
$object->id;
71 $head[$h][1] = $langs->trans(
'Notes');
73 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
75 $head[$h][2] =
'note';
79 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
81 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
82 $head[$h][0] = DOL_URL_ROOT.
'/resource/document.php?id='.
$object->id;
83 $head[$h][1] = $langs->trans(
"Documents");
85 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFiles.
'</span>';
87 $head[$h][2] =
'documents';
90 $head[$h][0] = DOL_URL_ROOT.
'/resource/agenda.php?id='.
$object->id;
91 $head[$h][1] = $langs->trans(
"Events");
92 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
94 $head[$h][1] .= $langs->trans(
"Agenda");
96 $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';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
dol_dir_list($utf8_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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
resource_admin_prepare_head()
Prepare head for admin tabs.
resource_prepare_head($object)
Prepare head for tabs.