Passed
Push — master ( 3cffbe...0f9140 )
by Alxarafe
23:50
created
Views/LoginView.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     public function draw()
62 62
     {
63 63
         header('Cache-Control: Public, must-revalidate');
64
-        header("Content-type: text/html; charset=" . Globals::$conf->file->character_set_client);
64
+        header("Content-type: text/html; charset=".Globals::$conf->file->character_set_client);
65 65
 
66 66
         // Need global variable $title to be defined by caller (like dol_loginfunction)
67 67
         // Caller can also set 	$morelogincontent = array(['options']=>array('js'=>..., 'table'=>...);
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
         }
94 94
 
95 95
         $php_self = AlDolUtils::dol_escape_htmltag($_SERVER['PHP_SELF']);
96
-        $php_self .= AlDolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?' . AlDolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
96
+        $php_self .= AlDolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.AlDolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
97 97
         if (!preg_match('/mainmenu=/', $php_self)) {
98
-            $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?') . 'mainmenu=home';
98
+            $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';
99 99
         }
100 100
 
101 101
         $this->url = $php_self;
@@ -109,28 +109,28 @@  discard block
 block discarded – undo
109 109
           );
110 110
          */
111 111
         $arrayofjs = array(
112
-            DOL_BASE_URI . '/includes/jstz/jstz.min.js' . (empty(Globals::$conf->dol_use_jmobile) ? '' : '?version=' . urlencode(DOL_VERSION)),
113
-        DOL_BASE_URI . '/core/js/dst.js' . (empty(Globals::$conf->dol_use_jmobile) ? '' : '?version=' . urlencode(DOL_VERSION))
112
+            DOL_BASE_URI.'/includes/jstz/jstz.min.js'.(empty(Globals::$conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)),
113
+        DOL_BASE_URI.'/core/js/dst.js'.(empty(Globals::$conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION))
114 114
         );
115 115
 
116 116
         // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php.
117 117
         // We must keep the @, some tools use it to know it is login page and find true dolibarr version.
118 118
         // $titleofloginpage = Globals::$langs->trans('Login') . ' @ ' . $titletruedolibarrversion;
119
-        $titleofloginpage = Globals::$langs->trans('Login') . ' @ ' . DOL_VERSION;
119
+        $titleofloginpage = Globals::$langs->trans('Login').' @ '.DOL_VERSION;
120 120
 
121 121
         $disablenofollow = 1;
122
-        if (!preg_match('/' . constant('DOL_APPLICATION_TITLE') . '/', $this->title)) {
122
+        if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $this->title)) {
123 123
             $disablenofollow = 0;
124 124
         }
125 125
 
126 126
         print $this->top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow);
127 127
 
128 128
 
129
-        $colorbackhmenu1 = '60,70,100';      // topmenu
129
+        $colorbackhmenu1 = '60,70,100'; // topmenu
130 130
         if (!isset(Globals::$conf->global->THEME_ELDY_TOPMENU_BACK1)) {
131 131
             Globals::$conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
132 132
         }
133 133
         $colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty(Globals::$conf->global->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : Globals::$conf->global->THEME_ELDY_TOPMENU_BACK1) : (empty($user->conf->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $user->conf->THEME_ELDY_TOPMENU_BACK1);
134
-        $colorbackhmenu1 = join(',', AlDolUtils2::colorStringToArray($colorbackhmenu1));    // Normalize value to 'x,y,z'
134
+        $colorbackhmenu1 = join(',', AlDolUtils2::colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
135 135
     }
136 136
 }
Please login to merge, or discard this patch.
Views/CategoriesView.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -70,21 +70,21 @@  discard block
 block discarded – undo
70 70
             if ($action == 'create' || filter_input(INPUT_POST, "addcat") == 'addcat') {
71 71
                 AlDolUtils::dol_set_focus('#label');
72 72
 
73
-                print '<form action="' . $_SERVER['PHP_SELF'] . '?type=' . $type . '" method="POST">';
74
-                print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
75
-                print '<input type="hidden" name="urlfrom" value="' . $urlfrom . '">';
73
+                print '<form action="'.$_SERVER['PHP_SELF'].'?type='.$type.'" method="POST">';
74
+                print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
75
+                print '<input type="hidden" name="urlfrom" value="'.$urlfrom.'">';
76 76
                 print '<input type="hidden" name="action" value="add">';
77 77
                 print '<input type="hidden" name="addcat" value="addcat">';
78
-                print '<input type="hidden" name="id" value="' . AlDolUtils::GETPOST('origin', 'alpha') . '">';
79
-                print '<input type="hidden" name="type" value="' . $type . '">';
80
-                print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
78
+                print '<input type="hidden" name="id" value="'.AlDolUtils::GETPOST('origin', 'alpha').'">';
79
+                print '<input type="hidden" name="type" value="'.$type.'">';
80
+                print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
81 81
                 if ($origin)
82 82
                 {
83
-                    print '<input type="hidden" name="origin" value="' . $origin . '">';
83
+                    print '<input type="hidden" name="origin" value="'.$origin.'">';
84 84
                 }
85 85
                 if ($catorigin)
86 86
                 {
87
-                    print '<input type="hidden" name="catorigin" value="' . $catorigin . '">';
87
+                    print '<input type="hidden" name="catorigin" value="'.$catorigin.'">';
88 88
                 }
89 89
 
90 90
                 print load_fiche_titre($langs->trans("CreateCat"));
@@ -95,29 +95,29 @@  discard block
 block discarded – undo
95 95
 
96 96
                 // Ref
97 97
                 print '<tr>';
98
-                print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Ref") . '</td><td><input id="label" class="minwidth100" name="label" value="' . $label . '">';
98
+                print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input id="label" class="minwidth100" name="label" value="'.$label.'">';
99 99
                 print'</td></tr>';
100 100
 
101 101
                 // Description
102
-                print '<tr><td class="tdtop">' . $langs->trans("Description") . '</td><td>';
102
+                print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
103 103
                 //require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
104 104
                 $doleditor = new DolEditor('description', $description, '', 200, 'dolibarr_notes', '', false, true, Globals::$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_6, '90%');
105 105
                 $doleditor->Create();
106 106
                 print '</td></tr>';
107 107
 
108 108
                 // Color
109
-                print '<tr><td>' . $langs->trans("Color") . '</td><td>';
109
+                print '<tr><td>'.$langs->trans("Color").'</td><td>';
110 110
                 print $formother->selectColor($color, 'color');
111 111
                 print '</td></tr>';
112 112
 
113 113
                 // Parent category
114
-                print '<tr><td>' . $langs->trans("AddIn") . '</td><td>';
114
+                print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
115 115
                 print $form->select_all_categories($type, $catorigin, 'parent');
116 116
                 print ajax_combobox('parent');
117 117
                 print '</td></tr>';
118 118
 
119 119
                 $parameters = array();
120
-                $reshook = Globals::$hookManager->executeHooks('formObjectOptions', $parameters, $object, $action);    // Note that $action and $object may have been modified by hook
120
+                $reshook = Globals::$hookManager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
121 121
                 print Globals::$hookManager->resPrint;
122 122
                 if (empty($reshook)) {
123 123
                     print $object->showOptionals($extrafields, 'edit');
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
                 AlDolUtils::dol_fiche_end('');
129 129
 
130 130
                 print '<div class="center">';
131
-                print '<input type="submit" class="button" value="' . $langs->trans("CreateThisCat") . '" name="creation" />';
131
+                print '<input type="submit" class="button" value="'.$langs->trans("CreateThisCat").'" name="creation" />';
132 132
                 print '&nbsp; &nbsp; &nbsp;';
133
-                print '<input type="submit" class="button" value="' . $langs->trans("Cancel") . '" name="cancel" />';
133
+                print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel" />';
134 134
                 print '</div>';
135 135
 
136 136
                 print '</form>';
Please login to merge, or discard this patch.
Base/MenuManager.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
      * @var DoliDB Database handler.
40 40
      */
41 41
     // public $db;
42
-    var $type_user;         // Put 0 for internal users, 1 for external users
43
-    var $atarget = "";                                // To store default target to use onto links
42
+    var $type_user; // Put 0 for internal users, 1 for external users
43
+    var $atarget = ""; // To store default target to use onto links
44 44
     var $name = "eldy";
45 45
     var $menu_array;
46 46
     var $menu_array_after;
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
 
165 165
         if ($mode == 'topnb') {
166 166
             //print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode);  // no output
167
-            AlEldyLib::print_eldy_menu(Config::$dbEngine, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode);  // no output
167
+            AlEldyLib::print_eldy_menu(Config::$dbEngine, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode); // no output
168 168
             return $this->menu->getNbOfVisibleMenuEntries();
169 169
         }
170 170
 
171 171
         if ($mode == 'jmobile') {     // Used to get menu in xml ul/li
172
-            AlEldyLib::print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode);      // Fill this->menu that is empty with top menu
172
+            AlEldyLib::print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode); // Fill this->menu that is empty with top menu
173 173
             // $this->menu->liste is top menu
174 174
             //var_dump($this->menu->liste);exit;
175 175
             $lastlevel = array();
176
-            print '<!-- Generate menu list from menu handler ' . $this->name . ' -->' . "\n";
176
+            print '<!-- Generate menu list from menu handler '.$this->name.' -->'."\n";
177 177
             foreach ($this->menu->liste as $key => $val) {  // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
178 178
                 print '<ul class="ulmenu" data-inset="true">';
179 179
                 print '<li class="lilevel0">';
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
                     }
195 195
 
196 196
                     print $val['titre'];
197
-                    print '</a>' . "\n";
197
+                    print '</a>'."\n";
198 198
 
199 199
                     // Search submenu fot this mainmenu entry
200 200
                     $tmpmainmenu = $val['mainmenu'];
201 201
                     $tmpleftmenu = 'all';
202 202
                     $submenu = new Menu();
203
-                    print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $submenu, 1, $tmpmainmenu, $tmpleftmenu);       // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home)
203
+                    print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $submenu, 1, $tmpmainmenu, $tmpleftmenu); // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home)
204 204
                     // Note: $submenu contains menu entry with substitution not yet done
205 205
                     //if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu); exit; }
206 206
                     //if ($tmpmainmenu=='accountancy') { var_dump($submenu->liste); exit; }
@@ -210,21 +210,21 @@  discard block
 block discarded – undo
210 210
                     $canonnexturl = preg_replace('/\?.*$/', '', $nexturl);
211 211
                     //var_dump($canonrelurl);
212 212
                     //var_dump($canonnexturl);
213
-                    print '<ul>' . "\n";
213
+                    print '<ul>'."\n";
214 214
                     if (($canonrelurl != $canonnexturl && !in_array($val['mainmenu'], array('tools'))) || (strpos($canonrelurl, '/product/index.php') !== false || strpos($canonrelurl, '/compta/bank/list.php') !== false)) {
215 215
                         // We add sub entry
216
-                        print str_pad('', 1) . '<li class="lilevel1 ui-btn-icon-right ui-btn">';  // ui-btn to highlight on clic
217
-                        print '<a href="' . $relurl . '">';
218
-                        if ($langs->trans(ucfirst($val['mainmenu']) . "Dashboard") == ucfirst($val['mainmenu']) . "Dashboard") {  // No translation
216
+                        print str_pad('', 1).'<li class="lilevel1 ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
217
+                        print '<a href="'.$relurl.'">';
218
+                        if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") {  // No translation
219 219
                             if (in_array($val['mainmenu'], array('cashdesk', 'externalsite', 'website', 'collab'))) {
220 220
                                 print $langs->trans("Access");
221 221
                             } else {
222 222
                                 print $langs->trans("Dashboard");
223 223
                             }
224 224
                         } else
225
-                            print $langs->trans(ucfirst($val['mainmenu']) . "Dashboard");
225
+                            print $langs->trans(ucfirst($val['mainmenu'])."Dashboard");
226 226
                         print '</a>';
227
-                        print '</li>' . "\n";
227
+                        print '</li>'."\n";
228 228
                     }
229 229
 
230 230
                     if ($val['level'] == 0) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                         if ($showmenu) {  // Visible (option to hide when not allowed is off or allowed)
259 259
                             $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
260 260
                             $substitarray['__USERID__'] = $user->id; // For backward compatibility
261
-                            $val2['url'] = make_substitutions($val2['url'], $substitarray);  // Make also substitution of __(XXX)__ and __[XXX]__
261
+                            $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__
262 262
 
263 263
                             if (!preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) {
264 264
                                 $relurl2 = dol_buildpath($val2['url'], 1);
@@ -277,14 +277,14 @@  discard block
 block discarded – undo
277 277
                             }
278 278
 
279 279
                             print str_pad('', $val2['level'] + 1);
280
-                            print '<li class="lilevel' . ($val2['level'] + 1);
280
+                            print '<li class="lilevel'.($val2['level'] + 1);
281 281
                             if ($val2['level'] == 0) {
282
-                                print ' ui-btn-icon-right ui-btn';  // ui-btn to highlight on clic
282
+                                print ' ui-btn-icon-right ui-btn'; // ui-btn to highlight on clic
283 283
                             }
284
-                            print $disabled . '">';  // ui-btn to highlight on clic
284
+                            print $disabled.'">'; // ui-btn to highlight on clic
285 285
                             if ($relurl2) {
286 286
                                 if ($val2['enabled']) { // Allowed
287
-                                    print '<a href="' . $relurl2 . '"';
287
+                                    print '<a href="'.$relurl2.'"';
288 288
                                     //print ' data-ajax="false"';
289 289
                                     print '>';
290 290
                                     $lastlevel2[$val2['level']] = 'enabled';
@@ -308,17 +308,17 @@  discard block
 block discarded – undo
308 308
                                 else
309 309
                                     print '</a>';
310 310
                             }
311
-                            print '</li>' . "\n";
311
+                            print '</li>'."\n";
312 312
                         }
313 313
                     }
314 314
                     //var_dump($submenu);
315 315
                     print '</ul>';
316 316
                 }
317 317
                 if ($val['enabled'] == 2) {
318
-                    print '<font class="vsmenudisabled">' . $val['titre'] . '</font>';
318
+                    print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
319 319
                 }
320 320
                 print '</li>';
321
-                print '</ul>' . "\n";
321
+                print '</ul>'."\n";
322 322
             }
323 323
         }
324 324
 
Please login to merge, or discard this patch.
Base/AlExtraFields.php 2 patches
Spacing   +207 added lines, -207 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         if ($elementtype == 'contact')
228 228
             $elementtype = 'socpeople';
229 229
 
230
-        $table = $elementtype . '_extrafields';
230
+        $table = $elementtype.'_extrafields';
231 231
         if ($elementtype == 'categorie')
232 232
             $table = 'categories_extrafields';
233 233
 
@@ -272,10 +272,10 @@  discard block
 block discarded – undo
272 272
                 'default' => $default_value
273 273
             );
274 274
 
275
-            $result = Config::$dbEngine->DDLAddField(MAIN_DB_PREFIX . $table, $attrname, $field_desc);
275
+            $result = Config::$dbEngine->DDLAddField(MAIN_DB_PREFIX.$table, $attrname, $field_desc);
276 276
             if ($result > 0) {
277 277
                 if ($unique) {
278
-                    $sql = "ALTER TABLE " . MAIN_DB_PREFIX . $table . " ADD UNIQUE INDEX uk_" . $table . "_" . $attrname . " (" . $attrname . ")";
278
+                    $sql = "ALTER TABLE ".MAIN_DB_PREFIX.$table." ADD UNIQUE INDEX uk_".$table."_".$attrname." (".$attrname.")";
279 279
                     $resql = Config::$dbEngine->query($sql, 1, 'dml');
280 280
                 }
281 281
                 return 1;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                 $params = '';
345 345
             }
346 346
 
347
-            $sql = "INSERT INTO " . MAIN_DB_PREFIX . "extrafields(";
347
+            $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(";
348 348
             $sql .= " name,";
349 349
             $sql .= " label,";
350 350
             $sql .= " type,";
@@ -367,30 +367,30 @@  discard block
 block discarded – undo
367 367
             $sql .= " enabled,";
368 368
             $sql .= " help";
369 369
             $sql .= " )";
370
-            $sql .= " VALUES('" . $attrname . "',";
371
-            $sql .= " '" . Config::$dbEngine->escape($label) . "',";
372
-            $sql .= " '" . Config::$dbEngine->escape($type) . "',";
373
-            $sql .= " " . $pos . ",";
374
-            $sql .= " '" . Config::$dbEngine->escape($size) . "',";
375
-            $sql .= " " . ($entity === '' ? Globals::$conf->entity : $entity) . ",";
376
-            $sql .= " '" . Config::$dbEngine->escape($elementtype) . "',";
377
-            $sql .= " " . $unique . ",";
378
-            $sql .= " " . $required . ",";
379
-            $sql .= " '" . Config::$dbEngine->escape($params) . "',";
380
-            $sql .= " " . $alwayseditable . ",";
381
-            $sql .= " " . ($perms ? "'" . Config::$dbEngine->escape($perms) . "'" : "null") . ",";
382
-            $sql .= " " . ($langfile ? "'" . Config::$dbEngine->escape($langfile) . "'" : "null") . ",";
383
-            $sql .= " '" . Config::$dbEngine->escape($list) . "',";
384
-            $sql .= " " . ($default ? "'" . Config::$dbEngine->escape($default) . "'" : "null") . ",";
385
-            $sql .= " " . ($computed ? "'" . Config::$dbEngine->escape($computed) . "'" : "null") . ",";
386
-            $sql .= " " . (is_object(Globals::$user) ? Globals::$user->id : 0) . ",";
387
-            $sql .= " " . (is_object(Globals::$user) ? Globals::$user->id : 0) . ",";
388
-            $sql .= "'" . Config::$dbEngine->idate(dol_now()) . "',";
389
-            $sql .= " " . ($enabled ? "'" . Config::$dbEngine->escape($enabled) . "'" : "1") . ",";
390
-            $sql .= " " . ($help ? "'" . Config::$dbEngine->escape($help) . "'" : "null");
370
+            $sql .= " VALUES('".$attrname."',";
371
+            $sql .= " '".Config::$dbEngine->escape($label)."',";
372
+            $sql .= " '".Config::$dbEngine->escape($type)."',";
373
+            $sql .= " ".$pos.",";
374
+            $sql .= " '".Config::$dbEngine->escape($size)."',";
375
+            $sql .= " ".($entity === '' ? Globals::$conf->entity : $entity).",";
376
+            $sql .= " '".Config::$dbEngine->escape($elementtype)."',";
377
+            $sql .= " ".$unique.",";
378
+            $sql .= " ".$required.",";
379
+            $sql .= " '".Config::$dbEngine->escape($params)."',";
380
+            $sql .= " ".$alwayseditable.",";
381
+            $sql .= " ".($perms ? "'".Config::$dbEngine->escape($perms)."'" : "null").",";
382
+            $sql .= " ".($langfile ? "'".Config::$dbEngine->escape($langfile)."'" : "null").",";
383
+            $sql .= " '".Config::$dbEngine->escape($list)."',";
384
+            $sql .= " ".($default ? "'".Config::$dbEngine->escape($default)."'" : "null").",";
385
+            $sql .= " ".($computed ? "'".Config::$dbEngine->escape($computed)."'" : "null").",";
386
+            $sql .= " ".(is_object(Globals::$user) ? Globals::$user->id : 0).",";
387
+            $sql .= " ".(is_object(Globals::$user) ? Globals::$user->id : 0).",";
388
+            $sql .= "'".Config::$dbEngine->idate(dol_now())."',";
389
+            $sql .= " ".($enabled ? "'".Config::$dbEngine->escape($enabled)."'" : "1").",";
390
+            $sql .= " ".($help ? "'".Config::$dbEngine->escape($help)."'" : "null");
391 391
             $sql .= ')';
392 392
 
393
-            AlDolUtils::dol_syslog(get_class($this) . "::create_label", LOG_DEBUG);
393
+            AlDolUtils::dol_syslog(get_class($this)."::create_label", LOG_DEBUG);
394 394
             if (Config::$dbEngine->query($sql)) {
395 395
                 return 1;
396 396
             } else {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
         if ($elementtype == 'contact')
416 416
             $elementtype = 'socpeople';
417 417
 
418
-        $table = $elementtype . '_extrafields';
418
+        $table = $elementtype.'_extrafields';
419 419
         if ($elementtype == 'categorie')
420 420
             $table = 'categories_extrafields';
421 421
 
@@ -430,15 +430,15 @@  discard block
 block discarded – undo
430 430
 
431 431
             if (!$error) {
432 432
                 $sql = "SELECT COUNT(rowid) as nb";
433
-                $sql .= " FROM " . MAIN_DB_PREFIX . "extrafields";
434
-                $sql .= " WHERE elementtype = '" . $elementtype . "'";
435
-                $sql .= " AND name = '" . $attrname . "'";
433
+                $sql .= " FROM ".MAIN_DB_PREFIX."extrafields";
434
+                $sql .= " WHERE elementtype = '".$elementtype."'";
435
+                $sql .= " AND name = '".$attrname."'";
436 436
                 //$sql.= " AND entity IN (0,".Globals::$conf->entity.")";      Do not test on entity here. We want to see if there is still on field remaning in other entities before deleting field in table
437 437
                 $resql = Config::$dbEngine->query($sql);
438 438
                 if ($resql) {
439 439
                     $obj = Config::$dbEngine->fetch_object($resql);
440 440
                     if ($obj->nb <= 0) {
441
-                        $result = Config::$dbEngine->DDLDropField(MAIN_DB_PREFIX . $table, $attrname); // This also drop the unique key
441
+                        $result = Config::$dbEngine->DDLDropField(MAIN_DB_PREFIX.$table, $attrname); // This also drop the unique key
442 442
                         if ($result < 0) {
443 443
                             $this->error = Config::$dbEngine->lasterror();
444 444
                             $error++;
@@ -472,12 +472,12 @@  discard block
 block discarded – undo
472 472
             $elementtype = 'socpeople';
473 473
 
474 474
         if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/", $attrname)) {
475
-            $sql = "DELETE FROM " . MAIN_DB_PREFIX . "extrafields";
476
-            $sql .= " WHERE name = '" . $attrname . "'";
477
-            $sql .= " AND entity IN  (0," . Globals::$conf->entity . ')';
478
-            $sql .= " AND elementtype = '" . $elementtype . "'";
475
+            $sql = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
476
+            $sql .= " WHERE name = '".$attrname."'";
477
+            $sql .= " AND entity IN  (0,".Globals::$conf->entity.')';
478
+            $sql .= " AND elementtype = '".$elementtype."'";
479 479
 
480
-            AlDolUtils::dol_syslog(get_class($this) . "::delete_label", LOG_DEBUG);
480
+            AlDolUtils::dol_syslog(get_class($this)."::delete_label", LOG_DEBUG);
481 481
             $resql = Config::$dbEngine->query($sql);
482 482
             if ($resql) {
483 483
                 return 1;
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
         if ($elementtype == 'contact')
522 522
             $elementtype = 'socpeople';
523 523
 
524
-        $table = $elementtype . '_extrafields';
524
+        $table = $elementtype.'_extrafields';
525 525
         if ($elementtype == 'categorie')
526 526
             $table = 'categories_extrafields';
527 527
 
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
             $field_desc = array('type' => $typedb, 'value' => $lengthdb, 'null' => ($required ? 'NOT NULL' : 'NULL'), 'default' => $default);
560 560
 
561 561
             if ($type != 'separate') { // No table update when separate type
562
-                $result = Config::$dbEngine->DDLUpdateField(MAIN_DB_PREFIX . $table, $attrname, $field_desc);
562
+                $result = Config::$dbEngine->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc);
563 563
             }
564 564
             if ($result > 0 || $type == 'separate') {
565 565
                 if ($label) {
@@ -568,11 +568,11 @@  discard block
 block discarded – undo
568 568
                 if ($result > 0) {
569 569
                     $sql = '';
570 570
                     if ($unique) {
571
-                        $sql = "ALTER TABLE " . MAIN_DB_PREFIX . $table . " ADD UNIQUE INDEX uk_" . $table . "_" . $attrname . " (" . $attrname . ")";
571
+                        $sql = "ALTER TABLE ".MAIN_DB_PREFIX.$table." ADD UNIQUE INDEX uk_".$table."_".$attrname." (".$attrname.")";
572 572
                     } else {
573
-                        $sql = "ALTER TABLE " . MAIN_DB_PREFIX . $table . " DROP INDEX uk_" . $table . "_" . $attrname;
573
+                        $sql = "ALTER TABLE ".MAIN_DB_PREFIX.$table." DROP INDEX uk_".$table."_".$attrname;
574 574
                     }
575
-                    AlDolUtils::dol_syslog(get_class($this) . '::update', LOG_DEBUG);
575
+                    AlDolUtils::dol_syslog(get_class($this).'::update', LOG_DEBUG);
576 576
                     $resql = Config::$dbEngine->query($sql, 1, 'dml');
577 577
                     return 1;
578 578
                 } else {
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
     {
618 618
         // phpcs:enable
619 619
         // global $conf, $user;
620
-        AlDolUtils::dol_syslog(get_class($this) . "::update_label " . $attrname . ", " . $label . ", " . $type . ", " . $size . ", " . $elementtype . ", " . $unique . ", " . $required . ", " . $pos . ", " . $alwayseditable . ", " . $perms . ", " . $list . ", " . $default . ", " . $computed . ", " . $entity . ", " . $langfile . ", " . $enabled . ", " . $totalizable);
620
+        AlDolUtils::dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled.", ".$totalizable);
621 621
 
622 622
         // Clean parameters
623 623
         if ($elementtype == 'thirdparty')
@@ -652,21 +652,21 @@  discard block
 block discarded – undo
652 652
 
653 653
             if ($entity === '' || $entity != '0') {
654 654
                 // We dont want on all entities, we delete all and current
655
-                $sql_del = "DELETE FROM " . MAIN_DB_PREFIX . "extrafields";
656
-                $sql_del .= " WHERE name = '" . $attrname . "'";
657
-                $sql_del .= " AND entity IN (0, " . ($entity === '' ? Globals::$conf->entity : $entity) . ")";
658
-                $sql_del .= " AND elementtype = '" . $elementtype . "'";
655
+                $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
656
+                $sql_del .= " WHERE name = '".$attrname."'";
657
+                $sql_del .= " AND entity IN (0, ".($entity === '' ? Globals::$conf->entity : $entity).")";
658
+                $sql_del .= " AND elementtype = '".$elementtype."'";
659 659
             } else {
660 660
                 // We want on all entities ($entities = '0'), we delete on all only (we keep setup specific to each entity)
661
-                $sql_del = "DELETE FROM " . MAIN_DB_PREFIX . "extrafields";
662
-                $sql_del .= " WHERE name = '" . $attrname . "'";
661
+                $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
662
+                $sql_del .= " WHERE name = '".$attrname."'";
663 663
                 $sql_del .= " AND entity = 0";
664
-                $sql_del .= " AND elementtype = '" . $elementtype . "'";
664
+                $sql_del .= " AND elementtype = '".$elementtype."'";
665 665
             }
666 666
             $resql1 = Config::$dbEngine->query($sql_del);
667 667
 
668
-            $sql = "INSERT INTO " . MAIN_DB_PREFIX . "extrafields(";
669
-            $sql .= " name,";  // This is code
668
+            $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields(";
669
+            $sql .= " name,"; // This is code
670 670
             $sql .= " entity,";
671 671
             $sql .= " label,";
672 672
             $sql .= " type,";
@@ -689,28 +689,28 @@  discard block
 block discarded – undo
689 689
             $sql .= " enabled,";
690 690
             $sql .= " help";
691 691
             $sql .= ") VALUES (";
692
-            $sql .= "'" . $attrname . "',";
693
-            $sql .= " " . ($entity === '' ? Globals::$conf->entity : $entity) . ",";
694
-            $sql .= " '" . Config::$dbEngine->escape($label) . "',";
695
-            $sql .= " '" . Config::$dbEngine->escape($type) . "',";
696
-            $sql .= " '" . Config::$dbEngine->escape($size) . "',";
697
-            $sql .= " '" . Config::$dbEngine->escape($elementtype) . "',";
698
-            $sql .= " " . $unique . ",";
699
-            $sql .= " " . $required . ",";
700
-            $sql .= " " . ($perms ? "'" . Config::$dbEngine->escape($perms) . "'" : "null") . ",";
701
-            $sql .= " " . ($langfile ? "'" . Config::$dbEngine->escape($langfile) . "'" : "null") . ",";
702
-            $sql .= " " . $pos . ",";
703
-            $sql .= " '" . Config::$dbEngine->escape($alwayseditable) . "',";
704
-            $sql .= " '" . Config::$dbEngine->escape($params) . "',";
705
-            $sql .= " '" . Config::$dbEngine->escape($list) . "', ";
706
-            $sql .= " " . $totalizable . ",";
707
-            $sql .= " " . (($default != '') ? "'" . Config::$dbEngine->escape($default) . "'" : "null") . ",";
708
-            $sql .= " " . ($computed ? "'" . Config::$dbEngine->escape($computed) . "'" : "null") . ",";
709
-            $sql .= " " . Globals::$user->id . ",";
710
-            $sql .= " " . Globals::$user->id . ",";
711
-            $sql .= "'" . Config::$dbEngine->idate(dol_now()) . "',";
712
-            $sql .= "'" . Config::$dbEngine->escape($enabled) . "',";
713
-            $sql .= " " . ($help ? "'" . Config::$dbEngine->escape($help) . "'" : "null");
692
+            $sql .= "'".$attrname."',";
693
+            $sql .= " ".($entity === '' ? Globals::$conf->entity : $entity).",";
694
+            $sql .= " '".Config::$dbEngine->escape($label)."',";
695
+            $sql .= " '".Config::$dbEngine->escape($type)."',";
696
+            $sql .= " '".Config::$dbEngine->escape($size)."',";
697
+            $sql .= " '".Config::$dbEngine->escape($elementtype)."',";
698
+            $sql .= " ".$unique.",";
699
+            $sql .= " ".$required.",";
700
+            $sql .= " ".($perms ? "'".Config::$dbEngine->escape($perms)."'" : "null").",";
701
+            $sql .= " ".($langfile ? "'".Config::$dbEngine->escape($langfile)."'" : "null").",";
702
+            $sql .= " ".$pos.",";
703
+            $sql .= " '".Config::$dbEngine->escape($alwayseditable)."',";
704
+            $sql .= " '".Config::$dbEngine->escape($params)."',";
705
+            $sql .= " '".Config::$dbEngine->escape($list)."', ";
706
+            $sql .= " ".$totalizable.",";
707
+            $sql .= " ".(($default != '') ? "'".Config::$dbEngine->escape($default)."'" : "null").",";
708
+            $sql .= " ".($computed ? "'".Config::$dbEngine->escape($computed)."'" : "null").",";
709
+            $sql .= " ".Globals::$user->id.",";
710
+            $sql .= " ".Globals::$user->id.",";
711
+            $sql .= "'".Config::$dbEngine->idate(dol_now())."',";
712
+            $sql .= "'".Config::$dbEngine->escape($enabled)."',";
713
+            $sql .= " ".($help ? "'".Config::$dbEngine->escape($help)."'" : "null");
714 714
             $sql .= ")";
715 715
 
716 716
             $resql2 = Config::$dbEngine->query($sql);
@@ -754,14 +754,14 @@  discard block
 block discarded – undo
754 754
         $array_name_label = array();
755 755
 
756 756
         // To avoid conflicts with external modules. TODO Remove this.
757
-        if (!$forceload &&!empty(Globals::$conf->global->MAIN_EXTRAFIELDS_DISABLED))
757
+        if (!$forceload && !empty(Globals::$conf->global->MAIN_EXTRAFIELDS_DISABLED))
758 758
         return $array_name_label;
759 759
 
760 760
         // Set array of label of entity
761 761
         // TODO Remove completely loading of label. This should be done by presentation.
762 762
         $labelmulticompany = array();
763 763
         if (!empty(Globals::$conf->multicompany->enabled)) {
764
-            $sql_entity_name = 'SELECT rowid, label FROM ' . MAIN_DB_PREFIX . 'entity WHERE rowid in (0,' . Globals::$conf->entity . ')';
764
+            $sql_entity_name = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'entity WHERE rowid in (0,'.Globals::$conf->entity.')';
765 765
             $resql_entity_name = Config::$dbEngine->query($sql_entity_name);
766 766
             if ($resql_entity_name) {
767 767
                 while ($obj = Config::$dbEngine->fetch_object($resql_entity_name)) {
@@ -771,13 +771,13 @@  discard block
 block discarded – undo
771 771
         }
772 772
 
773 773
         // We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
774
-        AlDolUtils::dol_syslog("fetch_name_optionals_label elementtype=" . $elementtype);
774
+        AlDolUtils::dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
775 775
 
776 776
         $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,totalizable,fielddefault,fieldcomputed,entity,enabled,help";
777
-        $sql .= " FROM " . MAIN_DB_PREFIX . "extrafields";
778
-        $sql .= " WHERE entity IN (0," . Globals::$conf->entity . ")";
777
+        $sql .= " FROM ".MAIN_DB_PREFIX."extrafields";
778
+        $sql .= " WHERE entity IN (0,".Globals::$conf->entity.")";
779 779
         if ($elementtype)
780
-            $sql .= " AND elementtype = '" . $elementtype . "'"; // Filed with object->table_element
780
+            $sql .= " AND elementtype = '".$elementtype."'"; // Filed with object->table_element
781 781
         $sql .= " ORDER BY pos";
782 782
 
783 783
         $resql = Config::$dbEngine->select($sql);
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
                 $this->attribute_list[$tab->name] = $tab->list;
810 810
                 $this->attribute_totalizable[$tab->name] = $tab->totalizable;
811 811
                 $this->attribute_entityid[$tab->name] = $tab->entity;
812
-                $this->attribute_entitylabel[$tab->name] = (empty($labelmulticompany[$tab->entity]) ? 'Entity' . $tab->entity : $labelmulticompany[$tab->entity]);
812
+                $this->attribute_entitylabel[$tab->name] = (empty($labelmulticompany[$tab->entity]) ? 'Entity'.$tab->entity : $labelmulticompany[$tab->entity]);
813 813
 
814 814
                 // New usage
815 815
                 $this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type;
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
                 $this->attributes[$tab->elementtype]['list'][$tab->name] = $tab->list;
829 829
                 $this->attributes[$tab->elementtype]['totalizable'][$tab->name] = $tab->totalizable;
830 830
                 $this->attributes[$tab->elementtype]['entityid'][$tab->name] = $tab->entity;
831
-                $this->attributes[$tab->elementtype]['entitylabel'][$tab->name] = (empty($labelmulticompany[$tab->entity]) ? 'Entity' . $tab->entity : $labelmulticompany[$tab->entity]);
831
+                $this->attributes[$tab->elementtype]['entitylabel'][$tab->name] = (empty($labelmulticompany[$tab->entity]) ? 'Entity'.$tab->entity : $labelmulticompany[$tab->entity]);
832 832
                 $this->attributes[$tab->elementtype]['enabled'][$tab->name] = $tab->enabled;
833 833
                 $this->attributes[$tab->elementtype]['help'][$tab->name] = $tab->help;
834 834
             }
@@ -861,13 +861,13 @@  discard block
 block discarded – undo
861 861
         // global $conf, $langs, $form;
862 862
 
863 863
         if (!is_object($form)) {
864
-            require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
864
+            require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
865 865
             $form = new Form(Config::$dbEngine);
866 866
         }
867 867
 
868 868
         $out = '';
869 869
 
870
-        $keyprefix = $keyprefix . 'options_';  // Because we work on extrafields
870
+        $keyprefix = $keyprefix.'options_'; // Because we work on extrafields
871 871
 
872 872
         if (!empty($extrafieldsobjectkey)) {
873 873
             $label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
             $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1);
884 884
             $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
885 885
             $help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
886
-            $hidden = (empty($list) ? 1 : 0);  // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
886
+            $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
887 887
         } else { // Old usage
888 888
             $label = $this->attribute_label[$key];
889 889
             $type = $this->attribute_type[$key];
@@ -897,12 +897,12 @@  discard block
 block discarded – undo
897 897
             $langfile = $this->attribute_langfile[$key];
898 898
             $list = $this->attribute_list[$key];
899 899
             $totalizable = $this->attribute_totalizable[$key];
900
-            $hidden = (empty($list) ? 1 : 0);  // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
900
+            $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
901 901
         }
902 902
 
903 903
         if ($computed) {
904 904
             if (!preg_match('/^search_/', $keyprefix))
905
-                return '<span class="opacitymedium">' . Globals::$langs->trans("AutomaticallyCalculated") . '</span>';
905
+                return '<span class="opacitymedium">'.Globals::$langs->trans("AutomaticallyCalculated").'</span>';
906 906
             else
907 907
                 return '';
908 908
         }
@@ -942,31 +942,31 @@  discard block
 block discarded – undo
942 942
                 $value = '-1';
943 943
 
944 944
             // TODO Must also support $moreparam
945
-            $out = $form->selectDate($value, $keyprefix . $key . $keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
945
+            $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
946 946
         }
947 947
         elseif (in_array($type, array('int', 'integer'))) {
948 948
             $tmp = explode(',', $size);
949 949
             $newsize = $tmp[0];
950
-            $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" maxlength="' . $newsize . '" value="' . dol_escape_htmltag($value) . '"' . ($moreparam ? $moreparam : '') . '>';
950
+            $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
951 951
         } elseif (preg_match('/varchar/', $type)) {
952
-            $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" maxlength="' . $size . '" value="' . dol_escape_htmltag($value) . '"' . ($moreparam ? $moreparam : '') . '>';
952
+            $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$size.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').'>';
953 953
         } elseif (in_array($type, array('mail', 'phone', 'url'))) {
954
-            $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" value="' . dol_escape_htmltag($value) . '" ' . ($moreparam ? $moreparam : '') . '>';
954
+            $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
955 955
         } elseif ($type == 'text') {
956 956
             if (!preg_match('/search_/', $keyprefix)) {  // If keyprefix is search_ or search_options_, we must just use a simple text field
957
-                require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
958
-                $doleditor = new DolEditor($keyprefix . $key . $keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, false, ROWS_5, '90%');
957
+                require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
958
+                $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, false, ROWS_5, '90%');
959 959
                 $out = $doleditor->Create(1);
960 960
             } else {
961
-                $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" value="' . dol_escape_htmltag($value) . '" ' . ($moreparam ? $moreparam : '') . '>';
961
+                $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
962 962
             }
963 963
         } elseif ($type == 'html') {
964 964
             if (!preg_match('/search_/', $keyprefix)) {  // If keyprefix is search_ or search_options_, we must just use a simple text field
965
-                require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
966
-                $doleditor = new DolEditor($keyprefix . $key . $keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty(Globals::$conf->fckeditor->enabled) && Globals::$conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
965
+                require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
966
+                $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty(Globals::$conf->fckeditor->enabled) && Globals::$conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
967 967
                 $out = $doleditor->Create(1);
968 968
             } else {
969
-                $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" value="' . dol_escape_htmltag($value) . '" ' . ($moreparam ? $moreparam : '') . '>';
969
+                $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').'>';
970 970
             }
971 971
         } elseif ($type == 'boolean') {
972 972
             $checked = '';
@@ -975,33 +975,33 @@  discard block
 block discarded – undo
975 975
             } else {
976 976
                 $checked = ' value="1" ';
977 977
             }
978
-            $out = '<input type="checkbox" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" ' . $checked . ' ' . ($moreparam ? $moreparam : '') . '>';
978
+            $out = '<input type="checkbox" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.$checked.' '.($moreparam ? $moreparam : '').'>';
979 979
         } elseif ($type == 'price') {
980 980
             if (!empty($value)) {  // $value in memory is a php numeric, we format it into user number format.
981 981
                 $value = price($value);
982 982
             }
983
-            $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" value="' . $value . '" ' . ($moreparam ? $moreparam : '') . '> ' . Globals::$langs->getCurrencySymbol(Globals::$conf->currency);
983
+            $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> '.Globals::$langs->getCurrencySymbol(Globals::$conf->currency);
984 984
         } elseif ($type == 'double') {
985 985
             if (!empty($value)) {  // $value in memory is a php numeric, we format it into user number format.
986 986
                 $value = price($value);
987 987
             }
988
-            $out = '<input type="text" class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" value="' . $value . '" ' . ($moreparam ? $moreparam : '') . '> ';
988
+            $out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
989 989
         } elseif ($type == 'select') {
990 990
             $out = '';
991
-            if (!empty(Globals::$conf->use_javascript_ajax) &&!empty(Globals::$conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) {
992
-                include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
993
-                $out .= ajax_combobox($keyprefix . $key . $keysuffix, array(), 0);
991
+            if (!empty(Globals::$conf->use_javascript_ajax) && !empty(Globals::$conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) {
992
+                include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
993
+                $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
994 994
             }
995 995
 
996
-            $out .= '<select class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" ' . ($moreparam ? $moreparam : '') . '>';
996
+            $out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
997 997
             $out .= '<option value="0">&nbsp;</option>';
998 998
             foreach ($param['options'] as $key => $val) {
999 999
                 if ((string) $key == '')
1000 1000
                     continue;
1001 1001
                 list($val, $parent) = explode('|', $val);
1002
-                $out .= '<option value="' . $key . '"';
1002
+                $out .= '<option value="'.$key.'"';
1003 1003
                 $out .= (((string) $value == (string) $key) ? ' selected' : '');
1004
-                $out .= (!empty($parent) ? ' parent="' . $parent . '"' : '');
1004
+                $out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
1005 1005
                 $out .= '>';
1006 1006
                 if ($langfile && $val)
1007 1007
                     $out .= Globals::$langs->trans($val);
@@ -1013,12 +1013,12 @@  discard block
 block discarded – undo
1013 1013
         }
1014 1014
         elseif ($type == 'sellist') {
1015 1015
             $out = '';
1016
-            if (!empty(Globals::$conf->use_javascript_ajax) &&!empty(Globals::$conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) {
1017
-                include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
1018
-                $out .= ajax_combobox($keyprefix . $key . $keysuffix, array(), 0);
1016
+            if (!empty(Globals::$conf->use_javascript_ajax) && !empty(Globals::$conf->global->MAIN_EXTRAFIELDS_USE_SELECT2)) {
1017
+                include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
1018
+                $out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
1019 1019
             }
1020 1020
 
1021
-            $out .= '<select class="flat ' . $morecss . ' maxwidthonsmartphone" name="' . $keyprefix . $key . $keysuffix . '" id="' . $keyprefix . $key . $keysuffix . '" ' . ($moreparam ? $moreparam : '') . '>';
1021
+            $out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
1022 1022
             if (is_array($param['options'])) {
1023 1023
                 $param_list = array_keys($param['options']);
1024 1024
                 $InfoFieldList = explode(":", $param_list[0]);
@@ -1029,19 +1029,19 @@  discard block
 block discarded – undo
1029 1029
                 // 2 : key fields name (if differ of rowid)
1030 1030
                 // 3 : key field parent (for dependent lists)
1031 1031
                 // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value
1032
-                $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2] . ' as rowid');
1032
+                $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid');
1033 1033
 
1034 1034
 
1035 1035
                 if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1036 1036
                     if (strpos($InfoFieldList[4], 'extra.') !== false) {
1037
-                        $keyList = 'main.' . $InfoFieldList[2] . ' as rowid';
1037
+                        $keyList = 'main.'.$InfoFieldList[2].' as rowid';
1038 1038
                     } else {
1039
-                        $keyList = $InfoFieldList[2] . ' as rowid';
1039
+                        $keyList = $InfoFieldList[2].' as rowid';
1040 1040
                     }
1041 1041
                 }
1042 1042
                 if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
1043 1043
                     list($parentName, $parentField) = explode('|', $InfoFieldList[3]);
1044
-                    $keyList .= ', ' . $parentField;
1044
+                    $keyList .= ', '.$parentField;
1045 1045
                 }
1046 1046
 
1047 1047
                 $fields_label = explode('|', $InfoFieldList[1]);
@@ -1051,8 +1051,8 @@  discard block
 block discarded – undo
1051 1051
                 }
1052 1052
 
1053 1053
                 $sqlwhere = '';
1054
-                $sql = 'SELECT ' . $keyList;
1055
-                $sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList[0];
1054
+                $sql = 'SELECT '.$keyList;
1055
+                $sql .= ' FROM '.MAIN_DB_PREFIX.$InfoFieldList[0];
1056 1056
                 if (!empty($InfoFieldList[4])) {
1057 1057
                     // can use curent entity filter
1058 1058
                     if (strpos($InfoFieldList[4], '$ENTITY$') !== false) {
@@ -1071,24 +1071,24 @@  discard block
 block discarded – undo
1071 1071
                     }
1072 1072
                     //We have to join on extrafield table
1073 1073
                     if (strpos($InfoFieldList[4], 'extra') !== false) {
1074
-                        $sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList[0] . '_extrafields as extra';
1075
-                        $sqlwhere .= ' WHERE extra.fk_object=main.' . $InfoFieldList[2] . ' AND ' . $InfoFieldList[4];
1074
+                        $sql .= ' as main, '.MAIN_DB_PREFIX.$InfoFieldList[0].'_extrafields as extra';
1075
+                        $sqlwhere .= ' WHERE extra.fk_object=main.'.$InfoFieldList[2].' AND '.$InfoFieldList[4];
1076 1076
                     } else {
1077
-                        $sqlwhere .= ' WHERE ' . $InfoFieldList[4];
1077
+                        $sqlwhere .= ' WHERE '.$InfoFieldList[4];
1078 1078
                     }
1079 1079
                 } else {
1080 1080
                     $sqlwhere .= ' WHERE 1=1';
1081 1081
                 }
1082 1082
                 // Some tables may have field, some other not. For the moment we disable it.
1083 1083
                 if (in_array($InfoFieldList[0], array('tablewithentity'))) {
1084
-                    $sqlwhere .= ' AND entity = ' . Globals::$conf->entity;
1084
+                    $sqlwhere .= ' AND entity = '.Globals::$conf->entity;
1085 1085
                 }
1086 1086
                 $sql .= $sqlwhere;
1087 1087
                 //print $sql;
1088 1088
 
1089
-                $sql .= ' ORDER BY ' . implode(', ', $fields_label);
1089
+                $sql .= ' ORDER BY '.implode(', ', $fields_label);
1090 1090
 
1091
-                AlDolUtils::dol_syslog(get_class($this) . '::showInputField type=sellist', LOG_DEBUG);
1091
+                AlDolUtils::dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
1092 1092
                 $resql = Config::$dbEngine->query($sql);
1093 1093
                 if ($resql) {
1094 1094
                     $out .= '<option value="0">&nbsp;</option>';
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
                         if (is_array($fields_label)) {
1105 1105
                             $notrans = true;
1106 1106
                             foreach ($fields_label as $field_toshow) {
1107
-                                $labeltoshow .= $obj->$field_toshow . ' ';
1107
+                                $labeltoshow .= $obj->$field_toshow.' ';
1108 1108
                             }
1109 1109
                         } else {
1110 1110
                             $labeltoshow = $obj->{$InfoFieldList[1]};
@@ -1115,12 +1115,12 @@  discard block
 block discarded – undo
1115 1115
                             foreach ($fields_label as $field_toshow) {
1116 1116
                                 $translabel = Globals::$langs->trans($obj->$field_toshow);
1117 1117
                                 if ($translabel != $obj->$field_toshow) {
1118
-                                    $labeltoshow = dol_trunc($translabel, 18) . ' ';
1118
+                                    $labeltoshow = dol_trunc($translabel, 18).' ';
1119 1119
                                 } else {
1120
-                                    $labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
1120
+                                    $labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
1121 1121
                                 }
1122 1122
                             }
1123
-                            $out .= '<option value="' . $obj->rowid . '" selected>' . $labeltoshow . '</option>';
1123
+                            $out .= '<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
1124 1124
                         } else {
1125 1125
                             if (!$notrans) {
1126 1126
                                 $translabel = Globals::$langs->trans($obj->{$InfoFieldList[1]});
@@ -1133,38 +1133,38 @@  discard block
 block discarded – undo
1133 1133
                             if (empty($labeltoshow))
1134 1134
                                 $labeltoshow = '(not defined)';
1135