33 global $db, $langs, $conf;
35 $langs->load(
"stocks");
40 $head[$h][0] =
dol_buildpath(
"/product/stock/stocktransfer/stocktransfer_card.php", 1).
'?id='.$object->id;
41 $head[$h][1] = $langs->trans(
"Card");
42 $head[$h][2] =
'card';
45 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
46 $nbContact = count($object->liste_contact(-1,
'internal')) + count($object->liste_contact(-1,
'external'));
47 $head[$h][0] =
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_contact.php', 1).
'?id='.$object->id;
48 $head[$h][1] = $langs->trans(
'ContactsAddresses');
49 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
50 $head[$h][2] =
'contact';
54 if (isset($object->fields[
'note_public']) || isset($object->fields[
'note_private'])) {
56 if (!empty($object->note_private)) $nbNote++;
57 if (!empty($object->note_public)) $nbNote++;
58 $head[$h][0] =
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_note.php', 1).
'?id='.$object->id;
59 $head[$h][1] = $langs->trans(
'Notes');
60 if ($nbNote > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' :
'');
61 $head[$h][2] =
'note';
65 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
66 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
67 $upload_dir = $conf->stocktransfer->dir_output.
"/stocktransfer/".
dol_sanitizeFileName($object->ref);
68 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
69 $nbLinks =
Link::count($db, $object->element, $object->id);
70 $head[$h][0] =
dol_buildpath(
"/product/stock/stocktransfer/stocktransfer_document.php", 1).
'?id='.$object->id;
71 $head[$h][1] = $langs->trans(
'Documents');
72 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
73 $head[$h][2] =
'document';
76 $head[$h][0] =
dol_buildpath(
"/product/stock/stocktransfer/stocktransfer_agenda.php", 1).
'?id='.$object->id;
77 $head[$h][1] = $langs->trans(
"Events");
78 $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).