dolibarr 22.0.5
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 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 * or see https://www.gnu.org/
22 */
23
37{
38 global $langs, $conf, $user;
39 if (isModEnabled("shipping")) {
40 $langs->load("sendings");
41 }
42 $langs->load("orders");
43
44 $h = 0;
45 $head = array();
46
47 $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
48 $head[$h][1] = $langs->trans("Setup");
49 $head[$h][2] = '';
50 $h++;
51
52 $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
53 $head[$h][1] = $langs->trans("Shipment");
54 $head[$h][2] = '';
55 $hselected = $h;
56 $h++;
57
58 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
59 $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
60 $head[$h][1] = $langs->trans("Receivings");
61 $head[$h][2] = '';
62 $h++;
63 }
64
65 complete_head_from_modules($conf, $langs, $object, $head, $h, 'order');
66
67 complete_head_from_modules($conf, $langs, $object, $head, $h, 'order', 'remove');
68
69 return $head;
70}
71
78{
79 global $langs, $conf, $user, $db;
80 $langs->load("sendings");
81
82 $extrafields = new ExtraFields($db);
83
84 $h = 0;
85 $head = array();
86
87 /*
88 $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
89 $head[$h][1] = $langs->trans("Setup");
90 $head[$h][2] = 'general';
91 $h++;
92 */
93
94 if (getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) {
95 $extrafields->fetch_name_optionals_label('expedition');
96 $extrafields->fetch_name_optionals_label('expeditiondet');
97
98 $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
99 $head[$h][1] = $langs->trans("Shipment");
100 $head[$h][2] = 'shipment';
101 $h++;
102
103 $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php';
104 $head[$h][1] = $langs->trans("ExtraFields");
105 $nbExtrafields = $extrafields->attributes['expedition']['count'];
106 if ($nbExtrafields > 0) {
107 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
108 }
109 $head[$h][2] = 'attributes_shipment';
110 $h++;
111
112 $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php';
113 $head[$h][1] = $langs->trans("ExtraFieldsLines");
114 $nbExtrafields = $extrafields->attributes['expeditiondet']['count'];
115 if ($nbExtrafields > 0) {
116 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
117 }
118 $head[$h][2] = 'attributeslines_shipment';
119 $h++;
120 }
121
122 $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php";
123 $head[$h][1] = $langs->trans("Receivings");
124 $head[$h][2] = 'receivings';
125 $h++;
126
127 if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) {
128 $extrafields->fetch_name_optionals_label('delivery');
129 $extrafields->fetch_name_optionals_label('deliverydet');
130
131 $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php';
132 $head[$h][1] = $langs->trans("ExtraFields");
133 $nbExtrafields = $extrafields->attributes['delivery']['count'];
134 if ($nbExtrafields > 0) {
135 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
136 }
137 $head[$h][2] = 'attributes_receivings';
138 $h++;
139
140 $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php';
141 $head[$h][1] = $langs->trans("ExtraFieldsLines");
142 $nbExtrafields = $extrafields->attributes['deliverydet']['count'];
143 if ($nbExtrafields > 0) {
144 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
145 }
146 $head[$h][2] = 'attributeslines_receivings';
147 $h++;
148 }
149
150 complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin');
151
152 complete_head_from_modules($conf, $langs, null, $head, $h, 'expedition_admin', 'remove');
153
154 return $head;
155}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
Class to manage standard extra fields.
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.
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79