param_ihm.php 19 KB

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