34 global $db, $langs, $conf;
36 $langs->load(
"stocks");
41 $head[$h][0] =
dol_buildpath(
"/product/stock/stocktransfer/stocktransfer_card.php", 1).
'?id='.
$object->id;
42 $head[$h][1] = $langs->trans(
"StockTransfer");
43 $head[$h][2] =
'card';
47 $nbContact = count(
$object->liste_contact(-1,
'internal')) + count(
$object->liste_contact(-1,
'external'));
48 $head[$h][0] =
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_contact.php', 1).
'?id='.
$object->id;
49 $head[$h][1] = $langs->trans(
'ContactsAddresses');
51 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
53 $head[$h][2] =
'contact';
57 if (isset(
$object->fields[
'note_public']) || isset(
$object->fields[
'note_private'])) {
59 if (!empty(
$object->note_private)) {
62 if (!empty(
$object->note_public)) {
65 $head[$h][0] =
dol_buildpath(
'/product/stock/stocktransfer/stocktransfer_note.php', 1).
'?id='.
$object->id;
66 $head[$h][1] = $langs->trans(
'Notes');
68 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>' :
'');
70 $head[$h][2] =
'note';
74 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
75 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
77 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
79 $head[$h][0] =
dol_buildpath(
"/product/stock/stocktransfer/stocktransfer_document.php", 1).
'?id='.
$object->id;
80 $head[$h][1] = $langs->trans(
'Documents');
81 if (($nbFiles + $nbLinks) > 0) {
82 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
84 $head[$h][2] =
'document';
87 $head[$h][0] =
dol_buildpath(
"/product/stock/stocktransfer/stocktransfer_agenda.php", 1).
'?id='.
$object->id;
88 $head[$h][1] = $langs->trans(
"Events");
89 $head[$h][2] =
'agenda';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
static count($dbs, $objecttype, $objectid)
Return nb of links.
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
stocktransferPrepareHead($object)
Prepare array of tabs for StockTransfer.