Passed
Push — master ( 1007d6...492b54 )
by Alxarafe
26:10
created
Views/CategoriesIndexView.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 
110 110
         $this->llxHeader('', $this->title, '', '', 0, 0, $arrayofjs, $arrayofcss);
111 111
 
112
-        $newcardbutton = '<a class="butActionNew" href="' . BASE_URI . '/categories/card.php?action=create&type=' . $this->type . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $this->type) . '"><span class="valignmiddle">' . Globals::$langs->trans("NewCategory") . '</span>';
112
+        $newcardbutton = '<a class="butActionNew" href="'.BASE_URI.'/categories/card.php?action=create&type='.$this->type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$this->type).'"><span class="valignmiddle">'.Globals::$langs->trans("NewCategory").'</span>';
113 113
         $newcardbutton .= '<span class="fa fa-plus-circle valignmiddle"></span>';
114 114
         $newcardbutton .= '</a>';
115 115
 
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
         /*
124 124
          * Zone recherche produit/service
125 125
          */
126
-        print '<form method="post" action="index.php?type=' . $this->type . '">';
127
-        print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
128
-        print '<input type="hidden" name="type" value="' . $this->type . '">';
126
+        print '<form method="post" action="index.php?type='.$this->type.'">';
127
+        print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
128
+        print '<input type="hidden" name="type" value="'.$this->type.'">';
129 129
 
130 130
 
131 131
         print '<table class="noborder nohover" width="100%">';
132 132
         print '<tr class="liste_titre">';
133
-        print '<td colspan="3">' . Globals::$langs->trans("Search") . '</td>';
133
+        print '<td colspan="3">'.Globals::$langs->trans("Search").'</td>';
134 134
         print '</tr>';
135 135
         print '<tr class="oddeven"><td>';
136
-        print Globals::$langs->trans("Name") . ':</td><td><input class="flat inputsearch" type="text" name="catname" value="' . $catname . '"/></td><td><input type="submit" class="button" value="' . Globals::$langs->trans("Search") . '"></td></tr>';
136
+        print Globals::$langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.Globals::$langs->trans("Search").'"></td></tr>';
137 137
         /*
138 138
           // faire une rech dans une sous categorie uniquement
139 139
           print '<tr '.$bc[0].'><td>';
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
             $cats = $categstatic->rechercher($id, $catname, $this->typetext);
159 159
 
160 160
             print '<table class="noborder" width="100%">';
161
-            print '<tr class="liste_titre"><td colspan="2">' . Globals::$langs->trans("FoundCats") . '</td></tr>';
161
+            print '<tr class="liste_titre"><td colspan="2">'.Globals::$langs->trans("FoundCats").'</td></tr>';
162 162
 
163 163
             foreach ($cats as $cat) {
164
-                print "\t" . '<tr class="oddeven">' . "\n";
164
+                print "\t".'<tr class="oddeven">'."\n";
165 165
                 print "\t\t<td>";
166 166
                 $categstatic->id = $cat->id;
167 167
                 $categstatic->ref = $cat->label;
168 168
                 $categstatic->label = $cat->label;
169 169
                 $categstatic->type = $cat->type;
170 170
                 $categstatic->color = $cat->color;
171
-                print '<span class="noborderoncategories" ' . ($categstatic->color ? ' style="background: #' . $categstatic->color . ';"' : ' style="background: #aaa"') . '>';
171
+                print '<span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>';
172 172
                 print $categstatic->getNomUrl(1, '');
173 173
                 print '</span>';
174 174
                 print "</td>\n";
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
             $data[] = array(
209 209
                 'rowid' => $val['rowid'],
210 210
                 'fk_menu' => $val['fk_parent'],
211
-                'entry' => '<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" ' . ($categstatic->color ? ' style="background: #' . $categstatic->color . ';"' : ' style="background: #aaa"') . '>' . $li . '</span></td>' .
211
+                'entry' => '<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'</span></td>'.
212 212
                 //'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
213
-                '<td align="right" width="20px;"><a href="' . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $val['id'] . '&type=' . $this->type . '">' . img_view() . '</a></td>' .
213
+                '<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$this->type.'">'.img_view().'</a></td>'.
214 214
                 '</tr></table>'
215 215
             );
216 216
         }
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
 //print_barre_liste('', 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, 0, '', 0, $newcardbutton, '', 0, 1, 1);
220 220
 
221 221
         print '<table class="liste nohover" width="100%">';
222
-        print '<tr class="liste_titre"><td>' . Globals::$langs->trans("Categories") . '</td><td></td><td align="right">';
222
+        print '<tr class="liste_titre"><td>'.Globals::$langs->trans("Categories").'</td><td></td><td align="right">';
223 223
         if (!empty($conf->use_javascript_ajax)) {
224
-            print '<div id="iddivjstreecontrol"><a class="notasortlink" href="#">' . img_picto('', 'object_category') . ' ' . Globals::$langs->trans("UndoExpandAll") . '</a> | <a class="notasortlink" href="#">' . img_picto('', 'object_category-expanded') . ' ' . Globals::$langs->trans("ExpandAll") . '</a></div>';
224
+            print '<div id="iddivjstreecontrol"><a class="notasortlink" href="#">'.img_picto('', 'object_category').' '.Globals::$langs->trans("UndoExpandAll").'</a> | <a class="notasortlink" href="#">'.img_picto('', 'object_category-expanded').' '.Globals::$langs->trans("ExpandAll").'</a></div>';
225 225
         }
226 226
         print '</td></tr>';
227 227
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
             print '</td></tr>';
234 234
         } else {
235 235
             print '<tr class="pair">';
236
-            print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>' . img_picto_common('', 'treemenu/branchbottom.gif') . '</td>';
236
+            print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('', 'treemenu/branchbottom.gif').'</td>';
237 237
             print '<td valign="middle">';
238 238
             print Globals::$langs->trans("NoCategoryYet");
239 239
             print '</td>';
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -178,8 +178,9 @@
 block discarded – undo
178 178
                 print "\t</tr>\n";
179 179
             }
180 180
             print "</table>";
181
-        } else
182
-            print '&nbsp;';
181
+        } else {
182
+                    print '&nbsp;';
183
+        }
183 184
 
184 185
 
185 186
 //print '</td></tr></table>';
Please login to merge, or discard this patch.
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'=>...);
@@ -94,9 +94,9 @@  discard block
 block discarded – undo
94 94
         }
95 95
 
96 96
         $php_self = DolUtils::dol_escape_htmltag($_SERVER['PHP_SELF']);
97
-        $php_self .= DolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?' . DolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
97
+        $php_self .= DolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.DolUtils::dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
98 98
         if (!preg_match('/mainmenu=/', $php_self)) {
99
-            $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?') . 'mainmenu=home';
99
+            $php_self .= (preg_match('/\?/', $php_self) ? '&' : '?').'mainmenu=home';
100 100
         }
101 101
 
102 102
         $this->url = $php_self;
@@ -110,28 +110,28 @@  discard block
 block discarded – undo
110 110
           );
111 111
          */
112 112
         $arrayofjs = array(
113
-            DOL_BASE_URI . '/includes/jstz/jstz.min.js' . (empty(Globals::$conf->dol_use_jmobile) ? '' : '?version=' . urlencode(DOL_VERSION)),
114
-        DOL_BASE_URI . '/core/js/dst.js' . (empty(Globals::$conf->dol_use_jmobile) ? '' : '?version=' . urlencode(DOL_VERSION))
113
+            DOL_BASE_URI.'/includes/jstz/jstz.min.js'.(empty(Globals::$conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)),
114
+        DOL_BASE_URI.'/core/js/dst.js'.(empty(Globals::$conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION))
115 115
         );
116 116
 
117 117
         // $titletruedolibarrversion is defined by dol_loginfunction in security2.lib.php.
118 118
         // We must keep the @, some tools use it to know it is login page and find true dolibarr version.
119 119
         // $titleofloginpage = Globals::$langs->trans('Login') . ' @ ' . $titletruedolibarrversion;
120
-        $titleofloginpage = Globals::$langs->trans('Login') . ' @ ' . DOL_VERSION;
120
+        $titleofloginpage = Globals::$langs->trans('Login').' @ '.DOL_VERSION;
121 121
 
122 122
         $disablenofollow = 1;
123
-        if (!preg_match('/' . constant('DOL_APPLICATION_TITLE') . '/', $this->title)) {
123
+        if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $this->title)) {
124 124
             $disablenofollow = 0;
125 125
         }
126 126
 
127 127
         print $this->top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow);
128 128
 
129 129
 
130
-        $colorbackhmenu1 = '60,70,100';      // topmenu
130
+        $colorbackhmenu1 = '60,70,100'; // topmenu
131 131
         if (!isset(Globals::$conf->global->THEME_ELDY_TOPMENU_BACK1)) {
132 132
             Globals::$conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
133 133
         }
134 134
         $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);
135
-        $colorbackhmenu1 = join(',', DolUtils2::colorStringToArray($colorbackhmenu1));    // Normalize value to 'x,y,z'
135
+        $colorbackhmenu1 = join(',', DolUtils2::colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
136 136
     }
137 137
 }
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
                 DolUtils::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="' . DolUtils::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="'.DolUtils::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
                 DolUtils::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.
Controllers/Categories.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -144,34 +144,34 @@  discard block
 block discarded – undo
144 144
             // Action ajout d'une categorie
145 145
             if ($this->cancel) {
146 146
                 if ($this->urlfrom) {
147
-                    header("Location: " . $urlfrom);
147
+                    header("Location: ".$urlfrom);
148 148
                     exit;
149 149
                 }
150 150
                 if ($idProdOrigin) {
151
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idProdOrigin . '&type=' . $this->type);
151
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$this->type);
152 152
                     exit;
153 153
                 }
154 154
                 if ($idCompanyOrigin) {
155
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idCompanyOrigin . '&type=' . $this->type);
155
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$this->type);
156 156
                     exit;
157 157
                 }
158 158
                 if ($idSupplierOrigin) {
159
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idSupplierOrigin . '&type=' . $this->type);
159
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$this->type);
160 160
                     exit;
161 161
                 }
162 162
                 if ($idMemberOrigin) {
163
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idMemberOrigin . '&type=' . $this->type);
163
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$this->type);
164 164
                     exit;
165 165
                 }
166 166
                 if ($idContactOrigin) {
167
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idContactOrigin . '&type=' . $this->type);
167
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$this->type);
168 168
                     exit;
169 169
                 }
170 170
                 if ($idProjectOrigin) {
171
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idProjectOrigin . '&type=' . $this->type);
171
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$this->type);
172 172
                     exit;
173 173
                 }
174
-                header("Location: " . DOL_URL_ROOT . '/categories/index.php?leftmenu=cat&type=' . $this->type);
174
+                header("Location: ".DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$this->type);
175 175
                 exit;
176 176
             }
177 177
 
@@ -214,39 +214,39 @@  discard block
 block discarded – undo
214 214
             // Action confirmation de creation categorie
215 215
             if ($this->action == 'confirmed') {
216 216
                 if ($urlfrom) {
217
-                    header("Location: " . $urlfrom);
217
+                    header("Location: ".$urlfrom);
218 218
                     exit;
219 219
                 }
220 220
                 if ($backtopage) {
221
-                    header("Location: " . $backtopage);
221
+                    header("Location: ".$backtopage);
222 222
                     exit;
223 223
                 }
224 224
                 if ($idProdOrigin) {
225
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idProdOrigin . '&type=' . $this->type . '&mesg=' . urlencode(Globals::$langs->trans("CatCreated")));
225
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$this->type.'&mesg='.urlencode(Globals::$langs->trans("CatCreated")));
226 226
                     exit;
227 227
                 }
228 228
                 if ($idCompanyOrigin) {
229
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idCompanyOrigin . '&type=' . $this->type . '&mesg=' . urlencode(Globals::$langs->trans("CatCreated")));
229
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$this->type.'&mesg='.urlencode(Globals::$langs->trans("CatCreated")));
230 230
                     exit;
231 231
                 }
232 232
                 if ($idSupplierOrigin) {
233
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idSupplierOrigin . '&type=' . $this->type . '&mesg=' . urlencode(Globals::$langs->trans("CatCreated")));
233
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$this->type.'&mesg='.urlencode(Globals::$langs->trans("CatCreated")));
234 234
                     exit;
235 235
                 }
236 236
                 if ($idMemberOrigin) {
237
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idMemberOrigin . '&type=' . $this->type . '&mesg=' . urlencode(Globals::$langs->trans("CatCreated")));
237
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$this->type.'&mesg='.urlencode(Globals::$langs->trans("CatCreated")));
238 238
                     exit;
239 239
                 }
240 240
                 if ($idContactOrigin) {
241
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idContactOrigin . '&type=' . $this->type . '&mesg=' . urlencode(Globals::$langs->trans("CatCreated")));
241
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$this->type.'&mesg='.urlencode(Globals::$langs->trans("CatCreated")));
242 242
                     exit;
243 243
                 }
244 244
                 if ($idProjectOrigin) {
245
-                    header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $idProjectOrigin . '&type=' . $this->type . '&mesg=' . urlencode(Globals::$langs->trans("CatCreated")));
245
+                    header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$this->type.'&mesg='.urlencode(Globals::$langs->trans("CatCreated")));
246 246
                     exit;
247 247
                 }
248 248
 
249
-                header("Location: " . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $result . '&type=' . $this->type);
249
+                header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$result.'&type='.$this->type);
250 250
                 exit;
251 251
             }
252 252
         }
Please login to merge, or discard this patch.
Base/ExtraFields.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
-            DolUtils::dol_syslog(get_class($this) . "::create_label", LOG_DEBUG);
393
+            DolUtils::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
-            DolUtils::dol_syslog(get_class($this) . "::delete_label", LOG_DEBUG);
480
+            DolUtils::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
-                    DolUtils::dol_syslog(get_class($this) . '::update', LOG_DEBUG);
575
+                    DolUtils::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
-        DolUtils::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
+        DolUtils::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
-        DolUtils::dol_syslog("fetch_name_optionals_label elementtype=" . $elementtype);
774
+        DolUtils::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