dolibarr 20.0.0
mrp.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
31{
32 global $langs, $conf, $db;
33
34 $extrafields = new ExtraFields($db);
35 $extrafields->fetch_name_optionals_label('mrp_mo');
36
37 $langs->load("mrp");
38
39 $h = 0;
40 $head = array();
41
42 $head[$h][0] = DOL_URL_ROOT . '/admin/mrp.php';
43 $head[$h][1] = $langs->trans("Settings");
44 $head[$h][2] = 'settings';
45 $h++;
46
47 $head[$h][0] = DOL_URL_ROOT . '/admin/mrp_extrafields.php';
48 $head[$h][1] = $langs->trans("ExtraFields");
49 $nbExtrafields = $extrafields->attributes['mrp_mo']['count'];
50 if ($nbExtrafields > 0) {
51 $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
52 }
53 $head[$h][2] = 'mrp_extrafields';
54 $h++;
55
56 $head[$h][0] = DOL_URL_ROOT . '/admin/mrp_production_extrafields.php';
57 $head[$h][1] = $langs->trans("ExtraFieldsLines");
58 $head[$h][2] = 'mrp_production_extrafields';
59 $h++;
60 // Show more tabs from modules
61 // Entries must be declared in modules descriptor with line
62 //$this->tabs = array(
63 // 'entity:+tabname:Title:@mrp:/mrp/mypage.php?id=__ID__'
64 //); // to add new tab
65 //$this->tabs = array(
66 // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__'
67 //); // to remove a tab
68 complete_head_from_modules($conf, $langs, null, $head, $h, 'mrp');
69
70 complete_head_from_modules($conf, $langs, null, $head, $h, 'mrp', 'remove');
71
72 return $head;
73}
Class to manage standard extra fields.
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).
mrpAdminPrepareHead()
Prepare admin pages header.
Definition mrp.lib.php:30