33 global $db, $langs, $conf;
35 $langs->loadLangs(array(
"mrp",
"stocks"));
40 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_card.php?id=' .
$object->id;
41 $head[$h][1] = $langs->trans(
"ManufacturingOrder");
42 $head[$h][2] =
'card';
45 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_production.php?id=' .
$object->id;
46 $head[$h][1] = $langs->trans(
"Production");
47 $arrayproduced =
$object->fetchLinesLinked(
'produced', 0);
49 foreach ($arrayproduced as $lineproduced) {
50 $nbProduced += $lineproduced[
'qty'];
52 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . $nbProduced .
' / ' .
$object->qty .
'</span>';
53 $head[$h][2] =
'production';
56 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_movements.php?id=' .
$object->id;
57 $head[$h][1] = $langs->trans(
"StockMovements");
58 $nbMove =
$object->countMovements();
59 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . $nbMove .
'</span>';
60 $head[$h][2] =
'stockmovement';
63 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
65 if (!empty(
$object->note_private)) {
68 if (!empty(
$object->note_public)) {
71 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_note.php?id=' .
$object->id;
72 $head[$h][1] = $langs->trans(
'Notes');
74 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . $nbNote .
'</span>';
76 $head[$h][2] =
'note';
80 require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
81 require_once DOL_DOCUMENT_ROOT .
'/core/class/link.class.php';
83 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
85 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_document.php?id=' .
$object->id;
86 $head[$h][1] = $langs->trans(
'Documents');
87 if (($nbFiles + $nbLinks) > 0) {
88 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) .
'</span>';
90 $head[$h][2] =
'document';
93 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_agenda.php?id=' .
$object->id;
94 $head[$h][1] = $langs->trans(
"Events");
95 $head[$h][2] =
'agenda';
dol_dir_list($utf8_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).