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>
|
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
|
2011-08-03 02:45:22 +02:00
|
|
|
* along with this program. If not, see <http://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
|
|
|
|
|
*/
|
|
|
|
|
|
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
|
|
|
|
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");
|
|
|
|
|
|
|
|
|
|
if (!$user->admin)
|
2011-09-14 23:29:04 +02:00
|
|
|
accessforbidden();
|
2009-01-23 17:44:12 +01:00
|
|
|
|
2012-03-29 18:04:10 +02:00
|
|
|
$action=GETPOST('action','alpha');
|
2009-01-23 17:44:12 +01:00
|
|
|
|
2011-09-03 16:40:48 +02:00
|
|
|
if ($action == 'setvalue')
|
2009-01-23 17:44:12 +01:00
|
|
|
{
|
2012-03-29 18:04:10 +02:00
|
|
|
$showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU','alpha');
|
2011-09-03 16:40:48 +02:00
|
|
|
$res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$showmenu,'chaine',0,'',$conf->entity);
|
2011-09-14 23:29:04 +02:00
|
|
|
|
2011-09-03 16:40:48 +02:00
|
|
|
if (! $res > 0) $error++;
|
2011-09-14 23:29:04 +02:00
|
|
|
|
2011-09-03 16:40:48 +02: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');
|
2011-09-14 23:29:04 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$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();
|
|
|
|
|
|
2018-02-26 09:20:05 +01:00
|
|
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
2015-09-24 18:33:48 +02: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"].'">';
|
2009-05-17 10:01:54 +02:00
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
2009-01-23 17:44:12 +01:00
|
|
|
print '<input type="hidden" name="action" value="setvalue">';
|
|
|
|
|
|
2014-03-11 13:04:02 +01:00
|
|
|
print '<table summary="bookmarklist" class="noborder" width="100%">';
|
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>';
|
|
|
|
|
print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="'.$conf->global->BOOKMARKS_SHOW_IN_MENU.'">';
|
|
|
|
|
print '</td></tr>';
|
2014-11-25 20:13:43 +01:00
|
|
|
print '</table><br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div></form>';
|
2009-01-23 17:44:12 +01:00
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2015-12-11 14:19:38 +01:00
|
|
|
$db->close();
|