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_URL_ROOT.
"/admin/bom_extrafields.php";
45 $head[$h][1] = $langs->trans(
"ExtraFields");
46 $head[$h][2] =
'bom_extrafields';
49 $head[$h][0] = DOL_URL_ROOT.
"/admin/bomline_extrafields.php";
50 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
51 $head[$h][2] =
'bomline_extrafields';
80 global $db, $langs, $conf;
87 $head[$h][0] = DOL_URL_ROOT.
"/bom/bom_card.php?id=".$object->id;
88 $head[$h][1] = $langs->trans(
"BOM");
89 $head[$h][2] =
'card';
92 $head[$h][0] = DOL_URL_ROOT.
"/bom/bom_net_needs.php?id=".$object->id;
93 $head[$h][1] = $langs->trans(
"BOMNetNeeds");
94 $head[$h][2] =
'net_needs';
97 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
99 if (!empty($object->note_private)) {
102 if (!empty($object->note_public)) {
105 $head[$h][0] = DOL_URL_ROOT.
'/bom/bom_note.php?id='.$object->id;
106 $head[$h][1] = $langs->trans(
'Notes');
108 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' :
'');
110 $head[$h][2] =
'note';
114 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
115 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
117 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
118 $nbLinks =
Link::count($db, $object->element, $object->id);
119 $head[$h][0] = DOL_URL_ROOT.
'/bom/bom_document.php?id='.$object->id;
120 $head[$h][1] = $langs->trans(
'Documents');
121 if (($nbFiles + $nbLinks) > 0) {
122 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>' :
'');
124 $head[$h][2] =
'document';
127 $head[$h][0] = DOL_URL_ROOT.
'/bom/bom_agenda.php?id='.$object->id;
128 $head[$h][1] = $langs->trans(
"Events");
129 $head[$h][2] =
'agenda';
156 <script
type=
"text/javascript" language=
"javascript">
158 $(document).ready(
function () {
159 function folderManage(element, onClose = 0) {
160 let id_bom_line = element.attr(
'id').replace(
'collapse-',
'');
161 let TSubLines = $(
'[parentid="'+ id_bom_line +
'"]');
163 if(element.html().indexOf(
'folder-open') <= 0 && onClose < 1) {
164 $(
'[parentid="'+ id_bom_line +
'"]').show();
165 element.html(
'<?php echo dol_escape_js(img_picto('', 'folder-open
')); ?>');
168 for (let i = 0; i < TSubLines.length; i++) {
169 let subBomFolder = $(TSubLines[i]).children(
'.linecoldescription').children(
'.collapse_bom');
171 if (subBomFolder.length > 0) {
173 folderManage(subBomFolder, onClose);
177 element.html(
'<?php echo dol_escape_js(img_picto('', 'folder
')); ?>');
182 $(
".collapse_bom").click(
function() {
183 folderManage($(
this));
188 $(
"#show_all").click(
function() {
189 console.log(
"We click on show all");
190 $(
"[class^=sub_bom_lines]").show();
191 $(
"[class^=collapse_bom]").html(
'<?php echo dol_escape_js(img_picto('', 'folder-open
')); ?>');
196 $(
"#hide_all").click(
function() {
197 console.log(
"We click on hide all");
198 $(
"[class^=sub_bom_lines]").hide();
199 $(
"[class^=collapse_bom]").html(
'<?php echo dol_escape_js(img_picto('', 'folder
')); ?>');
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).