32 global $db, $langs, $conf;
34 $langs->loadLangs(array(
"mrp",
"stocks"));
39 $head[$h][0] = DOL_URL_ROOT.
'/mrp/mo_card.php?id='.$object->id;
40 $head[$h][1] = $langs->trans(
"ManufacturingOrder");
41 $head[$h][2] =
'card';
44 $head[$h][0] = DOL_URL_ROOT.
'/mrp/mo_production.php?id='.$object->id;
45 $head[$h][1] = $langs->trans(
"Production");
46 $arrayproduced = $object->fetchLinesLinked(
'produced', 0);
48 foreach ($arrayproduced as $lineproduced) {
49 $nbProduced += $lineproduced[
'qty'];
51 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbProduced.
' / '.$object->qty.
'</span>';
52 $head[$h][2] =
'production';
55 $head[$h][0] = DOL_URL_ROOT.
'/mrp/mo_movements.php?id='.$object->id;
56 $head[$h][1] = $langs->trans(
"StockMovements");
57 $nbMove = $object->countMovements();
58 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbMove.
'</span>';
59 $head[$h][2] =
'stockmovement';
62 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
64 if (!empty($object->note_private)) {
67 if (!empty($object->note_public)) {
70 $head[$h][0] =
dol_buildpath(
'/mrp/mo_note.php', 1).
'?id='.$object->id;
71 $head[$h][1] = $langs->trans(
'Notes');
73 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
75 $head[$h][2] =
'note';
79 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
80 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
82 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
83 $nbLinks =
Link::count($db, $object->element, $object->id);
84 $head[$h][0] =
dol_buildpath(
"/mrp/mo_document.php", 1).
'?id='.$object->id;
85 $head[$h][1] = $langs->trans(
'Documents');
86 if (($nbFiles + $nbLinks) > 0) {
87 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
89 $head[$h][2] =
'document';
92 $head[$h][0] =
dol_buildpath(
"/mrp/mo_agenda.php", 1).
'?id='.$object->id;
93 $head[$h][1] = $langs->trans(
"Events");
94 $head[$h][2] =
'agenda';
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).