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