dolibarr  16.0.5
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 require '../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
30 
31 // Load translation files required by page
32 $langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members'));
33 
34 // Defini si peux lire/modifier permisssions
35 $canreaduser = ($user->admin || $user->rights->user->user->lire);
36 
37 $id = GETPOST('id', 'int');
38 $action = GETPOST('action', 'aZ09');
39 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userihm'; // To manage different context of search
40 
41 if ($id) {
42  // $user est le user qui edite, $id est l'id de l'utilisateur edite
43  $caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
44  || (($user->id != $id) && $user->rights->user->user->creer));
45 }
46 
47 // Security check
48 $socid = 0;
49 if ($user->socid > 0) {
50  $socid = $user->socid;
51 }
52 $feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
53 
54 $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
55 if ($user->id <> $id && !$canreaduser) {
57 }
58 
59 $dirtop = "../core/menus/standard";
60 $dirleft = "../core/menus/standard";
61 
62 // Charge utilisateur edite
63 $object = new User($db);
64 $object->fetch($id, '', '', 1);
65 $object->getrights();
66 
67 // Liste des zone de recherche permanentes supportees
68 /* deprecated
69 $searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice");
70 $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE);
71 $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"));
72 */
73 
74 $form = new Form($db);
75 $formadmin = new FormAdmin($db);
76 
77 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
78 $hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
79 
80 
81 /*
82  * Actions
83  */
84 
85 $parameters = array('id'=>$socid);
86 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
87 if ($reshook < 0) {
88  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
89 }
90 
91 if (empty($reshook)) {
92  if ($action == 'update' && ($caneditfield || !empty($user->admin))) {
93  if (!GETPOST("cancel")) {
94  $tabparam = array();
95 
96  if (GETPOST("check_MAIN_LANDING_PAGE") == "on") {
97  $tabparam["MAIN_LANDING_PAGE"] = GETPOST("MAIN_LANDING_PAGE", 'alphanohtml');
98  } else {
99  $tabparam["MAIN_LANDING_PAGE"] = '';
100  }
101 
102  if (GETPOST("check_MAIN_LANG_DEFAULT") == "on") {
103  $tabparam["MAIN_LANG_DEFAULT"] = GETPOST("main_lang_default", 'aZ09');
104  } else {
105  $tabparam["MAIN_LANG_DEFAULT"] = '';
106  }
107 
108  if (GETPOST("check_SIZE_LISTE_LIMIT") == "on") {
109  $tabparam["MAIN_SIZE_LISTE_LIMIT"] = GETPOST("main_size_liste_limit", 'int');
110  } else {
111  $tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
112  }
113 
114  if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") {
115  $tabparam["AGENDA_DEFAULT_VIEW"] = GETPOST("AGENDA_DEFAULT_VIEW", 'aZ09');
116  } else {
117  $tabparam["AGENDA_DEFAULT_VIEW"] = '';
118  }
119 
120  if (GETPOST("check_MAIN_THEME") == "on") {
121  $tabparam["MAIN_THEME"] = GETPOST('main_theme', 'aZ09');
122  } else {
123  $tabparam["MAIN_THEME"] = '';
124  }
125 
126  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array()))));
127  if ($val == '') {
128  $tabparam['THEME_ELDY_TOPMENU_BACK1'] = '';
129  } else {
130  $tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(
131  ',',
132  colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())
133  );
134  }
135 
136  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array()))));
137  if ($val == '') {
138  $tabparam['THEME_ELDY_BACKTITLE1'] = '';
139  } else {
140  $tabparam['THEME_ELDY_BACKTITLE1'] = join(
141  ',',
142  colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())
143  );
144  }
145 
146  if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') {
147  $tabparam["THEME_ELDY_USE_HOVER"] = 1;
148  } else {
149  $tabparam["THEME_ELDY_USE_HOVER"] = 0;
150  }
151 
152  if (GETPOST('check_THEME_ELDY_USE_CHECKED') == 'on') {
153  $tabparam["THEME_ELDY_USE_CHECKED"] = 1;
154  } else {
155  $tabparam["THEME_ELDY_USE_CHECKED"] = 0;
156  }
157 
158  if (GETPOST('MAIN_OPTIMIZEFORTEXTBROWSER')) {
159  $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 1;
160  } else {
161  $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0;
162  }
163 
164  if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) {
165  $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND', 'aZ09');
166  } else {
167  $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0;
168  }
169 
170  $result = dol_set_user_param($db, $conf, $object, $tabparam);
171 
172  header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
173  exit;
174  }
175  }
176 }
177 
178 /*
179  * View
180  */
181 
182 llxHeader();
183 
184 // List of possible landing pages
185 $tmparray = array('index.php'=>'Dashboard');
186 if (!empty($conf->societe->enabled)) {
187  $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea';
188 }
189 if (!empty($conf->project->enabled)) {
190  $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
191 }
192 if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
193  $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
194 }
195 if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
196  $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
197 }
198 if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
199  $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
200 }
201 if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
202  $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
203 }
204 if (!empty($conf->adherent->enabled)) {
205  $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
206 }
207 if (isModEnabled('agenda')) {
208  $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
209 }
210 if (!empty($conf->ticket->enabled)) {
211  $tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = 'Tickets';
212 }
213 
214 $head = user_prepare_head($object);
215 
216 $title = $langs->trans("User");
217 
218 if ($action == 'edit') {
219  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
220  print '<input type="hidden" name="token" value="'.newToken().'">';
221  print '<input type="hidden" name="action" value="update">';
222  print '<input type="hidden" name="id" value="'.$id.'">';
223 }
224 
225 
226 if ($action == 'edit') {
227  print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
228 
229  $linkback = '';
230 
231  if ($user->rights->user->user->lire || $user->admin) {
232  $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
233  }
234 
235  dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
236 
237  print '<div class="underbanner clearboth"></div>';
238 
239  print dol_get_fiche_end();
240 
241 
242  if (!empty($conf->use_javascript_ajax)) {
243  print '<script type="text/javascript">
244  jQuery(document).ready(function() {
245  function init_myfunc()
246  {
247  if (jQuery("#check_MAIN_LANDING_PAGE").prop("checked")) { jQuery("#MAIN_LANDING_PAGE").removeAttr(\'disabled\'); }
248  else { jQuery("#MAIN_LANDING_PAGE").attr(\'disabled\',\'disabled\'); }
249 
250  if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
251  else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
252 
253  if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
254  else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
255 
256  if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
257  else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
258 
259  if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
260  else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
261 
262  if (jQuery("#check_THEME_ELDY_TOPMENU_BACK1").prop("checked")) { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").removeAttr(\'disabled\'); }
263  else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
264  }
265  init_myfunc();
266  jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
267  jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
268  jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
269  jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
270  jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
271  jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
272  jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
273  });
274  </script>';
275  }
276 
277 
278  clearstatcache();
279 
280  print '<table class="noborder centpercent">';
281  print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
282 
283  // Language by default
284  print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("Language").'</td>';
285  print '<td>';
286  $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
287  print $s ? $s.' ' : '';
288  print ($conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
289  print '</td>';
290  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" : "");
291  print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
292  print '> <label for="check_MAIN_LANG_DEFAULT">'.$langs->trans("UsePersonalValue").'</label></td>';
293  print '<td>';
294  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)));
295  print '</td></tr>';
296 
297  // Landing page
298  print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
299  print '<td>';
300  print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
301  print '</td>';
302  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" : "");
303  print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
304  print '> <label for="check_MAIN_LANDING_PAGE">'.$langs->trans("UsePersonalValue").'</label></td>';
305  print '<td>';
306  print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (!empty($object->conf->MAIN_LANDING_PAGE) ? $object->conf->MAIN_LANDING_PAGE : ''), 0, 0, 0, '', 1);
307  //print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
308  print '</td></tr>';
309 
310  // Landing page for Agenda - AGENDA_DEFAULT_VIEW
311  print '<tr class="oddeven">'."\n";
312  print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
313  print '<td class="center">&nbsp;</td>'."\n";
314  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" : "");
315  print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
316  print '> <label for="check_AGENDA_DEFAULT_VIEW">'.$langs->trans("UsePersonalValue").'</label></td>';
317  print '<td>'."\n";
318  $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"));
319  print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
320  print '</td></tr>'."\n";
321 
322  // Max size of lists
323  print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
324  print '<td>'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'</td>';
325  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" : "");
326  print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
327  print '> <label for="check_SIZE_LISTE_LIMIT">'.$langs->trans("UsePersonalValue").'</label></td>';
328  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>';
329 
330  print '</table><br>';
331 
332  // Theme
333  showSkins($object, (($user->admin || empty($dolibarr_main_demo)) ? 1 : 0), true);
334 
335 
336  print $form->buttonsSaveCancel();
337 } else {
338  print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
339 
340  $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
341 
342  $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
343  $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
344  $morehtmlref .= '</a>';
345 
346  dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
347 
348  print '<div class="fichecenter">';
349 
350  print '<div class="underbanner clearboth"></div>';
351  print '<table class="border centpercent tableforfield">';
352 
353  // Login
354  print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
355  if (!empty($object->ldap_sid) && $object->statut == 0) {
356  print '<td class="error">';
357  print $langs->trans("LoginAccountDisableInDolibarr");
358  print '</td>';
359  } else {
360  print '<td>';
361  $addadmin = '';
362  if (property_exists($object, 'admin')) {
363  if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
364  $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
365  } elseif (!empty($object->admin)) {
366  $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
367  }
368  }
369  print showValueWithClipboardCPButton($object->login).$addadmin;
370  print '</td>';
371  }
372  print '</tr>'."\n";
373 
374  print '</table>';
375 
376  print '</div>';
377 
378  print dol_get_fiche_end();
379 
380 
381  print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
382  print '<table class="noborder centpercent">';
383  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>';
384 
385  // Language
386  print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
387  print '<td>';
388  $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
389  print ($s ? $s.' ' : '');
390  print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
391  print '</td>';
392  print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
393  print '<td>';
394  $s = (isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
395  print ($s ? $s.' ' : '');
396  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) : ''));
397  print '</td></tr>';
398 
399  // Landing page
400  print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
401  print '<td>';
402  print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
403  print '</td>';
404  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" : "");
405  print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
406  print '> '.$langs->trans("UsePersonalValue").'</td>';
407  print '<td>';
408  if (!empty($object->conf->MAIN_LANDING_PAGE)) {
409  if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
410  print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
411  } else {
412  print $object->conf->MAIN_LANDING_PAGE;
413  }
414  }
415  //print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
416  print '</td></tr>';
417 
418  // Landing page for Agenda - AGENDA_DEFAULT_VIEW
419  print '<tr class="oddeven">'."\n";
420  print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
421  print '<td class="center">&nbsp;</td>'."\n";
422  print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
423  print '<td>'."\n";
424  $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"));
425  if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) {
426  print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
427  }
428  print '</td></tr>'."\n";
429 
430  // Max size for lists
431  print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
432  print '<td>'.(!empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? $conf->global->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td>';
433  print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
434  print '<td>'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td></tr>';
435 
436  print '</table>';
437  print '</div>';
438  print '<br>';
439 
440 
441  // Skin
442  showSkins($object, 0, true);
443 
444 
445  print '<div class="tabsAction">';
446  if (empty($user->admin) && !empty($dolibarr_main_demo)) {
447  print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("FeatureDisabledInDemo").'" href="#">'.$langs->trans("Modify").'</a>';
448  } else {
449  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
450  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
451  } else {
452  print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Modify").'</a>';
453  }
454  }
455 
456  print '</div>';
457 }
458 
459 if ($action == 'edit') {
460  print '</form>';
461 }
462 
463 // End of page
464 llxFooter();
465 $db->close();
restrictedArea
restrictedArea($user, $features, $objectid=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.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
colorStringToArray
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
Definition: functions2.lib.php:2402
user_prepare_head
user_prepare_head(User $object)
Prepare array with list of tabs.
Definition: usergroups.lib.php:35
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
picto_from_langcode
picto_from_langcode($codelang, $moreatt='', $notitlealt=0)
Return img flag of country for a language code or country code.
Definition: functions.lib.php:8742
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
FormAdmin
Class to generate html code for admin pages.
Definition: html.formadmin.class.php:30
dol_banner_tab
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.
Definition: functions.lib.php:2046
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
showValueWithClipboardCPButton
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
Definition: functions.lib.php:11087
dol_set_user_param
dol_set_user_param($db, $conf, &$user, $tab)
Save personnal parameter.
Definition: functions2.lib.php:1786
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
User
Class to manage Dolibarr users.
Definition: user.class.php:44
showSkins
showSkins($fuser, $edit=0, $foruserprofile=false)
Show list of themes.
Definition: usergroups.lib.php:298
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59