34 global $db, $langs, $conf;
36 $langs->loadLangs(array(
"mrp",
"stocks"));
41 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_card.php?id=' .
$object->id;
42 $head[$h][1] = $langs->trans(
"ManufacturingOrder");
43 $head[$h][2] =
'card';
46 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_production.php?id=' .
$object->id;
47 $head[$h][1] = $langs->trans(
"Production");
48 $arrayproduced =
$object->fetchLinesLinked(
'produced', 0);
50 foreach ($arrayproduced as $lineproduced) {
51 $nbProduced += $lineproduced[
'qty'];
53 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . $nbProduced .
' / ' .
$object->qty .
'</span>';
54 $head[$h][2] =
'production';
57 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_movements.php?id=' .
$object->id;
58 $head[$h][1] = $langs->trans(
"StockMovements");
59 $nbMove =
$object->countMovements();
60 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . $nbMove .
'</span>';
61 $head[$h][2] =
'stockmovement';
64 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
66 if (!empty(
$object->note_private)) {
69 if (!empty(
$object->note_public)) {
72 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_note.php?id=' .
$object->id;
73 $head[$h][1] = $langs->trans(
'Notes');
75 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . $nbNote .
'</span>';
77 $head[$h][2] =
'note';
81 require_once DOL_DOCUMENT_ROOT .
'/core/lib/files.lib.php';
82 require_once DOL_DOCUMENT_ROOT .
'/core/class/link.class.php';
84 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
86 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_document.php?id=' .
$object->id;
87 $head[$h][1] = $langs->trans(
'Documents');
88 if (($nbFiles + $nbLinks) > 0) {
89 $head[$h][1] .=
'<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) .
'</span>';
91 $head[$h][2] =
'document';
94 $head[$h][0] = DOL_URL_ROOT .
'/mrp/mo_agenda.php?id=' .
$object->id;
95 $head[$h][1] = $langs->trans(
"Events");
96 $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).