dolibarr  13.0.2
ihm.php
Go to the documentation of this file.
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-2017 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
27 require '../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
35 
36 // Load translation files required by the page
37 $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'projects', 'hrm', 'agenda'));
38 
39 if (!$user->admin) accessforbidden();
40 
41 $action = GETPOST('action', 'aZ09');
42 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
43 
44 if (!defined("MAIN_MOTD")) define("MAIN_MOTD", "");
45 
46 
47 
48 /*
49  * Action
50  */
51 
52 $parameters = array();
53 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
54 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
55 
56 if (GETPOST('cancel', 'alpha'))
57 {
58  $action = '';
59 }
60 
61 // Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff)
62 $regs = array();
63 if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) {
64  if ($regs[1] == 'set') dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity);
65  else dolibarr_del_const($db, $regs[2], $conf->entity);
66 }
67 
68 if ($action == 'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKGROUND))
69 {
70  dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
71  require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
72 
73  $logofile = $conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
74  dol_delete_file($logofile);
75  dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND", $conf->entity);
76  $mysoc->logo = '';
77 
78  /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
79  dol_delete_file($logosmallfile);
80  dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity);
81  $mysoc->logo_small='';
82 
83  $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini;
84  dol_delete_file($logominifile);
85  dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity);
86  $mysoc->logo_mini='';*/
87 }
88 
89 if ($action == 'update')
90 {
91  dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
92  dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
93  //dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity);
94 
95  dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
96 
97  /*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
98  if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
99  else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/
100 
101  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array()))));
102  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
103  else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val, 'chaine', 0, '', $conf->entity);
104 
105  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array()))));
106  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
107  else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val, 'chaine', 0, '', $conf->entity);
108 
109  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'), array()))));
110  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity);
111  else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val, 'chaine', 0, '', $conf->entity);
112 
113  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'), array()))));
114  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
115  else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val, 'chaine', 0, '', $conf->entity);
116 
117  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array()))));
118  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
119  else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val, 'chaine', 0, '', $conf->entity);
120 
121  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'), array()))));
122  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
123  else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity);
124 
125  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array()))));
126  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity);
127  else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity);
128 
129  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
130  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
131  else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);
132  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
133  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity);
134  else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val, 'chaine', 0, '', $conf->entity);
135 
136  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array()))));
137  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity);
138  else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val, 'chaine', 0, '', $conf->entity);
139  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array()))));
140  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity);
141  else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val, 'chaine', 0, '', $conf->entity);
142 
143  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array()))));
144  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
145  else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val, 'chaine', 0, '', $conf->entity);
146 
147  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_USE_HOVER'), array()))));
148  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_HOVER', $conf->entity);
149  else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $val, 'chaine', 0, '', $conf->entity);
150 
151  $val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_USE_CHECKED'), array()))));
152  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity);
153  else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity);
154 
155  dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
156  dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
157 
158  //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
159  //dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
160  //dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
161  dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
162 
163  dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
164  dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
165 
166  dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
167 
168  dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
169  dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'restricthtml')), 'chaine', 0, '', $conf->entity);
170  //dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity);
171  //dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
172 
173  $varforimage = 'imagebackground'; $dirforimage = $conf->mycompany->dir_output.'/logos/';
174  if ($_FILES[$varforimage]["tmp_name"])
175  {
176  $reg = array();
177  if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg))
178  {
179  $original_file = $reg[1];
180 
181  $isimage = image_format_supported($original_file);
182  if ($isimage >= 0)
183  {
184  dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file);
185  if (!is_dir($dirforimage))
186  {
187  dol_mkdir($dirforimage);
188  }
189  $result = dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']);
190  if ($result > 0)
191  {
192  dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity);
193  } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result))
194  {
195  $error++;
196  $langs->load("errors");
197  $tmparray = explode(':', $result);
198  setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors');
199  } else {
200  $error++;
201  setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
202  }
203  } else {
204  $error++;
205  $langs->load("errors");
206  setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
207  }
208  }
209  }
210 
211 
212 
213  $_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer
214 
215  header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
216  exit;
217 }
218 
219 
220 /*
221  * View
222  */
223 
224 $wikihelp = 'EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
225 llxHeader('', $langs->trans("Setup"), $wikihelp);
226 
227 $form = new Form($db);
228 $formother = new FormOther($db);
229 $formadmin = new FormAdmin($db);
230 
231 print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
232 
233 print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
234 
235 //WYSIWYG Editor
236 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
237 
238 print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
239 print '<input type="hidden" name="token" value="'.newToken().'">';
240 print '<input type="hidden" name="action" value="update">';
241 
242 clearstatcache();
243 
244 print '<br>';
245 print '<div class="div-table-responsive-no-min">';
246 print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
247 print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
248 print '</tr>';
249 
250 // Default language
251 print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
252 print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
253 print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
254 print '</td>';
255 print '</tr>';
256 
257 // Multilingual GUI
258 print '<tr class="oddeven"><td>'.$langs->trans("EnableMultilangInterface").'</td><td>';
259 print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
260 print '</td>';
261 print '</tr>';
262 
263 print '</table><br>'."\n";
264 print '</div>';
265 
266 // Themes and themes options
267 showSkins(null, 1);
268 print '<br>';
269 
270 // Other
271 print '<div class="div-table-responsive-no-min">';
272 print '<table summary="otherparameters" class="noborder centpercent editmode">';
273 print '<tr class="liste_titre"><th>'.$langs->trans("Miscellaneous").'</th><th></th>';
274 print '<th width="20">&nbsp;</tg>';
275 print '</tr>';
276 
277 // Disable javascript and ajax
278 print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
279 print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
280 print ' <span class="opacitymedium"> &nbsp; &nbsp; '.$langs->trans("DisableJavascriptNote").'</span>';
281 print '</td>';
282 print '<td>';
283 print '</td>';
284 print '</tr>';
285 
286 // Max size of lists
287 print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="main_size_liste_limit" size="4" value="'.$conf->global->MAIN_SIZE_LISTE_LIMIT.'"></td>';
288 print '<td width="20">&nbsp;</td>';
289 print '</tr>';
290 
291 // Max size of short lists on customer card
292 print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="'.$conf->global->MAIN_SIZE_SHORTLIST_LIMIT.'"></td>';
293 print '<td width="20">&nbsp;</td>';
294 print '</tr>';
295 
296 // show input border
297 /*
298  print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
299  print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
300  print '</td>';
301  print '<td width="20">&nbsp;</td>';
302  print '</tr>';
303  */
304 
305 // First day for weeks
306 print '<tr class="oddeven"><td>'.$langs->trans("WeekStartOnDay").'</td><td>';
307 print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
308 print '</td>';
309 print '<td width="20">&nbsp;</td>';
310 print '</tr>';
311 
312 // DefaultWorkingDays
313 print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingDays").'</td><td>';
314 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').'">';
315 print '</td>';
316 print '<td width="20">&nbsp;</td>';
317 print '</tr>';
318 
319 // DefaultWorkingHours
320 print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingHours").'</td><td>';
321 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').'">';
322 print '</td>';
323 print '<td width="20">&nbsp;</td>';
324 print '</tr>';
325 
326 // Firstname/Name
327 print '<tr class="oddeven"><td>'.$langs->trans("FirstnameNamePosition").'</td><td>';
328 $array = array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
329 print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
330 print '</td>';
331 print '<td width="20">&nbsp;</td>';
332 print '</tr>';
333 
334 // Hide unauthorized menus
335 print '<tr class="oddeven"><td>'.$langs->trans("HideUnauthorizedMenu").'</td><td>';
336 //print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
337 print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
338 print '</td>';
339 print '<td width="20">&nbsp;</td>';
340 print '</tr>';
341 
342 // Hide unauthorized button
343 print '<tr class="oddeven"><td>'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
344 //print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
345 print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
346 print '</td>';
347 print '<td width="20">&nbsp;</td>';
348 print '</tr>';
349 
350 // Hide version link
351 /*
352 
353 print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
354 print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
355 print '</td>';
356 print '<td width="20">&nbsp;</td>';
357 print '</tr>';
358 */
359 
360 // Show bugtrack link
361 print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
362 print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0);
363 //print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1);
364 print '</td>';
365 print '<td width="20">&nbsp;</td>';
366 print '</tr>';
367 
368 // Hide wiki link on login page
369 $pictohelp = '<span class="fa fa-question-circle"></span>';
370 print '<tr class="oddeven"><td>'.str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')).'</td><td>';
371 print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
372 //print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
373 print '</td>';
374 print '<td width="20">&nbsp;</td>';
375 print '</tr>';
376 
377 // Message of the day on home page
378 $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
379 complete_substitutions_array($substitutionarray, $langs);
380 
381 print '<tr class="oddeven"><td>';
382 $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
383 foreach ($substitutionarray as $key => $val)
384 {
385  $texthelp .= $key.'<br>';
386 }
387 print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
388 
389 print '</td><td colspan="2">';
390 
391 $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
392 $doleditor->Create();
393 
394 print '</td></tr>'."\n";
395 
396 print '</table>'."\n";
397 print '</div>';
398 
399 print '<br>';
400 
401 // Other
402 print '<div class="div-table-responsive-no-min">';
403 print '<table summary="edit" class="noborder centpercent editmode">';
404 print '<tr class="liste_titre"><th>'.$langs->trans("LoginPage").'</th><th></th>';
405 print '<th width="20">&nbsp;</th>';
406 print '</tr>';
407 
408 // Hide helpcenter link on login page
409 print '<tr class="oddeven"><td>'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
410 print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
411 print '</td>';
412 print '<td width="20">&nbsp;</td>';
413 print '</tr>';
414 
415 // Message on login page
416 $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
417 complete_substitutions_array($substitutionarray, $langs);
418 print '<tr class="oddeven"><td>';
419 $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
420 foreach ($substitutionarray as $key => $val)
421 {
422  $texthelp .= $key.'<br>';
423 }
424 print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
425 print '</td><td colspan="2">';
426 $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
427 $doleditor->Create();
428 print '</td></tr>'."\n";
429 
430 // Background
431 print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
432 print '<div class="centpercent inline-block">';
433 $disabled = '';
434 if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) $disabled = ' disabled="disabled"';
435 print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground"'.$disabled.'>';
436 if ($disabled)
437 {
438  print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
439 }
440 if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
441  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
442  if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
443  print ' &nbsp; ';
444  print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
445  }
446 } else {
447  print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
448 }
449 print '</div>';
450 print '</td></tr>';
451 
452 print '</table>'."\n";
453 print '</div>';
454 
455 print '<br>';
456 print '<div class="center">';
457 print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
458 print '</div>';
459 
460 print '</form>';
461 
462 
463 // End of page
464 llxFooter();
465 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:575
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value (&#39;FFFFFF&#39;, &#39;255,255,255&#39;) into an array RGB array(255,255,255).
image_format_supported($file, $acceptsvg=0)
Return if a filename is file name of a supported image format.
Definition: images.lib.php:39
showSkins($fuser, $edit=0, $foruserprofile=false)
Show list of themes.
Class to generate html code for admin pages.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
Definition: agenda.php:120
llxHeader()
Empty header.
Definition: wrapper.php:45
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:499
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
Definition: ajax.lib.php:503
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Classe permettant la generation de composants html autre Only common components are here...
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1)
Remove a file or several files with a mask.
Definition: files.lib.php:1144
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles= 'addedfile', $upload_dir= '')
Make control on an uploaded file from an GUI page and move it to final destination.
Definition: files.lib.php:999
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
Definition: index.php:89
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
Class to manage a WYSIWYG editor.
llxFooter()
Empty footer.
Definition: wrapper.php:59
img_delete($titlealt= 'default', $other= 'class="pictodelete"', $morecss= '')
Show delete logo.
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the &quot;subst...