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