Passed
Push — master ( 5feb35...1007d6 )
by Alxarafe
33:05
created
Base/AlixarView.php 1 patch
Spacing   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 // html header
117 117
         $this->top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
118 118
 
119
-        print '<body id="mainbody"' . ($morecssonbody ? ' class="' . $morecssonbody . '"' : '') . '>' . "\n";
119
+        print '<body id="mainbody"'.($morecssonbody ? ' class="'.$morecssonbody.'"' : '').'>'."\n";
120 120
 
121 121
 // top menu and left menu area
122 122
         if (empty(Globals::$conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         }
125 125
 
126 126
         if (empty(Globals::$conf->dol_hide_leftmenu)) {
127
-            $this->left_menu('', $help_url, '', '', 1, $title, 1);  // $menumanager is retreived with a global $menumanager inside this function
127
+            $this->left_menu('', $help_url, '', '', 1, $title, 1); // $menumanager is retreived with a global $menumanager inside this function
128 128
         }
129 129
 
130 130
 // main area
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
          * Top menu
176 176
          */
177 177
         if ((empty(Globals::$conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int')) && (!defined('NOREQUIREMENU') || !constant('NOREQUIREMENU'))) {
178
-            print "\n" . '<!-- Start top horizontal -->' . "\n";
178
+            print "\n".'<!-- Start top horizontal -->'."\n";
179 179
 
180
-            print '<div class="side-nav-vert' . (DolUtils::GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '') . '"><div id="id-top">';  // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible.
180
+            print '<div class="side-nav-vert'.(DolUtils::GETPOST('dol_invisible_topmenu', 'int') ? ' hidden' : '').'"><div id="id-top">'; // dol_invisible_topmenu differs from dol_hide_topmenu: dol_invisible_topmenu means we output menu but we make it invisible.
181 181
 // Show menu entries
182
-            print '<div id="tmenu_tooltip' . (empty(Globals::$conf->global->MAIN_MENU_INVERT) ? '' : 'invert') . '" class="tmenu">' . "\n";
182
+            print '<div id="tmenu_tooltip'.(empty(Globals::$conf->global->MAIN_MENU_INVERT) ? '' : 'invert').'" class="tmenu">'."\n";
183 183
             Globals::$menuManager->atarget = $target;
184
-            Globals::$menuManager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks));      // This contains a \n
184
+            Globals::$menuManager->showmenu('top', array('searchform' => $searchform, 'bookmarks' => $bookmarks)); // This contains a \n
185 185
             print "</div>\n";
186 186
 
187 187
 // Define link to login card
@@ -189,36 +189,36 @@  discard block
 block discarded – undo
189 189
             if (!empty(Globals::$conf->global->MAIN_APPLICATION_TITLE)) {
190 190
                 $appli = Globals::$conf->global->MAIN_APPLICATION_TITLE;
191 191
                 if (preg_match('/\d\.\d/', $appli)) {
192
-                    if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli))
193
-                        $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core
192
+                    if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli))
193
+                        $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
194 194
                 } else
195
-                    $appli .= " " . DOL_VERSION;
195
+                    $appli .= " ".DOL_VERSION;
196 196
             } else
197
-                $appli .= " " . DOL_VERSION;
197
+                $appli .= " ".DOL_VERSION;
198 198
 
199 199
             if (!empty(Globals::$conf->global->MAIN_FEATURES_LEVEL))
200
-                $appli .= "<br>" . Globals::$langs->trans("LevelOfFeature") . ': ' . Globals::$conf->global->MAIN_FEATURES_LEVEL;
200
+                $appli .= "<br>".Globals::$langs->trans("LevelOfFeature").': '.Globals::$conf->global->MAIN_FEATURES_LEVEL;
201 201
 
202 202
             $logouttext = '';
203 203
             if (empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
204 204
 //$logouthtmltext=$appli.'<br>';
205 205
                 $logouthtmltext = '';
206 206
                 if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') { {
207
-                        $logouthtmltext .= Globals::$langs->trans("Logout") . '<br>';
207
+                        $logouthtmltext .= Globals::$langs->trans("Logout").'<br>';
208 208
                     }
209 209
 
210 210
 //$logouttext .='<a accesskey="l" href="'.DOL_BASE_URI.'/user/logout.php">';
211
-                    $logouttext .= '<a accesskey="l" href="' . BASE_URI . '?controller=user&method=logout">';
211
+                    $logouttext .= '<a accesskey="l" href="'.BASE_URI.'?controller=user&method=logout">';
212 212
 //$logouttext .= img_picto(Globals::$langs->trans('Logout').":".Globals::$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
213 213
                     $logouttext .= '<span class="fa fa-sign-out atoplogin"></span>';
214 214
                     $logouttext .= '</a>';
215 215
                 } else {
216 216
                     $logouthtmltext .= Globals::$langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]);
217
-                    $logouttext .= img_picto(Globals::$langs->trans('Logout') . ":" . Globals::$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
217
+                    $logouttext .= img_picto(Globals::$langs->trans('Logout').":".Globals::$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
218 218
                 }
219 219
             }
220 220
 
221
-            print '<div class="login_block">' . "\n";
221
+            print '<div class="login_block">'."\n";
222 222
 
223 223
 // Add login user link
224 224
             $toprightmenu .= '<div class="login_block_user">';
@@ -229,18 +229,18 @@  discard block
 block discarded – undo
229 229
             $toprightmenu .= Globals::$user->getNomUrl($mode, '', 1, 0, 11, 0, (Globals::$user->firstname ? 'firstname' : -1), 'atoplogin');
230 230
             $toprightmenu .= '</div></div>';
231 231
 
232
-            $toprightmenu .= '</div>' . "\n";
232
+            $toprightmenu .= '</div>'."\n";
233 233
 
234 234
             $toprightmenu .= '<div class="login_block_other">';
235 235
 
236 236
 // Execute hook printTopRightMenu (hooks should output string like '<div class="login"><a href="">mylink</a></div>')
237 237
             $parameters = array();
238
-            $result = Globals::$hookManager->executeHooks('printTopRightMenu', $parameters);    // Note that $action and $object may have been modified by some hooks
238
+            $result = Globals::$hookManager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks
239 239
             if (is_numeric($result)) {
240 240
                 if ($result == 0)
241
-                    $toprightmenu .= Globals::$hookManager->resPrint;  // add
241
+                    $toprightmenu .= Globals::$hookManager->resPrint; // add
242 242
                 else
243
-                    $toprightmenu = Globals::$hookManager->resPrint;      // replace
243
+                    $toprightmenu = Globals::$hookManager->resPrint; // replace
244 244
             }
245 245
             else {
246 246
                 $toprightmenu .= $result; // For backward compatibility
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 // Link to module builder
250 250
             if (!empty(Globals::$conf->modulebuilder->enabled)) {
251 251
 //$text = '<a href="' . DOL_BASE_URI . '/modulebuilder/index.php?mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
252
-                $text = '<a href="' . BASE_URI . '?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
252
+                $text = '<a href="'.BASE_URI.'?controller=modulebuilder&method=index&mainmenu=home&leftmenu=admintools" target="_modulebuilder">';
253 253
 //$text.= img_picto(":".Globals::$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
254 254
                 $text .= '<span class="fa fa-bug atoplogin"></span>';
255 255
                 $text .= '</a>';
@@ -263,12 +263,12 @@  discard block
 block discarded – undo
263 263
                 if (is_array($_POST)) {
264 264
                     foreach ($_POST as $key => $value) {
265 265
                         if ($key !== 'action' && $key !== 'password' && !is_array($value)) {
266
-                            $qs .= '&' . $key . '=' . urlencode($value);
266
+                            $qs .= '&'.$key.'='.urlencode($value);
267 267
                         }
268 268
                     }
269 269
                 }
270
-                $qs .= (($qs && $morequerystring) ? '&' : '') . $morequerystring;
271
-                $text = '<a href="' . dol_escape_htmltag($_SERVER["PHP_SELF"]) . '?' . $qs . ($qs ? '&' : '') . 'optioncss=print" target="_blank">';
270
+                $qs .= (($qs && $morequerystring) ? '&' : '').$morequerystring;
271
+                $text = '<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs ? '&' : '').'optioncss=print" target="_blank">';
272 272
 //$text.= img_picto(":".Globals::$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
273 273
                 $text .= '<span class="fa fa-print atoplogin"></span>';
274 274
                 $text .= '</a>';
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
                     $text = '';
298 298
                     if (!empty(Globals::$conf->global->MAIN_SHOWDATABASENAMEINHELPPAGESLINK)) {
299 299
                         Globals::$langs->load('admin');
300
-                        $appli .= '<br>' . Globals::$langs->trans("Database") . ': ' . $db->database_name;
300
+                        $appli .= '<br>'.Globals::$langs->trans("Database").': '.$db->database_name;
301 301
                     }
302
-                    $title = $appli . '<br>';
302
+                    $title = $appli.'<br>';
303 303
                     $title .= Globals::$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage' : 'GoToHelpPage');
304 304
                     if ($mode == 'wiki') {
305
-                        $title .= ' - ' . Globals::$langs->trans("PageWiki") . ' &quot;' . dol_escape_htmltag(strtr($helppage, '_', ' ')) . '&quot;';
305
+                        $title .= ' - '.Globals::$langs->trans("PageWiki").' &quot;'.dol_escape_htmltag(strtr($helppage, '_', ' ')).'&quot;';
306 306
                     }
307 307
                     $text .= '<a class="help" target="_blank" rel="noopener" href="';
308 308
                     if ($mode == 'wiki') {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 
329 329
             print $toprightmenu;
330 330
 
331
-            print "</div>\n";  // end div class="login_block"
331
+            print "</div>\n"; // end div class="login_block"
332 332
 
333 333
             print '</div></div>';
334 334
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
         }
338 338
 
339 339
         if (empty(Globals::$conf->dol_hide_leftmenu) && empty(Globals::$conf->dol_use_jmobile))
340
-            print '<!-- Begin div id-container --><div id="id-container" class="id-container' . ($morecss ? ' ' . $morecss : '') . '">';
340
+            print '<!-- Begin div id-container --><div id="id-container" class="id-container'.($morecss ? ' '.$morecss : '').'">';
341 341
     }
342 342
 
343 343
     /**
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 // Instantiate hooks of thirdparty module
370 370
             Globals::$hookManager->initHooks(array('searchform', 'leftblock'));
371 371
 
372
-            print "\n" . '<!-- Begin side-nav id-left -->' . "\n" . '<div class="side-nav"><div id="id-left">' . "\n";
372
+            print "\n".'<!-- Begin side-nav id-left -->'."\n".'<div class="side-nav"><div id="id-left">'."\n";
373 373
 
374 374
             if (Globals::$conf->browser->layout == 'phone')
375 375
                 Globals::$conf->global->MAIN_USE_OLD_SEARCH_FORM = 1; // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ?
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             }
382 382
             $selected = -1;
383 383
             $usedbyinclude = 1;
384
-            include_once DOL_BASE_PATH . '/core/ajax/selectsearchbox.php'; // This set $arrayresult
384
+            include_once DOL_BASE_PATH.'/core/ajax/selectsearchbox.php'; // This set $arrayresult
385 385
 
386 386
             if (Globals::$conf->use_javascript_ajax && empty(Globals::$conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
387 387
 //$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_BASE_URI.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, Globals::$langs->trans("Search"), 1);
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 // Execute hook printSearchForm
397 397
             $parameters = array('searchform' => $searchform);
398 398
 
399
-            $reshook = Globals::$hookManager->executeHooks('printSearchForm', $parameters);    // Note that $action and $object may have been modified by some hooks
399
+            $reshook = Globals::$hookManager->executeHooks('printSearchForm', $parameters); // Note that $action and $object may have been modified by some hooks
400 400
             if (empty($reshook)) {
401 401
                 $searchform .= Globals::$hookManager->resPrint;
402 402
             } else
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
 
405 405
 // Force special value for $searchform
406 406
             if (!empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) || empty(Globals::$conf->use_javascript_ajax)) {
407
-                $urltosearch = DOL_BASE_URI . '/core/search_page.php?showtitlebefore=1';
408
-                $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="' . $urltosearch . '" alt="' . dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")) . '">' . Globals::$langs->trans("Search") . '...</a></div></div>';
407
+                $urltosearch = DOL_BASE_URI.'/core/search_page.php?showtitlebefore=1';
408
+                $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="'.$urltosearch.'" alt="'.dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")).'">'.Globals::$langs->trans("Search").'...</a></div></div>';
409 409
             } elseif (Globals::$conf->use_javascript_ajax && !empty(Globals::$conf->global->MAIN_USE_OLD_SEARCH_FORM)) {
410
-                $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="' . dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")) . '">' . Globals::$langs->trans("Search") . '...</a></div><div id="divsearchforms2" style="display: none">' . $searchform . '</div>';
410
+                $searchform = '<div class="blockvmenuimpair blockvmenusearchphone"><div id="divsearchforms1"><a href="#" alt="'.dol_escape_htmltag(Globals::$langs->trans("ShowSearchFields")).'">'.Globals::$langs->trans("Search").'...</a></div><div id="divsearchforms2" style="display: none">'.$searchform.'</div>';
411 411
                 $searchform .= '<script type="text/javascript">
412 412
             	jQuery(document).ready(function () {
413 413
             		jQuery("#divsearchforms1").click(function(){
@@ -420,16 +420,16 @@  discard block
 block discarded – undo
420 420
 
421 421
 // Define $bookmarks
422 422
             if (!empty(Globals::$conf->bookmark->enabled) && Globals::$user->rights->bookmark->lire) {
423
-                include_once DOL_BASE_PATH . '/bookmarks/bookmarks.lib.php';
423
+                include_once DOL_BASE_PATH.'/bookmarks/bookmarks.lib.php';
424 424
                 Globals::$langs->load("bookmarks");
425 425
 
426 426
                 $bookmarks = printBookmarksList($db, Globals::$langs);
427 427
             }
428 428
 
429 429
 // Left column
430
-            print '<!-- Begin left menu -->' . "\n";
430
+            print '<!-- Begin left menu -->'."\n";
431 431
 
432
-            print '<div class="vmenu"' . (empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"') . '>' . "\n\n";
432
+            print '<div class="vmenu"'.(empty(Globals::$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' title="Left menu"').'>'."\n\n";
433 433
 
434 434
 // Show left menu with other forms
435 435
             Globals::$menuManager->menu_array = $menu_array_before;
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 // Dolibarr version + help + bug report link
439 439
             print "\n";
440 440
             print "<!-- Begin Help Block-->\n";
441
-            print '<div id="blockvmenuhelp" class="blockvmenuhelp">' . "\n";
441
+            print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n";
442 442
 
443 443
 // Version
444 444
             if (empty(Globals::$conf->global->MAIN_HIDE_VERSION)) {    // Version is already on help picto and on login page.
@@ -460,15 +460,15 @@  discard block
 block discarded – undo
460 460
                     $appli = Globals::$conf->global->MAIN_APPLICATION_TITLE;
461 461
                     $doliurl = '';
462 462
                     if (preg_match('/\d\.\d/', $appli)) {
463
-                        if (!preg_match('/' . preg_quote(DOL_VERSION) . '/', $appli))
464
-                            $appli .= " (" . DOL_VERSION . ")"; // If new title contains a version that is different than core
463
+                        if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli))
464
+                            $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
465 465
                     } else
466
-                        $appli .= " " . DOL_VERSION;
466
+                        $appli .= " ".DOL_VERSION;
467 467
                 } else
468
-                    $appli .= " " . DOL_VERSION;
468
+                    $appli .= " ".DOL_VERSION;
469 469
                 print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">';
470 470
                 if ($doliurl)
471
-                    print '<a class="help" target="_blank" rel="noopener" href="' . $doliurl . '">';
471
+                    print '<a class="help" target="_blank" rel="noopener" href="'.$doliurl.'">';
472 472
                 else
473 473
                     print '<span class="help">';
474 474
                 print $appli;
@@ -476,12 +476,12 @@  discard block
 block discarded – undo
476 476
                     print '</a>';
477 477
                 else
478 478
                     print '</span>';
479
-                print '</div>' . "\n";
479
+                print '</div>'."\n";
480 480
             }
481 481
 
482 482
 // Link to bugtrack
483 483
             if (!empty(Globals::$conf->global->MAIN_BUGTRACK_ENABLELINK)) {
484
-                require_once DOL_BASE_PATH . '/core/lib/functions2.lib.php';
484
+                require_once DOL_BASE_PATH.'/core/lib/functions2.lib.php';
485 485
 
486 486
                 $bugbaseurl = 'https://github.com/Dolibarr/dolibarr/issues/new';
487 487
                 $bugbaseurl .= '?title=';
@@ -490,16 +490,16 @@  discard block
 block discarded – undo
490 490
                 $bugbaseurl .= urlencode("# Bug\n");
491 491
                 $bugbaseurl .= urlencode("\n");
492 492
                 $bugbaseurl .= urlencode("## Environment\n");
493
-                $bugbaseurl .= urlencode("- **Version**: " . DOL_VERSION . "\n");
494
-                $bugbaseurl .= urlencode("- **OS**: " . php_uname('s') . "\n");
495
-                $bugbaseurl .= urlencode("- **Web server**: " . $_SERVER["SERVER_SOFTWARE"] . "\n");
496
-                $bugbaseurl .= urlencode("- **PHP**: " . php_sapi_name() . ' ' . phpversion() . "\n");
497
-                $bugbaseurl .= urlencode("- **Database**: " . $db::LABEL . ' ' . $db->getVersion() . "\n");
498
-                $bugbaseurl .= urlencode("- **URL**: " . $_SERVER["REQUEST_URI"] . "\n");
493
+                $bugbaseurl .= urlencode("- **Version**: ".DOL_VERSION."\n");
494
+                $bugbaseurl .= urlencode("- **OS**: ".php_uname('s')."\n");
495
+                $bugbaseurl .= urlencode("- **Web server**: ".$_SERVER["SERVER_SOFTWARE"]."\n");
496
+                $bugbaseurl .= urlencode("- **PHP**: ".php_sapi_name().' '.phpversion()."\n");
497
+                $bugbaseurl .= urlencode("- **Database**: ".$db::LABEL.' '.$db->getVersion()."\n");
498
+                $bugbaseurl .= urlencode("- **URL**: ".$_SERVER["REQUEST_URI"]."\n");
499 499
                 $bugbaseurl .= urlencode("\n");
500 500
                 $bugbaseurl .= urlencode("## Report\n");
501 501
                 print '<div id="blockvmenuhelpbugreport" class="blockvmenuhelp">';
502
-                print '<a class="help" target="_blank" rel="noopener" href="' . $bugbaseurl . '">' . Globals::$langs->trans("FindBug") . '</a>';
502
+                print '<a class="help" target="_blank" rel="noopener" href="'.$bugbaseurl.'">'.Globals::$langs->trans("FindBug").'</a>';
503 503
                 print '</div>';
504 504
             }
505 505
 
@@ -513,14 +513,14 @@  discard block
 block discarded – undo
513 513
 
514 514
 // Execute hook printLeftBlock
515 515
             $parameters = array();
516
-            $reshook = Globals::$hookManager->executeHooks('printLeftBlock', $parameters);    // Note that $action and $object may have been modified by some hooks
516
+            $reshook = Globals::$hookManager->executeHooks('printLeftBlock', $parameters); // Note that $action and $object may have been modified by some hooks
517 517
             print Globals::$hookManager->resPrint;
518 518
 
519 519
             print '</div></div> <!-- End side-nav id-left -->'; // End div id="side-nav" div id="id-left"
520 520
         }
521 521
 
522 522
         print "\n";
523
-        print '<!-- Begin right area -->' . "\n";
523
+        print '<!-- Begin right area -->'."\n";
524 524
 
525 525
         if (empty($leftmenuwithoutmainarea))
526 526
             main_area($title);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 
542 542
         print "\n";
543 543
 
544
-        print '<!-- Begin div class="fiche" -->' . "\n" . '<div class="fiche">' . "\n";
544
+        print '<!-- Begin div class="fiche" -->'."\n".'<div class="fiche">'."\n";
545 545
 
546 546
         if (!empty(Globals::$conf->global->MAIN_ONLY_LOGIN_ALLOWED))
547 547
             print info_admin(Globals::$langs->trans("WarningYouAreInMaintenanceMode", Globals::$conf->global->MAIN_ONLY_LOGIN_ALLOWED));
@@ -607,17 +607,17 @@  discard block
 block discarded – undo
607 607
         // global Globals::$conf, Globals::$langs, Globals::$user;
608 608
 
609 609
         $ret = '';
610
-        $ret .= '<form action="' . $urlaction . '" method="post" class="searchform">';
611
-        $ret .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
610
+        $ret .= '<form action="'.$urlaction.'" method="post" class="searchform">';
611
+        $ret .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
612 612
         $ret .= '<input type="hidden" name="mode" value="search">';
613
-        $ret .= '<input type="hidden" name="savelogin" value="' . dol_escape_htmltag(Globals::$user->login) . '">';
613
+        $ret .= '<input type="hidden" name="savelogin" value="'.dol_escape_htmltag(Globals::$user->login).'">';
614 614
         if ($showtitlebefore)
615
-            $ret .= $title . ' ';
616
-        $ret .= '<input type="text" class="flat ' . $htmlmorecss . '"';
617
-        $ret .= ' style="text-indent: 22px; background-image: url(\'' . $img . '\'); background-repeat: no-repeat; background-position: 3px;"';
618
-        $ret .= ($accesskey ? ' accesskey="' . $accesskey . '"' : '');
619
-        $ret .= ' placeholder="' . strip_tags($title) . '"';
620
-        $ret .= ' name="' . $htmlinputname . '" id="' . $prefhtmlinputname . $htmlinputname . '" />';
615
+            $ret .= $title.' ';
616
+        $ret .= '<input type="text" class="flat '.$htmlmorecss.'"';
617
+        $ret .= ' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"';
618
+        $ret .= ($accesskey ? ' accesskey="'.$accesskey.'"' : '');
619
+        $ret .= ' placeholder="'.strip_tags($title).'"';
620
+        $ret .= ' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />';
621 621
 //$ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.Globals::$langs->trans("Go").'">';
622 622
         $ret .= '<button type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px">';
623 623
         $ret .= '<span class="fa fa-search"></span>';
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         // global $delayedhtmlcontent;
643 643
         // global $contextpage, $page, $limit;
644 644
 
645
-        $ext = 'layout=' . Globals::$conf->browser->layout . '&version=' . urlencode(DOL_VERSION);
645
+        $ext = 'layout='.Globals::$conf->browser->layout.'&version='.urlencode(DOL_VERSION);
646 646
 
647 647
 // Global html output events ($mesgs, $errors, $warnings)
648 648
         dol_htmloutput_events($disabledoutputofmessages);
@@ -652,15 +652,15 @@  discard block
 block discarded – undo
652 652
         if (is_object(Globals::$user) && !empty(Globals::$user->lastsearch_values_tmp) && is_array(Globals::$user->lastsearch_values_tmp)) {
653 653
 // Clean and save data
654 654
             foreach (Globals::$user->lastsearch_values_tmp as $key => $val) {
655
-                unset($_SESSION['lastsearch_values_tmp_' . $key]);   // Clean array to rebuild it just after
655
+                unset($_SESSION['lastsearch_values_tmp_'.$key]); // Clean array to rebuild it just after
656 656
                 if (count($val) && empty($_POST['button_removefilter'])) { // If there is search criteria to save and we did not click on 'Clear filter' button
657 657
                     if (empty($val['sortfield']))
658 658
                         unset($val['sortfield']);
659 659
                     if (empty($val['sortorder']))
660 660
                         unset($val['sortorder']);
661
-                    dol_syslog('Save lastsearch_values_tmp_' . $key . '=' . json_encode($val, 0) . " (systematic recording of last search criterias)");
662
-                    $_SESSION['lastsearch_values_tmp_' . $key] = json_encode($val);
663
-                    unset($_SESSION['lastsearch_values_' . $key]);
661
+                    dol_syslog('Save lastsearch_values_tmp_'.$key.'='.json_encode($val, 0)." (systematic recording of last search criterias)");
662
+                    $_SESSION['lastsearch_values_tmp_'.$key] = json_encode($val);
663
+                    unset($_SESSION['lastsearch_values_'.$key]);
664 664
                 }
665 665
             }
666 666
         }
@@ -669,37 +669,37 @@  discard block
 block discarded – undo
669 669
         $relativepathstring = $_SERVER["PHP_SELF"];
670 670
 // Clean $relativepathstring
671 671
         if (constant('DOL_BASE_URI'))
672
-            $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_BASE_URI'), '/') . '/', '', $relativepathstring);
672
+            $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_BASE_URI'), '/').'/', '', $relativepathstring);
673 673
         $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
674 674
         $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
675 675
         if (preg_match('/list\.php$/', $relativepathstring)) {
676
-            unset($_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring]);
677
-            unset($_SESSION['lastsearch_page_tmp_' . $relativepathstring]);
678
-            unset($_SESSION['lastsearch_limit_tmp_' . $relativepathstring]);
676
+            unset($_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring]);
677
+            unset($_SESSION['lastsearch_page_tmp_'.$relativepathstring]);
678
+            unset($_SESSION['lastsearch_limit_tmp_'.$relativepathstring]);
679 679
 
680 680
             if (!empty($contextpage))
681
-                $_SESSION['lastsearch_contextpage_tmp_' . $relativepathstring] = $contextpage;
681
+                $_SESSION['lastsearch_contextpage_tmp_'.$relativepathstring] = $contextpage;
682 682
             if (!empty($page) && $page > 1)
683
-                $_SESSION['lastsearch_page_tmp_' . $relativepathstring] = $page;
683
+                $_SESSION['lastsearch_page_tmp_'.$relativepathstring] = $page;
684 684
             if (!empty($limit) && $limit != Globals::$conf->limit)
685
-                $_SESSION['lastsearch_limit_tmp_' . $relativepathstring] = $limit;
685
+                $_SESSION['lastsearch_limit_tmp_'.$relativepathstring] = $limit;
686 686
 
687
-            unset($_SESSION['lastsearch_contextpage_' . $relativepathstring]);
688
-            unset($_SESSION['lastsearch_page_' . $relativepathstring]);
689
-            unset($_SESSION['lastsearch_limit_' . $relativepathstring]);
687
+            unset($_SESSION['lastsearch_contextpage_'.$relativepathstring]);
688
+            unset($_SESSION['lastsearch_page_'.$relativepathstring]);
689
+            unset($_SESSION['lastsearch_limit_'.$relativepathstring]);
690 690
         }
691 691
 
692 692
 // Core error message
693 693
         if (!empty(Globals::$conf->global->MAIN_CORE_ERROR)) {
694 694
 // Ajax version
695 695
             if (Globals::$conf->use_javascript_ajax) {
696
-                $title = img_warning() . ' ' . Globals::$langs->trans('CoreErrorTitle');
696
+                $title = img_warning().' '.Globals::$langs->trans('CoreErrorTitle');
697 697
                 print ajax_dialog($title, Globals::$langs->trans('CoreErrorMessage'));
698 698
             }
699 699
 // html version
700 700
             else {
701
-                $msg = img_warning() . ' ' . Globals::$langs->trans('CoreErrorMessage');
702
-                print '<div class="error">' . $msg . '</div>';
701
+                $msg = img_warning().' '.Globals::$langs->trans('CoreErrorMessage');
702
+                print '<div class="error">'.$msg.'</div>';
703 703
             }
704 704
 
705 705
 //define("MAIN_CORE_ERROR",0);      // Constant was defined and we can't change value of a constant
@@ -707,17 +707,17 @@  discard block
 block discarded – undo
707 707
 
708 708
         print "\n\n";
709 709
 
710
-        print '</div> <!-- End div class="fiche" -->' . "\n"; // End div fiche
710
+        print '</div> <!-- End div class="fiche" -->'."\n"; // End div fiche
711 711
 
712 712
         if (empty(Globals::$conf->dol_hide_leftmenu))
713
-            print '</div> <!-- End div id-right -->' . "\n"; // End div id-right
713
+            print '</div> <!-- End div id-right -->'."\n"; // End div id-right
714 714
 
715 715
         if (empty(Globals::$conf->dol_hide_leftmenu) && empty(Globals::$conf->dol_use_jmobile))
716
-            print '</div> <!-- End div id-container -->' . "\n"; // End div container
716
+            print '</div> <!-- End div id-container -->'."\n"; // End div container
717 717
 
718 718
         print "\n";
719 719
         if ($comment)
720
-            print '<!-- ' . $comment . ' -->' . "\n";
720
+            print '<!-- '.$comment.' -->'."\n";
721 721
 
722 722
         printCommonFooter($zone);
723 723
 
@@ -725,8 +725,8 @@  discard block
 block discarded – undo
725 725
             print $delayedhtmlcontent;
726 726
 
727 727
         if (!empty(Globals::$conf->use_javascript_ajax)) {
728
-            print "\n" . '<!-- Includes JS Footer of Dolibarr -->' . "\n";
729
-            print '<script type="text/javascript" src="' . BASE_URI . '?controller=core/js/&method=lib_foot.js&lang=' . Globals::$langs->defaultlang . ($ext ? '&' . $ext : '') . '"></script>' . "\n";
728
+            print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
729
+            print '<script type="text/javascript" src="'.BASE_URI.'?controller=core/js/&method=lib_foot.js&lang='.Globals::$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n";
730 730
         }
731 731
 
732 732
 // Wrapper to add log when clicking on download or preview
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
                 <script type="text/javascript">
739 739
                     jQuery(document).ready(function () {
740 740
                         $('a.documentpreview').click(function () {
741
-                            $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>'
741
+                            $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>'
742 742
                                     , {
743 743
                                         id:<?php echo $object->id; ?>
744 744
                                         , element: '<?php echo $object->element ?>'
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
                             );
748 748
                         });
749 749
                         $('a.documentdownload').click(function () {
750
-                            $.post('<?php echo DOL_BASE_URI . "/blockedlog/ajax/block-add.php" ?>'
750
+                            $.post('<?php echo DOL_BASE_URI."/blockedlog/ajax/block-add.php" ?>'
751 751
                                     , {
752 752
                                         id:<?php echo $object->id; ?>
753 753
                                         , element: '<?php echo $object->element ?>'
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
 
764 764
 // A div for the address popup
765 765
         print "\n<!-- A div to allow dialog popup -->\n";
766
-        print '<div id="dialogforpopup" style="display: none;"></div>' . "\n";
766
+        print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
767 767
 
768 768
         print "</body>\n";
769 769
 
Please login to merge, or discard this patch.
Base/User.php 1 patch
Spacing   +337 added lines, -337 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public $skype;
56 56
     public $twitter;
57 57
     public $facebook;
58
-    public $job;   // job position
58
+    public $job; // job position
59 59
     public $signature;
60 60
 
61 61
     /**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public $address;
65 65
     public $zip;
66 66
     public $town;
67
-    public $state_id;  // The state/department
67
+    public $state_id; // The state/department
68 68
     public $state_code;
69 69
     public $state;
70 70
     public $office_phone;
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
     public $datepreviouslogin;
119 119
     public $photo;
120 120
     public $lang;
121
-    public $rights;                        // Array of permissions user->rights->permx
122
-    public $all_permissions_are_loaded;    // All permission are loaded
123
-    public $nb_rights;              // Number of rights granted to the user
124
-    private $_tab_loaded = array();     // Cache array of already loaded permissions
125
-    public $conf;             // To store personal config
126
-    public $default_values;         // To store default values for user
127
-    public $lastsearch_values_tmp;  // To store current search criterias for user
128
-    public $lastsearch_values;      // To store last saved search criterias for user
129
-    public $users = array();  // To store all tree of users hierarchy
130
-    public $parentof;    // To store an array of all parents for all ids.
121
+    public $rights; // Array of permissions user->rights->permx
122
+    public $all_permissions_are_loaded; // All permission are loaded
123
+    public $nb_rights; // Number of rights granted to the user
124
+    private $_tab_loaded = array(); // Cache array of already loaded permissions
125
+    public $conf; // To store personal config
126
+    public $default_values; // To store default values for user
127
+    public $lastsearch_values_tmp; // To store current search criterias for user
128
+    public $lastsearch_values; // To store last saved search criterias for user
129
+    public $users = array(); // To store all tree of users hierarchy
130
+    public $parentof; // To store an array of all parents for all ids.
131 131
     private $cache_childids;
132
-    public $accountancy_code;   // Accountancy code in prevision of the complete accountancy module
133
-    public $thm;     // Average cost of employee - Used for valuation of time spent
134
-    public $tjm;     // Average cost of employee
135
-    public $salary;     // Monthly salary       - Denormalized value from llx_user_employment
136
-    public $salaryextra;    // Monthly salary extra - Denormalized value from llx_user_employment
137
-    public $weeklyhours;    // Weekly hours         - Denormalized value from llx_user_employment
138
-    public $color;      // Define background color for user in agenda
139
-    public $dateemployment;   // Define date of employment by company
140
-    public $dateemploymentend;  // Define date of employment end by company
132
+    public $accountancy_code; // Accountancy code in prevision of the complete accountancy module
133
+    public $thm; // Average cost of employee - Used for valuation of time spent
134
+    public $tjm; // Average cost of employee
135
+    public $salary; // Monthly salary       - Denormalized value from llx_user_employment
136
+    public $salaryextra; // Monthly salary extra - Denormalized value from llx_user_employment
137
+    public $weeklyhours; // Weekly hours         - Denormalized value from llx_user_employment
138
+    public $color; // Define background color for user in agenda
139
+    public $dateemployment; // Define date of employment by company
140
+    public $dateemploymentend; // Define date of employment end by company
141 141
     public $default_c_exp_tax_cat;
142 142
     public $default_range;
143 143
     public $fields = array(
@@ -212,37 +212,37 @@  discard block
 block discarded – undo
212 212
         $sql .= " u.color,";
213 213
         $sql .= " u.dateemployment, u.dateemploymentend,";
214 214
         $sql .= " u.ref_int, u.ref_ext,";
215
-        $sql .= " u.default_range, u.default_c_exp_tax_cat,";   // Expense report default mode
215
+        $sql .= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode
216 216
         $sql .= " c.code as country_code, c.label as country,";
217 217
         $sql .= " d.code_departement as state_code, d.nom as state";
218
-        $sql .= " FROM " . MAIN_DB_PREFIX . "user as u";
219
-        $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON u.fk_country = c.rowid";
220
-        $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_departements as d ON u.fk_state = d.rowid";
218
+        $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
219
+        $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON u.fk_country = c.rowid";
220
+        $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON u.fk_state = d.rowid";
221 221
 
222 222
         if ($entity < 0) {
223 223
             if ((empty($conf->multicompany->enabled) || empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) && (!empty(Globals::$user->entity))) {
224
-                $sql .= " WHERE u.entity IN (0," . Globals::$conf->entity . ")";
224
+                $sql .= " WHERE u.entity IN (0,".Globals::$conf->entity.")";
225 225
             } else {
226
-                $sql .= " WHERE u.entity IS NOT NULL";    // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
226
+                $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
227 227
             }
228 228
         } else {  // The fetch was forced on an entity
229 229
             if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
230
-                $sql .= " WHERE u.entity IS NOT NULL";    // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
230
+                $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
231 231
             } else {
232
-                $sql .= " WHERE u.entity IN (0, " . (($entity != '' && $entity >= 0) ? $entity : Globals::$conf->entity) . ")";   // search in entity provided in parameter
232
+                $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : Globals::$conf->entity).")"; // search in entity provided in parameter
233 233
             }
234 234
         }
235 235
 
236 236
         if ($sid) {    // permet une recherche du user par son SID ActiveDirectory ou Samba
237 237
 //$sql .= " AND (u.ldap_sid = '" . Config::$dbEngine->escape($sid) . "' OR u.login = '" . Config::$dbEngine->escape($login) . "') LIMIT 1";
238
-            $sql .= " AND (u.ldap_sid = '" . $sid . "' OR u.login = '" . Config::$dbEngine->escape($login) . "') LIMIT 1";
238
+            $sql .= " AND (u.ldap_sid = '".$sid."' OR u.login = '".Config::$dbEngine->escape($login)."') LIMIT 1";
239 239
         } else if ($login) {
240 240
 // $sql .= " AND u.login = '" . Config::$dbEngine->escape($login) . "'";
241
-            $sql .= " AND u.login = '" . $login . "'";
241
+            $sql .= " AND u.login = '".$login."'";
242 242
         } else {
243
-            $sql .= " AND u.rowid = " . $id;
243
+            $sql .= " AND u.rowid = ".$id;
244 244
         }
245
-        $sql .= " ORDER BY u.entity ASC";    // Avoid random result when there is 2 login in 2 different entities
245
+        $sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities
246 246
 
247 247
         $result = Config::$dbEngine->select($sql);
248 248
 // echo "<p>SQL in 2477 of User: '$sql'</p>";
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
                 $this->datelastlogin = $obj->datel;
329 329
                 $this->datepreviouslogin = $obj->datep;
330 330
 
331
-                $this->societe_id = $obj->fk_soc;  // deprecated
331
+                $this->societe_id = $obj->fk_soc; // deprecated
332 332
                 $this->contact_id = $obj->fk_socpeople; // deprecated
333 333
                 $this->socid = $obj->fk_soc;
334 334
                 $this->contactid = $obj->fk_socpeople;
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                 $this->fetch_optionals();
350 350
             } else {
351 351
                 $this->error = "USERNOTFOUND";
352
-                DolUtils::dol_syslog(get_class($this) . "::fetch user not found", LOG_DEBUG);
352
+                DolUtils::dol_syslog(get_class($this)."::fetch user not found", LOG_DEBUG);
353 353
                 return 0;
354 354
             }
355 355
         } else {
@@ -360,9 +360,9 @@  discard block
 block discarded – undo
360 360
 // To get back the global configuration unique to the user
361 361
         if ($loadpersonalconf) {
362 362
 // Load user->conf for user
363
-            $sql = "SELECT param, value FROM " . MAIN_DB_PREFIX . "user_param";
364
-            $sql .= " WHERE fk_user = " . $this->id;
365
-            $sql .= " AND entity = " . Globals::$conf->entity;
363
+            $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param";
364
+            $sql .= " WHERE fk_user = ".$this->id;
365
+            $sql .= " AND entity = ".Globals::$conf->entity;
366 366
 //DolUtils::dol_syslog(get_class($this).'::fetch load personalized conf', LOG_DEBUG);
367 367
             $resql = Config::$dbEngine->select($sql);
368 368
             if (is_array($resql)) {
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 // global $conf;
401 401
 // Load user->default_values for user. TODO Save this in memcached ?
402 402
         $sql = "SELECT rowid, entity, type, page, param, value";
403
-        $sql .= " FROM " . MAIN_DB_PREFIX . "default_values";
404
-        $sql .= " WHERE entity IN (" . ($this->entity > 0 ? $this->entity . ", " : "") . Globals::$conf->entity . ")"; // Entity of user (if defined) + current entity
405
-        $sql .= " AND user_id IN (0" . ($this->id > 0 ? ", " . $this->id : "") . ")";       // User 0 (all) + me (if defined)
403
+        $sql .= " FROM ".MAIN_DB_PREFIX."default_values";
404
+        $sql .= " WHERE entity IN (".($this->entity > 0 ? $this->entity.", " : "").Globals::$conf->entity.")"; // Entity of user (if defined) + current entity
405
+        $sql .= " AND user_id IN (0".($this->id > 0 ? ", ".$this->id : "").")"; // User 0 (all) + me (if defined)
406 406
         $resql = Config::$dbEngine->select($sql);
407 407
         if (is_array($resql)) {
408 408
             foreach ($resql as $array) {
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 
451 451
         $entity = (!empty($entity) ? $entity : Globals::$conf->entity);
452 452
 
453
-        DolUtils::dol_syslog(get_class($this) . "::addrights $rid, $allmodule, $allperms, $entity");
453
+        DolUtils::dol_syslog(get_class($this)."::addrights $rid, $allmodule, $allperms, $entity");
454 454
         $error = 0;
455 455
         $whereforadd = '';
456 456
 
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
 // Si on a demande ajout d'un droit en particulier, on recupere
461 461
 // les caracteristiques (module, perms et subperms) de ce droit.
462 462
             $sql = "SELECT module, perms, subperms";
463
-            $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def";
464
-            $sql .= " WHERE id = '" . Config::$dbEngine->escape($rid) . "'";
465
-            $sql .= " AND entity = " . $entity;
463
+            $sql .= " FROM ".MAIN_DB_PREFIX."rights_def";
464
+            $sql .= " WHERE id = '".Config::$dbEngine->escape($rid)."'";
465
+            $sql .= " AND entity = ".$entity;
466 466
 
467 467
             $result = Config::$dbEngine->query($sql);
468 468
             if ($result) {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             }
477 477
 
478 478
 // Where pour la liste des droits a ajouter
479
-            $whereforadd = "id=" . Config::$dbEngine->escape($rid);
479
+            $whereforadd = "id=".Config::$dbEngine->escape($rid);
480 480
 // Ajout des droits induits
481 481
             if (!empty($subperms)) {
482 482
                 $whereforadd .= " OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
@@ -493,9 +493,9 @@  discard block
 block discarded – undo
493 493
                 if ($allmodule == 'allmodules') {
494 494
                     $whereforadd = 'allmodules';
495 495
                 } else {
496
-                    $whereforadd = "module='" . Config::$dbEngine->escape($allmodule) . "'";
496
+                    $whereforadd = "module='".Config::$dbEngine->escape($allmodule)."'";
497 497
                     if (!empty($allperms)) {
498
-                        $whereforadd .= " AND perms='" . Config::$dbEngine->escape($allperms) . "'";
498
+                        $whereforadd .= " AND perms='".Config::$dbEngine->escape($allperms)."'";
499 499
                     }
500 500
                 }
501 501
             }
@@ -505,10 +505,10 @@  discard block
 block discarded – undo
505 505
         if (!empty($whereforadd)) {
506 506
 //print "$module-$perms-$subperms";
507 507
             $sql = "SELECT id";
508
-            $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def";
509
-            $sql .= " WHERE entity = " . $entity;
508
+            $sql .= " FROM ".MAIN_DB_PREFIX."rights_def";
509
+            $sql .= " WHERE entity = ".$entity;
510 510
             if (!empty($whereforadd) && $whereforadd != 'allmodules') {
511
-                $sql .= " AND " . $whereforadd;
511
+                $sql .= " AND ".$whereforadd;
512 512
             }
513 513
 
514 514
             $result = Config::$dbEngine->query($sql);
@@ -519,10 +519,10 @@  discard block
 block discarded – undo
519 519
                     $obj = Config::$dbEngine->fetch_object($result);
520 520
                     $nid = $obj->id;
521 521
 
522
-                    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights WHERE fk_user = " . $this->id . " AND fk_id=" . $nid . " AND entity = " . $entity;
522
+                    $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id." AND fk_id=".$nid." AND entity = ".$entity;
523 523
                     if (!Config::$dbEngine->query($sql))
524 524
                         $error++;
525
-                    $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_rights (entity, fk_user, fk_id) VALUES (" . $entity . ", " . $this->id . ", " . $nid . ")";
525
+                    $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_rights (entity, fk_user, fk_id) VALUES (".$entity.", ".$this->id.", ".$nid.")";
526 526
                     if (!Config::$dbEngine->query($sql))
527 527
                         $error++;
528 528
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
         if (!$error && !$notrigger) {
539 539
             Globals::$langs->load("other");
540
-            $this->context = array('audit' => Globals::$langs->trans("PermissionsAdd") . ($rid ? ' (id=' . $rid . ')' : ''));
540
+            $this->context = array('audit' => Globals::$langs->trans("PermissionsAdd").($rid ? ' (id='.$rid.')' : ''));
541 541
 
542 542
 // Call trigger
543 543
             $result = $this->call_trigger('USER_MODIFY', Globals::$user);
@@ -581,9 +581,9 @@  discard block
 block discarded – undo
581 581
 // Si on a demande supression d'un droit en particulier, on recupere
582 582
 // les caracteristiques module, perms et subperms de ce droit.
583 583
             $sql = "SELECT module, perms, subperms";
584
-            $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def";
585
-            $sql .= " WHERE id = '" . Config::$dbEngine->escape($rid) . "'";
586
-            $sql .= " AND entity = " . $entity;
584
+            $sql .= " FROM ".MAIN_DB_PREFIX."rights_def";
585
+            $sql .= " WHERE id = '".Config::$dbEngine->escape($rid)."'";
586
+            $sql .= " AND entity = ".$entity;
587 587
 
588 588
             $result = Config::$dbEngine->query($sql);
589 589
             if ($result) {
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
             }
598 598
 
599 599
 // Where pour la liste des droits a supprimer
600
-            $wherefordel = "id=" . Config::$dbEngine->escape($rid);
600
+            $wherefordel = "id=".Config::$dbEngine->escape($rid);
601 601
 // Suppression des droits induits
602 602
             if ($subperms == 'lire' || $subperms == 'read') {
603 603
                 $wherefordel .= " OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
@@ -612,9 +612,9 @@  discard block
 block discarded – undo
612 612
                 if ($allmodule == 'allmodules') {
613 613
                     $wherefordel = 'allmodules';
614 614
                 } else {
615
-                    $wherefordel = "module='" . Config::$dbEngine->escape($allmodule) . "'";
615
+                    $wherefordel = "module='".Config::$dbEngine->escape($allmodule)."'";
616 616
                     if (!empty($allperms)) {
617
-                        $whereforadd .= " AND perms='" . Config::$dbEngine->escape($allperms) . "'";
617
+                        $whereforadd .= " AND perms='".Config::$dbEngine->escape($allperms)."'";
618 618
                     }
619 619
                 }
620 620
             }
@@ -624,10 +624,10 @@  discard block
 block discarded – undo
624 624
         if (!empty($wherefordel)) {
625 625
 //print "$module-$perms-$subperms";
626 626
             $sql = "SELECT id";
627
-            $sql .= " FROM " . MAIN_DB_PREFIX . "rights_def";
628
-            $sql .= " WHERE entity = " . $entity;
627
+            $sql .= " FROM ".MAIN_DB_PREFIX."rights_def";
628
+            $sql .= " WHERE entity = ".$entity;
629 629
             if (!empty($wherefordel) && $wherefordel != 'allmodules') {
630
-                $sql .= " AND " . $wherefordel;
630
+                $sql .= " AND ".$wherefordel;
631 631
             }
632 632
 
633 633
             $result = Config::$dbEngine->query($sql);
@@ -638,9 +638,9 @@  discard block
 block discarded – undo
638 638
                     $obj = Config::$dbEngine->fetch_object($result);
639 639
                     $nid = $obj->id;
640 640
 
641
-                    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_rights";
642
-                    $sql .= " WHERE fk_user = " . $this->id . " AND fk_id=" . $nid;
643
-                    $sql .= " AND entity = " . $entity;
641
+                    $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights";
642
+                    $sql .= " WHERE fk_user = ".$this->id." AND fk_id=".$nid;
643
+                    $sql .= " AND entity = ".$entity;
644 644
                     if (!Config::$dbEngine->query($sql)) {
645 645
                         $error++;
646 646
                     }
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
 
656 656
         if (!$error && !$notrigger) {
657 657
             Globals::$langs->load("other");
658
-            $this->context = array('audit' => Globals::$langs->trans("PermissionsDelete") . ($rid ? ' (id=' . $rid . ')' : ''));
658
+            $this->context = array('audit' => Globals::$langs->trans("PermissionsDelete").($rid ? ' (id='.$rid.')' : ''));
659 659
 
660 660
 // Call trigger
661 661
             $result = $this->call_trigger('USER_MODIFY', Globals::$user);
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
      */
683 683
     function clearrights()
684 684
     {
685
-        DolUtils::dol_syslog(get_class($this) . "::clearrights reset user->rights");
685
+        DolUtils::dol_syslog(get_class($this)."::clearrights reset user->rights");
686 686
         $this->rights = '';
687 687
         $this->all_permissions_are_loaded = false;
688 688
         $this->_tab_loaded = array();
@@ -715,19 +715,19 @@  discard block
 block discarded – undo
715 715
 // Recuperation des droits utilisateurs + recuperation des droits groupes
716 716
 // D'abord les droits utilisateurs
717