dolibarr  16.0.5
perf.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2019 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
23 require '../../main.inc.php';
24 require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
25 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
28 
29 // Load translation files required by the page
30 $langs->loadLangs(array("install", "other", "admin", "products"));
31 
32 if (!$user->admin) {
34 }
35 
36 if (GETPOST('action', 'aZ09') == 'donothing') {
37  exit;
38 }
39 
40 
41 /*
42  * View
43  */
44 
45 $form = new Form($db);
46 $nowstring = dol_print_date(dol_now(), 'dayhourlog');
47 
48 llxHeader();
49 
50 print load_fiche_titre($langs->trans("PerfDolibarr"), '', 'title_setup');
51 
52 print '<span class="opacitymedium">'.$langs->trans("YouMayFindPerfAdviceHere", 'https://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').'</span> (<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Reload").'</a>)<br>';
53 
54 print '<br>';
55 print '<hr>';
56 
57 // Recupere la version de PHP
58 $phpversion = version_php();
59 print "<br><strong>PHP</strong> - ".$langs->trans("Version").": ".$phpversion."<br>\n";
60 
61 // Recupere la version du serveur web
62 print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
63 
64 // XDebug
65 print '<br>';
66 print '<strong>'.$langs->trans("XDebug").'</strong>: ';
67 $test = !function_exists('xdebug_is_enabled');
68 if ($test) {
69  print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
70 } else {
71  print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
72  print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
73 }
74 print '<br>';
75 
76 // Module log
77 print '<br>';
78 print '<strong>'.$langs->trans("Syslog").'</strong>: ';
79 $test = empty($conf->syslog->enabled);
80 if ($test) {
81  print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
82 } else {
83  if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) {
84  print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog"));
85  } else {
86  print img_picto('', 'tick.png').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), $conf->global->SYSLOG_LEVEL);
87  }
88  //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
89 }
90 print '<br>';
91 
92 // Module debugbar
93 print '<br>';
94 print '<strong>'.$langs->trans("DebugBar").'</strong>: ';
95 $test = empty($conf->debugbar->enabled);
96 if ($test) {
97  print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
98 } else {
99  print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
100  //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
101 }
102 print '<br>';
103 
104 // Applicative cache
105 print '<br>';
106 print '<strong>'.$langs->trans("ApplicativeCache").'</strong>: ';
107 $test = !empty($conf->memcached->enabled);
108 if ($test) {
109  if (!empty($conf->global->MEMCACHED_SERVER)) {
110  print $langs->trans("MemcachedAvailableAndSetup");
111  print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
112  } else {
113  print $langs->trans("MemcachedModuleAvailableButNotSetup");
114  print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
115  }
116 } else {
117  print $langs->trans("MemcachedNotAvailable");
118 }
119 print '</br>';
120 
121 // OPCode cache
122 print '<br>';
123 print '<strong>'.$langs->trans("OPCodeCache").'</strong>: ';
124 $foundcache = 0;
125 $test = function_exists('xcache_info');
126 if (!$foundcache && $test) {
127  $foundcache++;
128  print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache");
129  print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php">Xcache admin page</a>';
130 }
131 $test = function_exists('eaccelerator_info');
132 if (!$foundcache && $test) {
133  $foundcache++;
134  print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "Eaccelerator");
135 }
136 $test = function_exists('opcache_get_status');
137 if (!$foundcache && $test) {
138  $foundcache++;
139  print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "ZendOPCache"); // Should be by default starting with PHP 5.5
140  //$tmp=opcache_get_status();
141  //var_dump($tmp);
142 }
143 $test = function_exists('apc_cache_info');
144 if (!$foundcache && $test) {
145  //var_dump(apc_cache_info());
146  if (ini_get('apc.enabled')) {
147  $foundcache++;
148  print img_picto('', 'tick.png').' '.$langs->trans("APCInstalled");
149  } else {
150  print img_picto('', 'warning').' '.$langs->trans("APCCacheInstalledButDisabled");
151  }
152 }
153 if (!$foundcache) {
154  print $langs->trans("NoOPCodeCacheFound");
155 }
156 print '<br>';
157 
158 // Use of preload bootstrap
159 if (ini_get('opcache.preload')) {
160  print '<br>';
161  print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
162  print ini_get('opcache.preload');
163 } else {
164  print '<br>';
165  print '<strong>'.$langs->trans("PreloadOPCode").'</strong>: ';
166  print $langs->trans("No");
167 }
168 print '<br>';
169 
170 // HTTPCacheStaticResources
171 print '<script type="text/javascript">
172 jQuery(document).ready(function() {
173  var getphpurl;
174  var cachephpstring;
175  var compphpstring;
176  getphpurl = $.ajax({
177  type: "GET",
178  data: { token: \''.currentToken().'\' },
179  url: \''.DOL_URL_ROOT.'/public/notice.php\',
180  cache: false,
181  /* async: false, */
182  /* crossDomain: true,*/
183  success: function () {
184  cachephpstring=getphpurl.getResponseHeader(\'Cache-Control\');
185  /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */
186  /*alert(\'php:\'+cachephpstring);*/
187  if (cachephpstring == null || cachephpstring.indexOf("no-cache") !== -1)
188  {
189  jQuery("#httpcachephpok").hide();
190  jQuery("#httpcachephpko").show();
191  }
192  else
193  {
194  jQuery("#httpcachephpok").show();
195  jQuery("#httpcachephpko").hide();
196  }
197  compphpstring=getphpurl.getResponseHeader(\'Content-Encoding\');
198  /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */
199  /*alert(\'php:\'+compphpstring);*/
200  if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1))
201  {
202  jQuery("#httpcompphpok").hide();
203  jQuery("#httpcompphpko").show();
204  }
205  else
206  {
207  jQuery("#httpcompphpok").show();
208  jQuery("#httpcompphpko").hide();
209  }
210  }
211  })
212 
213  var getcssurl;
214  var cachecssstring;
215  var compcssstring;
216  getcssurl = $.ajax({
217  type: "GET",
218  data: { token: \'notrequired\' },
219  url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\',
220  cache: false,
221  /* async: false, */
222  /* crossDomain: true, */
223  success: function () {
224  cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\');
225  /* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */
226  /*alert(\'css:\'+cachecssstring);*/
227  if (cachecssstring != null && cachecssstring.indexOf("no-cache") !== -1)
228  {
229  jQuery("#httpcachecssok").hide();
230  jQuery("#httpcachecssko").show();
231  }
232  else
233  {
234  jQuery("#httpcachecssok").show();
235  jQuery("#httpcachecssko").hide();
236  }
237  compcssstring=getcssurl.getResponseHeader(\'Content-Encoding\');
238  /* alert(\'php:\'+getcssurl.getAllResponseHeaders()); */
239  /*alert(\'php:\'+compcssstring);*/
240  if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1))
241  {
242  jQuery("#httpcompcssok").hide();
243  jQuery("#httpcompcssko").show();
244  }
245  else
246  {
247  jQuery("#httpcompcssok").show();
248  jQuery("#httpcompcssko").hide();
249  }
250  }
251  })
252 
253  var getcssphpurl;
254  var cachecssphpstring;
255  var compcssphpstring;
256  getcssphpurl = $.ajax({
257  type: "GET",
258  data: { token: \''.currentToken().'\' },
259  url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\',
260  cache: false,
261  /* async: false, */
262  /* crossDomain: true,*/
263  success: function () {
264  cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\');
265  /* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */
266  /*alert(\'cssphp:\'+cachecssphpstring);*/
267  if (cachecssphpstring != null && cachecssphpstring.indexOf("no-cache") !== -1)
268  {
269  jQuery("#httpcachecssphpok").hide();
270  jQuery("#httpcachecssphpko").show();
271  }
272  else
273  {
274  jQuery("#httpcachecssphpok").show();
275  jQuery("#httpcachecssphpko").hide();
276  }
277  compcssphpstring=getcssphpurl.getResponseHeader(\'Content-Encoding\');
278  /* alert(\'php:\'+getcssphpurl.getAllResponseHeaders()); */
279  /*alert(\'php:\'+compcssphpstring);*/
280  if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1))
281  {
282  jQuery("#httpcompcssphpok").hide();
283  jQuery("#httpcompcssphpko").show();
284  }
285  else
286  {
287  jQuery("#httpcompcssphpok").show();
288  jQuery("#httpcompcssphpko").hide();
289  }
290  }
291  })
292 
293  var getimgurl;
294  var cacheimgstring;
295  var compimgstring;
296  getimgurl = $.ajax({
297  type: "GET",
298  data: { token: \'notrequired\' },
299  url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\',
300  cache: false,
301  /* async: false, */
302  /* crossDomain: true,*/
303  success: function () {
304  cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\');
305  /* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */
306  /*alert(\'img:\'+cacheimgstring);*/
307  if (cacheimgstring != null && cacheimgstring.indexOf("no-cache") !== -1)
308  {
309  jQuery("#httpcacheimgok").hide();
310  jQuery("#httpcacheimgko").show();
311  }
312  else
313  {
314  jQuery("#httpcacheimgok").show();
315  jQuery("#httpcacheimgko").hide();
316  }
317  compimgstring=getimgurl.getResponseHeader(\'Content-Encoding\');
318  /* alert(\'php:\'+getimgurl.getAllResponseHeaders()); */
319  /*alert(\'php:\'+compimgstring);*/
320  if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1))
321  {
322  jQuery("#httpcompimgok").hide();
323  jQuery("#httpcompimgko").show();
324  }
325  else
326  {
327  jQuery("#httpcompimgok").show();
328  jQuery("#httpcompimgko").hide();
329  }
330  }
331  })
332 
333  var getjsurl;
334  var cachejsstring;
335  var compjsstring;
336  getjsurl = $.ajax({
337  type: "GET",
338  data: { token: \'notrequired\' },
339  url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
340  cache: false,
341  /* async: false, */
342  /* crossDomain: true,*/
343  success: function () {
344  cachejsstring=getjsurl.getResponseHeader(\'Cache-Control\');
345  /*alert(\'js:\'+getjsurl.getAllResponseHeaders());*/
346  /*alert(\'js:\'+cachejsstring);*/
347  if (cachejsstring != null && cachejsstring.indexOf("no-cache") !== -1)
348  {
349  jQuery("#httpcachejsok").hide();
350  jQuery("#httpcachejsko").show();
351  }
352  else
353  {
354  jQuery("#httpcachejsok").show();
355  jQuery("#httpcachejsko").hide();
356  }
357  compjsstring=getjsurl.getResponseHeader(\'Content-Encoding\');
358  /* alert(\'js:\'+getjsurl.getAllResponseHeaders()); */
359  /*alert(\'js:\'+compjsstring);*/
360  if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1))
361  {
362  jQuery("#httpcompjsok").hide();
363  jQuery("#httpcompjsko").show();
364  }
365  else
366  {
367  jQuery("#httpcompjsok").show();
368  jQuery("#httpcompjsko").hide();
369  }
370  }
371  })
372 
373  var getjsphpurl;
374  var cachejsphpstring;
375  var compjsphpstring;
376  getjsphpurl = $.ajax({
377  type: "GET",
378  data: { token: \''.currentToken().'\' },
379  url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
380  cache: false,
381  /* async: false, */
382  /* crossDomain: true,*/
383  success: function () {
384  cachejsphpstring=getjsphpurl.getResponseHeader(\'Cache-Control\');
385  /* alert(\'jsphp:\'+getjsphpurl.getAllResponseHeaders()); */
386  /*alert(\'jsphp:\'+cachejsphpstring);*/
387  if (cachejsphpstring != null && cachejsphpstring.indexOf("no-cache") !== -1)
388  {
389  jQuery("#httpcachejsphpok").hide();
390  jQuery("#httpcachejsphpko").show();
391  }
392  else
393  {
394  jQuery("#httpcachejsphpok").show();
395  jQuery("#httpcachejsphpko").hide();
396  }
397  compjsphpstring=getjsphpurl.getResponseHeader(\'Content-Encoding\');
398  /* alert(\'php:\'+getjsphpurl.getAllResponseHeaders()); */
399  /*alert(\'php:\'+compjsphpstring);*/
400  if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1))
401  {
402  jQuery("#httpcompjsphpok").hide();
403  jQuery("#httpcompjsphpko").show();
404  }
405  else
406  {
407  jQuery("#httpcompjsphpok").show();
408  jQuery("#httpcompjsphpko").hide();
409  }
410  }
411  })
412 
413 });
414 </script>';
415 
416 
417 print '<br>';
418 print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - ';
419 print $form->textwithpicto($langs->trans("CacheByServer"), $langs->trans("CacheByServerDesc"));
420 print ':</strong><br>';
421 // No cahce on PHP
422 //print '<div id="httpcachephpok">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'</div>';
423 //print '<div id="httpcachephpko">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeNotCached",'php (.php)').'</div>';
424 // Cache on rest
425 print '<div id="httpcachecssok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCached", 'css (.css)').'</div>';
426 print '<div id="httpcachecssko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCached", 'css (.css)').'</div>';
427 print '<div id="httpcachecssphpok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCached", 'css (.css.php)').'</div>';
428 print '<div id="httpcachecssphpko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCached", 'css (.css.php)').'</div>';
429 print '<div id="httpcacheimgok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCached", 'img (.png)').'</div>';
430 print '<div id="httpcacheimgko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCached", 'img (.png)').'</div>';
431 print '<div id="httpcachejsok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCached", 'javascript (.js)').'</div>';
432 print '<div id="httpcachejsko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCached", 'javascript (.js)').'</div>';
433 print '<div id="httpcachejsphpok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCached", 'javascript (.js.php)').'</div>';
434 print '<div id="httpcachejsphpko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCached", 'javascript (.js.php)').'</div>';
435 print '<br>';
436 print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - ';
437 print $langs->trans("CacheByClient").':</strong><br>';
438 print $langs->trans("TestNotPossibleWithCurrentBrowsers").'<br>';
439 
440 
441 // Compressions
442 print '<br>';
443 print '<strong>';
444 print $form->textwithpicto($langs->trans("CompressionOfResources"), $langs->trans("CompressionOfResourcesDesc"));
445 print '</strong>: ';
446 print '<br>';
447 // on PHP
448 print '<div id="httpcompphpok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCompressed", 'php (.php)').'</div>';
449 print '<div id="httpcompphpko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCompressed", 'php (.php)').'</div>';
450 // on rest
451 print '<div id="httpcompcssok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCompressed", 'css (.css)').'</div>';
452 print '<div id="httpcompcssko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCompressed", 'css (.css)').'</div>';
453 print '<div id="httpcompcssphpok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCompressed", 'css (.css.php)').'</div>';
454 print '<div id="httpcompcssphpko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCompressed", 'css (.css.php)').'</div>';
455 //print '<div id="httpcompimgok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'img (.png)').'</div>';
456 //print '<div id="httpcompimgko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'img (.png)').'</div>';
457 print '<div id="httpcompjsok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCompressed", 'javascript (.js)').'</div>';
458 print '<div id="httpcompjsko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCompressed", 'javascript (.js)').'</div>';
459 print '<div id="httpcompjsphpok">'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCompressed", 'javascript (.js.php)').'</div>';
460 print '<div id="httpcompjsphpko">'.img_picto('', 'warning.png').' '.$langs->trans("FilesOfTypeNotCompressed", 'javascript (.js.php)').'</div>';
461 
462 // Database driver
463 print '<br>';
464 print '<strong>'.$langs->trans("DriverType").'</strong>: ';
465 print '<br>';
466 if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
467  $test = ($conf->db->type == 'mysqli');
468  if ($test) {
469  print img_picto('', 'tick.png').' '.$langs->trans("YouUseBestDriver", $conf->db->type);
470  } else {
471  print img_picto('', 'warning.png').' '.$langs->trans("YouDoNotUseBestDriver", $conf->db->type, 'mysqli');
472  }
473  print '<br>';
474 }
475 
476 print '<br>';
477 print '<strong>'.$langs->trans("ComboListOptim").'</strong>: ';
478 print '<br>';
479 // Product combo list
480 $sql = "SELECT COUNT(*) as nb";
481 $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
482 $resql = $db->query($sql);
483 if ($resql) {
484  $limitforoptim = 5000;
485  $num = $db->num_rows($resql);
486  $obj = $db->fetch_object($resql);
487  $nb = $obj->nb;
488  if ($nb > $limitforoptim) {
489  if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) {
490  print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT');
491  } else {
492  print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
493  }
494  } else {
495  print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
496  }
497  print '<br>';
498  $db->free($resql);
499 }
500 // Thirdparty combo list
501 $sql = "SELECT COUNT(*) as nb";
502 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
503 $resql = $db->query($sql);
504 if ($resql) {
505  $limitforoptim = 5000;
506  $num = $db->num_rows($resql);
507  $obj = $db->fetch_object($resql);
508  $nb = $obj->nb;
509  if ($nb > $limitforoptim) {
510  if (empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) {
511  print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT');
512  } else {
513  print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
514  }
515  } else {
516  print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
517  }
518  print '<br>';
519  $db->free($resql);
520 }
521 // Contact combo list
522 $sql = "SELECT COUNT(*) as nb";
523 $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s";
524 $resql = $db->query($sql);
525 if ($resql) {
526  $limitforoptim = 5000;
527  $num = $db->num_rows($resql);
528  $obj = $db->fetch_object($resql);
529  $nb = $obj->nb;
530  if ($nb > $limitforoptim) {
531  if (empty($conf->global->CONTACT_USE_SEARCH_TO_SELECT)) {
532  print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT');
533  } else {
534  print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
535  }
536  } else {
537  print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts"));
538  }
539  print '<br>';
540  $db->free($resql);
541 }
542 // Contact combo list
543 $sql = "SELECT COUNT(*) as nb";
544 $sql .= " FROM ".MAIN_DB_PREFIX."projet as s";
545 $resql = $db->query($sql);
546 if ($resql) {
547  $limitforoptim = 5000;
548  $num = $db->num_rows($resql);
549  $obj = $db->fetch_object($resql);
550  $nb = $obj->nb;
551  if ($nb > $limitforoptim) {
552  if (empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) {
553  print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT');
554  } else {
555  print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', $conf->global->PROJECT_USE_SEARCH_TO_SELECT);
556  }
557  } else {
558  print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects"));
559  }
560  print '<br>';
561  $db->free($resql);
562 }
563 
564 
565 print '<br>';
566 print '<strong>'.$langs->trans("SearchOptim").'</strong>: ';
567 print '<br>';
568 // Product search
569 $sql = "SELECT COUNT(*) as nb";
570 $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
571 $resql = $db->query($sql);
572 if ($resql) {
573  $limitforoptim = 100000;
574  $num = $db->num_rows($resql);
575  $obj = $db->fetch_object($resql);
576  $nb = $obj->nb;
577  if ($nb > $limitforoptim) {
578  if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) {
579  print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
580  print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
581  } else {
582  print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', $conf->global->PRODUCT_DONOTSEARCH_ANYWHERE);
583  }
584  } else {
585  print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
586  }
587  print '<br>';
588  $db->free($resql);
589 }
590 
591 // Thirdparty search
592 $sql = "SELECT COUNT(*) as nb";
593 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
594 $resql = $db->query($sql);
595 if ($resql) {
596  $limitforoptim = 100000;
597  $num = $db->num_rows($resql);
598  $obj = $db->fetch_object($resql);
599  $nb = $obj->nb;
600  if ($nb > $limitforoptim) {
601  if (empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) {
602  print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
603  print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
604  } else {
605  print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', $conf->global->COMPANY_DONOTSEARCH_ANYWHERE);
606  }
607  } else {
608  print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
609  }
610  print '<br>';
611  $db->free($resql);
612 }
613 
614 // Browser
615 print '<br>';
616 print '<strong>'.$langs->trans("Browser").'</strong>:<br>';
617 if (!in_array($conf->browser->name, array('chrome', 'opera', 'safari', 'firefox'))) {
618  print img_picto('', 'warning.png').' '.$langs->trans("BrowserIsKO", $conf->browser->name);
619 } else {
620  print img_picto('', 'tick.png').' '.$langs->trans("BrowserIsOK", $conf->browser->name);
621 }
622 print '<br>';
623 
624 // End of page
625 llxFooter();
626 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
version_php
version_php()
Return PHP version.
Definition: functions2.lib.php:1885
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
currentToken
currentToken()
Return the value of token currently saved into session with name 'token'.
Definition: functions.lib.php:10889
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59