dolibarr 20.0.2
website_options.php
1<?php
2/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
24// Load Dolibarr environment
25require '../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
27require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
33require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
34
35// Load translation files required by the page
36$langs->loadLangs(array('errors', 'admin', 'companies', 'website'));
37
38$action = GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view';
39$confirm = GETPOST('confirm', 'alpha');
40$backtopage = GETPOST('backtopage', 'alpha');
41
42// Load variable for pagination
43$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
44$sortfield = GETPOST('sortfield', 'aZ09comma');
45$sortorder = GETPOST('sortorder', 'aZ09comma');
46$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
47if (empty($page) || $page == -1) {
48 $page = 0;
49} // If $page is not defined, or '' or -1
50$offset = $limit * $page;
51$pageprev = $page - 1;
52$pagenext = $page + 1;
53
54// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
55$hookmanager->initHooks(array('admin'));
56
57$arrayofparameters = array('WEBSITE_USE_WEBSITE_ACCOUNTS'=>array('css'=>'minwidth200'));
58
59$status = 1;
60$rowid = GETPOST('rowid', 'alpha');
61
62if (!$user->admin || !isModEnabled('website')) {
64}
65
66// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
67/*
68$useFormSetup = 1;
69
70if (!class_exists('FormSetup')) {
71 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
72}
73$formSetup = new FormSetup($db);
74
75$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
76*/
77
78
79/*
80 * Actions
81 */
82
83include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
84
85
86/*
87 * View
88 */
89
90$form = new Form($db);
91$formadmin = new FormAdmin($db);
92
93llxHeader('', $langs->trans("WebsiteSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-website_options');
94
95$titre = $langs->trans("WebsiteSetup");
96$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php').'">'.$langs->trans("BackToModuleList").'</a>';
97print load_fiche_titre($titre, $linkback, 'title_setup');
98
99// Onglets
100$head = array();
101$h = 0;
102
103$head[$h][0] = DOL_URL_ROOT."/admin/website.php";
104$head[$h][1] = $langs->trans("WebSites");
105$head[$h][2] = 'website';
106$h++;
107
108$head[$h][0] = DOL_URL_ROOT."/admin/website_options.php";
109$head[$h][1] = $langs->trans("Options");
110$head[$h][2] = 'options';
111$h++;
112
113print dol_get_fiche_head($head, 'options', '', -1);
114
115
116
117print '<div class="div-table-responsive-no-min">';
118print '<table class="noborder centpercent">';
119print '<tr class="liste_titre">';
120print '<td>'.$langs->trans("Parameter").'</td>';
121print '<td align="center" width="20">&nbsp;</td>';
122print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
123print '</tr>';
124
125
126// Mail required for users
127
128print '<tr class="oddeven">';
129print '<td>';
130print $form->textwithpicto($langs->trans('WEBSITE_USE_WEBSITE_ACCOUNTS'), $langs->trans('WEBSITE_USE_WEBSITE_ACCOUNTSTooltip'));
131print '</td>';
132print '<td align="center" width="20">&nbsp;</td>';
133
134print '<td align="center" width="100">';
135if (!empty($conf->use_javascript_ajax)) {
136 print ajax_constantonoff('WEBSITE_USE_WEBSITE_ACCOUNTS');
137} else {
138 if (!getDolGlobalString('WEBSITE_USE_WEBSITE_ACCOUNTS')) {
139 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_WEBSITE_USE_WEBSITE_ACCOUNTS&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
140 } else {
141 print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_WEBSITE_USE_WEBSITE_ACCOUNTS&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
142 }
143}
144print '</td></tr>';
145
146
147print '</table>';
148
149if (empty($conf->use_javascript_ajax)) {
150 print '<div class="tabsAction">';
151 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
152 print '</div>';
153}
154
155print dol_get_fiche_end();
156
157// End of page
158llxFooter();
159$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to generate html code for admin pages.
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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 dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.