dolibarr 21.0.0-beta
bookmark.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.org>
4 * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
5 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
26// Load Dolibarr environment
27require '../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
29
38// Load translation files required by the page
39$langs->load("admin");
40
41if (!$user->admin) {
43}
44
45$action = GETPOST('action', 'aZ09');
46
47/*
48 * Actions
49 */
50$error = 0;
51
52if ($action == 'setvalue') {
53 $showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU', 'alpha');
54 $res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU", $showmenu, 'chaine', 0, '', $conf->entity);
55
56 if (!($res > 0)) {
57 $error++;
58 }
59
60 if (!$error) {
61 $db->commit();
62 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
63 } else {
64 $db->rollback();
65 setEventMessages($langs->trans("Error"), null, 'errors');
66 }
67}
68
69
70/*
71 * View
72 */
73
74llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-bookmarks page-admin_bookmark');
75
76$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
77print load_fiche_titre($langs->trans("BookmarkSetup"), $linkback, 'title_setup');
78
79print $langs->trans("BookmarkDesc")."<br>\n";
80
81print '<br>';
82print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
83print '<input type="hidden" name="token" value="'.newToken().'">';
84print '<input type="hidden" name="action" value="setvalue">';
85
86print '<table summary="bookmarklist" class="noborder centpercent">';
87print '<tr class="liste_titre">';
88print '<td>'.$langs->trans("Name").'</td>';
89print '<td>'.$langs->trans("Value").'</td>';
90print "</tr>\n";
91
92print '<tr class="oddeven"><td>';
93print $langs->trans("NbOfBoomarkToShow").'</td><td>';
94print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="' . getDolGlobalString('BOOKMARKS_SHOW_IN_MENU').'">';
95print '</td></tr>';
96print '</table><br><div class="center"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></div></form>';
97
98// End of page
99llxFooter();
100$db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.