dolibarr 24.0.0-beta
quickmemo.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2026 John BOTELLA
3 * Copyright (C) 2025-2026 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;
33
34 // global $db;
35 // $extrafields = new ExtraFields($db);
36 // $extrafields->fetch_name_optionals_label('myobject');
37
38 $langs->load("quickmemo");
39
40 $h = 0;
41 $head = array();
42
43 $head[$h][0] = dolBuildUrl(DOL_DOCUMENT_ROOT."/quickmemo/admin/setup.php");
44 $head[$h][1] = $langs->trans("Settings");
45 $head[$h][2] = 'settings';
46 $h++;
47
48
49 // $head[$h][0] = dolBuildUrl(dol_buildpath("/quickmemo/admin/memo_extrafields.php", 1));
50 // $head[$h][1] = $langs->trans("ExtraFields");
51 // $nbExtrafields = (isset($extrafields->attributes['memo']['label']) && is_countable($extrafields->attributes['memo']['label'])) ? count($extrafields->attributes['memo']['label']) : 0;
52 // if ($nbExtrafields > 0) {
53 // $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
54 // }
55 // $head[$h][2] = 'memo_extrafields';
56 // $h++;
57
58 /*
59 $head[$h][0] = dolBuildUrl(dol_buildpath("/quickmemo/admin/myobjectline_extrafields.php", 1));
60 $head[$h][1] = $langs->trans("ExtraFieldsLines");
61 $nbExtrafields = (isset($extrafields->attributes['myobjectline']['label']) && is_countable($extrafields->attributes['myobjectline']['label'])) ? count($extrafields->attributes['myobject']['label']) : 0;
62 if ($nbExtrafields > 0) {
63 $head[$h][1] .= '<span class="badge marginleftonlyshort">' . $nbExtrafields . '</span>';
64 }
65 $head[$h][2] = 'myobject_extrafieldsline';
66 $h++;
67 */
68
69
70 // Show more tabs from modules
71 // Entries must be declared in modules descriptor with line
72 //$this->tabs = array(
73 // 'entity:+tabname:Title:@quickmemo:/quickmemo/mypage.php?id=__ID__'
74 //); // to add new tab
75 //$this->tabs = array(
76 // 'entity:-tabname:Title:@quickmemo:/quickmemo/mypage.php?id=__ID__'
77 //); // to remove a tab
78 complete_head_from_modules($conf, $langs, null, $head, $h, 'quickmemo@quickmemo');
79
80 complete_head_from_modules($conf, $langs, null, $head, $h, 'quickmemo@quickmemo', 'remove');
81
82 return $head;
83}
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
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).
quickmemoAdminPrepareHead()
Prepare admin pages header.