37 global $db, $langs, $conf, $user;
39 $langs->loadLangs(array(
"sendings",
"deliveries"));
44 $head[$h][0] = DOL_URL_ROOT.
"/reception/card.php?id=".$object->id;
45 $head[$h][1] = $langs->trans(
"ReceptionCard");
46 $head[$h][2] =
'reception';
49 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) {
51 if ($object->origin ==
'supplier_order' && $object->origin_id > 0) {
53 $objectsrc->fetch($object->origin_id);
55 $nbContact = count($objectsrc->liste_contact(-1,
'internal')) + count($objectsrc->liste_contact(-1,
'external'));
56 $head[$h][0] = DOL_URL_ROOT.
"/reception/contact.php?id=".$object->id;
57 $head[$h][1] = $langs->trans(
"ContactsAddresses");
59 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
61 $head[$h][2] =
'contact';
71 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
72 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
74 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
75 $nbLinks =
Link::count($db, $object->element, $object->id);
76 $head[$h][0] = DOL_URL_ROOT.
'/reception/document.php?id='.$object->id;
77 $head[$h][1] = $langs->trans(
'Documents');
78 if (($nbFiles + $nbLinks) > 0) {
79 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
81 $head[$h][2] =
'documents';
85 if (!empty($object->note_private)) {
88 if (!empty($object->note_public)) {
91 $head[$h][0] = DOL_URL_ROOT.
"/reception/note.php?id=".$object->id;
92 $head[$h][1] = $langs->trans(
"Notes");
94 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
96 $head[$h][2] =
'note';
111 global $langs, $conf, $user;
112 $langs->load(
"receptions");
117 $head[$h][0] = DOL_URL_ROOT.
"/admin/reception_setup.php";
118 $head[$h][1] = $langs->trans(
"Reception");
119 $head[$h][2] =
'reception';
124 if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
125 $head[$h][0] = DOL_URL_ROOT.
'/admin/reception_extrafields.php';
126 $head[$h][1] = $langs->trans(
"ExtraFields");
127 $head[$h][2] =
'attributes_reception';
131 if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
132 $head[$h][0] = DOL_URL_ROOT.
'/admin/commande_fournisseur_dispatch_extrafields.php';
133 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
134 $head[$h][2] =
'attributeslines_reception';
Class to manage receptions.
static count($dbs, $objecttype, $objectid)
Return nb of links.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
Class to manage predefined suppliers products.
reception_admin_prepare_head()
Return array head with list of tabs to view object informations.
reception_prepare_head(Reception $object)
Prepare array with list of tabs.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).