dolibarr/htdocs/bookmarks/admin/bookmark.php

101 lines
3.1 KiB
PHP
Raw Permalink Normal View History

2009-01-23 17:44:12 +01:00
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.org>
2012-03-29 18:04:10 +02:00
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
add baseline exclude for phpstan (#31632) * add baseline exclude for phpstan * update * update * update * update * update * merge * restore one filter * delete old errors * fix * fix * fix * $moreforfilter can t be empty * fix * enable check * refresh baseline * add phpdoc * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
2011-09-14 23:29:04 +02:00
*
2009-01-23 17:44:12 +01:00
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2009-01-23 17:44:12 +01:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2009-01-23 17:44:12 +01:00
*/
2010-05-12 17:50:59 +02:00
/** \file htdocs/bookmarks/admin/bookmark.php
2009-01-23 17:44:12 +01:00
* \ingroup bookmark
* \brief Page to setup bookmark module
*/
2022-09-07 20:08:59 +02:00
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
2009-01-23 17:44:12 +01:00
add baseline exclude for phpstan (#31632) * add baseline exclude for phpstan * update * update * update * update * update * merge * restore one filter * delete old errors * fix * fix * fix * $moreforfilter can t be empty * fix * enable check * refresh baseline * add phpdoc * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * update phpstan baseline * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-11-04 23:53:20 +01:00
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
2018-05-27 09:58:23 +02:00
// Load translation files required by the page
2009-01-23 17:44:12 +01:00
$langs->load("admin");
2020-12-16 20:15:48 +01:00
if (!$user->admin) {
accessforbidden();
}
2009-01-23 17:44:12 +01:00
2020-09-16 19:39:50 +02:00
$action = GETPOST('action', 'aZ09');
2009-01-23 17:44:12 +01:00
/*
* Actions
*/
$error = 0;
2020-12-16 20:15:48 +01:00
if ($action == 'setvalue') {
$showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU', 'alpha');
$res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU", $showmenu, 'chaine', 0, '', $conf->entity);
2011-09-14 23:29:04 +02:00
2021-01-23 17:49:08 +01:00
if (!($res > 0)) {
2020-12-16 20:15:48 +01:00
$error++;
}
2011-09-14 23:29:04 +02:00
2020-12-16 20:15:48 +01:00
if (!$error) {
2011-09-14 23:29:04 +02:00
$db->commit();
2015-10-30 21:59:22 +01:00
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
2020-05-21 15:05:19 +02:00
} else {
2011-09-14 23:29:04 +02:00
$db->rollback();
2015-10-30 21:59:22 +01:00
setEventMessages($langs->trans("Error"), null, 'errors');
2011-09-03 16:40:48 +02:00
}
2009-01-23 17:44:12 +01:00
}
/*
2012-03-29 18:04:10 +02:00
* View
2009-01-23 17:44:12 +01:00
*/
llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-bookmarks page-admin_bookmark');
2009-01-23 17:44:12 +01:00
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("BookmarkSetup"), $linkback, 'title_setup');
2009-01-23 17:44:12 +01:00
print $langs->trans("BookmarkDesc")."<br>\n";
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
2009-01-23 17:44:12 +01:00
print '<input type="hidden" name="action" value="setvalue">';
2019-11-05 21:24:41 +01:00
print '<table summary="bookmarklist" class="noborder centpercent">';
2009-01-23 17:44:12 +01:00
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td>';
2009-01-23 17:44:12 +01:00
print $langs->trans("NbOfBoomarkToShow").'</td><td>';
2023-10-15 15:32:35 +02:00
print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="' . getDolGlobalString('BOOKMARKS_SHOW_IN_MENU').'">';
2009-01-23 17:44:12 +01:00
print '</td></tr>';
print '</table><br><div class="center"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></div></form>';
2009-01-23 17:44:12 +01:00
2018-07-29 13:40:35 +02:00
// End of page
llxFooter();
$db->close();