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))
51 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
52 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/contact.php?id='.$object->id;
53 $head[$h][1] = $langs->trans(
'InterventionContact');
54 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
55 $head[$h][2] =
'contact';
66 if ($conf->resource->enabled)
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) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbResource.
'</span>';
87 $head[$h][2] =
'resource';
91 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
94 if (!empty($object->note_private)) $nbNote++;
95 if (!empty($object->note_public)) $nbNote++;
96 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/note.php?id='.$object->id;
97 $head[$h][1] = $langs->trans(
'Notes');
98 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
99 $head[$h][2] =
'note';
103 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
104 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
106 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
107 $nbLinks =
Link::count($db, $object->element, $object->id);
108 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/document.php?id='.$object->id;
109 $head[$h][1] = $langs->trans(
"Documents");
110 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
111 $head[$h][2] =
'documents';
114 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/info.php?id='.$object->id;
115 $head[$h][1] = $langs->trans(
'Info');
116 $head[$h][2] =
'info';
131 global $langs, $conf, $user;
138 $head[$h][0] = DOL_URL_ROOT.
"/admin/fichinter.php";
139 $head[$h][1] = $langs->trans(
"Interventions");
140 $head[$h][2] =
'ficheinter';
149 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/admin/fichinter_extrafields.php';
150 $head[$h][1] = $langs->trans(
"ExtraFields");
151 $head[$h][2] =
'attributes';
154 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/admin/fichinterdet_extrafields.php';
155 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
156 $head[$h][2] =
'attributesdet';
174 global $langs, $conf;
179 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/card-rec.php?id='.$object->id;
180 $head[$h][1] = $langs->trans(
"CardFichinter");
181 $head[$h][2] =
'card';
fichinter_rec_prepare_head($object)
Prepare array with list of tabs.
fichinter_prepare_head($object)
Prepare array with list of tabs.
fichinter_admin_prepare_head()
Return array head with list of tabs to view object informations.
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.
static count($db, $objecttype, $objectid)
Return nb of links.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).