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>
|
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
|
2013-01-16 15:36:08 +01:00
|
|
|
* 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
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
2009-01-23 17:44:12 +01:00
|
|
|
|
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
|
|
|
|
2024-11-10 11:16:23 +01:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
|
|
|
|
$error = 0;
|
|
|
|
|
|
2020-12-16 20:15:48 +01:00
|
|
|
if ($action == 'setvalue') {
|
2019-01-27 11:55:16 +01:00
|
|
|
$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
|
|
|
*/
|
|
|
|
|
|
2024-06-09 14:59:03 +02:00
|
|
|
llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-bookmarks page-admin_bookmark');
|
2009-01-23 17:44:12 +01:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
2019-01-27 11:55:16 +01:00
|
|
|
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"].'">';
|
2019-12-18 23:12:31 +01:00
|
|
|
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";
|
2017-04-14 11:22:48 +02:00
|
|
|
|
2017-04-14 13:02:29 +02:00
|
|
|
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>';
|
2021-08-24 17:04:17 +02:00
|
|
|
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
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2015-12-11 14:19:38 +01:00
|
|
|
$db->close();
|