ihm.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <?php
  2. /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  5. * Copyright (C) 2016 Juanjo Menent <jmenent@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/admin/ihm.php
  22. * \brief Page to setup GUI display options
  23. */
  24. require '../main.inc.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
  32. $langs->load("admin");
  33. $langs->load("languages");
  34. $langs->load("other");
  35. $langs->load("companies");
  36. $langs->load("products");
  37. $langs->load("members");
  38. $langs->load("projects");
  39. $langs->load("hrm");
  40. $langs->load("agenda");
  41. if (! $user->admin) accessforbidden();
  42. $action = GETPOST('action','aZ09');
  43. if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
  44. /*
  45. * Action
  46. */
  47. if (GETPOST('cancel'))
  48. {
  49. $action='';
  50. }
  51. if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND))
  52. {
  53. require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
  54. $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
  55. dol_delete_file($logofile);
  56. dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND",$conf->entity);
  57. $mysoc->logo='';
  58. /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
  59. dol_delete_file($logosmallfile);
  60. dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity);
  61. $mysoc->logo_small='';
  62. $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini;
  63. dol_delete_file($logominifile);
  64. dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity);
  65. $mysoc->logo_mini='';*/
  66. }
  67. if ($action == 'update')
  68. {
  69. dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"],'chaine',0,'',$conf->entity);
  70. dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
  71. dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
  72. $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
  73. if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
  74. else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'),'chaine',0,'',$conf->entity);
  75. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array()))));
  76. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
  77. else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val,'chaine',0,'',$conf->entity);
  78. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
  79. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
  80. else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val,'chaine',0,'',$conf->entity);
  81. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
  82. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
  83. else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val,'chaine',0,'',$conf->entity);
  84. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array()))));
  85. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
  86. else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val,'chaine',0,'',$conf->entity);
  87. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array()))));
  88. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity);
  89. else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val,'chaine',0,'',$conf->entity);
  90. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array()))));
  91. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity);
  92. else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val,'chaine',0,'',$conf->entity);
  93. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array()))));
  94. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity);
  95. else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val,'chaine',0,'',$conf->entity);
  96. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array()))));
  97. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
  98. else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val,'chaine',0,'',$conf->entity);
  99. if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
  100. else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
  101. $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
  102. if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
  103. else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val,'chaine',0,'',$conf->entity);
  104. dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
  105. dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
  106. dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
  107. dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
  108. dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
  109. dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
  110. dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
  111. dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
  112. dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
  113. dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
  114. dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
  115. dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
  116. dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
  117. dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
  118. $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
  119. if ($_FILES[$varforimage]["tmp_name"])
  120. {
  121. if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg))
  122. {
  123. $original_file=$reg[1];
  124. $isimage=image_format_supported($original_file);
  125. if ($isimage >= 0)
  126. {
  127. dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file);
  128. if (! is_dir($dirforimage))
  129. {
  130. dol_mkdir($dirforimage);
  131. }
  132. $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']);
  133. if ($result > 0)
  134. {
  135. dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
  136. }
  137. else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
  138. {
  139. $error++;
  140. $langs->load("errors");
  141. $tmparray=explode(':',$result);
  142. setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors');
  143. }
  144. else
  145. {
  146. $error++;
  147. setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
  148. }
  149. }
  150. else
  151. {
  152. $error++;
  153. $langs->load("errors");
  154. setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
  155. }
  156. }
  157. }
  158. $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
  159. header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
  160. exit;
  161. }
  162. /*
  163. * View
  164. */
  165. $wikihelp='EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
  166. llxHeader('',$langs->trans("Setup"),$wikihelp);
  167. $form=new Form($db);
  168. $formother=new FormOther($db);
  169. $formadmin=new FormAdmin($db);
  170. print load_fiche_titre($langs->trans("GUISetup"),'','title_setup');
  171. print $langs->trans("DisplayDesc")."<br>\n";
  172. print "<br>\n";
  173. if ($action == 'edit') // Edit
  174. {
  175. //WYSIWYG Editor
  176. require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  177. print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
  178. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  179. print '<input type="hidden" name="action" value="update">';
  180. clearstatcache();
  181. print '<br>';
  182. print '<table summary="edit" class="noborder" width="100%">';
  183. print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td></td>';
  184. print '<td width="20">&nbsp;</td>';
  185. print '</tr>';
  186. // Default language
  187. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
  188. print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'main_lang_default', 1, 0, 0, 0, 0, 'minwidth300');
  189. print '</td>';
  190. print '<td width="20">&nbsp;</td>';
  191. print '</tr>';
  192. // Multilingual GUI
  193. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
  194. print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
  195. print '</td>';
  196. print '<td width="20">&nbsp;</td>';
  197. print '</tr>';
  198. print '</table><br>'."\n";
  199. // Themes and themes options
  200. show_theme(null,1);
  201. print '<br>';
  202. // Other
  203. print '<table summary="edit" class="noborder" width="100%">';
  204. print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
  205. print '<td width="20">&nbsp;</td>';
  206. print '</tr>';
  207. // Max size of lists
  208. print '<tr><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '"></td>';
  209. print '<td width="20">&nbsp;</td>';
  210. print '</tr>';
  211. // Max size of short lists on customer card
  212. print '<tr><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '"></td>';
  213. print '<td width="20">&nbsp;</td>';
  214. print '</tr>';
  215. // show input border
  216. /*
  217. print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
  218. print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
  219. print '</td>';
  220. print '<td width="20">&nbsp;</td>';
  221. print '</tr>';
  222. */
  223. // Disable javascript and ajax
  224. print '<tr><td>'.$langs->trans("DisableJavascript").'</td><td>';
  225. print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
  226. print '</td>';
  227. print '<td width="20">&nbsp;</td>';
  228. print '</tr>';
  229. // First day for weeks
  230. print '<tr><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
  231. print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0);
  232. print '</td>';
  233. print '<td width="20">&nbsp;</td>';
  234. print '</tr>';
  235. // DefaultWorkingDays
  236. print '<tr><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
  237. print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5').'">';
  238. print '</td>';
  239. print '<td width="20">&nbsp;</td>';
  240. print '</tr>';
  241. // DefaultWorkingHours
  242. print '<tr><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
  243. print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18').'">';
  244. print '</td>';
  245. print '<td width="20">&nbsp;</td>';
  246. print '</tr>';
  247. // Firstname/Name
  248. print '<tr><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
  249. $array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
  250. print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
  251. print '</td>';
  252. print '<td width="20">&nbsp;</td>';
  253. print '</tr>';
  254. // Hide unauthorized button
  255. print '<tr><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
  256. print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
  257. print '</td>';
  258. print '<td width="20">&nbsp;</td>';
  259. print '</tr>';
  260. // Show logo
  261. print '<tr><td class="titlefield">'.$langs->trans("EnableShowLogo").'</td><td>';
  262. print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
  263. print '</td>';
  264. print '<td width="20">&nbsp;</td>';
  265. print '</tr>';
  266. // Hide version link
  267. /*
  268. print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
  269. print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
  270. print '</td>';
  271. print '<td width="20">&nbsp;</td>';
  272. print '</tr>';
  273. */
  274. // Show bugtrack link
  275. print '<tr><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
  276. print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
  277. print '</td>';
  278. print '<td width="20">&nbsp;</td>';
  279. print '</tr>';
  280. // Hide wiki link on login page
  281. print '<tr><td class="titlefield">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td>';
  282. print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
  283. print '</td>';
  284. print '<td width="20">&nbsp;</td>';
  285. print '</tr>';
  286. // Message of the day on home page
  287. print '<tr><td class="titlefield">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
  288. $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
  289. $doleditor->Create();
  290. print '</td></tr>'."\n";
  291. print '</table>'."\n";
  292. print '<br>';
  293. // Other
  294. print '<table summary="edit" class="noborder" width="100%">';
  295. print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LoginPage").'</td><td></td>';
  296. print '<td width="20">&nbsp;</td>';
  297. print '</tr>';
  298. // Message on login page
  299. print '<tr><td>'.$langs->trans("MessageLogin").'</td><td colspan="2">';
  300. $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
  301. $doleditor->Create();
  302. print '</td></tr>'."\n";
  303. // Hide helpcenter link on login page
  304. print '<tr><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
  305. print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
  306. print '</td>';
  307. print '<td width="20">&nbsp;</td>';
  308. print '</tr>';
  309. // Background
  310. print '<tr><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
  311. print '<div class="centpercent inline-block">';
  312. print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground">';
  313. if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
  314. print '<a href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
  315. if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
  316. print ' &nbsp; ';
  317. print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
  318. }
  319. } else {
  320. print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
  321. }
  322. print '</div>';
  323. print '</td></tr>';
  324. print '</table>'."\n";
  325. print '<br><div class="center">';
  326. print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">';
  327. print ' &nbsp; ';
  328. print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
  329. print '</div>';
  330. print '</form>';
  331. }
  332. else // Show
  333. {
  334. // Language
  335. print '<table class="noborder" width="100%">';
  336. print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td></td><td>&nbsp;</td></tr>';
  337. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
  338. $s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
  339. print ($s?$s.' ':'');
  340. print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
  341. print '</td>';
  342. print '<td width="20">';
  343. if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''),$conf->global->MAIN_LANG_DEFAULT),1);
  344. print '</td>';
  345. print "</tr>";
  346. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>';
  347. print '<td width="20">&nbsp;</td>';
  348. print "</tr>";
  349. print '</table><br>'."\n";
  350. // Themes
  351. show_theme(null,0);
  352. print '<br>';
  353. // Other
  354. print '<table class="noborder" width="100%">';
  355. print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>';
  356. print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
  357. print '<td width="20">&nbsp;</td>';
  358. print "</tr>";
  359. print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '</td>';
  360. print '<td width="20">&nbsp;</td>';
  361. print "</tr>";
  362. /*
  363. print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
  364. print yn($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)."</td>";
  365. print '<td width="20">&nbsp;</td>';
  366. print "</tr>";
  367. */
  368. // Disable javascript/ajax
  369. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableJavascript").'</td><td>';
  370. print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)."</td>";
  371. print '<td width="20">&nbsp;</td>';
  372. print "</tr>";
  373. // First day for weeks
  374. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
  375. print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'));
  376. print '</td>';
  377. print '<td width="20">&nbsp;</td>';
  378. print '</tr>';
  379. // DefaultWorkingDays
  380. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
  381. print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5';
  382. print '</td>';
  383. print '<td width="20">&nbsp;</td>';
  384. print '</tr>';
  385. // DefaultWorkingHours
  386. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
  387. print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18';
  388. print '</td>';
  389. print '<td width="20">&nbsp;</td>';
  390. print '</tr>';
  391. // Firstname / Name position
  392. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
  393. if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); }
  394. else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); }
  395. print '</td>';
  396. print '<td width="20">&nbsp;</td>';
  397. print '</tr>';
  398. // Hide unauthorized button
  399. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td colspan="2">';
  400. print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1);
  401. print '</td></tr>';
  402. // Show logo
  403. print '<tr class="oddeven"><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
  404. print '<td width="20">&nbsp;</td>';
  405. print "</tr>";
  406. // Hide version link
  407. /*
  408. print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
  409. print yn($conf->global->MAIN_HIDE_VERSION);
  410. print '</td>';
  411. print '<td width="20">&nbsp;</td>';
  412. print '</tr>';
  413. */
  414. // Show bugtrack link
  415. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
  416. print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
  417. print '<td width="20">&nbsp;</td>';
  418. print "</tr>";
  419. // Link to wiki help
  420. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td colspan="2">';
  421. print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
  422. print '</td></tr>';
  423. // Message of the day
  424. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
  425. if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
  426. else print '&nbsp;';
  427. print '</td></tr>'."\n";
  428. print '</table>'."\n";
  429. print '<br>';
  430. // Login page
  431. print '<table class="noborder" width="100%">';
  432. print '<tr class="liste_titre"><td>'.$langs->trans("LoginPage").'</td><td></td><td>&nbsp;</td></tr>';
  433. // Message login
  434. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
  435. if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
  436. else print '&nbsp;';
  437. print '</td></tr>'."\n";
  438. // Link to help center
  439. print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td colspan="2">';
  440. print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
  441. print '</td></tr>';
  442. // Background login
  443. print '<tr class="oddeven"><td>'.$langs->trans("BackgroundImageLogin").'</td><td colspan="2">';
  444. print '<div class="centpercent inline-block">';
  445. print $conf->global->MAIN_LOGIN_BACKGROUND;
  446. if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND))
  447. {
  448. print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'">';
  449. }
  450. else
  451. {
  452. print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
  453. }
  454. print '</div>';
  455. print '</td></tr>';
  456. print '</table>'."\n";
  457. print '<div class="tabsAction tabsActionNoBottom">';
  458. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
  459. print '</div>';
  460. }
  461. llxFooter();
  462. $db->close();