param_ihm.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. /**
  21. * \file htdocs/user/param_ihm.php
  22. * \brief Page to show user setup for display
  23. */
  24. require '../main.inc.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
  28. // Load translation files required by page
  29. $langs->loadLangs(array('companies', 'products', 'admin', 'users', 'languages', 'projects', 'members'));
  30. // Defini si peux lire/modifier permisssions
  31. $canreaduser = ($user->admin || $user->rights->user->user->lire);
  32. $id = GETPOST('id', 'int');
  33. $action = GETPOST('action', 'aZ09');
  34. $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userihm'; // To manage different context of search
  35. if ($id) {
  36. // $user est le user qui edite, $id est l'id de l'utilisateur edite
  37. $caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
  38. || (($user->id != $id) && $user->rights->user->user->creer));
  39. }
  40. // Security check
  41. $socid = 0;
  42. if ($user->socid > 0) {
  43. $socid = $user->socid;
  44. }
  45. $feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
  46. $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
  47. if ($user->id <> $id && !$canreaduser) {
  48. accessforbidden();
  49. }
  50. $dirtop = "../core/menus/standard";
  51. $dirleft = "../core/menus/standard";
  52. // Charge utilisateur edite
  53. $object = new User($db);
  54. $object->fetch($id, '', '', 1);
  55. $object->getrights();
  56. // Liste des zone de recherche permanentes supportees
  57. /* deprecated
  58. $searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice");
  59. $searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE);
  60. $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"));
  61. */
  62. $form = new Form($db);
  63. $formadmin = new FormAdmin($db);
  64. // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
  65. $hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
  66. /*
  67. * Actions
  68. */
  69. $parameters = array('id'=>$socid);
  70. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  71. if ($reshook < 0) {
  72. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  73. }
  74. if (empty($reshook)) {
  75. if ($action == 'update' && ($caneditfield || !empty($user->admin))) {
  76. if (!GETPOST("cancel")) {
  77. $tabparam = array();
  78. if (GETPOST("check_MAIN_LANDING_PAGE") == "on") {
  79. $tabparam["MAIN_LANDING_PAGE"] = GETPOST("MAIN_LANDING_PAGE", 'alphanohtml');
  80. } else {
  81. $tabparam["MAIN_LANDING_PAGE"] = '';
  82. }
  83. if (GETPOST("check_MAIN_LANG_DEFAULT") == "on") {
  84. $tabparam["MAIN_LANG_DEFAULT"] = GETPOST("main_lang_default", 'aZ09');
  85. } else {
  86. $tabparam["MAIN_LANG_DEFAULT"] = '';
  87. }
  88. if (GETPOST("check_SIZE_LISTE_LIMIT") == "on") {
  89. $tabparam["MAIN_SIZE_LISTE_LIMIT"] = GETPOST("main_size_liste_limit", 'int');
  90. } else {
  91. $tabparam["MAIN_SIZE_LISTE_LIMIT"] = '';
  92. }
  93. if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") {
  94. $tabparam["AGENDA_DEFAULT_VIEW"] = GETPOST("AGENDA_DEFAULT_VIEW", 'aZ09');
  95. } else {
  96. $tabparam["AGENDA_DEFAULT_VIEW"] = '';
  97. }
  98. if (GETPOST("check_MAIN_THEME") == "on") {
  99. $tabparam["MAIN_THEME"] = GETPOST('main_theme', 'aZ09');
  100. } else {
  101. $tabparam["MAIN_THEME"] = '';
  102. }
  103. $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array()))));
  104. if ($val == '') {
  105. $tabparam['THEME_ELDY_TOPMENU_BACK1'] = '';
  106. } else {
  107. $tabparam['THEME_ELDY_TOPMENU_BACK1'] = join(
  108. ',',
  109. colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1', 'alphanohtml'), array())
  110. );
  111. }
  112. $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array()))));
  113. if ($val == '') {
  114. $tabparam['THEME_ELDY_BACKTITLE1'] = '';
  115. } else {
  116. $tabparam['THEME_ELDY_BACKTITLE1'] = join(
  117. ',',
  118. colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1', 'alphanohtml'), array())
  119. );
  120. }
  121. if (GETPOST('check_THEME_ELDY_USE_HOVER') == 'on') {
  122. $tabparam["THEME_ELDY_USE_HOVER"] = 1;
  123. } else {
  124. $tabparam["THEME_ELDY_USE_HOVER"] = 0;
  125. }
  126. if (GETPOST('check_THEME_ELDY_USE_CHECKED') == 'on') {
  127. $tabparam["THEME_ELDY_USE_CHECKED"] = 1;
  128. } else {
  129. $tabparam["THEME_ELDY_USE_CHECKED"] = 0;
  130. }
  131. if (GETPOST('MAIN_OPTIMIZEFORTEXTBROWSER')) {
  132. $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 1;
  133. } else {
  134. $tabparam["MAIN_OPTIMIZEFORTEXTBROWSER"] = 0;
  135. }
  136. if (GETPOST('MAIN_OPTIMIZEFORCOLORBLIND')) {
  137. $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = GETPOST('MAIN_OPTIMIZEFORCOLORBLIND', 'aZ09');
  138. } else {
  139. $tabparam["MAIN_OPTIMIZEFORCOLORBLIND"] = 0;
  140. }
  141. $result = dol_set_user_param($db, $conf, $object, $tabparam);
  142. header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
  143. exit;
  144. }
  145. }
  146. }
  147. /*
  148. * View
  149. */
  150. llxHeader();
  151. // List of possible landing pages
  152. $tmparray = array('index.php'=>'Dashboard');
  153. if (!empty($conf->societe->enabled)) {
  154. $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea';
  155. }
  156. if (!empty($conf->projet->enabled)) {
  157. $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea';
  158. }
  159. if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) {
  160. $tmparray['hrm/index.php?mainmenu=hrm&leftmenu='] = 'HRMArea'; // TODO Complete list with first level of menus
  161. }
  162. if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
  163. $tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
  164. }
  165. if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
  166. $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
  167. }
  168. if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
  169. $tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
  170. }
  171. if (!empty($conf->adherent->enabled)) {
  172. $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = 'MembersArea';
  173. }
  174. if (!empty($conf->agenda->enabled)) {
  175. $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
  176. }
  177. $head = user_prepare_head($object);
  178. $title = $langs->trans("User");
  179. if ($action == 'edit') {
  180. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  181. print '<input type="hidden" name="token" value="'.newToken().'">';
  182. print '<input type="hidden" name="action" value="update">';
  183. print '<input type="hidden" name="id" value="'.$id.'">';
  184. }
  185. if ($action == 'edit') {
  186. print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
  187. $linkback = '';
  188. if ($user->rights->user->user->lire || $user->admin) {
  189. $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  190. }
  191. dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
  192. print dol_get_fiche_end();
  193. if (!empty($conf->use_javascript_ajax)) {
  194. print '<script type="text/javascript" language="javascript">
  195. jQuery(document).ready(function() {
  196. function init_myfunc()
  197. {
  198. if (jQuery("#check_MAIN_LANDING_PAGE").prop("checked")) { jQuery("#MAIN_LANDING_PAGE").removeAttr(\'disabled\'); }
  199. else { jQuery("#MAIN_LANDING_PAGE").attr(\'disabled\',\'disabled\'); }
  200. if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
  201. else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
  202. if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
  203. else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
  204. if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
  205. else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
  206. if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
  207. else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
  208. if (jQuery("#check_THEME_ELDY_TOPMENU_BACK1").prop("checked")) { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").removeAttr(\'disabled\'); }
  209. else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
  210. }
  211. init_myfunc();
  212. jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
  213. jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
  214. jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
  215. jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
  216. jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
  217. jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
  218. jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
  219. });
  220. </script>';
  221. }
  222. clearstatcache();
  223. print '<table class="noborder centpercent">';
  224. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
  225. // Language by default
  226. print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("Language").'</td>';
  227. print '<td>';
  228. $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
  229. print $s ? $s.' ' : '';
  230. print ($conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
  231. print '</td>';
  232. 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" : "");
  233. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  234. print '> <label for="check_MAIN_LANG_DEFAULT">'.$langs->trans("UsePersonalValue").'</label></td>';
  235. print '<td>';
  236. 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)));
  237. print '</td></tr>';
  238. // Landing page
  239. print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
  240. print '<td>';
  241. print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
  242. print '</td>';
  243. 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" : "");
  244. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  245. print '> <label for="check_MAIN_LANDING_PAGE">'.$langs->trans("UsePersonalValue").'</label></td>';
  246. print '<td>';
  247. print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (!empty($object->conf->MAIN_LANDING_PAGE) ? $object->conf->MAIN_LANDING_PAGE : ''), 0, 0, 0, '', 1);
  248. //print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
  249. print '</td></tr>';
  250. // Landing page for Agenda - AGENDA_DEFAULT_VIEW
  251. print '<tr class="oddeven">'."\n";
  252. print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
  253. print '<td class="center">&nbsp;</td>'."\n";
  254. 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" : "");
  255. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  256. print '> <label for="check_AGENDA_DEFAULT_VIEW">'.$langs->trans("UsePersonalValue").'</label></td>';
  257. print '<td>'."\n";
  258. $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"));
  259. print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
  260. print '</td></tr>'."\n";
  261. // Max size of lists
  262. print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
  263. print '<td>'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'</td>';
  264. 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" : "");
  265. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  266. print '> <label for="check_SIZE_LISTE_LIMIT">'.$langs->trans("UsePersonalValue").'</label></td>';
  267. 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>';
  268. print '</table><br>';
  269. // Theme
  270. showSkins($object, (($user->admin || empty($dolibarr_main_demo)) ? 1 : 0), true);
  271. print '<div class="center">';
  272. print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
  273. print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
  274. print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
  275. print '</div>';
  276. } else {
  277. print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
  278. $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  279. dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
  280. print dol_get_fiche_end();
  281. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  282. print '<table class="noborder centpercent">';
  283. 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>';
  284. // Language
  285. print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
  286. print '<td>';
  287. $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
  288. print ($s ? $s.' ' : '');
  289. print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
  290. print '</td>';
  291. print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
  292. print '<td>';
  293. $s = (isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
  294. print ($s ? $s.' ' : '');
  295. 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) : ''));
  296. print '</td></tr>';
  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"><input class="oddeven" name="check_MAIN_LANDING_PAGE" disabled 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 '> '.$langs->trans("UsePersonalValue").'</td>';
  305. print '<td>';
  306. if (!empty($object->conf->MAIN_LANDING_PAGE)) {
  307. if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
  308. print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
  309. } else {
  310. print $object->conf->MAIN_LANDING_PAGE;
  311. }
  312. }
  313. //print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
  314. print '</td></tr>';
  315. // Landing page for Agenda - AGENDA_DEFAULT_VIEW
  316. print '<tr class="oddeven">'."\n";
  317. print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
  318. print '<td class="center">&nbsp;</td>'."\n";
  319. print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
  320. print '<td>'."\n";
  321. $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"));
  322. if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) {
  323. print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
  324. }
  325. print '</td></tr>'."\n";
  326. // Max size for lists
  327. print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
  328. print '<td>'.(!empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? $conf->global->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td>';
  329. print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
  330. print '<td>'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td></tr>';
  331. print '</table>';
  332. print '</div>';
  333. print '<br>';
  334. // Skin
  335. showSkins($object, 0, true);
  336. print '<div class="tabsAction">';
  337. if (empty($user->admin) && !empty($dolibarr_main_demo)) {
  338. print "<a class=\"butActionRefused classfortooltip\" title=\"".$langs->trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify")."</a>";
  339. } else {
  340. 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
  341. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&amp;id='.$object->id.'">'.$langs->trans("Modify").'</a>';
  342. } else {
  343. print "<a class=\"butActionRefused classfortooltip\" title=\"".$langs->trans("NotEnoughPermissions")."\" href=\"#\">".$langs->trans("Modify")."</a>";
  344. }
  345. }
  346. print '</div>';
  347. }
  348. if ($action == 'edit') {
  349. print '</form>';
  350. }
  351. // End of page
  352. llxFooter();
  353. $db->close();