param_ihm.php 21 KB

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