39 $head[$h][0] = DOL_URL_ROOT.
"/admin/bom.php";
40 $head[$h][1] = $langs->trans(
"Settings");
41 $head[$h][2] =
'settings';
44 $head[$h][0] =
dol_buildpath(
"/admin/bom_extrafields.php", 1);
45 $head[$h][1] = $langs->trans(
"ExtraFields");
46 $head[$h][2] =
'bom_extrafields';
79 global $db, $langs, $conf;
86 $head[$h][0] = DOL_URL_ROOT.
"/bom/bom_card.php?id=".$object->id;
87 $head[$h][1] = $langs->trans(
"BOM");
88 $head[$h][2] =
'card';
91 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private']))
94 if (!empty($object->note_private)) $nbNote++;
95 if (!empty($object->note_public)) $nbNote++;
96 $head[$h][0] = DOL_URL_ROOT.
'/bom/bom_note.php?id='.$object->id;
97 $head[$h][1] = $langs->trans(
'Notes');
98 if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<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.
'/bom/bom_document.php?id='.$object->id;
109 $head[$h][1] = $langs->trans(
'Documents');
110 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>' :
'');
111 $head[$h][2] =
'document';
114 $head[$h][0] = DOL_URL_ROOT.
'/bom/bom_agenda.php?id='.$object->id;
115 $head[$h][1] = $langs->trans(
"Events");
116 $head[$h][2] =
'agenda';
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
bomPrepareHead($object)
Prepare array of tabs for BillOfMaterials.
bomAdminPrepareHead()
Prepare admin pages header.
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).