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';
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';
67 if (isModEnabled(
'resource')) {
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';
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/agenda.php?id='.$object->id;
124 $head[$h][1] = $langs->trans(
'Events');
125 if (isModEnabled(
'agenda')&& ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
128 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
129 $cachekey =
'count_events_fichinter_'.$object->id;
131 if (!is_null($dataretrieved)) {
132 $nbEvent = $dataretrieved;
134 $sql =
"SELECT COUNT(id) as nb";
135 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm";
136 $sql .=
" WHERE fk_element = ".((int) $object->id);
137 $sql .=
" AND elementtype = 'fichinter'";
138 $resql = $db->query($sql);
140 $obj = $db->fetch_object($resql);
143 dol_syslog(
'Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
149 $head[$h][1] .= $langs->trans(
"Agenda");
151 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbEvent.
'</span>';
154 $head[$h][2] =
'agenda';
171 global $langs, $conf, $user, $db;
174 $extrafields->fetch_name_optionals_label(
'fichinter');
175 $extrafields->fetch_name_optionals_label(
'fichinterdet');
182 $head[$h][0] = DOL_URL_ROOT.
"/admin/fichinter.php";
183 $head[$h][1] = $langs->trans(
"Interventions");
184 $head[$h][2] =
'ficheinter';
193 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/admin/fichinter_extrafields.php';
194 $head[$h][1] = $langs->trans(
"ExtraFields");
195 $nbExtrafields = $extrafields->attributes[
'fichinter'][
'count'];
196 if ($nbExtrafields > 0) {
197 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
199 $head[$h][2] =
'attributes';
202 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/admin/fichinterdet_extrafields.php';
203 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
204 $nbExtrafields = $extrafields->attributes[
'fichinterdet'][
'count'];
205 if ($nbExtrafields > 0) {
206 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
208 $head[$h][2] =
'attributesdet';
224 global $langs, $conf;
229 $head[$h][0] = DOL_URL_ROOT.
'/fichinter/card-rec.php?id='.$object->id;
230 $head[$h][1] = $langs->trans(
"CardFichinter");
231 $head[$h][2] =
'card';
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).
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.