dolibarr  9.0.0
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 <http://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 if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND))
62 {
63  require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
64 
65  $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND;
66  dol_delete_file($logofile);
67  dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND",$conf->entity);
68  $mysoc->logo='';
69 
70  /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small;
71  dol_delete_file($logosmallfile);
72  dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity);
73  $mysoc->logo_small='';
74 
75  $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini;
76  dol_delete_file($logominifile);
77  dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity);
78  $mysoc->logo_mini='';*/
79 }
80 
81 if ($action == 'update')
82 {
83  dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity);
84  dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity);
85 
86  dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
87 
88  $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
89  if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
90  else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'),'chaine',0,'',$conf->entity);
91 
92  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array()))));
93  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
94  else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val,'chaine',0,'',$conf->entity);
95 
96  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
97  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
98  else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val,'chaine',0,'',$conf->entity);
99 
100  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'),array()))));
101  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity);
102  else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val,'chaine',0,'',$conf->entity);
103 
104  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array()))));
105  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity);
106  else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val,'chaine',0,'',$conf->entity);
107 
108  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
109  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
110  else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val,'chaine',0,'',$conf->entity);
111 
112  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'),array()))));
113  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
114  else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val,'chaine',0,'',$conf->entity);
115 
116  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array()))));
117  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
118  else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val,'chaine',0,'',$conf->entity);
119  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array()))));
120  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity);
121  else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val,'chaine',0,'',$conf->entity);
122 
123  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array()))));
124  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity);
125  else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val,'chaine',0,'',$conf->entity);
126  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array()))));
127  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity);
128  else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val,'chaine',0,'',$conf->entity);
129 
130  $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array()))));
131  if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity);
132  else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val,'chaine',0,'',$conf->entity);
133 
134  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)
135  else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
136 
137  if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity);
138  else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity);
139 
140  dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
141  dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
142  dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
143  dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
144  dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
145  dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
146  dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
147  dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
148  dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
149 
150  dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
151  dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
152  dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
153  dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
154  dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
155 
156  $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
157  if ($_FILES[$varforimage]["tmp_name"])
158  {
159  if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg))
160  {
161  $original_file=$reg[1];
162 
163  $isimage=image_format_supported($original_file);
164  if ($isimage >= 0)
165  {
166  dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file);
167  if (! is_dir($dirforimage))
168  {
169  dol_mkdir($dirforimage);
170  }
171  $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']);
172  if ($result > 0)
173  {
174  dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
175  }
176  else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
177  {
178  $error++;
179  $langs->load("errors");
180  $tmparray=explode(':',$result);
181  setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors');
182  }
183  else
184  {
185  $error++;
186  setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
187  }
188  }
189  else
190  {
191  $error++;
192  $langs->load("errors");
193  setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
194  }
195  }
196  }
197 
198 
199 
200  $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
201 
202  header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
203  exit;
204 }
205 
206 
207 /*
208  * View
209  */
210 
211 $wikihelp='EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
212 llxHeader('',$langs->trans("Setup"),$wikihelp);
213 
214 $form=new Form($db);
215 $formother=new FormOther($db);
216 $formadmin=new FormAdmin($db);
217 
218 print load_fiche_titre($langs->trans("GUISetup"),'','title_setup');
219 
220 print $langs->trans("DisplayDesc")."<br>\n";
221 print "<br>\n";
222 
223 
224 if ($action == 'edit') // Edit
225 {
226  //WYSIWYG Editor
227  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
228 
229  print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
230  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
231  print '<input type="hidden" name="action" value="update">';
232 
233  clearstatcache();
234 
235  print '<br>';
236  print '<table summary="edit" class="noborder" width="100%">';
237  print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td></td>';
238  print '<td width="20">&nbsp;</td>';
239  print '</tr>';
240 
241  // Default language
242  print '<tr><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
243  print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, 0, 0, 0, 0, 'minwidth300', 2);
244  print '</td>';
245  print '<td width="20">&nbsp;</td>';
246  print '</tr>';
247 
248  // Multilingual GUI
249  print '<tr><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
250  print $form->selectyesno('MAIN_MULTILANGS',$conf->global->MAIN_MULTILANGS,1);
251  print '</td>';
252  print '<td width="20">&nbsp;</td>';
253  print '</tr>';
254 
255  print '</table><br>'."\n";
256 
257  // Themes and themes options
258  show_theme(null,1);
259  print '<br>';
260 
261  // Other
262  print '<table summary="edit" class="noborder" width="100%">';
263  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
264  print '<td width="20">&nbsp;</td>';
265  print '</tr>';
266 
267  // Max size of lists
268  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>';
269  print '<td width="20">&nbsp;</td>';
270  print '</tr>';
271 
272  // Max size of short lists on customer card
273  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>';
274  print '<td width="20">&nbsp;</td>';
275  print '</tr>';
276 
277  // show input border
278  /*
279  print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';
280  print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1);
281  print '</td>';
282  print '<td width="20">&nbsp;</td>';
283  print '</tr>';
284  */
285 
286  // Disable javascript and ajax
287  print '<tr><td>'.$langs->trans("DisableJavascript").'</td><td>';
288  print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
289  print '</td>';
290  print '<td width="20">&nbsp;</td>';
291  print '</tr>';
292 
293  // First day for weeks
294  print '<tr><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
295  print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0);
296  print '</td>';
297  print '<td width="20">&nbsp;</td>';
298  print '</tr>';
299 
300  // DefaultWorkingDays
301  print '<tr><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
302  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').'">';
303  print '</td>';
304  print '<td width="20">&nbsp;</td>';
305  print '</tr>';
306 
307  // DefaultWorkingHours
308  print '<tr><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
309  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').'">';
310  print '</td>';
311  print '<td width="20">&nbsp;</td>';
312  print '</tr>';
313 
314  // Firstname/Name
315  print '<tr><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
316  $array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
317  print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
318  print '</td>';
319  print '<td width="20">&nbsp;</td>';
320  print '</tr>';
321 
322  // Hide unauthorized button
323  print '<tr><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
324  print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
325  print '</td>';
326  print '<td width="20">&nbsp;</td>';
327  print '</tr>';
328 
329  // Show logo
330  print '<tr><td class="titlefield">'.$langs->trans("EnableShowLogo").'</td><td>';
331  print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
332  print '</td>';
333  print '<td width="20">&nbsp;</td>';
334  print '</tr>';
335 
336  // Hide version link
337  /*
338 
339  print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
340  print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
341  print '</td>';
342  print '<td width="20">&nbsp;</td>';
343  print '</tr>';
344  */
345 
346  // Show bugtrack link
347  print '<tr><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
348  print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
349  print '</td>';
350  print '<td width="20">&nbsp;</td>';
351  print '</tr>';
352 
353  // Hide wiki link on login page
354  $pictohelp='<span class="fa fa-question-circle"></span>';
355  print '<tr><td class="titlefield">'.$langs->trans("DisableLinkToHelp",$pictohelp).'</td><td>';
356  print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
357  print '</td>';
358  print '<td width="20">&nbsp;</td>';
359  print '</tr>';
360 
361  // Message of the day on home page
362  $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount'));
363  complete_substitutions_array($substitutionarray, $langs);
364 
365  print '<tr><td class="titlefield">';
366  $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
367  foreach($substitutionarray as $key => $val)
368  {
369  $texthelp.=$key.'<br>';
370  }
371  print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
372 
373  print '</td><td colspan="2">';
374 
375  $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
376  $doleditor->Create();
377 
378  print '</td></tr>'."\n";
379 
380  print '</table>'."\n";
381 
382  print '<br>';
383 
384  // Other
385  print '<table summary="edit" class="noborder" width="100%">';
386  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LoginPage").'</td><td></td>';
387  print '<td width="20">&nbsp;</td>';
388  print '</tr>';
389 
390  // Message on login page
391  $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount','user'));
392  complete_substitutions_array($substitutionarray, $langs);
393  print '<tr><td>';
394  $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
395  foreach($substitutionarray as $key => $val)
396  {
397  $texthelp.=$key.'<br>';
398  }
399  print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
400  print '</td><td colspan="2">';
401  $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
402  $doleditor->Create();
403  print '</td></tr>'."\n";
404 
405  // Hide helpcenter link on login page
406  print '<tr><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
407  print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
408  print '</td>';
409  print '<td width="20">&nbsp;</td>';
410  print '</tr>';
411 
412  // Background
413  print '<tr><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
414  print '<div class="centpercent inline-block">';
415  print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground">';
416  if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
417  print '<a href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
418  if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
419  print ' &nbsp; ';
420  print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
421  }
422  } else {
423  print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
424  }
425  print '</div>';
426  print '</td></tr>';
427 
428  print '</table>'."\n";
429 
430 
431  print '<br><div class="center">';
432  print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">';
433  print ' &nbsp; ';
434  print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
435  print '</div>';
436 
437  print '</form>';
438 }
439 else // Show
440 {
441  // Language
442  print '<table class="noborder" width="100%">';
443  print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
444 
445  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
446  $s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
447  print ($s?$s.' ':'');
448  print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT));
449  print '</td>';
450  print '<td width="20">';
451  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);
452  print '</td>';
453  print "</tr>";
454 
455  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>';
456  print '<td width="20">&nbsp;</td>';
457  print "</tr>";
458 
459  print '</table><br>'."\n";
460 
461 
462  // Themes
463  show_theme(null,0);
464  print '<br>';
465 
466 
467  // Other
468  print '<table class="noborder" width="100%">';
469  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td></tr>';
470 
471  print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
472  print "</tr>";
473 
474  print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '</td>';
475  print "</tr>";
476 
477  // Disable javascript/ajax
478  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableJavascript").'</td><td>';
479  print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)."</td>";
480  print "</tr>";
481 
482  // First day for weeks
483  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
484  print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'));
485  print '</td>';
486  print '</tr>';
487 
488  // DefaultWorkingDays
489  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
490  print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5';
491  print '</td>';
492  print '</tr>';
493 
494  // DefaultWorkingHours
495  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
496  print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18';
497  print '</td>';
498  print '</tr>';
499 
500  // Firstname / Name position
501  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
502  if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); }
503  else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); }
504  print '</td>';
505  print '</tr>';
506 
507  // Hide unauthorized button
508  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
509  print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1);
510  print '</td></tr>';
511 
512  // Show logo
513  print '<tr class="oddeven"><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
514  print "</tr>";
515 
516  // Hide version link
517  /*
518  print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
519  print yn($conf->global->MAIN_HIDE_VERSION);
520  print '</td>';
521  print '</tr>';
522  */
523 
524  // Show bugtrack link
525  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
526  print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
527  print "</tr>";
528 
529  // Link to wiki help
530  $pictohelp='<span class="fa fa-question-circle"></span>';
531  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp",$pictohelp).'</td><td>';
532  print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
533  print '</td></tr>';
534 
535  // Message of the day
536  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("MessageOfDay").'</td><td>';
537  if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
538  else print '&nbsp;';
539  print '</td></tr>'."\n";
540 
541  print '</table>'."\n";
542 
543  print '<br>';
544 
545  // Login page
546  print '<div class="div-table-responsive">';
547 
548  print '<table class="noborder" width="100%">';
549  print '<tr class="liste_titre"><td>'.$langs->trans("LoginPage").'</td><td></td></tr>';
550 
551  // Message login
552  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("MessageLogin").'</td><td>';
553  if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
554  else print '&nbsp;';
555  print '</td></tr>'."\n";
556 
557  // Link to help center
558  print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
559  print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
560  print '</td></tr>';
561 
562  // Background login
563  print '<tr class="oddeven"><td>'.$langs->trans("BackgroundImageLogin").'</td><td>';
564  print '<div class="centpercent inline-block">';
565  print $conf->global->MAIN_LOGIN_BACKGROUND;
566  if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND))
567  {
568  print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
569  }
570  else
571  {
572  print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
573  }
574  print '</div>';
575  print '</td></tr>';
576 
577  print '</table>'."\n";
578  print '</div>';
579 
580  print '<div class="tabsAction tabsActionNoBottom">';
581  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
582  print '</div>';
583 }
584 
585 // End of page
586 llxFooter();
587 $db->close();
image_format_supported($file)
Return if a filename is file name of a supported image format.
Definition: images.lib.php:38
llxFooter()
Empty footer.
Definition: wrapper.php:56
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
print
Draft customers invoices.
Definition: index.php:91
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile')
Make control on an uploaded file from an GUI page and move it to final destination.
Definition: files.lib.php:996
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
picto_from_langcode($codelang, $moreatt='')
Return img flag of country for a language code or country code.
show_theme($fuser, $edit=0, $foruserprofile=false)
Show list of themes.
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:510
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).
img_delete($titlealt='default', $other='class="pictodelete"')
Show delete logo.
Class to generate html code for admin pages.
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='')
Show information for admin users or standard users.
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:435
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:44
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:1139
dol_mkdir($dir, $dataroot='', $newmask=null)
Creation of a directory (this can create recursive subdir)
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
Class to manage a WYSIWYG editor.
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 "subst...
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