param_ihm.php 19 KB

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