dolibarr  7.0.0-beta
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@capnetworks.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 $langs->load("admin");
33 $langs->load("install");
34 $langs->load("other");
35 
36 $action=GETPOST('action','alpha');
37 
38 if (! $user->admin)
40 
41 $sfurl = '';
42 $version='0.0';
43 
44 
45 
46 /*
47  * Actions
48  */
49 
50 if ($action == 'getlastversion')
51 {
52  $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
53  //var_dump($result['content']);
54  $sfurl = simplexml_load_string($result['content']);
55 }
56 
57 
58 /*
59  * View
60  */
61 
62 $form=new Form($db);
63 
64 $title=$langs->trans("InfoDolibarr");
65 
66 llxHeader('', $title);
67 
68 print load_fiche_titre($title,'','title_setup');
69 
70 // Version
71 print '<div class="div-table-responsive-no-min">';
72 print '<table class="noborder" width="100%">';
73 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
74 print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')</td><td>'.DOL_VERSION;
75 // If current version differs from last upgrade
76 if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
77 {
78  // Compare version with last install database version (upgrades never occured)
79  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_INSTALL));
80 }
81 else
82 {
83  // Compare version with last upgrade database version
84  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE));
85 }
86 
87 if (function_exists('curl_init'))
88 {
89  $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
90  print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
91  if ($action == 'getlastversion')
92  {
93  if ($sfurl)
94  {
95  while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
96  {
97  $title=$sfurl->channel[0]->item[$i]->title;
98  if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
99  {
100  $newversion=$reg[1];
101  $newversionarray=explode('.',$newversion);
102  $versionarray=explode('.',$version);
103  //var_dump($newversionarray);var_dump($versionarray);
104  if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
105  }
106  $i++;
107  }
108 
109  // Show version
110  print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b>';
111  }
112  else
113  {
114  print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>';
115  }
116  }
117  else
118  {
119  print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">' .$langs->trans("Check").'</a>';
120  }
121 }
122 
123 // Now show link to the changelog
124 print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
125 
126 $version=DOL_VERSION;
127 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.
128 
129 print '<a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
130 print '</td></tr>'."\n";
131 print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
132 print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
133 print '</table>';
134 print '</div>';
135 print '<br>';
136 
137 // Session
138 print '<div class="div-table-responsive-no-min">';
139 print '<table class="noborder" width="100%">';
140 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
141 print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td colspan="2">'.session_save_path().'</td></tr>'."\n";
142 print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td colspan="2">'.session_name().'</td></tr>'."\n";
143 print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td colspan="2">'.session_id().'</td></tr>'."\n";
144 print '<tr class="oddeven"><td>'.$langs->trans("CurrentSessionTimeOut").'</td><td>'.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
145 print '</td><td align="right">';
146 print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
147 print "</td></tr>\n";
148 print '<tr class="oddeven"><td>'.$langs->trans("CurrentTheme").'</td><td colspan="2">'.$conf->theme.'</td></tr>'."\n";
149 print '<tr class="oddeven"><td>'.$langs->trans("CurrentMenuHandler").'</td><td colspan="2">';
150 print $conf->standard_menu;
151 print '</td></tr>'."\n";
152 print '<tr class="oddeven"><td>'.$langs->trans("Screen").'</td><td colspan="2">';
153 print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
154 print '</td></tr>'."\n";
155 print '<tr class="oddeven"><td>'.$langs->trans("Session").'</td><td colspan="2">';
156 $i=0;
157 foreach($_SESSION as $key => $val)
158 {
159  if ($i > 0) print ', ';
160  print $key.' => '.$val;
161  $i++;
162 }
163 print '</td></tr>'."\n";
164 print '</table>';
165 print '</div>';
166 print '<br>';
167 
168 
169 // Shmop
170 if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
171 {
172  $shmoparray=dol_listshmop();
173 
174  print '<div class="div-table-responsive-no-min">';
175  print '<table class="noborder" width="100%">';
176  print '<tr class="liste_titre">';
177  print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
178  print '<td>'.$langs->trans("NbOfEntries").'</td>';
179  print '<td align="right">'.$langs->trans("Address").'</td>';
180  print '</tr>'."\n";
181 
182  foreach($shmoparray as $key => $val)
183  {
184  print '<tr class="oddeven"><td>'.$key.'</td>';
185  print '<td>'.count($val).'</td>';
186  print '<td align="right">'.dol_getshmopaddress($key).'</td>';
187  print '</tr>'."\n";
188  }
189 
190  print '</table>';
191  print '</div>';
192  print '<br>';
193 }
194 
195 
196 // Localisation
197 print '<div class="div-table-responsive-no-min">';
198 print '<table class="noborder" width="100%">';
199 print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
200 print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter","HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
201 print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
202 // Thousands
203 $thousand=$langs->transnoentitiesnoconv("SeparatorThousand");
204 if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method
205 if ($thousand == 'None') $thousand='';
206 print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorThousand").'</td><td>'.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).'</td></tr>'."\n";
207 // Decimals
208 $dec=$langs->transnoentitiesnoconv("SeparatorDecimal");
209 print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorDecimal").'</td><td>'.$dec.'</td></tr>'."\n";
210 // Show results of functions to see if everything works
211 print '<tr class="oddeven"><td>&nbsp; => price2num(1233.56+1)</td><td>'.price2num(1233.56+1,'2').'</td></tr>'."\n";
212 print '<tr class="oddeven"><td>&nbsp; => price2num('."'1".$thousand."234".$dec."56')</td><td>".price2num("1".$thousand."234".$dec."56",'2')."</td></tr>\n";
213 if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
214 {
215  print '<tr class="oddeven"><td>&nbsp; => price2num('."'1 234.56')</td><td>".price2num("1 234.56",'2')."</td>";
216  print "</tr>\n";
217 }
218 print '<tr class="oddeven"><td>&nbsp; => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
219 // Timezone
220 $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'<br>'."\n";
221 $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
222 $txt.=$langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ)?$langs->trans("NotDefined"):$conf->global->MAIN_SERVER_TZ);
223 //$txt.=$langs->trans("YouCanEditPHPTZ"); // deprecated
224 print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
225 $a=getServerTimeZoneInt('now');
226 $b=getServerTimeZoneInt('winter');
227 $c=getServerTimeZoneInt('summer');
228 $daylight=(is_numeric($c) && is_numeric($b))?round($c-$b):'unknown';
229 //print $a." ".$b." ".$c." ".$daylight;
230 $val=($a>=0?'+':'').$a;
231 $val.=' ('.($a=='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')';
232 $val.=' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
233 $val.=' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?' &nbsp; &nbsp; ('.$langs->trans('YesInSummer').')':'')));
234 print $form->textwithtooltip($val,$txt,2,1,img_info(''));
235 print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
236 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now(),'dayhour','tzserver').'</td></tr>'."\n";
237 print '<tr class="oddeven"><td>&nbsp; => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0,"dayhourtext").'</td>';
238 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>';
239 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>';
240 // Database timezone
241 if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
242 {
243  print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
244  $sql="SHOW VARIABLES where variable_name = 'system_time_zone'";
245  $resql = $db->query($sql);
246  if ($resql)
247  {
248  $obj = $db->fetch_object($resql);
249  print $form->textwithtooltip($obj->Value,$langs->trans('TZHasNoEffect'),2,1,img_info(''));
250  }
251  print '</td></tr>'."\n";
252 }
253 // Client
254 $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
255 print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')';
256 print ' &nbsp; &nbsp; &nbsp; '.$_SESSION['dol_tz_string'];
257 print ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': ';
258 if ($_SESSION['dol_dst']>0) print yn(1);
259 else print yn(0);
260 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').')';
261 print '</td></tr>'."\n";
262 print '</td></tr>'."\n";
263 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now(),'dayhour','tzuser').'</td></tr>'."\n";
264 
265 $filesystemencoding=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
266 print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
267 
268 $tmp=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
269 if (empty($tmp) && ! empty($_SERVER["WINDIR"])) $tmp='iso-8859-1'; // By default for windows
270 if (empty($tmp)) $tmp='utf-8'; // By default for other
271 if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_FILESYSTEM_ENCODING;
272 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
273 
274 print '</table>';
275 print '</div>';
276 print '<br>';
277 
278 
279 
280 // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
281 $configfileparameters=array(
282  'dolibarr_main_url_root' => $langs->trans("URLRoot"),
283  '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
284  'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"),
285  '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
286  'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
287  'separator1' => '',
288  'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
289  'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
290  'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
291  'dolibarr_main_db_type' => $langs->trans("DriverType"),
292  'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
293  'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
294  'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
295  'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
296  '?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
297  'separator2' => '',
298  'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
299  '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
300  'separator'=> '',
301  '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
302  '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
303  '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
304  '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
305  '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
306  '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
307  '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
308  '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
309  'separator3' => '',
310  '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
311  '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
312  '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
313  '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
314  '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
315  '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
316  '?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_PATH',
317  '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
318  '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
319  '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
320  '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
321  '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
322  '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
323  '?dolibarr_js_JQUERY_FLOT' => 'dolibarr_js_JQUERY_FLOT',
324  '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
325  '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
326  'separator4' => '',
327  'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
328  '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
329  '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
330  '?dolibarr_strict_mode' => 'Strict mode is on/off',
331  '?dolibarr_pdf_force_fpdf' => 'Force fpdf usage to generate PDF'
332 );
333 
334 $var=true;
335 print '<div class="div-table-responsive-no-min">';
336 print '<table class="noborder" width="100%">';
337 print '<tr class="liste_titre">';
338 print '<td class="titlefield">'.$langs->trans("Parameters").' ';
339 print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
340 print '</td>';
341 print '<td>'.$langs->trans("Parameter").'</td>';
342 print '<td>'.$langs->trans("Value").'</td>';
343 print '</tr>'."\n";
344 
345 foreach($configfileparameters as $key => $value)
346 {
347  $ignore=0;
348 
349  if (empty($ignore))
350  {
351  $newkey = preg_replace('/^\?/','',$key);
352 
353  if (preg_match('/^\?/',$key) && empty(${$newkey}))
354  {
355  if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled))
356  continue; // We discard parameters starting with ?
357  }
358  if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
359 
360  print '<tr class="oddeven">';
361  if (strpos($newkey, 'separator') !== false)
362  {
363  print '<td colspan="3">&nbsp;</td>';
364  }
365  else
366  {
367  // Label
368  print "<td>".$value.'</td>';
369  // Key
370  print '<td>'.$newkey.'</td>';
371  // Value
372  print "<td>";
373  if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
374  else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
375  else if ($newkey == 'dolibarr_main_document_root_alt')
376  {
377  $tmparray=explode(',',${$newkey});
378  $i=0;
379  foreach($tmparray as $value2)
380  {
381  if ($i > 0) print ', ';
382  print $value2;
383  if (! is_readable($value2))
384  {
385  $langs->load("errors");
386  print ' '.img_warning($langs->trans("ErrorCantReadDir",$value2));
387  }
388  ++$i;
389  }
390  }
391  else print ${$newkey};
392  if ($newkey == 'dolibarr_main_url_root' && $newkey != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
393  print "</td>";
394  }
395  print "</tr>\n";
396  $lastkeyshown=$newkey;
397  }
398 }
399 print '</table>';
400 print '</div>';
401 print '<br>';
402 
403 
404 
405 // Parameters in database
406 print '<div class="div-table-responsive-no-min">';
407 print '<table class="noborder">';
408 print '<tr class="liste_titre">';
409 print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
410 print '<td>'.$langs->trans("Value").'</td>';
411 if (empty($conf->multicompany->enabled) || !$user->entity) print '<td class="center width="80px"">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
412 print "</tr>\n";
413 
414 $sql = "SELECT";
415 $sql.= " rowid";
416 $sql.= ", ".$db->decrypt('name')." as name";
417 $sql.= ", ".$db->decrypt('value')." as value";
418 $sql.= ", type";
419 $sql.= ", note";
420 $sql.= ", entity";
421 $sql.= " FROM ".MAIN_DB_PREFIX."const";
422 if (empty($conf->multicompany->enabled))
423 {
424  // If no multicompany mode, admins can see global and their constantes
425  $sql.= " WHERE entity IN (0,".$conf->entity.")";
426 }
427 else
428 {
429  // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
430  if ($user->entity) $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
431 }
432 $sql.= " ORDER BY entity, name ASC";
433 $resql = $db->query($sql);
434 if ($resql)
435 {
436  $num = $db->num_rows($resql);
437  $i = 0;
438 
439  while ($i < $num)
440  {
441  $obj = $db->fetch_object($resql);
442 
443  print '<tr class="oddeven">';
444  print '<td class="tdoverflow">'.$obj->name.'</td>'."\n";
445  print '<td class="tdoverflow">'.$obj->value.'</td>'."\n";
446  if (empty($conf->multicompany->enabled) || !$user->entity) print '<td align="center" width="80px">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
447  print "</tr>\n";
448 
449  $i++;
450  }
451 }
452 
453 print '</table>';
454 print '</div>';
455 
456 
457 llxFooter();
458 
459 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:445
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:286
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
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
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
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
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).
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:1013
img_info($titlealt= 'default')
Show info logo.
price2num($amount, $rounding='', $alreadysqlnb=0)
Function that return a number with universal decimal format (decimal separator is '...