dolibarr 24.0.0-beta
expedition.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4 * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
7 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
8 * Copyright (C) 2025-2026 Frédéric France <frederic.france@free.fr>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 * or see https://www.gnu.org/
23 */
24
38{
39 global $langs, $conf, $user;
40 if (isModEnabled("shipping")) {
41 $langs->load("sendings");
42 }
43 $langs->load("orders");
44
45 $h = 0;
46 $head = array();
47
48 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/confexped.php");
49 $head[$h][1] = $langs->trans("Setup");
50 $head[$h][2] = '';
51 $h++;
52
53 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expedition.php");
54 $head[$h][1] = $langs->trans("Shipment");
55 $head[$h][2] = '';
56 $hselected = $h;
57 $h++;
58
59 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
60 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/delivery.php");
61 $head[$h][1] = $langs->trans("Receivings");
62 $head[$h][2] = '';
63 $h++;
64 }
65
66 complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
67
68 complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
69
70 return $head;
71}
72
79{
80 global $langs, $conf, $user, $extrafields;
81 $langs->load("sendings");
82
83 $h = 0;
84 $head = array();
85
86 /*
87 $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
88 $head[$h][1] = $langs->trans("Setup");
89 $head[$h][2] = 'general';
90 $h++;
91 */
92
93 if (getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) {
94 $extrafields->fetch_name_optionals_label('expedition');
95 $extrafields->fetch_name_optionals_label('expeditiondet');
96
97 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expedition.php");
98 $head[$h][1] = $langs->trans("Shipment");
99 $head[$h][2] = 'shipment';
100 $h++;
101
102 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/expedition_extrafields.php');
103 $head[$h][1] = $langs->trans("ExtraFields");
104 $nbExtrafields = $extrafields->attributes['expedition']['count'];
105 if ($nbExtrafields > 0) {
106 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
107 }
108 $head[$h][2] = 'attributes_shipment';
109 $h++;
110
111 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php');
112 $head[$h][1] = $langs->trans("ExtraFieldsLines");
113 $nbExtrafields = $extrafields->attributes['expeditiondet']['count'];
114 if ($nbExtrafields > 0) {
115 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
116 }
117 $head[$h][2] = 'attributeslines_shipment';
118 $h++;
119 }
120
121 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/delivery.php");
122 $head[$h][1] = $langs->trans("Receivings");
123 $head[$h][2] = 'receivings';
124 $h++;
125
126 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
127 $extrafields->fetch_name_optionals_label('delivery');
128 $extrafields->fetch_name_optionals_label('deliverydet');
129
130 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/delivery_extrafields.php');
131 $head[$h][1] = $langs->trans("ExtraFields");
132 $nbExtrafields = $extrafields->attributes['delivery']['count'];
133 if ($nbExtrafields > 0) {
134 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
135 }
136 $head[$h][2] = 'attributes_receivings';
137 $h++;
138
139 $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/deliverydet_extrafields.php');
140 $head[$h][1] = $langs->trans("ExtraFieldsLines");
141 $nbExtrafields = $extrafields->attributes['deliverydet']['count'];
142 if ($nbExtrafields > 0) {
143 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
144 }
145 $head[$h][2] = 'attributeslines_receivings';
146 $h++;
147 }
148
149 complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin');
150
151 complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin', 'remove');
152
153 return $head;
154}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
expedition_prepare_head(Expedition $object)
Prepare array with list of tabs.
expedition_admin_prepare_head()
Return array head with list of tabs to view object information.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
isModEnabled($module)
Is Dolibarr module enabled.