param_ihm.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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->project->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 (isModEnabled('agenda')) {
  175. $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu='] = 'Agenda';
  176. }
  177. if (!empty($conf->ticket->enabled)) {
  178. $tmparray['ticket/list.php?mainmenu=ticket&leftmenu='] = 'Tickets';
  179. }
  180. $head = user_prepare_head($object);
  181. $title = $langs->trans("User");
  182. if ($action == 'edit') {
  183. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  184. print '<input type="hidden" name="token" value="'.newToken().'">';
  185. print '<input type="hidden" name="action" value="update">';
  186. print '<input type="hidden" name="id" value="'.$id.'">';
  187. }
  188. if ($action == 'edit') {
  189. print dol_get_fiche_head($head, 'guisetup', $title, -1, 'user');
  190. $linkback = '';
  191. if ($user->rights->user->user->lire || $user->admin) {
  192. $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  193. }
  194. dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
  195. print '<div class="underbanner clearboth"></div>';
  196. print dol_get_fiche_end();
  197. if (!empty($conf->use_javascript_ajax)) {
  198. print '<script type="text/javascript">
  199. jQuery(document).ready(function() {
  200. function init_myfunc()
  201. {
  202. if (jQuery("#check_MAIN_LANDING_PAGE").prop("checked")) { jQuery("#MAIN_LANDING_PAGE").removeAttr(\'disabled\'); }
  203. else { jQuery("#MAIN_LANDING_PAGE").attr(\'disabled\',\'disabled\'); }
  204. if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); }
  205. else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); }
  206. if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#main_size_liste_limit").removeAttr(\'disabled\'); }
  207. else { jQuery("#main_size_liste_limit").attr(\'disabled\',\'disabled\'); }
  208. if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); }
  209. else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); }
  210. if (jQuery("#check_MAIN_THEME").prop("checked")) { jQuery(".themethumbs").removeAttr(\'disabled\'); }
  211. else { jQuery(".themethumbs").attr(\'disabled\',\'disabled\'); }
  212. if (jQuery("#check_THEME_ELDY_TOPMENU_BACK1").prop("checked")) { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").removeAttr(\'disabled\'); }
  213. else { jQuery("#colorpickerTHEME_ELDY_TOPMENU_BACK1").attr(\'disabled\',\'disabled\'); }
  214. }
  215. init_myfunc();
  216. jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); });
  217. jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); });
  218. jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); });
  219. jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); });
  220. jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); });
  221. jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); });
  222. jQuery("#check_THEME_ELDY_BACKTITLE1").click(function() { init_myfunc(); });
  223. });
  224. </script>';
  225. }
  226. clearstatcache();
  227. print '<table class="noborder centpercent">';
  228. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
  229. // Language by default
  230. print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("Language").'</td>';
  231. print '<td>';
  232. $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
  233. print $s ? $s.' ' : '';
  234. print ($conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
  235. print '</td>';
  236. 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" : "");
  237. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  238. print '> <label for="check_MAIN_LANG_DEFAULT">'.$langs->trans("UsePersonalValue").'</label></td>';
  239. print '<td>';
  240. 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)));
  241. print '</td></tr>';
  242. // Landing page
  243. print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
  244. print '<td>';
  245. print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
  246. print '</td>';
  247. 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" : "");
  248. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  249. print '> <label for="check_MAIN_LANDING_PAGE">'.$langs->trans("UsePersonalValue").'</label></td>';
  250. print '<td>';
  251. print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (!empty($object->conf->MAIN_LANDING_PAGE) ? $object->conf->MAIN_LANDING_PAGE : ''), 0, 0, 0, '', 1);
  252. //print info_admin($langs->trans("WarningYouMayLooseAccess"), 0, 0, 0);
  253. print '</td></tr>';
  254. // Landing page for Agenda - AGENDA_DEFAULT_VIEW
  255. print '<tr class="oddeven">'."\n";
  256. print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
  257. print '<td class="center">&nbsp;</td>'."\n";
  258. 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" : "");
  259. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  260. print '> <label for="check_AGENDA_DEFAULT_VIEW">'.$langs->trans("UsePersonalValue").'</label></td>';
  261. print '<td>'."\n";
  262. $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"));
  263. print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '');
  264. print '</td></tr>'."\n";
  265. // Max size of lists
  266. print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
  267. print '<td>'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'</td>';
  268. 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" : "");
  269. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  270. print '> <label for="check_SIZE_LISTE_LIMIT">'.$langs->trans("UsePersonalValue").'</label></td>';
  271. 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>';
  272. print '</table><br>';
  273. // Theme
  274. showSkins($object, (($user->admin || empty($dolibarr_main_demo)) ? 1 : 0), true);
  275. print $form->buttonsSaveCancel();
  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. $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
  280. $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
  281. $morehtmlref .= '</a>';
  282. dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
  283. print '<div class="fichecenter">';
  284. print '<div class="underbanner clearboth"></div>';
  285. print '<table class="border centpercent tableforfield">';
  286. // Login
  287. print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
  288. if (!empty($object->ldap_sid) && $object->statut == 0) {
  289. print '<td class="error">';
  290. print $langs->trans("LoginAccountDisableInDolibarr");
  291. print '</td>';
  292. } else {
  293. print '<td>';
  294. $addadmin = '';
  295. if (property_exists($object, 'admin')) {
  296. if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
  297. $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
  298. } elseif (!empty($object->admin)) {
  299. $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
  300. }
  301. }
  302. print showValueWithClipboardCPButton($object->login).$addadmin;
  303. print '</td>';
  304. }
  305. print '</tr>'."\n";
  306. print '</table>';
  307. print '</div>';
  308. print dol_get_fiche_end();
  309. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  310. print '<table class="noborder centpercent">';
  311. 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>';
  312. // Language
  313. print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
  314. print '<td>';
  315. $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
  316. print ($s ? $s.' ' : '');
  317. print (isset($conf->global->MAIN_LANG_DEFAULT) && $conf->global->MAIN_LANG_DEFAULT == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
  318. print '</td>';
  319. print '<td class="nowrap"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
  320. print '<td>';
  321. $s = (isset($object->conf->MAIN_LANG_DEFAULT) ? picto_from_langcode($object->conf->MAIN_LANG_DEFAULT) : '');
  322. print ($s ? $s.' ' : '');
  323. 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) : ''));
  324. print '</td></tr>';
  325. // Landing page
  326. print '<tr class="oddeven"><td>'.$langs->trans("LandingPage").'</td>';
  327. print '<td>';
  328. print (empty($conf->global->MAIN_LANDING_PAGE) ? '' : $conf->global->MAIN_LANDING_PAGE);
  329. print '</td>';
  330. 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" : "");
  331. print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo
  332. print '> '.$langs->trans("UsePersonalValue").'</td>';
  333. print '<td>';
  334. if (!empty($object->conf->MAIN_LANDING_PAGE)) {
  335. if (!empty($tmparray[$object->conf->MAIN_LANDING_PAGE])) {
  336. print $langs->trans($tmparray[$object->conf->MAIN_LANDING_PAGE]);
  337. } else {
  338. print $object->conf->MAIN_LANDING_PAGE;
  339. }
  340. }
  341. //print $form->selectarray('MAIN_LANDING_PAGE', $tmparray, (! empty($object->conf->MAIN_LANDING_PAGE)?$object->conf->MAIN_LANDING_PAGE:''), 0, 0, 0, '', 1);
  342. print '</td></tr>';
  343. // Landing page for Agenda - AGENDA_DEFAULT_VIEW
  344. print '<tr class="oddeven">'."\n";
  345. print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
  346. print '<td class="center">&nbsp;</td>'."\n";
  347. print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->AGENDA_DEFAULT_VIEW) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
  348. print '<td>'."\n";
  349. $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"));
  350. if (!empty($object->conf->AGENDA_DEFAULT_VIEW)) {
  351. print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $object->conf->AGENDA_DEFAULT_VIEW, 0, 0, 0, '', 0, 0, 1);
  352. }
  353. print '</td></tr>'."\n";
  354. // Max size for lists
  355. print '<tr class="oddeven"><td>'.$langs->trans("MaxSizeList").'</td>';
  356. print '<td>'.(!empty($conf->global->MAIN_SIZE_LISTE_LIMIT) ? $conf->global->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td>';
  357. print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
  358. print '<td>'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td></tr>';
  359. print '</table>';
  360. print '</div>';
  361. print '<br>';
  362. // Skin
  363. showSkins($object, 0, true);
  364. print '<div class="tabsAction">';
  365. if (empty($user->admin) && !empty($dolibarr_main_demo)) {
  366. print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("FeatureDisabledInDemo").'" href="#">'.$langs->trans("Modify").'</a>';
  367. } else {
  368. 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
  369. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
  370. } else {
  371. print '<a class="butActionRefused classfortooltip" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Modify").'</a>';
  372. }
  373. }
  374. print '</div>';
  375. }
  376. if ($action == 'edit') {
  377. print '</form>';
  378. }
  379. // End of page
  380. llxFooter();
  381. $db->close();