dolibarr  9.0.0
dolibarr.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4  * Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array("install","other","admin"));
34 
35 $action=GETPOST('action','alpha');
36 
37 if (! $user->admin)
39 
40 $sfurl = '';
41 $version='0.0';
42 
43 
44 
45 /*
46  * Actions
47  */
48 
49 if ($action == 'getlastversion')
50 {
51  $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
52  //var_dump($result['content']);
53  $sfurl = simplexml_load_string($result['content']);
54 }
55 
56 
57 /*
58  * View
59  */
60 
61 $form=new Form($db);
62 
63 $title=$langs->trans("InfoDolibarr");
64 
65 llxHeader('', $title);
66 
67 print load_fiche_titre($title,'','title_setup');
68 
69 // Version
70 print '<div class="div-table-responsive-no-min">';
71 print '<table class="noborder" width="100%">';
72 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
73 print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')</td><td>'.DOL_VERSION;
74 // If current version differs from last upgrade
75 if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
76 {
77  // Compare version with last install database version (upgrades never occured)
78  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_INSTALL));
79 }
80 else
81 {
82  // Compare version with last upgrade database version
83  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE));
84 }
85 
86 if (function_exists('curl_init'))
87 {
88  $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
89  print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
90  if ($action == 'getlastversion')
91  {
92  if ($sfurl)
93  {
94  while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
95  {
96  $title=$sfurl->channel[0]->item[$i]->title;
97  if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
98  {
99  $newversion=$reg[1];
100  $newversionarray=explode('.',$newversion);
101  $versionarray=explode('.',$version);
102  //var_dump($newversionarray);var_dump($versionarray);
103  if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
104  }
105  $i++;
106  }
107 
108  // Show version
109  print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b>';
110  }
111  else
112  {
113  print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>';
114  }
115  }
116  else
117  {
118  print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="butAction">' .$langs->trans("Check").'</a>';
119  }
120 }
121 
122 // Now show link to the changelog
123 print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
124 
125 $version=DOL_VERSION;
126 if (preg_match('/[a-z]+/i', $version)) $version='develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
127 
128 print '<a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
129 print '</td></tr>'."\n";
130 print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
131 print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
132 print '</table>';
133 print '</div>';
134 print '<br>';
135 
136 // Session
137 print '<div class="div-table-responsive-no-min">';
138 print '<table class="noborder" width="100%">';
139 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
140 print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td colspan="2">'.session_save_path().'</td></tr>'."\n";
141 print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td colspan="2">'.session_name().'</td></tr>'."\n";
142 print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td colspan="2">'.session_id().'</td></tr>'."\n";
143 print '<tr class="oddeven"><td>'.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime)</td><td>'.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
144 print '</td><td align="right">';
145 print '<!-- session.gc_maxlifetime = '.ini_get("session.gc_maxlifetime").' -->'."\n";
146 print '<!-- session.gc_probability = '.ini_get("session.gc_probability").' -->'."\n";
147 print '<!-- session.gc_divisor = '.ini_get("session.gc_divisor").' -->'."\n";
148 print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
149 print "</td></tr>\n";
150 print '<tr class="oddeven"><td>'.$langs->trans("CurrentTheme").'</td><td colspan="2">'.$conf->theme.'</td></tr>'."\n";
151 print '<tr class="oddeven"><td>'.$langs->trans("CurrentMenuHandler").'</td><td colspan="2">';
152 print $conf->standard_menu;
153 print '</td></tr>'."\n";
154 print '<tr class="oddeven"><td>'.$langs->trans("Screen").'</td><td colspan="2">';
155 print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
156 print '</td></tr>'."\n";
157 print '<tr class="oddeven"><td>'.$langs->trans("Session").'</td><td colspan="2">';
158 $i=0;
159 foreach($_SESSION as $key => $val)
160 {
161  if ($i > 0) print ', ';
162  if (is_array($val)) print $key.' => array(...)';
163  else print $key.' => '.dol_escape_htmltag($val);
164  $i++;
165 }
166 print '</td></tr>'."\n";
167 print '</table>';
168 print '</div>';
169 print '<br>';
170 
171 
172 // Shmop
173 if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
174 {
175  $shmoparray=dol_listshmop();
176 
177  print '<div class="div-table-responsive-no-min">';
178  print '<table class="noborder" width="100%">';
179  print '<tr class="liste_titre">';
180  print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
181  print '<td>'.$langs->trans("NbOfEntries").'</td>';
182  print '<td align="right">'.$langs->trans("Address").'</td>';
183  print '</tr>'."\n";
184 
185  foreach($shmoparray as $key => $val)
186  {
187  print '<tr class="oddeven"><td>'.$key.'</td>';
188  print '<td>'.count($val).'</td>';
189  print '<td align="right">'.dol_getshmopaddress($key).'</td>';
190  print '</tr>'."\n";
191  }
192 
193  print '</table>';
194  print '</div>';
195  print '<br>';
196 }
197 
198 
199 // Localisation
200 print '<div class="div-table-responsive-no-min">';
201 print '<table class="noborder" width="100%">';
202 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
203 print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
204 print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
205 // Thousands
206 $thousand=$langs->transnoentitiesnoconv("SeparatorThousand");
207 if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method
208 if ($thousand == 'None') $thousand='';
209 print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorThousand").'</td><td>'.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).'</td></tr>'."\n";
210 // Decimals
211 $dec=$langs->transnoentitiesnoconv("SeparatorDecimal");
212 print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorDecimal").'</td><td>'.$dec.'</td></tr>'."\n";
213 // Show results of functions to see if everything works
214 print '<tr class="oddeven"><td>&nbsp; => price2num(1233.56+1)</td><td>'.price2num(1233.56+1,'2').'</td></tr>'."\n";
215 print '<tr class="oddeven"><td>&nbsp; => price2num('."'1".$thousand."234".$dec."56')</td><td>".price2num("1".$thousand."234".$dec."56",'2')."</td></tr>\n";
216 if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
217 {
218  print '<tr class="oddeven"><td>&nbsp; => price2num('."'1 234.56')</td><td>".price2num("1 234.56",'2')."</td>";
219  print "</tr>\n";
220 }
221 print '<tr class="oddeven"><td>&nbsp; => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
222 // Timezone
223 $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'<br>'."\n";
224 $txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
225 $txt.=$langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ)?$langs->trans("NotDefined"):$conf->global->MAIN_SERVER_TZ);
226 print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
227 $a=getServerTimeZoneInt('now');
228 $b=getServerTimeZoneInt('winter');
229 $c=getServerTimeZoneInt('summer');
230 $daylight=(is_numeric($c) && is_numeric($b))?round($c-$b):'unknown';
231 //print $a." ".$b." ".$c." ".$daylight;
232 $val=($a>=0?'+':'').$a;
233 $val.=' ('.($a=='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')';
234 $val.=' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
235 $val.=' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?' &nbsp; &nbsp; ('.$langs->trans('YesInSummer').')':'')));
236 print $form->textwithtooltip($val,$txt,2,1,img_info(''));
237 print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
238 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now(),'dayhour','tzserver').'</td></tr>'."\n";
239 print '<tr class="oddeven"><td>&nbsp; => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0,"dayhourtext").'</td>';
240 print '<tr class="oddeven"><td>&nbsp; => dol_get_first_day(1970,1,false)</td><td>'.dol_get_first_day(1970,1,false).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')</td>';
241 print '<tr class="oddeven"><td>&nbsp; => dol_get_first_day(1970,1,true)</td><td>'.dol_get_first_day(1970,1,true).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')</td>';
242 // Database timezone
243 if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
244 {
245  print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
246  $sql="SHOW VARIABLES where variable_name = 'system_time_zone'";
247  $resql = $db->query($sql);
248  if ($resql)
249  {
250  $obj = $db->fetch_object($resql);
251  print $form->textwithtooltip($obj->Value,$langs->trans('TZHasNoEffect'),2,1,img_info(''));
252  }
253  print '</td></tr>'."\n";
254 }
255 // Client
256 $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
257 print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')';
258 print ' &nbsp; &nbsp; &nbsp; '.$_SESSION['dol_tz_string'];
259 print ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': ';
260 if ($_SESSION['dol_dst']>0) print yn(1);
261 else print yn(0);
262 if (! empty($_SESSION['dol_dst_first'])) print ' &nbsp; &nbsp; ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']),'dayhour','gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']),'dayhour','gmt').')';
263 print '</td></tr>'."\n";
264 print '</td></tr>'."\n";
265 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now(),'dayhour','tzuser').'</td></tr>'."\n";
266 
267 $filesystemencoding=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
268 print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
269 
270 $tmp=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
271 if (empty($tmp) && ! empty($_SERVER["WINDIR"])) $tmp='iso-8859-1'; // By default for windows
272 if (empty($tmp)) $tmp='utf-8'; // By default for other
273 if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_FILESYSTEM_ENCODING;
274 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
275 
276 print '</table>';
277 print '</div>';
278 print '<br>';
279 
280 
281 
282 // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
283 $configfileparameters=array(
284  'dolibarr_main_url_root' => $langs->trans("URLRoot"),
285  '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
286  'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"),
287  '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
288  'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
289  'separator1' => '',
290  'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
291  'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
292  'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
293  'dolibarr_main_db_type' => $langs->trans("DriverType"),
294  'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
295  'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
296  'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
297  'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
298  '?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
299  'separator2' => '',
300  'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
301  '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
302  'separator'=> '',
303  '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
304  '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
305  '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
306  '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
307  '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
308  '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
309  '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
310  '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
311  'separator3' => '',
312  '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
313  '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
314  '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
315  '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
316  '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
317  '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
318  '?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_PATH',
319  '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
320  '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
321  '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
322  '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
323  '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
324  '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
325  '?dolibarr_js_JQUERY_FLOT' => 'dolibarr_js_JQUERY_FLOT',
326  '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
327  '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
328  'separator4' => '',
329  'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
330  'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
331  'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
332  '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
333  '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
334  '?dolibarr_strict_mode' => 'Strict mode is on/off',
335  '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
336 );
337 
338 print '<div class="div-table-responsive-no-min">';
339 print '<table class="noborder" width="100%">';
340 print '<tr class="liste_titre">';
341 print '<td class="titlefield">'.$langs->trans("Parameters").' ';
342 print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
343 print '</td>';
344 print '<td>'.$langs->trans("Parameter").'</td>';
345 print '<td>'.$langs->trans("Value").'</td>';
346 print '</tr>'."\n";
347 
348 foreach($configfileparameters as $key => $value)
349 {
350  $ignore=0;
351 
352  if (empty($ignore))
353  {
354  $newkey = preg_replace('/^\?/','',$key);
355 
356  if (preg_match('/^\?/',$key) && empty(${$newkey}))
357  {
358  if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled))
359  continue; // We discard parameters starting with ?
360  }
361  if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
362 
363  print '<tr class="oddeven">';
364  if (strpos($newkey, 'separator') !== false)
365  {
366  print '<td colspan="3">&nbsp;</td>';
367  }
368  else
369  {
370  // Label
371  print "<td>".$value.'</td>';
372  // Key
373  print '<td>'.$newkey.'</td>';
374  // Value
375  print "<td>";
376  if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
377  else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
378  else if ($newkey == 'dolibarr_main_document_root_alt')
379  {
380  $tmparray=explode(',',${$newkey});
381  $i=0;
382  foreach($tmparray as $value2)
383  {
384  if ($i > 0) print ', ';
385  print $value2;
386  if (! is_readable($value2))
387  {
388  $langs->load("errors");
389  print ' '.img_warning($langs->trans("ErrorCantReadDir",$value2));
390  }
391  ++$i;
392  }
393  }
394  else print ${$newkey};
395  if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
396  print "</td>";
397  }
398  print "</tr>\n";
399  $lastkeyshown=$newkey;
400  }
401 }
402 print '</table>';
403 print '</div>';
404 print '<br>';
405 
406 
407 
408 // Parameters in database
409 print '<div class="div-table-responsive-no-min">';
410 print '<table class="noborder">';
411 print '<tr class="liste_titre">';
412 print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
413 print '<td>'.$langs->trans("Value").'</td>';
414 if (empty($conf->multicompany->enabled) || !$user->entity) print '<td class="center width="80px"">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
415 print "</tr>\n";
416 
417 $sql = "SELECT";
418 $sql.= " rowid";
419 $sql.= ", ".$db->decrypt('name')." as name";
420 $sql.= ", ".$db->decrypt('value')." as value";
421 $sql.= ", type";
422 $sql.= ", note";
423 $sql.= ", entity";
424 $sql.= " FROM ".MAIN_DB_PREFIX."const";
425 if (empty($conf->multicompany->enabled))
426 {
427  // If no multicompany mode, admins can see global and their constantes
428  $sql.= " WHERE entity IN (0,".$conf->entity.")";
429 }
430 else
431 {
432  // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
433  if ($user->entity) $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
434 }
435 $sql.= " ORDER BY entity, name ASC";
436 $resql = $db->query($sql);
437 if ($resql)
438 {
439  $num = $db->num_rows($resql);
440  $i = 0;
441 
442  while ($i < $num)
443  {
444  $obj = $db->fetch_object($resql);
445 
446  print '<tr class="oddeven">';
447  print '<td class="tdoverflowmax300">'.$obj->name.'</td>'."\n";
448  print '<td class="tdoverflowmax300">'.dol_escape_htmltag($obj->value).'</td>'."\n";
449  if (empty($conf->multicompany->enabled) || !$user->entity) print '<td align="center" width="80px">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
450  print "</tr>\n";
451 
452  $i++;
453  }
454 }
455 
456 print '</table>';
457 print '</div>';
458 
459 // End of page
460 llxFooter();
461 $db->close();
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
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->lire) if(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if(! empty($conf->facture->enabled) &&! empty($conf->commande->enabled) && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1053
img_info($titlealt='default')
Show info logo.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:453
dol_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
Definition: date.lib.php:295
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...
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.
getURLContent($url, $postorget='GET', $param='', $followlocation=1, $addheaders=array())
Function get content from an URL (use proxy if proxy defined)
Definition: geturl.lib.php:34
llxHeader()
Empty header.
Definition: wrapper.php:44
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition: admin.lib.php:58
getServerTimeZoneInt($refgmtdate='now')
Return server timezone int.
Definition: date.lib.php:82
dol_now($mode='gmt')
Return date for now.
dol_listshmop()
Return list of contents of all memory area shared.
Definition: memory.lib.php:197
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is &#39;...