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