38 global $db, $langs, $conf, $user;
39 $langs->load(
"fichinter");
44 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/card.php?id='.$object->id;
45 $head[$h][1] = $langs->trans(
"Intervention");
46 $head[$h][2] =
'card';
49 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
50 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
51 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/contact.php?id='.$object->id;
52 $head[$h][1] = $langs->trans(
'InterventionContact');
54 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
56 $head[$h][2] =
'contact';
68 require_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
70 $linked_resources = $objectres->getElementResources(
'fichinter', $object->id);
71 $nbResource = (is_array($linked_resources) ?count($linked_resources) : 0);
84 $head[$h][0] = DOL_URL_ROOT.
'/resource/element_resource.php?element=fichinter&element_id='.$object->id;
85 $head[$h][1] = $langs->trans(
"Resources");
86 if ($nbResource > 0) {
87 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbResource.
'</span>';
89 $head[$h][2] =
'resource';
93 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
95 if (!empty($object->note_private)) {
98 if (!empty($object->note_public)) {
101 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/note.php?id='.$object->id;
102 $head[$h][1] = $langs->trans(
'Notes');
104 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
106 $head[$h][2] =
'note';
110 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
111 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
113 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
114 $nbLinks =
Link::count($db, $object->element, $object->id);
115 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/document.php?id='.$object->id;
116 $head[$h][1] = $langs->trans(
"Documents");
117 if (($nbFiles + $nbLinks) > 0) {
118 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
120 $head[$h][2] =
'documents';
123 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/info.php?id='.$object->id;
124 $head[$h][1] = $langs->trans(
'Info');
125 $head[$h][2] =
'info';
142 global $langs, $conf, $user, $db;
145 $extrafields->fetch_name_optionals_label(
'fichinter');
146 $extrafields->fetch_name_optionals_label(
'fichinterdet');
153 $head[$h][0] = DOL_URL_ROOT.
"/admin/fichinter.php";
154 $head[$h][1] = $langs->trans(
"Interventions");
155 $head[$h][2] =
'ficheinter';
164 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/admin/fichinter_extrafields.php';
165 $head[$h][1] = $langs->trans(
"ExtraFields");
166 $nbExtrafields = $extrafields->attributes[
'fichinter'][
'count'];
167 if ($nbExtrafields > 0) {
168 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
170 $head[$h][2] =
'attributes';
173 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/admin/fichinterdet_extrafields.php';
174 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
175 $nbExtrafields = $extrafields->attributes[
'fichinterdet'][
'count'];
176 if ($nbExtrafields > 0) {
177 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
179 $head[$h][2] =
'attributesdet';
195 global $langs, $conf;
200 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/card-rec.php?id='.$object->id;
201 $head[$h][1] = $langs->trans(
"CardFichinter");
202 $head[$h][2] =
'card';
static count($dbs, $objecttype, $objectid)
Return nb of links.
fichinter_admin_prepare_head()
Return array head with list of tabs to view object informations.
fichinter_rec_prepare_head($object)
Prepare array with list of tabs.
fichinter_prepare_head($object)
Prepare array with list of tabs.
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_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.