dolibarr 19.0.3
param_ihm.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2010-2015 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro.com>
5 * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
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/functions2.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
31
32// Load translation files required by page
33$langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members'));
34
35// Defini si peux lire/modifier permisssions
36$canreaduser = ($user->admin || $user->hasRight("user", "user", "read"));
37
38$id = GETPOST('id', 'int');
39$action = GETPOST('action', 'aZ09');
40$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'userihm'; // To manage different context of search
41
42if (!isset($id) || empty($id)) {
44}
45
46if ($id) {
47 // $user est le user qui edite, $id est l'id de l'utilisateur edite
48 $caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write"))
49 || (($user->id != $id) && $user->hasRight("user", "user", "write")));
50}
51
52// Security check
53$socid = 0;
54if ($user->socid > 0) {
55 $socid = $user->socid;
56}
57$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user');
58
59$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
60if ($user->id != $id && !$canreaduser) {
62}
63
64$dirtop = "../core/menus/standard";
65$dirleft = "../core/menus/standard";
66
67// Charge utilisateur edite
68$object = new User($db);
69$object->fetch($id, '', '', 1);
70$object->getrights();
71
72// Liste des zone de recherche permanentes supportees
73/* deprecated
74$searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice");
75$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE);
76$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"));
77*/
78
79$form = new Form($db);
80$formadmin = new FormAdmin($db);
81
82// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
83$hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
84
85
86/*
87 * Actions
88 */
89
90$parameters = array('id'=>$socid);
91$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
92if ($reshook < 0) {
93 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
94}
95
96if (empty($reshook)) {
97 if ($action == 'update' && ($caneditfield || !empty($user->admin))) {
98 if (!GETPOST("cancel")) {
99 $tabparam = array();
100
101 if (GETPOST("check_MAIN_LANDING_PAGE") == "on") {
102 $tabparam["MAIN_LANDING_PAGE"] = GETPOST("MAIN_LANDING_PAGE", 'alphanohtml');
103 } else {
104 $tabparam["MAIN_LANDING_PAGE"] = '';
105 }
106
107 if (GETPOST("check_MAIN_LANG_DEFAULT") == "on") {
108 $tabparam["MAIN_LANG_DEFAULT"] = GETPOST("main_lang_default", 'aZ09');
109 } else {
110 $tabparam["MAIN_LANG_DEFAULT"] = '';
111 }
112
113 if (GETPOST("check_SIZE_LISTE_LIMIT") == "on") {
114 $tabparam["MAIN_SIZE_LISTE_LIMIT"] = GETPOST("MAIN_SIZE_LISTE_LIMIT", 'int');
115 } else {
116 $tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
117 }
118
119 if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") {
120 $tabparam["AGENDA_DEFAULT_VIEW"] = GETPOST("AGENDA_DEFAULT_VIEW", 'aZ09');
121 } else {
122 $tabparam["AGENDA_DEFAULT_VIEW"] = '';
123 }
124
125 if (GETPOST("check_MAIN_THEME") == "on") {
126 $tabparam["MAIN_THEME"] = GETPOST('main_theme', 'aZ09');
127 } else {
128 $tabparam["MAIN_THEME"] = '';
129 }
130
131 $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array()))));
132 if ($val == '') {
133 $tabparam['THEME_ELDY_TOPMENU_BACK1'] = '';
134 } else {
135 $tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(
136 ',',
137 colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())
138 );
139 }
140
141 $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array()))));
142 if ($val == '') {
143 $tabparam['THEME_ELDY_BACKTITLE1'] = '';
144 } else {
145 $tabparam['THEME_ELDY_BACKTITLE1'] = join(
146 ',',
147 colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())
148 );
149 }
150
151 if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') {
152 $tabparam["THEME_ELDY_USE_HOVER"] = 1;
153 } else {
154 $tabparam["THEME_ELDY_USE_HOVER"] = 0;
155 }
156
157 if (GETPOST('check_THEME_ELDY_USE_CHECKED') == 'on') {
158 $tabparam["THEME_ELDY_USE_CHECKED"] = 1;
159 } else {
160 $tabparam["THEME_ELDY_USE_CHECKED"] = 0;
161 }
162
163 if (GETPOST('MAIN_OPTIMIZEFORTEXTBROWSER')) {
164 $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 1;
165 } else {
166 $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0;
167 }
168
169 if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) {
170 $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND', 'aZ09');
171 } else {
172 $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0;
173 }
174
175 $result = dol_set_user_param($db, $conf, $object, $tabparam);
176
177 header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
178 exit;
179 }
180 }
181}
182
183
184/*
185 * View
186 */
187
188$person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname;
189$title = $person_name." - ".$langs->trans('Card');
190$help_url = '';
191
192llxHeader('', $title, $help_url);
193
194// List of possible landing pages
195$tmparray = array();
196$tmparray['index.php'] = array('label'=>'Dashboard', 'picto'=>'graph');
197if (isModEnabled("societe")) {
198 $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = array('label'=>'ThirdPartiesArea', 'picto'=>'company');
199}
200if (isModEnabled('project')) {
201 $tmparray['projet/index.php?mainmenu=project&leftmenu='] = array('label'=>'ProjectsArea', 'picto'=>'project');
202 if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
203 $tmparray['projet/list.php?mainmenu=project&leftmenu=&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead'] = array('label'=>'ListOpenLeads', 'picto'=>'project');
204 }
205}
206if (isModEnabled('holiday') || isModEnabled('expensereport')) {
207 $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = array('label'=>'HRMArea', 'picto'=>'user'); // TODO Complete list with first level of menus
208}
209if (isModEnabled("product") || isModEnabled("service")) {
210 $tmparray['product/index.php?mainmenu=products&leftmenu='] = array('label'=>'ProductsAndServicesArea', 'picto'=>'product');
211}
212if (isModEnabled("propal") || isModEnabled('commande') || isModEnabled('ficheinter') || isModEnabled('contrat')) {
213 $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = array('label'=>'CommercialArea', 'picto'=>'commercial');
214}
215if (isModEnabled('facture')) {
216 $tmparray['compta/index.php?mainmenu=billing&leftmenu='] = array('label'=>'InvoicesArea', 'picto'=>'bill');
217}
218if (isModEnabled('comptabilite') || isModEnabled('accounting')) {
219 $tmparray['compta/index.php?mainmenu=accountancy&leftmenu='] = array('label'=>'AccountancyTreasuryArea', 'picto'=>'bill');
220}
221if (isModEnabled('adherent')) {
222 $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = array('label'=>'MembersArea', 'picto'=>'member');
223}
224if (isModEnabled('agenda')) {
225 $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = array('label'=>'Agenda', 'picto'=>'action');
226}
227if (isModEnabled('ticket')) {
228 $tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = array('label'=>'Tickets', 'picto'=>'ticket');
229}
230// add bookmarks to available landing pages
231if (!getDolGlobalString('MAIN_NO_BOOKMARKS_FOR_LANDING_PAGES')) {
232 $sql = "SELECT b.rowid, b.fk_user, b.url, b.title";
233 $sql .= " FROM ".MAIN_DB_PREFIX."bookmark as b";
234 $sql .= " WHERE b.entity IN (".getEntity('bookmark').")";
235 $sql .= " AND b.url NOT LIKE 'http%'";
236 if (!$object->admin) {
237 $sql .= " AND (b.fk_user = ".((int) $object->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
238 }
239 $resql = $db->query($sql);
240 if ($resql) {
241 $i = 0;
242 $num_rows = $db->num_rows($resql);
243 if ($num_rows > 0) {
244 $tmparray['sep'.$i] = array('data-html'=>'<span class="opacitymedium">--- '.$langs->trans("Bookmarks").'</span>', 'label'=>'--- '.$langs->trans("Bookmarks"));
245 while ($i < $num_rows) {
246 $obj = $db->fetch_object($resql);
247
248 $landing_url = str_replace(DOL_URL_ROOT, '', $obj->url);
249 $tmparray[$landing_url] = array('label'=>$obj->title, 'picto'=>'generic');
250 $i++;
251 }
252 }
253 }
254}
255
256// Hook for insertion new items in the List of possible landing pages
257$reshook = $hookmanager->executeHooks('addToLandingPageList', $tmparray, $object);
258if ($reshook < 0) {
259 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
260} elseif ($reshook > 0) {
261 $tmparray = $hookmanager->resArray;
262} elseif ($reshook == 0) {
263 $tmparray = array_merge($tmparray, $hookmanager->resArray);
264}
265
266foreach ($tmparray as $key => $val) {
267 $tmparray[$key]['data-html'] = img_picto($langs->trans($val['label']), empty($val['picto']) ? 'generic' : $val['picto'], 'class="pictofixedwidth"').$langs->trans($val['label']);
268 $tmparray[$key]['label'] = $langs->trans($val['label']);
269}
270
271$head = user_prepare_head($object);
272
273$title = $langs->trans("User");
274
275if ($action == 'edit') {
276 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
277 print '<input type="hidden" name="token" value="'.newToken().'">';
278 print '<input type="hidden" name="action" value="update">';
279 print '<input type="hidden" name="id" value="'.$id.'">';
280}
281
282
283if ($action == 'edit') {
284 print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
285
286 $linkback = '';
287
288 if ($user->hasRight("user", "user", "read") || $user->admin) {
289 $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
290 }
291
292 dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin);
293
294 print '<div class="underbanner clearboth"></div>';
295
296 print dol_get_fiche_end();
297
298
299 if (!empty($conf->use_javascript_ajax)) {
300 print '<script type="text/javascript">
301 jQuery(document).ready(function() {
302 function init_myfunc()
303 {
304 if (jQuery("#check_MAIN_LANDING_PAGE").prop("checked")) { jQuery("#MAIN_LANDING_PAGE").removeAttr(\'disabled\'); }
305 else { jQuery("#MAIN_LANDING_PAGE").attr(\'disabled\',\'disabled\'); }
306
307 if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
308 else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
309
310 if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#MAIN_SIZE_LISTE_LIMIT").removeAttr(\'disabled\'); }
311 else { jQuery("#MAIN_SIZE_LISTE_LIMIT").attr(\'disabled\',\'disabled\'); }
312
313 if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
314 else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
315
316 if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
317 else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
318
319 if (jQuery("#check_THEME_ELDY_TOPMENU_BACK1").prop("checked")) { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").removeAttr(\'disabled\'); }
320 else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
321 }
322 init_myfunc();
323 jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
324 jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
325 jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
326 jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
327 jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
328 jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
329 jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
330 });
331 </script>';
332 }
333
334
335 clearstatcache();
336
337 print '<table class="noborder centpercent">';
338 print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
339
340 // Language by default
341 print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("Language").'</td>';
342 print '<td>';
343 $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
344 print $s ? $s.' ' : '';
345 print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT')));
346 print '</td>';
347 print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANG_DEFAULT" id="check_MAIN_LANG_DEFAULT" type="checkbox" '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "");
348 print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
349 print '> <label for="check_MAIN_LANG_DEFAULT">'.$langs->trans("UsePersonalValue").'</label></td>';
350 print '<td>';
351 print $formadmin->select_language((!empty($object->conf->MAIN_LANG_DEFAULT) ? $object->conf->MAIN_LANG_DEFAULT : ''), 'main_lang_default', 1, null, 0, 0, (!empty($dolibarr_main_demo)));
352 print '</td></tr>';
353
354 // Landing page
355 print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
356 print '<td>';
357 print(!getDolGlobalString('MAIN_LANDING_PAGE') ? '' : $conf->global->MAIN_LANDING_PAGE);
358 print '</td>';
359 print '<td class="nowrap" width="20%"><input class="oddeven" name="check_MAIN_LANDING_PAGE" id="check_MAIN_LANDING_PAGE" type="checkbox" '.(!empty($object->conf->MAIN_LANDING_PAGE) ? " checked" : "");
360 print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
361 print '> <label for="check_MAIN_LANDING_PAGE">'.$langs->trans("UsePersonalValue").'</label></td>';
362 print '<td>';
363 print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (!empty($object->conf->MAIN_LANDING_PAGE) ? $object->conf->MAIN_LANDING_PAGE : ''), 0, 0, 0, '', 0, 0, 0, '', 'maxwidth250');
364 //print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
365 print '</td></tr>';
366
367 // Landing page for Agenda - AGENDA_DEFAULT_VIEW
368 print '<tr class="oddeven">'."\n";
369 print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
370 print '<td class="center">&nbsp;</td>'."\n";
371 print '<td class="nowrap" width="20%"><input class="oddeven" name="check_AGENDA_DEFAULT_VIEW" id="check_AGENDA_DEFAULT_VIEW" type="checkbox" '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "");
372 print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
373 print '> <label for="check_AGENDA_DEFAULT_VIEW">'.$langs->trans("UsePersonalValue").'</label></td>';
374 print '<td>'."\n";
375 $tmplist = array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
376 print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, (isset($object->conf->AGENDA_DEFAULT_VIEW) ? $object->conf->AGENDA_DEFAULT_VIEW : ''), 0, 0, 0, '');
377 print '</td></tr>'."\n";
378
379 // Max size of lists
380 print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
381 print '<td>' . getDolGlobalString('MAIN_SIZE_LISTE_LIMIT').'</td>';
382 print '<td class="nowrap" width="20%"><input class="oddeven" name="check_SIZE_LISTE_LIMIT" id="check_SIZE_LISTE_LIMIT" type="checkbox" '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "");
383 print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
384 print '> <label for="check_SIZE_LISTE_LIMIT">'.$langs->trans("UsePersonalValue").'</label></td>';
385 print '<td><input class="flat" name="MAIN_SIZE_LISTE_LIMIT" id="MAIN_SIZE_LISTE_LIMIT" size="4" value="'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '').'"></td></tr>';
386
387 print '</table><br>';
388
389 // Theme
390 showSkins($object, (($user->admin || empty($dolibarr_main_demo)) ? 1 : 0), true);
391
392
393 print $form->buttonsSaveCancel();
394} else {
395 print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
396
397 $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
398
399 $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid" rel="noopener">';
400 $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
401 $morehtmlref .= '</a>';
402
403 $urltovirtualcard = '/user/virtualcard.php?id='.((int) $object->id);
404 $morehtmlref .= dolButtonToOpenUrlInDialogPopup('publicvirtualcard', $langs->transnoentitiesnoconv("PublicVirtualCardUrl").' - '.$object->getFullName($langs), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', 'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard, '', 'nohover');
405
406 dol_banner_tab($object, 'id', $linkback, $user->hasRight("user", "user", "read") || $user->admin, 'rowid', 'ref', $morehtmlref);
407
408 print '<div class="fichecenter">';
409
410 print '<div class="underbanner clearboth"></div>';
411 print '<table class="border centpercent tableforfield">';
412
413 // Login
414 print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
415 if (!empty($object->ldap_sid) && $object->statut == 0) {
416 print '<td class="error">';
417 print $langs->trans("LoginAccountDisableInDolibarr");
418 print '</td>';
419 } else {
420 print '<td>';
421 $addadmin = '';
422 if (property_exists($object, 'admin')) {
423 if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
424 $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
425 } elseif (!empty($object->admin)) {
426 $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
427 }
428 }
429 print showValueWithClipboardCPButton($object->login).$addadmin;
430 print '</td>';
431 }
432 print '</tr>'."\n";
433
434 print '</table>';
435
436 print '</div>';
437
438 print dol_get_fiche_end();
439
440
441 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
442 print '<table class="noborder centpercent">';
443 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
444
445 // Language
446 print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
447 print '<td>';
448 $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
449 print($s ? $s.' ' : '');
450 print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT')));
451 print '</td>';
452 print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
453 print '<td>';
454 $s = (isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
455 print($s ? $s.' ' : '');
456 print(isset($object->conf->MAIN_LANG_DEFAULT) && $object->conf->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : (!empty($object->conf->MAIN_LANG_DEFAULT) ? $langs->trans("Language_".$object->conf->MAIN_LANG_DEFAULT) : ''));
457 print '</td></tr>';
458
459 // Landing page
460 print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
461 print '<td>';
462 print(!getDolGlobalString('MAIN_LANDING_PAGE') ? '' : $conf->global->MAIN_LANDING_PAGE);
463 print '</td>';
464 print '<td class="nowrap"><input class="oddeven" name="check_MAIN_LANDING_PAGE" disabled id="check_MAIN_LANDING_PAGE" type="checkbox" '.(!empty($object->conf->MAIN_LANDING_PAGE) ? " checked" : "");
465 print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
466 print '> '.$langs->trans("UsePersonalValue").'</td>';
467 print '<td class="tdoverflowmax300">';
468 if (!empty($object->conf->MAIN_LANDING_PAGE)) {
469 $urltoshow = '';
470 if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
471 if (is_array($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
472 $urltoshow = $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]['label']);
473 } else {
474 $urltoshow = $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
475 }
476 } else {
477 $urltoshow = $object->conf->MAIN_LANDING_PAGE;
478 }
479 print '<a href="'.DOL_URL_ROOT.'/'.$object->conf->MAIN_LANDING_PAGE.'" target="_blank" rel="noopener">';
480 $s = '';
481 if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE]['picto'])) {
482 $s = img_picto($urltoshow, $tmparray[$object->conf->MAIN_LANDING_PAGE]['picto'], 'class="pictofixedwidth"');
483 }
484 if (empty($s)) {
485 print img_picto($urltoshow, 'globe', 'class="pictofixedwidth"');
486 } else {
487 print $s;
488 }
489 print $urltoshow;
490 print '</a>';
491 }
492 print '</td></tr>';
493
494 // Landing page for Agenda - AGENDA_DEFAULT_VIEW
495 print '<tr class="oddeven">'."\n";
496 print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
497 print '<td class="center">&nbsp;</td>'."\n";
498 print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
499 print '<td>'."\n";
500 $tmplist = array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
501 if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) {
502 print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
503 }
504 print '</td></tr>'."\n";
505
506 // Max size for lists
507 print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
508 print '<td>'.(getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') ? $conf->global->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td>';
509 print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
510 print '<td>'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td></tr>';
511
512 print '</table>';
513 print '</div>';
514 print '<br>';
515
516
517 // Skin
518 showSkins($object, 0, true);
519
520
521 print '<div class="tabsAction">';
522 if (empty($user->admin) && !empty($dolibarr_main_demo)) {
523 print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("FeatureDisabledInDemo").'" href="#">'.$langs->trans("Modify").'</a>';
524 } else {
525 if ($caneditfield || !empty($user->admin)) { // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin
526 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
527 } else {
528 print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Modify").'</a>';
529 }
530 }
531
532 print '</div>';
533}
534
535if ($action == 'edit') {
536 print '</form>';
537}
538
539// End of page
540llxFooter();
541$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.
Class to manage Dolibarr users.
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
dol_set_user_param($db, $conf, &$user, $tab)
Save personnal parameter.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
conf($dolibarr_main_document_root)
Load conf file (file must exists)
Definition inc.php:403
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
user_prepare_head(User $object)
Prepare array with list of tabs.
showSkins($fuser, $edit=0, $foruserprofile=false)
Show list of themes.