36 global $db, $langs, $conf, $user;
37 if (!empty($conf->expedition->enabled)) $langs->load(
"sendings");
38 $langs->load(
"orders");
43 if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
45 $head[$h][0] = DOL_URL_ROOT.
'/commande/card.php?id='.$object->id;
46 $head[$h][1] = $langs->trans(
"CustomerOrder");
47 $head[$h][2] =
'order';
51 if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
54 $head[$h][0] = DOL_URL_ROOT.
'/commande/contact.php?id='.$object->id;
55 $head[$h][1] = $langs->trans(
'ContactsAddresses');
56 if ($nbContact > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
57 $head[$h][2] =
'contact';
61 if (($conf->expedition_bon->enabled && $user->rights->expedition->lire)
62 || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire))
65 $head[$h][0] = DOL_URL_ROOT.
'/expedition/shipment.php?id='.$object->id;
67 if ($conf->expedition_bon->enabled) $text .= $langs->trans(
"Shipments");
68 if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) $text .=
' - ';
69 if ($conf->delivery_note->enabled) $text .= $langs->trans(
"Receivings");
70 if ($nbShipments > 0 || $nbReceiption > 0) $text .=
'<span class="badge marginleftonlyshort">'.($nbShipments ? $nbShipments : 0);
71 if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .=
' - ';
72 if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0);
73 if ($nbShipments > 0 || $nbReceiption > 0) $text .=
'</span>';
75 $head[$h][2] =
'shipping';
85 if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
88 if (!empty($object->note_private)) $nbNote++;
89 if (!empty($object->note_public)) $nbNote++;
90 $head[$h][0] = DOL_URL_ROOT.
'/commande/note.php?id='.$object->id;
91 $head[$h][1] = $langs->trans(
'Notes');
92 if ($nbNote > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbNote.
'</span>';
93 $head[$h][2] =
'note';
97 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
98 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
99 $upload_dir = $conf->commande->multidir_output[$object->entity].
"/".
dol_sanitizeFileName($object->ref);
100 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
101 $nbLinks =
Link::count($db, $object->element, $object->id);
102 $head[$h][0] = DOL_URL_ROOT.
'/commande/document.php?id='.$object->id;
103 $head[$h][1] = $langs->trans(
'Documents');
104 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>';
105 $head[$h][2] =
'documents';
108 $head[$h][0] = DOL_URL_ROOT.
'/commande/info.php?id='.$object->id;
109 $head[$h][1] = $langs->trans(
"Info");
110 $head[$h][2] =
'info';
125 global $langs, $conf, $user;
130 $head[$h][0] = DOL_URL_ROOT.
'/admin/commande.php';
131 $head[$h][1] = $langs->trans(
"Miscellaneous");
132 $head[$h][2] =
'general';
137 $head[$h][0] = DOL_URL_ROOT.
'/admin/order_extrafields.php';
138 $head[$h][1] = $langs->trans(
"ExtraFields");
139 $head[$h][2] =
'attributes';
142 $head[$h][0] = DOL_URL_ROOT.
'/admin/orderdet_extrafields.php';
143 $head[$h][1] = $langs->trans(
"ExtraFieldsLines");
144 $head[$h][2] =
'attributeslines';
order_admin_prepare_head()
Return array head with list of tabs to view object informations.
Class to manage customers orders.
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.
commande_prepare_head(Commande $object)
Prepare array with list of tabs.
liste_contact($status=-1, $source= 'external', $list=0, $code= '')
Get array of all contacts for an object.
static count($db, $objecttype, $objectid)
Return nb of links.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).
getNbOfShipments()
Count number of shipments for this order.