@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * \remarks To run this script as CLI: phpunit filename.php |
25 | 25 | */ |
26 | 26 | |
27 | -global $conf,$user,$langs,$db; |
|
27 | +global $conf, $user, $langs, $db; |
|
28 | 28 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
29 | 29 | //require_once 'PHPUnit/Autoload.php'; |
30 | 30 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -57,10 +57,10 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public static function setUpBeforeClass(): void |
59 | 59 | { |
60 | - global $conf,$user,$langs,$db; |
|
60 | + global $conf, $user, $langs, $db; |
|
61 | 61 | |
62 | 62 | if ($conf->global->SOCIETE_CODECLIENT_ADDON != 'mod_codeclient_monkey') { |
63 | - print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '" . getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n"; |
|
63 | + print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n"; |
|
64 | 64 | die(1); |
65 | 65 | } |
66 | 66 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | die(1); |
75 | 75 | } |
76 | 76 | |
77 | - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
77 | + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
78 | 78 | |
79 | 79 | print __METHOD__."\n"; |
80 | 80 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function testSocieteCreate() |
88 | 88 | { |
89 | - global $conf,$user,$langs,$db; |
|
89 | + global $conf, $user, $langs, $db; |
|
90 | 90 | $conf = $this->savconf; |
91 | 91 | $user = $this->savuser; |
92 | 92 | $langs = $this->savlangs; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function testSocieteFetch($id) |
115 | 115 | { |
116 | - global $conf,$user,$langs,$db; |
|
116 | + global $conf, $user, $langs, $db; |
|
117 | 117 | $conf = $this->savconf; |
118 | 118 | $user = $this->savuser; |
119 | 119 | $langs = $this->savlangs; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function testSocieteUpdate($localobject) |
144 | 144 | { |
145 | - global $conf,$user,$langs,$db; |
|
145 | + global $conf, $user, $langs, $db; |
|
146 | 146 | $conf = $this->savconf; |
147 | 147 | $user = $this->savuser; |
148 | 148 | $langs = $this->savlangs; |
@@ -218,10 +218,10 @@ discard block |
||
218 | 218 | $localobject->country_code = 'FR'; |
219 | 219 | $localobject->idprof1 = 493861496; |
220 | 220 | $localobject->idprof2 = 49386149600021; |
221 | - $result = $localobject->id_prof_check(1, $localobject); // Must be > 0 |
|
221 | + $result = $localobject->id_prof_check(1, $localobject); // Must be > 0 |
|
222 | 222 | print __METHOD__." OK FR idprof1 result=".$result."\n"; |
223 | 223 | $this->assertGreaterThanOrEqual(1, $result); |
224 | - $result = $localobject->id_prof_check(2, $localobject); // Must be > 0 |
|
224 | + $result = $localobject->id_prof_check(2, $localobject); // Must be > 0 |
|
225 | 225 | print __METHOD__." OK FR idprof2 result=".$result."\n"; |
226 | 226 | $this->assertGreaterThanOrEqual(1, $result); |
227 | 227 | |
@@ -229,17 +229,17 @@ discard block |
||
229 | 229 | $localobject->country_code = 'FR'; |
230 | 230 | $localobject->idprof1 = 'id1ko'; |
231 | 231 | $localobject->idprof2 = 'id2ko'; |
232 | - $result = $localobject->id_prof_check(1, $localobject); // Must be <= 0 |
|
232 | + $result = $localobject->id_prof_check(1, $localobject); // Must be <= 0 |
|
233 | 233 | print __METHOD__." KO FR idprof1 result=".$result."\n"; |
234 | 234 | $this->assertLessThan(1, $result); |
235 | - $result = $localobject->id_prof_check(2, $localobject); // Must be <= 0 |
|
235 | + $result = $localobject->id_prof_check(2, $localobject); // Must be <= 0 |
|
236 | 236 | print __METHOD__." KO FR idprof2 result=".$result."\n"; |
237 | 237 | $this->assertLessThan(1, $result); |
238 | 238 | |
239 | 239 | // KO ES |
240 | 240 | $localobject->country_code = 'ES'; |
241 | 241 | $localobject->idprof1 = 'id1ko'; |
242 | - $result = $localobject->id_prof_check(1, $localobject); // Must be <= 0 |
|
242 | + $result = $localobject->id_prof_check(1, $localobject); // Must be <= 0 |
|
243 | 243 | print __METHOD__." KO ES idprof1 result=".$result."\n"; |
244 | 244 | $this->assertLessThan(1, $result); |
245 | 245 | |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | $localobject->country_code = 'AR'; |
248 | 248 | $localobject->idprof1 = 'id1ko'; |
249 | 249 | $localobject->idprof2 = 'id2ko'; |
250 | - $result = $localobject->id_prof_check(1, $localobject); // Must be > 0 |
|
250 | + $result = $localobject->id_prof_check(1, $localobject); // Must be > 0 |
|
251 | 251 | print __METHOD__." OK AR idprof1 result=".$result."\n"; |
252 | 252 | $this->assertGreaterThanOrEqual(0, $result); |
253 | - $result = $localobject->id_prof_check(2, $localobject); // Must be > 0 |
|
253 | + $result = $localobject->id_prof_check(2, $localobject); // Must be > 0 |
|
254 | 254 | print __METHOD__." OK AR idprof2 result=".$result."\n"; |
255 | 255 | $this->assertGreaterThanOrEqual(1, $result); |
256 | 256 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function testSocieteOther($localobject) |
271 | 271 | { |
272 | - global $conf,$user,$langs,$db; |
|
272 | + global $conf, $user, $langs, $db; |
|
273 | 273 | $conf = $this->savconf; |
274 | 274 | $user = $this->savuser; |
275 | 275 | $langs = $this->savlangs; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | */ |
330 | 330 | public function testGetOutstandingBills($id) |
331 | 331 | { |
332 | - global $conf,$user,$langs,$db; |
|
332 | + global $conf, $user, $langs, $db; |
|
333 | 333 | $conf = $this->savconf; |
334 | 334 | $user = $this->savuser; |
335 | 335 | $langs = $this->savlangs; |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function testSocieteDelete($id) |
360 | 360 | { |
361 | - global $conf,$user,$langs,$db; |
|
361 | + global $conf, $user, $langs, $db; |
|
362 | 362 | $conf = $this->savconf; |
363 | 363 | $user = $this->savuser; |
364 | 364 | $langs = $this->savlangs; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | public function testSocieteGetFullAddress() |
384 | 384 | { |
385 | - global $conf,$user,$langs,$db; |
|
385 | + global $conf, $user, $langs, $db; |
|
386 | 386 | $conf = $this->savconf; |
387 | 387 | $user = $this->savuser; |
388 | 388 | $langs = $this->savlangs; |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | |
105 | 105 | // Define value to know what current user can do on users |
106 | 106 | $selfpermission = ($user->id == $id && $user->hasRight('user', 'self', 'creer')); |
107 | -$usercanadd = (!empty($user->admin) || $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write') ); |
|
108 | -$usercanread = (!empty($user->admin) || $user->hasRight('user', 'user', 'lire') || $user->hasRight('hrm', 'read_personal_information', 'read') ); |
|
107 | +$usercanadd = (!empty($user->admin) || $user->hasRight('user', 'user', 'creer') || $user->hasRight('hrm', 'write_personal_information', 'write')); |
|
108 | +$usercanread = (!empty($user->admin) || $user->hasRight('user', 'user', 'lire') || $user->hasRight('hrm', 'read_personal_information', 'read')); |
|
109 | 109 | $permissiontoaddbankaccount = ($user->hasRight('salaries', 'write') || $user->hasRight('hrm', 'employee', 'write') || $user->hasRight('user', 'user', 'creer') || $selfpermission); |
110 | 110 | $permissiontoreadhr = $user->hasRight('hrm', 'read_personal_information', 'read') || $user->hasRight('hrm', 'write_personal_information', 'write'); |
111 | 111 | $permissiontowritehr = $user->hasRight('hrm', 'write_personal_information', 'write'); |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | if (!empty($object->accountancy_code_user_general) && $object->accountancy_code_user_general != '-1') { |
640 | 640 | print ' ('; |
641 | 641 | } |
642 | - $accountingAccountByDefault = $langs->trans("AccountingAccountByDefaultShort") . ": " . length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')); |
|
642 | + $accountingAccountByDefault = $langs->trans("AccountingAccountByDefaultShort").": ".length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')); |
|
643 | 643 | print (getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') ? $accountingAccountByDefault : ''); |
644 | 644 | if (!empty($object->accountancy_code_user_general) && $object->accountancy_code_user_general != '-1') { |
645 | 645 | print ')'; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | |
214 | 214 | $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image |
215 | 215 | |
216 | - $infoImg = getimagesize($filetoread); // Get data about src image |
|
216 | + $infoImg = getimagesize($filetoread); // Get data about src image |
|
217 | 217 | $imgWidth = $infoImg[0]; // Largeur de l'image |
218 | 218 | $imgHeight = $infoImg[1]; // Hauteur de l'image |
219 | 219 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | } |
335 | 335 | |
336 | 336 | // Set transparent color according to image extension |
337 | - $trans_colour = -1; // By default, undefined |
|
337 | + $trans_colour = -1; // By default, undefined |
|
338 | 338 | switch ($newExt) { |
339 | 339 | case 'gif': // Gif |
340 | 340 | $trans_colour = imagecolorallocate($imgTarget, 255, 255, 255); // The method is different for the GIF format |
@@ -553,8 +553,8 @@ discard block |
||
553 | 553 | $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image |
554 | 554 | |
555 | 555 | $infoImg = getimagesize($filetoread); // Get information like size and real format of image. Warning real format may be png when extension is .jpg |
556 | - $imgWidth = $infoImg[0]; // Width of image |
|
557 | - $imgHeight = $infoImg[1]; // Height of image |
|
556 | + $imgWidth = $infoImg[0]; // Width of image |
|
557 | + $imgHeight = $infoImg[1]; // Height of image |
|
558 | 558 | |
559 | 559 | // TODO LDR |
560 | 560 | //if $infoImg[2] != extension of file $file, return a string 'Error: content of file has a format that differs of the format of its extension |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | imagejpeg($imgThumb, $imgThumbName, $newquality); // @phan-suppress-current-line PhanTypeMismatchArgumentNullableInternal,PhanPossiblyUndeclaredVariable |
806 | 806 | break; |
807 | 807 | case IMAGETYPE_PNG: // 3 |
808 | - imagepng($imgThumb, $imgThumbName, $newquality); // @phan-suppress-current-line PhanPossiblyUndeclaredVariable |
|
808 | + imagepng($imgThumb, $imgThumbName, $newquality); // @phan-suppress-current-line PhanPossiblyUndeclaredVariable |
|
809 | 809 | break; |
810 | 810 | case IMAGETYPE_BMP: // 6 |
811 | 811 | // Not supported by PHP GD |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
124 | 124 | if (!empty($perm)) { |
125 | 125 | $tmp = explode(':', $typeofdata); |
126 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
126 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
127 | 127 | if ($fieldrequired) { |
128 | 128 | $ret .= '<span class="fieldrequired">'; |
129 | 129 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | if ($fieldrequired) { |
136 | 136 | $ret .= '</span>'; |
137 | 137 | } |
138 | - $ret .= '</div>' . "\n"; |
|
138 | + $ret .= '</div>'."\n"; |
|
139 | 139 | } else { |
140 | 140 | if ($fieldrequired) { |
141 | 141 | $ret .= '<span class="fieldrequired">'; |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | if (empty($notabletag) && $perm) { |
174 | 174 | $ret .= '<td class="right">'; |
175 | 175 | } |
176 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
177 | - $ret .= '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=edit' . $htmlname . '&token=' . newToken() . '&' . $paramid . '=' . $object->id . $moreparam . '">' . img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)) . '</a>'; |
|
176 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
177 | + $ret .= '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&token='.newToken().'&'.$paramid.'='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).'</a>'; |
|
178 | 178 | } |
179 | 179 | if (!empty($notabletag) && $notabletag == 1) { |
180 | 180 | if ($text) { |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | } elseif ($reg[1] == 'int') { |
242 | 242 | $typeofdata = 'numeric'; |
243 | 243 | } else { |
244 | - return 'ErrorBadParameter ' . $typeofdata; |
|
244 | + return 'ErrorBadParameter '.$typeofdata; |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
@@ -252,13 +252,13 @@ discard block |
||
252 | 252 | if ($editaction == '') { |
253 | 253 | $editaction = GETPOST('action', 'aZ09'); |
254 | 254 | } |
255 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
255 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
256 | 256 | if ($editmode) { // edit mode |
257 | 257 | $ret .= "<!-- formeditfieldval -->\n"; |
258 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
259 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
260 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
261 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
258 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
259 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
260 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
261 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
262 | 262 | if (empty($notabletag)) { |
263 | 263 | $ret .= '<table class="nobordernopadding centpercent">'; |
264 | 264 | } |
@@ -267,28 +267,28 @@ discard block |
||
267 | 267 | } |
268 | 268 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
269 | 269 | $tmp = explode(':', $typeofdata); |
270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
271 | 271 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
272 | 272 | $tmp = explode(':', $typeofdata); |
273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
275 | 275 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
276 | 276 | $tmp = explode(':', $typeofdata); |
277 | 277 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
278 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
278 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
279 | 279 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
280 | 280 | $tmp = explode(':', $typeofdata); |
281 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
281 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
282 | 282 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
283 | 283 | $tmp = explode(':', $typeofdata); |
284 | 284 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
285 | 285 | $morealt = ''; |
286 | 286 | if (preg_match('/%/', $cols)) { |
287 | - $morealt = ' style="width: ' . $cols . '"'; |
|
287 | + $morealt = ' style="width: '.$cols.'"'; |
|
288 | 288 | $cols = ''; |
289 | 289 | } |
290 | 290 | $valuetoshow = ($editvalue ? $editvalue : $value); |
291 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
291 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
292 | 292 | // textarea convert automatically entities chars into simple chars. |
293 | 293 | // So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwyg is off. |
294 | 294 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -298,12 +298,12 @@ discard block |
||
298 | 298 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
299 | 299 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
300 | 300 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
301 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
301 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
302 | 302 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
303 | 303 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
304 | 304 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
305 | 305 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
306 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
306 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
307 | 307 | } elseif (preg_match('/^select;/', $typeofdata)) { |
308 | 308 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
309 | 309 | $arraylist = array(); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | // TODO Not yet implemented. See code for extrafields |
318 | 318 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
319 | 319 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
320 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
320 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
321 | 321 | $doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? 100 : (int) $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? false : (bool) $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? 20 : (int) $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
322 | 322 | $ret .= $doleditor->Create(1); |
323 | 323 | } elseif ($typeofdata == 'asis') { |
@@ -332,19 +332,19 @@ discard block |
||
332 | 332 | $ret .= '<td>'; |
333 | 333 | } |
334 | 334 | //else $ret.='<div class="clearboth"></div>'; |
335 | - $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
335 | + $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
336 | 336 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
337 | - $ret .= '<br>' . "\n"; |
|
337 | + $ret .= '<br>'."\n"; |
|
338 | 338 | } |
339 | - $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
339 | + $ret .= '<input type="submit" class="smallpaddingimp nomargingtop nomarginbottom button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
340 | 340 | if (empty($notabletag)) { |
341 | 341 | $ret .= '</td>'; |
342 | 342 | } |
343 | 343 | |
344 | 344 | if (empty($notabletag)) { |
345 | - $ret .= '</tr></table>' . "\n"; |
|
345 | + $ret .= '</tr></table>'."\n"; |
|
346 | 346 | } |
347 | - $ret .= '</form>' . "\n"; |
|
347 | + $ret .= '</form>'."\n"; |
|
348 | 348 | } else { // view mode |
349 | 349 | if (preg_match('/^email/', $typeofdata)) { |
350 | 350 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -356,15 +356,15 @@ discard block |
||
356 | 356 | $ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); |
357 | 357 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
358 | 358 | $tmp = explode(':', $typeofdata); |
359 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
359 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
360 | 360 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
361 | 361 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
362 | 362 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
363 | 363 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
364 | 364 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
365 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
365 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
366 | 366 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
367 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
367 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
368 | 368 | } elseif (preg_match('/^select;/', $typeofdata)) { |
369 | 369 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
370 | 370 | $arraylist = array(); |
@@ -375,9 +375,9 @@ discard block |
||
375 | 375 | $ret .= $arraylist[$value]; |
376 | 376 | if ($htmlname == 'fk_product_type') { |
377 | 377 | if ($value == 0) { |
378 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
378 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
379 | 379 | } else { |
380 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
380 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
386 | 386 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
387 | 387 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
388 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
388 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
389 | 389 | } |
390 | 390 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
391 | 391 | // clean data from some dangerous html |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
395 | 395 | $ret .= dol_escape_htmltag($value); |
396 | 396 | } else { |
397 | - $ret .= $value; // $value must be already html escaped. |
|
397 | + $ret .= $value; // $value must be already html escaped. |
|
398 | 398 | } |
399 | 399 | } |
400 | 400 | |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | |
433 | 433 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
434 | 434 | if (!is_object($extralanguages)) { |
435 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
435 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
436 | 436 | $extralanguages = new ExtraLanguages($this->db); |
437 | 437 | } |
438 | 438 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -441,17 +441,17 @@ discard block |
||
441 | 441 | return ''; // No extralang field to show |
442 | 442 | } |
443 | 443 | |
444 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
445 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
444 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
445 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
446 | 446 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', 0, 0, 0, '', 'fa-15 editfieldlang'); |
447 | 447 | $result .= $s; |
448 | 448 | $result .= '</div>'; |
449 | 449 | |
450 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
450 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
451 | 451 | |
452 | 452 | $resultforextrlang = ''; |
453 | 453 | foreach ($arrayoflangcode as $langcode) { |
454 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
454 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
455 | 455 | if (empty($valuetoshow)) { |
456 | 456 | $object->fetchValuesForExtraLanguages(); |
457 | 457 | //var_dump($object->array_languages); |
@@ -463,17 +463,17 @@ discard block |
||
463 | 463 | |
464 | 464 | // TODO Use the showInputField() method of ExtraLanguages object |
465 | 465 | if ($typeofdata == 'textarea') { |
466 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
466 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
467 | 467 | $resultforextrlang .= $valuetoshow; |
468 | 468 | $resultforextrlang .= '</textarea>'; |
469 | 469 | } else { |
470 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
470 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
471 | 471 | } |
472 | 472 | } |
473 | 473 | $result .= $resultforextrlang; |
474 | 474 | |
475 | 475 | $result .= '</div>'; |
476 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
476 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | return $result; |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | if (!empty($tmp[2])) { |
537 | 537 | $savemethod = $tmp[2]; |
538 | 538 | } |
539 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
539 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
540 | 540 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
541 | 541 | $tmp = explode(':', $inputType); |
542 | 542 | $inputType = $tmp[0]; |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $savemethod = $tmp[2]; |
548 | 548 | } |
549 | 549 | |
550 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
550 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
551 | 551 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
552 | 552 | $tmp = explode(':', $inputType); |
553 | 553 | $inputType = $tmp[0]; |
@@ -578,40 +578,40 @@ discard block |
||
578 | 578 | } |
579 | 579 | |
580 | 580 | if (isModEnabled('fckeditor')) { |
581 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
581 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
582 | 582 | } else { |
583 | 583 | $inputType = 'textarea'; |
584 | 584 | } |
585 | 585 | } |
586 | 586 | |
587 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
588 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
589 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
590 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
587 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
588 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
589 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
590 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
591 | 591 | if (!empty($savemethod)) { |
592 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
592 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
593 | 593 | } |
594 | 594 | if (!empty($ext_element)) { |
595 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
595 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
596 | 596 | } |
597 | 597 | if (!empty($custommsg)) { |
598 | 598 | if (is_array($custommsg)) { |
599 | 599 | if (!empty($custommsg['success'])) { |
600 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
600 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
601 | 601 | } |
602 | 602 | if (!empty($custommsg['error'])) { |
603 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
603 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
604 | 604 | } |
605 | 605 | } else { |
606 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
606 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
607 | 607 | } |
608 | 608 | } |
609 | 609 | if ($inputType == 'textarea') { |
610 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
611 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
610 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
611 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
612 | 612 | } |
613 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
614 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
613 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
614 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
615 | 615 | } else { |
616 | 616 | $out = $value; |
617 | 617 | } |
@@ -640,12 +640,12 @@ discard block |
||
640 | 640 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
641 | 641 | { |
642 | 642 | if ($incbefore) { |
643 | - $text = $incbefore . $text; |
|
643 | + $text = $incbefore.$text; |
|
644 | 644 | } |
645 | 645 | if (!$htmltext) { |
646 | 646 | return $text; |
647 | 647 | } |
648 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
648 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
649 | 649 | |
650 | 650 | $tag = 'td'; |
651 | 651 | if ($notabs == 2) { |
@@ -659,11 +659,11 @@ discard block |
||
659 | 659 | |
660 | 660 | $extrastyle = ''; |
661 | 661 | if ($direction < 0) { |
662 | - $extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : ''); |
|
662 | + $extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : ''); |
|
663 | 663 | $extrastyle = 'padding: 0px; padding-left: 2px;'; |
664 | 664 | } |
665 | 665 | if ($direction > 0) { |
666 | - $extracss = ($extracss ? $extracss : '') . ($notabs != 3 ? ' inline-block' : ''); |
|
666 | + $extracss = ($extracss ? $extracss : '').($notabs != 3 ? ' inline-block' : ''); |
|
667 | 667 | $extrastyle = 'padding: 0px; padding-right: 2px;'; |
668 | 668 | } |
669 | 669 | |
@@ -676,53 +676,53 @@ discard block |
||
676 | 676 | $htmltext = str_replace('"', '"', $htmltext); |
677 | 677 | } else { |
678 | 678 | $classfortooltip = 'classfortooltiponclick'; |
679 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
679 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
680 | 680 | } |
681 | 681 | if ($tooltipon == 2 || $tooltipon == 3) { |
682 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
682 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
683 | 683 | if ($tooltiptrigger == '') { |
684 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
684 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
685 | 685 | } else { |
686 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
686 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
687 | 687 | } |
688 | 688 | } else { |
689 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
689 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
690 | 690 | } |
691 | 691 | if ($tooltipon == 1 || $tooltipon == 3) { |
692 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ($tag != 'td' ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
692 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.($tag != 'td' ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
693 | 693 | if ($tooltiptrigger == '') { |
694 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
694 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
695 | 695 | } else { |
696 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
696 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
697 | 697 | } |
698 | 698 | } else { |
699 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
699 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
700 | 700 | } |
701 | 701 | if (empty($notabs)) { |
702 | 702 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
703 | 703 | } elseif ($notabs == 2) { |
704 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
704 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
705 | 705 | } |
706 | 706 | // Define value if value is before |
707 | 707 | if ($direction < 0) { |
708 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
708 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
709 | 709 | if ($tag == 'td') { |
710 | 710 | $s .= ' class="valigntop" width="14"'; |
711 | 711 | } |
712 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
712 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
713 | 713 | } |
714 | 714 | // Use another method to help avoid having a space in value in order to use this value with jquery |
715 | 715 | // Define label |
716 | 716 | if ((string) $text != '') { |
717 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
717 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
718 | 718 | } |
719 | 719 | // Define value if value is after |
720 | 720 | if ($direction > 0) { |
721 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
721 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
722 | 722 | if ($tag == 'td') { |
723 | 723 | $s .= ' class="valignmiddle" width="14"'; |
724 | 724 | } |
725 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
725 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
726 | 726 | } |
727 | 727 | if (empty($notabs)) { |
728 | 728 | $s .= '</tr></table>'; |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | |
830 | 830 | $disabled = 0; |
831 | 831 | $ret = '<div class="centpercent center">'; |
832 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
832 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
833 | 833 | |
834 | 834 | // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. |
835 | 835 | $parameters = array(); |
@@ -840,10 +840,10 @@ discard block |
||
840 | 840 | return; |
841 | 841 | } |
842 | 842 | if (empty($reshook)) { |
843 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
843 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
844 | 844 | if (is_array($arrayofaction)) { |
845 | 845 | foreach ($arrayofaction as $code => $label) { |
846 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
846 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
847 | 847 | } |
848 | 848 | } |
849 | 849 | } |
@@ -852,17 +852,17 @@ discard block |
||
852 | 852 | $ret .= '</select>'; |
853 | 853 | |
854 | 854 | if (empty($conf->dol_optimize_smallscreen)) { |
855 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
855 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button |
859 | 859 | $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. |
860 | - $ret .= '<input type="submit" disabled name="confirmmassaction"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display: none"') . ' class="reposition button smallpaddingimp' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'confirmed" value="' . dol_escape_htmltag($langs->trans("Confirm")) . '">'; |
|
860 | + $ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="reposition button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; |
|
861 | 861 | $ret .= '</div>'; |
862 | 862 | |
863 | 863 | if (!empty($conf->use_javascript_ajax)) { |
864 | 864 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
865 | - <script nonce="' . getNonce() . '"> |
|
865 | + <script nonce="' . getNonce().'"> |
|
866 | 866 | function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */ |
867 | 867 | { |
868 | 868 | atleastoneselected=0; |
@@ -873,11 +873,11 @@ discard block |
||
873 | 873 | |
874 | 874 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
875 | 875 | |
876 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
876 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
877 | 877 | { |
878 | 878 | jQuery("."+name).show(); |
879 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
880 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
879 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
880 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
881 | 881 | } |
882 | 882 | else |
883 | 883 | { |
@@ -887,26 +887,26 @@ discard block |
||
887 | 887 | } |
888 | 888 | |
889 | 889 | jQuery(document).ready(function () { |
890 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
891 | - jQuery(".' . $cssclass . '").click(function() { |
|
892 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
890 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
891 | + jQuery(".' . $cssclass.'").click(function() { |
|
892 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
893 | 893 | }); |
894 | - jQuery(".' . $name . 'select").change(function() { |
|
894 | + jQuery(".' . $name.'select").change(function() { |
|
895 | 895 | var massaction = $( this ).val(); |
896 | 896 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
897 | 897 | if (massaction == "builddoc") { |
898 | 898 | urlform = urlform + "#show_files"; |
899 | 899 | } |
900 | 900 | $( this ).closest("form").attr("action", urlform); |
901 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
901 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
902 | 902 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
903 | 903 | if ($(this).val() != \'0\') { |
904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
905 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
906 | - jQuery(".' . $name . '"+massaction).show(); |
|
904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
905 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
906 | + jQuery(".' . $name.'"+massaction).show(); |
|
907 | 907 | } else { |
908 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
909 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
908 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
909 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
910 | 910 | } |
911 | 911 | }); |
912 | 912 | }); |
@@ -949,14 +949,14 @@ discard block |
||
949 | 949 | $atleastonefavorite = 0; |
950 | 950 | |
951 | 951 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
952 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
952 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
953 | 953 | $sql .= " WHERE active > 0"; |
954 | 954 | //$sql.= " ORDER BY code ASC"; |
955 | 955 | |
956 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
956 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
957 | 957 | $resql = $this->db->query($sql); |
958 | 958 | if ($resql) { |
959 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
959 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
960 | 960 | $num = $this->db->num_rows($resql); |
961 | 961 | $i = 0; |
962 | 962 | if ($num) { |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | $countryArray[$i]['rowid'] = $obj->rowid; |
967 | 967 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
968 | 968 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
969 | - $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
969 | + $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso) != "Country".$obj->code_iso ? $langs->transnoentitiesnoconv("Country".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
970 | 970 | $countryArray[$i]['favorite'] = $obj->favorite; |
971 | 971 | $countryArray[$i]['eec'] = $obj->eec; |
972 | 972 | $favorite[$i] = $obj->favorite; |
@@ -984,20 +984,20 @@ discard block |
||
984 | 984 | |
985 | 985 | if ($showempty) { |
986 | 986 | if (is_numeric($showempty)) { |
987 | - $out .= '<option value=""> </option>' . "\n"; |
|
987 | + $out .= '<option value=""> </option>'."\n"; |
|
988 | 988 | } else { |
989 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
989 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
990 | 990 | } |
991 | 991 | } |
992 | 992 | |
993 | 993 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
994 | 994 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
995 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
996 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
995 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
996 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
997 | 997 | if ($mysoc->isInEEC()) { |
998 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
998 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
999 | 999 | } |
1000 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
1000 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
1001 | 1001 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
1002 | 1002 | } |
1003 | 1003 | |
@@ -1025,20 +1025,20 @@ discard block |
||
1025 | 1025 | $labeltoshow .= ' '; |
1026 | 1026 | } |
1027 | 1027 | if ($row['code_iso']) { |
1028 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
1028 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
1029 | 1029 | if (empty($hideflags)) { |
1030 | 1030 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
1031 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
1031 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
1032 | 1032 | } |
1033 | 1033 | } |
1034 | 1034 | |
1035 | 1035 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
1036 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
1036 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" selected data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
1037 | 1037 | } else { |
1038 | - $out .= '<option value="' . ($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']) . '" data-html="' . dol_escape_htmltag($labeltoshow) . '" data-eec="' . ((int) $row['eec']) . '">'; |
|
1038 | + $out .= '<option value="'.($usecodeaskey ? ($usecodeaskey == 'code2' ? $row['code_iso'] : $row['code_iso3']) : $row['rowid']).'" data-html="'.dol_escape_htmltag($labeltoshow).'" data-eec="'.((int) $row['eec']).'">'; |
|
1039 | 1039 | } |
1040 | 1040 | $out .= dol_string_nohtmltag($labeltoshow); |
1041 | - $out .= '</option>' . "\n"; |
|
1041 | + $out .= '</option>'."\n"; |
|
1042 | 1042 | } |
1043 | 1043 | } |
1044 | 1044 | $out .= '</select>'; |
@@ -1047,8 +1047,8 @@ discard block |
||
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | // Make select dynamic |
1050 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1051 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
1050 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1051 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
1052 | 1052 | |
1053 | 1053 | return $out; |
1054 | 1054 | } |
@@ -1080,25 +1080,25 @@ discard block |
||
1080 | 1080 | $incotermArray = array(); |
1081 | 1081 | |
1082 | 1082 | $sql = "SELECT rowid, code"; |
1083 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
1083 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
1084 | 1084 | $sql .= " WHERE active > 0"; |
1085 | 1085 | $sql .= " ORDER BY code ASC"; |
1086 | 1086 | |
1087 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
1087 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
1088 | 1088 | $resql = $this->db->query($sql); |
1089 | 1089 | if ($resql) { |
1090 | 1090 | if ($conf->use_javascript_ajax && !$forcecombo) { |
1091 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1091 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1092 | 1092 | $out .= ajax_combobox($htmlname, $events); |
1093 | 1093 | } |
1094 | 1094 | |
1095 | 1095 | if (!empty($page)) { |
1096 | - $out .= '<form method="post" action="' . $page . '">'; |
|
1096 | + $out .= '<form method="post" action="'.$page.'">'; |
|
1097 | 1097 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
1098 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1098 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1099 | 1099 | } |
1100 | 1100 | |
1101 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
1101 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
1102 | 1102 | $out .= '<option value="0"> </option>'; |
1103 | 1103 | $num = $this->db->num_rows($resql); |
1104 | 1104 | $i = 0; |
@@ -1112,9 +1112,9 @@ discard block |
||
1112 | 1112 | |
1113 | 1113 | foreach ($incotermArray as $row) { |
1114 | 1114 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
1115 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
1115 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
1116 | 1116 | } else { |
1117 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
1117 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | if ($row['code']) { |
@@ -1128,13 +1128,13 @@ discard block |
||
1128 | 1128 | $out .= ajax_combobox($htmlname); |
1129 | 1129 | |
1130 | 1130 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
1131 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
1131 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
1132 | 1132 | $moreattrib .= ' autocomplete="off"'; |
1133 | 1133 | } |
1134 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
1134 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
1135 | 1135 | |
1136 | 1136 | if (!empty($page)) { |
1137 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
1137 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
1138 | 1138 | } |
1139 | 1139 | } else { |
1140 | 1140 | dol_print_error($this->db); |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | if (empty($hidetext)) { |
1170 | 1170 | print $langs->trans("Type").'...'; |
1171 | 1171 | } |
1172 | - print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
1172 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
1173 | 1173 | if ($showempty) { |
1174 | 1174 | print '<option value="-1" class="opacitymedium"'.($useajaxcombo ? '' : ' disabled="disabled"'); |
1175 | 1175 | if ($selected == -1) { |
@@ -1188,31 +1188,31 @@ discard block |
||
1188 | 1188 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
1189 | 1189 | print ' selected'; |
1190 | 1190 | } |
1191 | - print '>' . $langs->trans("Product"); |
|
1191 | + print '>'.$langs->trans("Product"); |
|
1192 | 1192 | |
1193 | 1193 | print '<option value="1"'; |
1194 | 1194 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
1195 | 1195 | print ' selected'; |
1196 | 1196 | } |
1197 | - print '>' . $langs->trans("Service"); |
|
1197 | + print '>'.$langs->trans("Service"); |
|
1198 | 1198 | |
1199 | 1199 | print '</select>'; |
1200 | 1200 | |
1201 | 1201 | if ($useajaxcombo) { |
1202 | - print ajax_combobox('select_' . $htmlname); |
|
1202 | + print ajax_combobox('select_'.$htmlname); |
|
1203 | 1203 | } |
1204 | 1204 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
1205 | 1205 | } |
1206 | 1206 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
1207 | 1207 | print $langs->trans("Service"); |
1208 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
1208 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
1209 | 1209 | } |
1210 | 1210 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
1211 | 1211 | print $langs->trans("Product"); |
1212 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
1212 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
1213 | 1213 | } |
1214 | 1214 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
1215 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
1215 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; // By default we set on service for contract. If CONTRACT_SUPPORT_PRODUCTS is set, forceall should be 1 not -1 |
|
1216 | 1216 | } |
1217 | 1217 | } |
1218 | 1218 | |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | $langs->load("trips"); |
1239 | 1239 | |
1240 | 1240 | $sql = "SELECT c.code, c.label"; |
1241 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
1241 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
1242 | 1242 | $sql .= " WHERE active > 0"; |
1243 | 1243 | |
1244 | 1244 | $resql = $this->db->query($sql); |
@@ -1279,11 +1279,11 @@ discard block |
||
1279 | 1279 | // phpcs:enable |
1280 | 1280 | global $user, $langs; |
1281 | 1281 | |
1282 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
1282 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
1283 | 1283 | |
1284 | 1284 | $this->load_cache_types_fees(); |
1285 | 1285 | |
1286 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
1286 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
1287 | 1287 | if ($showempty) { |
1288 | 1288 | print '<option value="-1"'; |
1289 | 1289 | if ($selected == -1) { |
@@ -1293,7 +1293,7 @@ discard block |
||
1293 | 1293 | } |
1294 | 1294 | |
1295 | 1295 | foreach ($this->cache_types_fees as $key => $value) { |
1296 | - print '<option value="' . $key . '"'; |
|
1296 | + print '<option value="'.$key.'"'; |
|
1297 | 1297 | if ($key == $selected) { |
1298 | 1298 | print ' selected'; |
1299 | 1299 | } |
@@ -1345,12 +1345,12 @@ discard block |
||
1345 | 1345 | $ajaxoptions = array(); |
1346 | 1346 | } |
1347 | 1347 | |
1348 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1348 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1349 | 1349 | |
1350 | 1350 | // No immediate load of all database |
1351 | 1351 | $placeholder = ''; |
1352 | 1352 | if ($selected && empty($selected_input_value)) { |
1353 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
1353 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
1354 | 1354 | $societetmp = new Societe($this->db); |
1355 | 1355 | $societetmp->fetch($selected); |
1356 | 1356 | $selected_input_value = $societetmp->name; |
@@ -1358,11 +1358,11 @@ discard block |
||
1358 | 1358 | } |
1359 | 1359 | |
1360 | 1360 | // mode 1 |
1361 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode((string) ($showtype)) : '') . ($showcode ? '&showcode=' . urlencode((string) ($showcode)) : ''); |
|
1361 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode((string) ($showtype)) : '').($showcode ? '&showcode='.urlencode((string) ($showcode)) : ''); |
|
1362 | 1362 | |
1363 | 1363 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1364 | 1364 | if (empty($hidelabel)) { |
1365 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
1365 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
1366 | 1366 | } elseif ($hidelabel == 1 && !is_numeric($showempty)) { |
1367 | 1367 | $placeholder = $langs->trans($showempty); |
1368 | 1368 | } elseif ($hidelabel > 1) { |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | $out .= img_picto($langs->trans("Search"), 'search'); |
1372 | 1372 | } |
1373 | 1373 | } |
1374 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
1374 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('THIRDPARTY_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
1375 | 1375 | if ($hidelabel == 3) { |
1376 | 1376 | $out .= img_picto($langs->trans("Search"), 'search'); |
1377 | 1377 | } |
@@ -1433,12 +1433,12 @@ discard block |
||
1433 | 1433 | $events = array(); |
1434 | 1434 | } |
1435 | 1435 | |
1436 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1436 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1437 | 1437 | |
1438 | 1438 | // No immediate load of all database |
1439 | 1439 | $placeholder = ''; |
1440 | 1440 | if ($selected && empty($selected_input_value)) { |
1441 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1441 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1442 | 1442 | $contacttmp = new Contact($this->db); |
1443 | 1443 | $contacttmp->fetch($selected); |
1444 | 1444 | $selected_input_value = $contacttmp->getFullName($langs); |
@@ -1449,11 +1449,11 @@ discard block |
||
1449 | 1449 | } |
1450 | 1450 | |
1451 | 1451 | // mode 1 |
1452 | - $urloption = 'htmlname=' . urlencode((string) (str_replace('.', '_', $htmlname))) . '&outjson=1&filter=' . urlencode((string) ($filter)) . (empty($exclude) ? '' : '&exclude=' . urlencode($exclude)) . ($showsoc ? '&showsoc=' . urlencode((string) ($showsoc)) : ''); |
|
1452 | + $urloption = 'htmlname='.urlencode((string) (str_replace('.', '_', $htmlname))).'&outjson=1&filter='.urlencode((string) ($filter)).(empty($exclude) ? '' : '&exclude='.urlencode($exclude)).($showsoc ? '&showsoc='.urlencode((string) ($showsoc)) : ''); |
|
1453 | 1453 | |
1454 | 1454 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1455 | 1455 | |
1456 | - $out .= '<input type="text" class="' . $morecss . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' ' . (getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
1456 | + $out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(getDolGlobalString('CONTACT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
1457 | 1457 | |
1458 | 1458 | $out .= ajax_event($htmlname, $events); |
1459 | 1459 | |
@@ -1552,30 +1552,30 @@ discard block |
||
1552 | 1552 | $sql .= ", s.address, s.zip, s.town"; |
1553 | 1553 | $sql .= ", dictp.code as country_code"; |
1554 | 1554 | } |
1555 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
1555 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
1556 | 1556 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
1557 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1557 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1558 | 1558 | } |
1559 | 1559 | if (!$user->hasRight('societe', 'client', 'voir')) { |
1560 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
1560 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
1561 | 1561 | } |
1562 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
1562 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
1563 | 1563 | if (!empty($user->socid)) { |
1564 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
1564 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
1565 | 1565 | } |
1566 | 1566 | if ($filter) { |
1567 | 1567 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1568 | 1568 | // if not, by testSqlAndScriptInject() only. |
1569 | - $sql .= " AND (" . $filter . ")"; |
|
1569 | + $sql .= " AND (".$filter.")"; |
|
1570 | 1570 | } |
1571 | 1571 | if (!$user->hasRight('societe', 'client', 'voir')) { |
1572 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
1572 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
1573 | 1573 | } |
1574 | 1574 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
1575 | 1575 | $sql .= " AND s.status <> 0"; |
1576 | 1576 | } |
1577 | 1577 | if (!empty($excludeids)) { |
1578 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
1578 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
1579 | 1579 | } |
1580 | 1580 | // Add where from hooks |
1581 | 1581 | $parameters = array(); |
@@ -1595,17 +1595,17 @@ discard block |
||
1595 | 1595 | if ($i > 0) { |
1596 | 1596 | $sql .= " AND "; |
1597 | 1597 | } |
1598 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
1598 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
1599 | 1599 | $i++; |
1600 | 1600 | } |
1601 | 1601 | if (count($search_crit) > 1) { |
1602 | 1602 | $sql .= ")"; |
1603 | 1603 | } |
1604 | 1604 | if (isModEnabled('barcode')) { |
1605 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1605 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1606 | 1606 | } |
1607 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1608 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1607 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1608 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1609 | 1609 | $sql .= ")"; |
1610 | 1610 | } |
1611 | 1611 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1616,7 +1616,7 @@ discard block |
||
1616 | 1616 | $resql = $this->db->query($sql); |
1617 | 1617 | if ($resql) { |
1618 | 1618 | // Construct $out and $outarray |
1619 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
1619 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
1620 | 1620 | |
1621 | 1621 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
1622 | 1622 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1629,7 +1629,7 @@ discard block |
||
1629 | 1629 | } |
1630 | 1630 | } |
1631 | 1631 | if ($showempty) { |
1632 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
1632 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
1633 | 1633 | } |
1634 | 1634 | |
1635 | 1635 | $companytemp = new Societe($this->db); |
@@ -1642,18 +1642,18 @@ discard block |
||
1642 | 1642 | $label = ''; |
1643 | 1643 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
1644 | 1644 | if (($obj->client) && (!empty($obj->code_client))) { |
1645 | - $label = $obj->code_client . ' - '; |
|
1645 | + $label = $obj->code_client.' - '; |
|
1646 | 1646 | } |
1647 | 1647 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
1648 | - $label .= $obj->code_fournisseur . ' - '; |
|
1648 | + $label .= $obj->code_fournisseur.' - '; |
|
1649 | 1649 | } |
1650 | - $label .= ' ' . $obj->name; |
|
1650 | + $label .= ' '.$obj->name; |
|
1651 | 1651 | } else { |
1652 | 1652 | $label = $obj->name; |
1653 | 1653 | } |
1654 | 1654 | |
1655 | 1655 | if (!empty($obj->name_alias)) { |
1656 | - $label .= ' (' . $obj->name_alias . ')'; |
|
1656 | + $label .= ' ('.$obj->name_alias.')'; |
|
1657 | 1657 | } |
1658 | 1658 | |
1659 | 1659 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1668,7 +1668,7 @@ discard block |
||
1668 | 1668 | $companytemp->fournisseur = $obj->fournisseur; |
1669 | 1669 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
1670 | 1670 | if ($tmptype) { |
1671 | - $labelhtml .= ' ' . $tmptype; |
|
1671 | + $labelhtml .= ' '.$tmptype; |
|
1672 | 1672 | } |
1673 | 1673 | |
1674 | 1674 | if ($obj->client || $obj->fournisseur) { |
@@ -1678,10 +1678,10 @@ discard block |
||
1678 | 1678 | $label .= $langs->trans("Customer"); |
1679 | 1679 | } |
1680 | 1680 | if ($obj->client == 2 || $obj->client == 3) { |
1681 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
1681 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
1682 | 1682 | } |
1683 | 1683 | if ($obj->fournisseur) { |
1684 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
1684 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
1685 | 1685 | } |
1686 | 1686 | if ($obj->client || $obj->fournisseur) { |
1687 | 1687 | $label .= ')'; |
@@ -1689,9 +1689,9 @@ discard block |
||
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
1692 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
1692 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
1693 | 1693 | if (!empty($obj->country_code)) { |
1694 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
1694 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
1695 | 1695 | } |
1696 | 1696 | $label .= $s; |
1697 | 1697 | $labelhtml .= $s; |
@@ -1699,9 +1699,9 @@ discard block |
||
1699 | 1699 | |
1700 | 1700 | if (empty($outputmode)) { |
1701 | 1701 | if (in_array($obj->rowid, $selected)) { |
1702 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1702 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1703 | 1703 | } else { |
1704 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1704 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
1705 | 1705 | } |
1706 | 1706 | } else { |
1707 | 1707 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1713,9 +1713,9 @@ discard block |
||
1713 | 1713 | } |
1714 | 1714 | } |
1715 | 1715 | } |
1716 | - $out .= '</select>' . "\n"; |
|
1716 | + $out .= '</select>'."\n"; |
|
1717 | 1717 | if (!$forcecombo) { |
1718 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1718 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1719 | 1719 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("COMPANY_USE_SEARCH_TO_SELECT")); |
1720 | 1720 | } |
1721 | 1721 | } else { |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | } |
1805 | 1805 | |
1806 | 1806 | if (!is_object($hookmanager)) { |
1807 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
1807 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
1808 | 1808 | $hookmanager = new HookManager($this->db); |
1809 | 1809 | } |
1810 | 1810 | |
@@ -1813,14 +1813,14 @@ discard block |
||
1813 | 1813 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
1814 | 1814 | $sql .= ", s.nom as company, s.town AS company_town"; |
1815 | 1815 | } |
1816 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
1816 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
1817 | 1817 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
1818 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
1818 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
1819 | 1819 | } |
1820 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
1820 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
1821 | 1821 | $sql .= " AND ((sp.fk_user_creat = ".((int) $user->id)." AND sp.priv = 1) OR sp.priv = 0)"; // check if this is a private contact |
1822 | 1822 | if ($socid > 0 || $socid == -1) { |
1823 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
1823 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
1824 | 1824 | } |
1825 | 1825 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
1826 | 1826 | $sql .= " AND sp.statut <> 0"; |
@@ -1828,7 +1828,7 @@ discard block |
||
1828 | 1828 | if ($filter) { |
1829 | 1829 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1830 | 1830 | // if not, by testSqlAndScriptInject() only. |
1831 | - $sql .= " AND (" . $filter . ")"; |
|
1831 | + $sql .= " AND (".$filter.")"; |
|
1832 | 1832 | } |
1833 | 1833 | // Add where from hooks |
1834 | 1834 | $parameters = array(); |
@@ -1836,30 +1836,30 @@ discard block |
||
1836 | 1836 | $sql .= $hookmanager->resPrint; |
1837 | 1837 | $sql .= " ORDER BY sp.lastname ASC"; |
1838 | 1838 | |
1839 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
1839 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
1840 | 1840 | $resql = $this->db->query($sql); |
1841 | 1841 | if ($resql) { |
1842 | 1842 | $num = $this->db->num_rows($resql); |
1843 | 1843 | |
1844 | 1844 | if ($htmlname != 'none' && !$options_only) { |
1845 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
1845 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
1846 | 1846 | } |
1847 | 1847 | |
1848 | 1848 | if ($showempty && !is_numeric($showempty)) { |
1849 | 1849 | $textforempty = $showempty; |
1850 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
1850 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
1851 | 1851 | } else { |
1852 | 1852 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
1853 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
1853 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
1854 | 1854 | } |
1855 | 1855 | if ($showempty == 2) { |
1856 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
1856 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
1857 | 1857 | } |
1858 | 1858 | } |
1859 | 1859 | |
1860 | 1860 | $i = 0; |
1861 | 1861 | if ($num) { |
1862 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1862 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
1863 | 1863 | $contactstatic = new Contact($this->db); |
1864 | 1864 | |
1865 | 1865 | while ($i < $num) { |
@@ -1895,7 +1895,7 @@ discard block |
||
1895 | 1895 | } |
1896 | 1896 | $extendedInfos = implode(' - ', $extendedInfos); |
1897 | 1897 | if (!empty($extendedInfos)) { |
1898 | - $extendedInfos = ' - ' . $extendedInfos; |
|
1898 | + $extendedInfos = ' - '.$extendedInfos; |
|
1899 | 1899 | } |
1900 | 1900 | } |
1901 | 1901 | |
@@ -1913,35 +1913,35 @@ discard block |
||
1913 | 1913 | $disabled = 1; |
1914 | 1914 | } |
1915 | 1915 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
1916 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1916 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1917 | 1917 | if ($disabled) { |
1918 | 1918 | $out .= ' disabled'; |
1919 | 1919 | } |
1920 | 1920 | $out .= ' selected>'; |
1921 | 1921 | |
1922 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
1922 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
1923 | 1923 | if ($showfunction && $obj->poste) { |
1924 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
1924 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
1925 | 1925 | } |
1926 | 1926 | if (($showsoc > 0) && $obj->company) { |
1927 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
1927 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
1928 | 1928 | } |
1929 | 1929 | |
1930 | 1930 | $out .= $tmplabel; |
1931 | 1931 | $out .= '</option>'; |
1932 | 1932 | } else { |
1933 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
1933 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
1934 | 1934 | if ($disabled) { |
1935 | 1935 | $out .= ' disabled'; |
1936 | 1936 | } |
1937 | 1937 | $out .= '>'; |
1938 | 1938 | |
1939 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
1939 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
1940 | 1940 | if ($showfunction && $obj->poste) { |
1941 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
1941 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
1942 | 1942 | } |
1943 | 1943 | if (($showsoc > 0) && $obj->company) { |
1944 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
1944 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
1945 | 1945 | } |
1946 | 1946 | |
1947 | 1947 | $out .= $tmplabel; |
@@ -1949,12 +1949,12 @@ discard block |
||
1949 | 1949 | } |
1950 | 1950 | } else { |
1951 | 1951 | if (in_array($obj->rowid, $selected)) { |
1952 | - $tmplabel = $contactstatic->getFullName($langs) . $extendedInfos; |
|
1952 | + $tmplabel = $contactstatic->getFullName($langs).$extendedInfos; |
|
1953 | 1953 | if ($showfunction && $obj->poste) { |
1954 | - $tmplabel .= ' (' . $obj->poste . ')'; |
|
1954 | + $tmplabel .= ' ('.$obj->poste.')'; |
|
1955 | 1955 | } |
1956 | 1956 | if (($showsoc > 0) && $obj->company) { |
1957 | - $tmplabel .= ' - (' . $obj->company . ')'; |
|
1957 | + $tmplabel .= ' - ('.$obj->company.')'; |
|
1958 | 1958 | } |
1959 | 1959 | |
1960 | 1960 | $out .= $tmplabel; |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | } |
1970 | 1970 | } else { |
1971 | 1971 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
1972 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
1972 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
1973 | 1973 | $out .= $labeltoshow; |
1974 | 1974 | $out .= '</option>'; |
1975 | 1975 | } |
@@ -1990,7 +1990,7 @@ discard block |
||
1990 | 1990 | } |
1991 | 1991 | |
1992 | 1992 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
1993 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1993 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
1994 | 1994 | $out .= ajax_combobox($htmlid, $events, getDolGlobalInt("CONTACT_USE_SEARCH_TO_SELECT")); |
1995 | 1995 | } |
1996 | 1996 | |
@@ -2029,18 +2029,18 @@ discard block |
||
2029 | 2029 | // On recherche les remises |
2030 | 2030 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
2031 | 2031 | $sql .= " re.description, re.fk_facture_source"; |
2032 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
2033 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
2034 | - $sql .= " AND re.entity = " . $conf->entity; |
|
2032 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
2033 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
2034 | + $sql .= " AND re.entity = ".$conf->entity; |
|
2035 | 2035 | if ($filter) { |
2036 | - $sql .= " AND " . $filter; |
|
2036 | + $sql .= " AND ".$filter; |
|
2037 | 2037 | } |
2038 | 2038 | $sql .= " ORDER BY re.description ASC"; |
2039 | 2039 | |
2040 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
2040 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
2041 | 2041 | $resql = $this->db->query($sql); |
2042 | 2042 | if ($resql) { |
2043 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
2043 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
2044 | 2044 | $num = $this->db->num_rows($resql); |
2045 | 2045 | |
2046 | 2046 | $qualifiedlines = $num; |
@@ -2078,16 +2078,16 @@ discard block |
||
2078 | 2078 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
2079 | 2079 | $tmpfac = new Facture($this->db); |
2080 | 2080 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
2081 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
2081 | + $desc = $desc.' - '.$tmpfac->ref; |
|
2082 | 2082 | } |
2083 | 2083 | } |
2084 | 2084 | |
2085 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
2085 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
2086 | 2086 | $i++; |
2087 | 2087 | } |
2088 | 2088 | } |
2089 | 2089 | print '</select>'; |
2090 | - print ajax_combobox('select_' . $htmlname); |
|
2090 | + print ajax_combobox('select_'.$htmlname); |
|
2091 | 2091 | |
2092 | 2092 | return $qualifiedlines; |
2093 | 2093 | } else { |
@@ -2196,14 +2196,14 @@ discard block |
||
2196 | 2196 | if ($showlabelofentity) { |
2197 | 2197 | $sql .= ", e.label"; |
2198 | 2198 | } |
2199 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
2199 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
2200 | 2200 | if ($showlabelofentity) { |
2201 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
2201 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
2202 | 2202 | } |
2203 | 2203 | // Condition here should be the same than into societe->getSalesRepresentatives(). |
2204 | 2204 | if ($userissuperadminentityone && $force_entity != 'default') { |
2205 | 2205 | if (!empty($force_entity)) { |
2206 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
2206 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
2207 | 2207 | } else { |
2208 | 2208 | $sql .= " WHERE u.entity IS NOT NULL"; |
2209 | 2209 | } |
@@ -2211,18 +2211,18 @@ discard block |
||
2211 | 2211 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
2212 | 2212 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
2213 | 2213 | } else { |
2214 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
2214 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
2215 | 2215 | } |
2216 | 2216 | } |
2217 | 2217 | |
2218 | 2218 | if (!empty($user->socid)) { |
2219 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
2219 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
2220 | 2220 | } |
2221 | 2221 | if (is_array($exclude) && $excludeUsers) { |
2222 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
2222 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
2223 | 2223 | } |
2224 | 2224 | if ($includeUsers) { |
2225 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
2225 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
2226 | 2226 | } |
2227 | 2227 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
2228 | 2228 | $sql .= " AND u.statut <> 0"; |
@@ -2259,7 +2259,7 @@ discard block |
||
2259 | 2259 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
2260 | 2260 | } |
2261 | 2261 | |
2262 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
2262 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
2263 | 2263 | |
2264 | 2264 | $resql = $this->db->query($sql); |
2265 | 2265 | if ($resql) { |
@@ -2267,7 +2267,7 @@ discard block |
||
2267 | 2267 | $i = 0; |
2268 | 2268 | if ($num) { |
2269 | 2269 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
2270 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
2270 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
2271 | 2271 | if ($show_empty && !$multiple) { |
2272 | 2272 | $textforempty = ' '; |
2273 | 2273 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2276,7 +2276,7 @@ discard block |
||
2276 | 2276 | if (!is_numeric($show_empty)) { |
2277 | 2277 | $textforempty = $show_empty; |
2278 | 2278 | } |
2279 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
2279 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
2280 | 2280 | |
2281 | 2281 | $outarray[($show_empty < 0 ? $show_empty : -1)] = $textforempty; |
2282 | 2282 | $outarray2[($show_empty < 0 ? $show_empty : -1)] = array( |
@@ -2288,13 +2288,13 @@ discard block |
||
2288 | 2288 | ); |
2289 | 2289 | } |
2290 | 2290 | if ($show_every) { |
2291 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
2291 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
2292 | 2292 | |
2293 | - $outarray[-2] = '-- ' . $langs->trans("Everybody") . ' --'; |
|
2293 | + $outarray[-2] = '-- '.$langs->trans("Everybody").' --'; |
|
2294 | 2294 | $outarray2[-2] = array( |
2295 | 2295 | 'id' => -2, |
2296 | - 'label' => '-- ' . $langs->trans("Everybody") . ' --', |
|
2297 | - 'labelhtml' => '-- ' . $langs->trans("Everybody") . ' --', |
|
2296 | + 'label' => '-- '.$langs->trans("Everybody").' --', |
|
2297 | + 'labelhtml' => '-- '.$langs->trans("Everybody").' --', |
|
2298 | 2298 | 'color' => '', |
2299 | 2299 | 'picto' => '' |
2300 | 2300 | ); |
@@ -2345,21 +2345,21 @@ discard block |
||
2345 | 2345 | } |
2346 | 2346 | if ($showstatus >= 0) { |
2347 | 2347 | if ($obj->status == 1 && $showstatus == 1) { |
2348 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
2349 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
2348 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
2349 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
2350 | 2350 | } |
2351 | 2351 | if ($obj->status == 0 && $showstatus == 1) { |
2352 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
2353 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
2352 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
2353 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
2354 | 2354 | } |
2355 | 2355 | } |
2356 | 2356 | if ($showlabelofentity) { |
2357 | 2357 | if (empty($obj->entity)) { |
2358 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
2359 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
2358 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
2359 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
2360 | 2360 | } else { |
2361 | 2361 | if ($obj->entity != $conf->entity) { |
2362 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2362 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2363 | 2363 | $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
2364 | 2364 | } |
2365 | 2365 | } |
@@ -2368,13 +2368,13 @@ discard block |
||
2368 | 2368 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
2369 | 2369 | if (!empty($disableline) && $disableline != '1') { |
2370 | 2370 | // Add text from $enableonlytext parameter |
2371 | - $moreinfo .= ' - ' . $disableline; |
|
2372 | - $moreinfohtml .= ' - ' . $disableline; |
|
2371 | + $moreinfo .= ' - '.$disableline; |
|
2372 | + $moreinfohtml .= ' - '.$disableline; |
|
2373 | 2373 | } |
2374 | 2374 | $labeltoshow .= $moreinfo; |
2375 | 2375 | $labeltoshowhtml .= $moreinfohtml; |
2376 | 2376 | |
2377 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2377 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2378 | 2378 | if (!empty($disableline)) { |
2379 | 2379 | $out .= ' disabled'; |
2380 | 2380 | } |
@@ -2383,7 +2383,7 @@ discard block |
||
2383 | 2383 | } |
2384 | 2384 | $out .= ' data-html="'; |
2385 | 2385 | |
2386 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
2386 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
2387 | 2387 | if ($showstatus >= 0 && $obj->status == 0) { |
2388 | 2388 | $outhtml .= '<strike class="opacitymediumxxx">'; |
2389 | 2389 | } |
@@ -2398,7 +2398,7 @@ discard block |
||
2398 | 2398 | $out .= $labeltoshow; |
2399 | 2399 | $out .= '</option>'; |
2400 | 2400 | |
2401 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
2401 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
2402 | 2402 | $outarray2[$userstatic->id] = array( |
2403 | 2403 | 'id' => $userstatic->id, |
2404 | 2404 | 'label' => $labeltoshow, |
@@ -2410,14 +2410,14 @@ discard block |
||
2410 | 2410 | $i++; |
2411 | 2411 | } |
2412 | 2412 | } else { |
2413 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
2414 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
2413 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
2414 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
2415 | 2415 | } |
2416 | 2416 | $out .= '</select>'; |
2417 | 2417 | |
2418 | 2418 | if ($num && !$forcecombo) { |
2419 | 2419 | // Enhance with select2 |
2420 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2420 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2421 | 2421 | $out .= ajax_combobox($htmlname); |
2422 | 2422 | } |
2423 | 2423 | } else { |
@@ -2494,7 +2494,7 @@ discard block |
||
2494 | 2494 | $out .= $userstatic->getNomUrl(-1); |
2495 | 2495 | if ($i == 0) { |
2496 | 2496 | $ownerid = $value['id']; |
2497 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
2497 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
2498 | 2498 | } |
2499 | 2499 | // Add picto to delete owner/assignee |
2500 | 2500 | if ($nbassignetouser > 1 && $action != 'view') { |
@@ -2505,7 +2505,7 @@ discard block |
||
2505 | 2505 | $canremoveassignee = 0; |
2506 | 2506 | } |
2507 | 2507 | if (!$user->hasRight('agenda', 'allactions', 'create')) { |
2508 | - $canremoveassignee = 0; // Can't remove the owner |
|
2508 | + $canremoveassignee = 0; // Can't remove the owner |
|
2509 | 2509 | } |
2510 | 2510 | } else { |
2511 | 2511 | // We are not on the owner of the event but on a secondary assignee |
@@ -2513,14 +2513,14 @@ discard block |
||
2513 | 2513 | if ($canremoveassignee) { |
2514 | 2514 | // If user has all permission, he should be ableto remove a assignee. |
2515 | 2515 | // If user has not all permission, he can onlyremove assignee of other (he can't remove itself) |
2516 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $userstatic->id . '" class="removedassigned reposition" id="removedassigned_' . $userstatic->id . '" name="removedassigned_' . $userstatic->id . '">'; |
|
2516 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; |
|
2517 | 2517 | } |
2518 | 2518 | } |
2519 | 2519 | // Show my availability |
2520 | 2520 | if ($showproperties) { |
2521 | 2521 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
2522 | 2522 | $out .= '<div class="myavailability inline-block">'; |
2523 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparency" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofuserid[$ownerid]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
2523 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparency" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofuserid[$ownerid]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
2524 | 2524 | $out .= '</div>'; |
2525 | 2525 | } |
2526 | 2526 | } |
@@ -2537,15 +2537,15 @@ discard block |
||
2537 | 2537 | // Method with no ajax |
2538 | 2538 | if ($action != 'view') { |
2539 | 2539 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
2540 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2540 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2541 | 2541 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
2542 | 2542 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
2543 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
2544 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
2543 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
2544 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
2545 | 2545 | $out .= '});'; |
2546 | 2546 | $out .= '})</script>'; |
2547 | 2547 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2548 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2548 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2549 | 2549 | $out .= '<br>'; |
2550 | 2550 | } |
2551 | 2551 | |
@@ -2604,13 +2604,13 @@ discard block |
||
2604 | 2604 | $resourcestatic->fetch($value['id']); |
2605 | 2605 | $out .= $resourcestatic->getNomUrl(-1); |
2606 | 2606 | if ($nbassignetoresource >= 1 && $action != 'view') { |
2607 | - $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassignedresource reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
2607 | + $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassignedresource reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
|
2608 | 2608 | } |
2609 | 2609 | // Show my availability |
2610 | 2610 | if ($showproperties) { |
2611 | 2611 | if (is_array($listofresourceid) && count($listofresourceid)) { |
2612 | 2612 | $out .= '<div class="myavailability inline-block">'; |
2613 | - $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">' . $langs->trans("Availability") . ':</span> </span><input id="transparencyresource" class="paddingrightonly" ' . ($action == 'view' ? 'disabled' : '') . ' type="checkbox" name="transparency"' . ($listofresourceid[$value['id']]['transparency'] ? ' checked' : '') . '><label for="transparency">' . $langs->trans("Busy") . '</label>'; |
|
2613 | + $out .= '<span class="hideonsmartphone"> - <span class="opacitymedium">'.$langs->trans("Availability").':</span> </span><input id="transparencyresource" class="paddingrightonly" '.($action == 'view' ? 'disabled' : '').' type="checkbox" name="transparency"'.($listofresourceid[$value['id']]['transparency'] ? ' checked' : '').'><label for="transparency">'.$langs->trans("Busy").'</label>'; |
|
2614 | 2614 | $out .= '</div>'; |
2615 | 2615 | } |
2616 | 2616 | } |
@@ -2627,11 +2627,11 @@ discard block |
||
2627 | 2627 | // Method with no ajax |
2628 | 2628 | if ($action != 'view') { |
2629 | 2629 | $out .= '<input type="hidden" class="removedassignedresourcehidden" name="removedassignedresource" value="">'; |
2630 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2630 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
2631 | 2631 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
2632 | 2632 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
2633 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
2634 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
2633 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
2634 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
2635 | 2635 | $out .= '});'; |
2636 | 2636 | $out .= '})</script>'; |
2637 | 2637 | |
@@ -2639,7 +2639,7 @@ discard block |
||
2639 | 2639 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
2640 | 2640 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0); |
2641 | 2641 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2642 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2642 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
2643 | 2643 | $out .= '<br>'; |
2644 | 2644 | } |
2645 | 2645 | |
@@ -2702,7 +2702,7 @@ discard block |
||
2702 | 2702 | $placeholder = (is_numeric($showempty) ? '' : 'placeholder="'.dolPrintHTML($showempty).'"'); |
2703 | 2703 | |
2704 | 2704 | if ($selected && empty($selected_input_value)) { |
2705 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2705 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2706 | 2706 | $producttmpselect = new Product($this->db); |
2707 | 2707 | $producttmpselect->fetch($selected); |
2708 | 2708 | $selected_input_value = $producttmpselect->ref; |
@@ -2717,21 +2717,21 @@ discard block |
||
2717 | 2717 | } |
2718 | 2718 | } |
2719 | 2719 | // mode=1 means customers products |
2720 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=1&status=' . $status . '&status_purchase=' . $status_purchase . '&finished=' . $finished . '&hidepriceinlabel=' . $hidepriceinlabel . '&warehousestatus=' . $warehouseStatus; |
|
2720 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&status_purchase='.$status_purchase.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus; |
|
2721 | 2721 | if ((int) $warehouseId > 0) { |
2722 | - $urloption .= '&warehouseid=' . (int) $warehouseId; |
|
2722 | + $urloption .= '&warehouseid='.(int) $warehouseId; |
|
2723 | 2723 | } |
2724 | 2724 | |
2725 | - $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
2725 | + $out .= ajax_autocompleter((string) $selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), getDolGlobalInt('PRODUCT_SEARCH_AUTO_SELECT_IF_ONLY_ONE', 1), $ajaxoptions); |
|
2726 | 2726 | |
2727 | 2727 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
2728 | 2728 | // Code to automatically insert with javascript the select of attributes under the select of product |
2729 | 2729 | // when a parent of variant has been selected. |
2730 | 2730 | $out .= ' |
2731 | 2731 | <!-- script to auto show attributes select tags if a variant was selected --> |
2732 | - <script nonce="' . getNonce() . '"> |
|
2732 | + <script nonce="' . getNonce().'"> |
|
2733 | 2733 | // auto show attributes fields |
2734 | - selected = ' . json_encode($selected_combinations) . '; |
|
2734 | + selected = ' . json_encode($selected_combinations).'; |
|
2735 | 2735 | combvalues = {}; |
2736 | 2736 | |
2737 | 2737 | jQuery(document).ready(function () { |
@@ -2742,7 +2742,7 @@ discard block |
||
2742 | 2742 | } |
2743 | 2743 | }); |
2744 | 2744 | |
2745 | - jQuery("input#' . $htmlname . '").change(function () { |
|
2745 | + jQuery("input#' . $htmlname.'").change(function () { |
|
2746 | 2746 | |
2747 | 2747 | if (!jQuery(this).val()) { |
2748 | 2748 | jQuery(\'div#attributes_box\').empty(); |
@@ -2751,7 +2751,7 @@ discard block |
||
2751 | 2751 | |
2752 | 2752 | console.log("A change has started. We get variants fields to inject html select"); |
2753 | 2753 | |
2754 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
2754 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
2755 | 2755 | id: jQuery(this).val() |
2756 | 2756 | }, function (data) { |
2757 | 2757 | jQuery(\'div#attributes_box\').empty(); |
@@ -2794,22 +2794,22 @@ discard block |
||
2794 | 2794 | }) |
2795 | 2795 | }); |
2796 | 2796 | |
2797 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
2797 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
2798 | 2798 | }); |
2799 | 2799 | </script> |
2800 | 2800 | '; |
2801 | 2801 | } |
2802 | 2802 | |
2803 | 2803 | if (empty($hidelabel)) { |
2804 | - $placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"'; |
|
2804 | + $placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"'; |
|
2805 | 2805 | } elseif ($hidelabel > 1) { |
2806 | - $placeholder = ' placeholder="' . dolPrintHTMLForAttribute($langs->trans("RefOrLabel")) . '"'; |
|
2806 | + $placeholder = ' placeholder="'.dolPrintHTMLForAttribute($langs->trans("RefOrLabel")).'"'; |
|
2807 | 2807 | if ($hidelabel == 2) { |
2808 | 2808 | $out .= img_picto($langs->trans("Search"), 'search'); |
2809 | 2809 | } |
2810 | 2810 | } |
2811 | 2811 | |
2812 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
2812 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
2813 | 2813 | if ($hidelabel == 3) { |
2814 | 2814 | $out .= img_picto($langs->trans("Search"), 'search'); |
2815 | 2815 | } |
@@ -2846,33 +2846,33 @@ discard block |
||
2846 | 2846 | // phpcs:enable |
2847 | 2847 | global $db; |
2848 | 2848 | |
2849 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2849 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2850 | 2850 | |
2851 | 2851 | $error = 0; |
2852 | 2852 | $out = ''; |
2853 | 2853 | |
2854 | 2854 | if (!$forcecombo) { |
2855 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2855 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
2856 | 2856 | $events = array(); |
2857 | 2857 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2858 | 2858 | } |
2859 | 2859 | |
2860 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2860 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
2861 | 2861 | |
2862 | 2862 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
2863 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
2864 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
2863 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
2864 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
2865 | 2865 | if (!empty($status)) { |
2866 | - $sql .= ' AND status = ' . (int) $status; |
|
2866 | + $sql .= ' AND status = '.(int) $status; |
|
2867 | 2867 | } |
2868 | 2868 | if (!empty($type)) { |
2869 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
2869 | + $sql .= ' AND bomtype = '.(int) $type; |
|
2870 | 2870 | } |
2871 | 2871 | if (!empty($TProducts)) { |
2872 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
2872 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
2873 | 2873 | } |
2874 | 2874 | if (!empty($limit)) { |
2875 | - $sql .= ' LIMIT ' . (int) $limit; |
|
2875 | + $sql .= ' LIMIT '.(int) $limit; |
|
2876 | 2876 | } |
2877 | 2877 | $resql = $db->query($sql); |
2878 | 2878 | if ($resql) { |
@@ -2886,11 +2886,11 @@ discard block |
||
2886 | 2886 | while ($obj = $db->fetch_object($resql)) { |
2887 | 2887 | $product = new Product($db); |
2888 | 2888 | $res = $product->fetch($obj->fk_product); |
2889 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
2889 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
2890 | 2890 | if ($obj->rowid == $selected) { |
2891 | 2891 | $out .= 'selected'; |
2892 | 2892 | } |
2893 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
2893 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
2894 | 2894 | } |
2895 | 2895 | } else { |
2896 | 2896 | $error++; |
@@ -2948,7 +2948,7 @@ discard block |
||
2948 | 2948 | |
2949 | 2949 | $warehouseStatusArray = array(); |
2950 | 2950 | if (!empty($warehouseStatus)) { |
2951 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
2951 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
2952 | 2952 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
2953 | 2953 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
2954 | 2954 | } |
@@ -2962,9 +2962,9 @@ discard block |
||
2962 | 2962 | |
2963 | 2963 | $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_country, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.default_vat_code, p.duration, p.fk_price_expression"; |
2964 | 2964 | if (count($warehouseStatusArray)) { |
2965 | - $selectFieldsGrouped = ", sum(" . $this->db->ifsql("e.statut IS NULL", "0", "ps.reel") . ") as stock"; // e.statut is null if there is no record in stock |
|
2965 | + $selectFieldsGrouped = ", sum(".$this->db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock |
|
2966 | 2966 | } else { |
2967 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
2967 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
2968 | 2968 | } |
2969 | 2969 | |
2970 | 2970 | $sql = "SELECT "; |
@@ -2980,9 +2980,9 @@ discard block |
||
2980 | 2980 | |
2981 | 2981 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
2982 | 2982 | //Product category |
2983 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
2984 | - FROM " . $this->db->prefix() . "categorie_product |
|
2985 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
2983 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
2984 | + FROM " . $this->db->prefix()."categorie_product |
|
2985 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
2986 | 2986 | LIMIT 1 |
2987 | 2987 | ) AS categorie_product_id "; |
2988 | 2988 | } |
@@ -3008,15 +3008,15 @@ discard block |
||
3008 | 3008 | } |
3009 | 3009 | // Price by quantity |
3010 | 3010 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
3011 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
3011 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
3012 | 3012 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
3013 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
3013 | + $sql .= " AND price_level = ".((int) $price_level); |
|
3014 | 3014 | } |
3015 | 3015 | $sql .= " ORDER BY date_price"; |
3016 | 3016 | $sql .= " DESC LIMIT 1) as price_rowid"; |
3017 | - $sql .= ", (SELECT pp.price_by_qty FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
3017 | + $sql .= ", (SELECT pp.price_by_qty FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; // price_by_qty is 1 if some prices by qty exists in subtable |
|
3018 | 3018 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
3019 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
3019 | + $sql .= " AND price_level = ".((int) $price_level); |
|
3020 | 3020 | } |
3021 | 3021 | $sql .= " ORDER BY date_price"; |
3022 | 3022 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -3026,7 +3026,7 @@ discard block |
||
3026 | 3026 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
3027 | 3027 | |
3028 | 3028 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_FORCE_INDEX')) { |
3029 | - $sql .= " USE INDEX (" . $this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')) . ")"; |
|
3029 | + $sql .= " USE INDEX (".$this->db->sanitize(getDolGlobalString('MAIN_PRODUCT_FORCE_INDEX')).")"; |
|
3030 | 3030 | } |
3031 | 3031 | |
3032 | 3032 | // Add from (left join) from hooks |
@@ -3035,53 +3035,53 @@ discard block |
||
3035 | 3035 | $sql .= $hookmanager->resPrint; |
3036 | 3036 | |
3037 | 3037 | if (count($warehouseStatusArray)) { |
3038 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
3039 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
3040 | - $sql .= ' AND e.statut IN (' . $this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))) . ')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
3038 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
3039 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
3040 | + $sql .= ' AND e.statut IN ('.$this->db->sanitize($this->db->escape(implode(',', $warehouseStatusArray))).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0. |
|
3041 | 3041 | } |
3042 | 3042 | |
3043 | 3043 | // include search in supplier ref |
3044 | 3044 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
3045 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3045 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3046 | 3046 | } |
3047 | 3047 | |
3048 | 3048 | //Price by customer |
3049 | 3049 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
3050 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
3050 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
3051 | 3051 | } |
3052 | 3052 | // Units |
3053 | 3053 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3054 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3054 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
3055 | 3055 | } |
3056 | 3056 | // Multilang : we add translation |
3057 | 3057 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
3058 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
3058 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
3059 | 3059 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
3060 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
3060 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
3061 | 3061 | $soc = new Societe($this->db); |
3062 | 3062 | $result = $soc->fetch($socid); |
3063 | 3063 | if ($result > 0 && !empty($soc->default_lang)) { |
3064 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
3064 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
3065 | 3065 | } else { |
3066 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
3066 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
3067 | 3067 | } |
3068 | 3068 | } else { |
3069 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
3069 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
3070 | 3070 | } |
3071 | 3071 | } |
3072 | 3072 | |
3073 | 3073 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
3074 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
3074 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
3075 | 3075 | } |
3076 | 3076 | |
3077 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
3077 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
3078 | 3078 | |
3079 | 3079 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
3080 | 3080 | $sql .= " AND pac.rowid IS NULL"; |
3081 | 3081 | } |
3082 | 3082 | |
3083 | 3083 | if ($finished == 0) { |
3084 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
3084 | + $sql .= " AND p.finished = ".((int) $finished); |
|
3085 | 3085 | } elseif ($finished == 1) { |
3086 | 3086 | $sql .= " AND p.finished = ".((int) $finished); |
3087 | 3087 | } |
@@ -3089,11 +3089,11 @@ discard block |
||
3089 | 3089 | $sql .= " AND p.tosell = ".((int) $status); |
3090 | 3090 | } |
3091 | 3091 | if ($status_purchase >= 0) { |
3092 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
3092 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
3093 | 3093 | } |
3094 | 3094 | // Filter by product type |
3095 | 3095 | if (strval($filtertype) != '') { |
3096 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3096 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
3097 | 3097 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
3098 | 3098 | $sql .= " AND p.fk_product_type = 1"; |
3099 | 3099 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -3101,7 +3101,7 @@ discard block |
||
3101 | 3101 | } |
3102 | 3102 | |
3103 | 3103 | if ((int) $warehouseId > 0) { |
3104 | - $sql .= " AND EXISTS (SELECT psw.fk_product FROM " . $this->db->prefix() . "product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
3104 | + $sql .= " AND EXISTS (SELECT psw.fk_product FROM ".$this->db->prefix()."product_stock as psw WHERE psw.reel>0 AND psw.fk_entrepot=".(int) $warehouseId." AND psw.fk_product = p.rowid)"; |
|
3105 | 3105 | } |
3106 | 3106 | |
3107 | 3107 | // Add where from hooks |
@@ -3122,21 +3122,21 @@ discard block |
||
3122 | 3122 | if ($i > 0) { |
3123 | 3123 | $sql .= " AND "; |
3124 | 3124 | } |
3125 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3125 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3126 | 3126 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
3127 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3127 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3128 | 3128 | } |
3129 | 3129 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) && !empty($socid)) { |
3130 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3130 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3131 | 3131 | } |
3132 | 3132 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
3133 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3133 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3134 | 3134 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
3135 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3135 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3136 | 3136 | } |
3137 | 3137 | } |
3138 | 3138 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
3139 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3139 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3140 | 3140 | } |
3141 | 3141 | $sql .= ")"; |
3142 | 3142 | $i++; |
@@ -3145,12 +3145,12 @@ discard block |
||
3145 | 3145 | $sql .= ")"; |
3146 | 3146 | } |
3147 | 3147 | if (isModEnabled('barcode')) { |
3148 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3148 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3149 | 3149 | } |
3150 | 3150 | $sql .= ')'; |
3151 | 3151 | } |
3152 | 3152 | if (count($warehouseStatusArray)) { |
3153 | - $sql .= " GROUP BY " . $selectFields; |
|
3153 | + $sql .= " GROUP BY ".$selectFields; |
|
3154 | 3154 | } |
3155 | 3155 | |
3156 | 3156 | //Sort by category |
@@ -3165,23 +3165,23 @@ discard block |
||
3165 | 3165 | $sql .= $this->db->plimit($limit, 0); |
3166 | 3166 | |
3167 | 3167 | // Build output string |
3168 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
3168 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
3169 | 3169 | $result = $this->db->query($sql); |
3170 | 3170 | if ($result) { |
3171 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3172 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3173 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3171 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
3172 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3173 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
3174 | 3174 | |
3175 | 3175 | $num = $this->db->num_rows($result); |
3176 | 3176 | |
3177 | 3177 | $events = array(); |
3178 | 3178 | |
3179 | 3179 | if (!$forcecombo) { |
3180 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
3180 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
3181 | 3181 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
3182 | 3182 | } |
3183 | 3183 | |
3184 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
3184 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
3185 | 3185 | |
3186 | 3186 | $textifempty = ''; |
3187 | 3187 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -3198,7 +3198,7 @@ discard block |
||
3198 | 3198 | } |
3199 | 3199 | } |
3200 | 3200 | if ($showempty) { |
3201 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
3201 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
3202 | 3202 | } |
3203 | 3203 | |
3204 | 3204 | $i = 0; |
@@ -3209,11 +3209,11 @@ discard block |
||
3209 | 3209 | |
3210 | 3210 | if ((getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) && !empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product |
3211 | 3211 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
3212 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
3213 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
3212 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
3213 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
3214 | 3214 | $sql .= " ORDER BY quantity ASC"; |
3215 | 3215 | |
3216 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
3216 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
3217 | 3217 | $result2 = $this->db->query($sql); |
3218 | 3218 | if ($result2) { |
3219 | 3219 | $nb_prices = $this->db->num_rows($result2); |
@@ -3251,7 +3251,7 @@ discard block |
||
3251 | 3251 | $price_product = new Product($this->db); |
3252 | 3252 | $price_product->fetch($objp->rowid, '', '', 1); |
3253 | 3253 | |
3254 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3254 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3255 | 3255 | $priceparser = new PriceParser($this->db); |
3256 | 3256 | $price_result = $priceparser->parseProduct($price_product); |
3257 | 3257 | if ($price_result >= 0) { |
@@ -3337,7 +3337,7 @@ discard block |
||
3337 | 3337 | $label = $objp->label_translated; |
3338 | 3338 | } |
3339 | 3339 | if (!empty($filterkey) && $filterkey != '') { |
3340 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3340 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3341 | 3341 | } |
3342 | 3342 | |
3343 | 3343 | $outkey = $objp->rowid; |
@@ -3358,32 +3358,32 @@ discard block |
||
3358 | 3358 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
3359 | 3359 | |
3360 | 3360 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3361 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
3361 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
3362 | 3362 | } |
3363 | 3363 | |
3364 | 3364 | // Units |
3365 | 3365 | $outvalUnits = ''; |
3366 | 3366 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3367 | 3367 | if (!empty($objp->unit_short)) { |
3368 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3368 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3369 | 3369 | } |
3370 | 3370 | } |
3371 | 3371 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
3372 | 3372 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3373 | 3373 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3374 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3374 | + $outvalUnits .= ' - '.$unitToShow; |
|
3375 | 3375 | } |
3376 | 3376 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3377 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3378 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3377 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3378 | + $outvalUnits .= ' - '.$unitToShow; |
|
3379 | 3379 | } |
3380 | 3380 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3381 | 3381 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3382 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3382 | + $outvalUnits .= ' - '.$unitToShow; |
|
3383 | 3383 | } |
3384 | 3384 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3385 | 3385 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3386 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3386 | + $outvalUnits .= ' - '.$unitToShow; |
|
3387 | 3387 | } |
3388 | 3388 | } |
3389 | 3389 | if ($outdurationvalue && $outdurationunit) { |
@@ -3395,7 +3395,7 @@ discard block |
||
3395 | 3395 | 'y' => $langs->trans('Year') |
3396 | 3396 | ); |
3397 | 3397 | if (isset($da[$outdurationunit])) { |
3398 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3398 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3399 | 3399 | } |
3400 | 3400 | } |
3401 | 3401 | |
@@ -3415,31 +3415,31 @@ discard block |
||
3415 | 3415 | $labeltoshow = ''; |
3416 | 3416 | $labeltoshow .= $objp->ref; |
3417 | 3417 | if (!empty($objp->custref)) { |
3418 | - $labeltoshow .= ' (' . $objp->custref . ')'; |
|
3418 | + $labeltoshow .= ' ('.$objp->custref.')'; |
|
3419 | 3419 | } |
3420 | 3420 | if ($outbarcode) { |
3421 | - $labeltoshow .= ' (' . $outbarcode . ')'; |
|
3421 | + $labeltoshow .= ' ('.$outbarcode.')'; |
|
3422 | 3422 | } |
3423 | - $labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3423 | + $labeltoshow .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3424 | 3424 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3425 | - $labeltoshow .= ' (' . getCountry($outorigin, '1') . ')'; |
|
3425 | + $labeltoshow .= ' ('.getCountry($outorigin, '1').')'; |
|
3426 | 3426 | } |
3427 | 3427 | |
3428 | 3428 | // Set $labltoshowhtml |
3429 | 3429 | $labeltoshowhtml = ''; |
3430 | 3430 | $labeltoshowhtml .= $objp->ref; |
3431 | 3431 | if (!empty($objp->custref)) { |
3432 | - $labeltoshowhtml .= ' (' . $objp->custref . ')'; |
|
3432 | + $labeltoshowhtml .= ' ('.$objp->custref.')'; |
|
3433 | 3433 | } |
3434 | 3434 | if (!empty($filterkey) && $filterkey != '') { |
3435 | - $labeltoshowhtml = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
3435 | + $labeltoshowhtml = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $labeltoshowhtml, 1); |
|
3436 | 3436 | } |
3437 | 3437 | if ($outbarcode) { |
3438 | - $labeltoshowhtml .= ' (' . $outbarcode . ')'; |
|
3438 | + $labeltoshowhtml .= ' ('.$outbarcode.')'; |
|
3439 | 3439 | } |
3440 | - $labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3440 | + $labeltoshowhtml .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3441 | 3441 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3442 | - $labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')'; |
|
3442 | + $labeltoshowhtml .= ' ('.getCountry($outorigin, '1').')'; |
|
3443 | 3443 | } |
3444 | 3444 | |
3445 | 3445 | // Stock |
@@ -3447,14 +3447,14 @@ discard block |
||
3447 | 3447 | $labeltoshowhtmlstock = ''; |
3448 | 3448 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
3449 | 3449 | if ($user->hasRight('stock', 'lire')) { |
3450 | - $labeltoshowstock .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
3450 | + $labeltoshowstock .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
3451 | 3451 | |
3452 | 3452 | if ($objp->stock > 0) { |
3453 | 3453 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_ok">'; |
3454 | 3454 | } elseif ($objp->stock <= 0) { |
3455 | 3455 | $labeltoshowhtmlstock .= ' - <span class="product_line_stock_too_low">'; |
3456 | 3456 | } |
3457 | - $labeltoshowhtmlstock .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
3457 | + $labeltoshowhtmlstock .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
3458 | 3458 | $labeltoshowhtmlstock .= '</span>'; |
3459 | 3459 | |
3460 | 3460 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
@@ -3465,9 +3465,9 @@ discard block |
||
3465 | 3465 | $tmpproduct->load_virtual_stock(); |
3466 | 3466 | $virtualstock = $tmpproduct->stock_theorique; |
3467 | 3467 | |
3468 | - $labeltoshowstock .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3468 | + $labeltoshowstock .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
3469 | 3469 | |
3470 | - $labeltoshowhtmlstock .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3470 | + $labeltoshowhtmlstock .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
3471 | 3471 | if ($virtualstock > 0) { |
3472 | 3472 | $labeltoshowhtmlstock .= '<span class="product_line_stock_ok">'; |
3473 | 3473 | } elseif ($virtualstock <= 0) { |
@@ -3488,35 +3488,35 @@ discard block |
||
3488 | 3488 | // If we need a particular price level (from 1 to n) |
3489 | 3489 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES'))) { |
3490 | 3490 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
3491 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
3492 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
3493 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
3494 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
3491 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
3492 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
3493 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
3494 | + $sql .= " AND price_level = ".((int) $price_level); |
|
3495 | 3495 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
3496 | 3496 | $sql .= " LIMIT 1"; |
3497 | 3497 | |
3498 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
3498 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
3499 | 3499 | $result2 = $this->db->query($sql); |
3500 | 3500 | if ($result2) { |
3501 | 3501 | $objp2 = $this->db->fetch_object($result2); |
3502 | 3502 | if ($objp2) { |
3503 | 3503 | $found = 1; |
3504 | 3504 | if ($objp2->price_base_type == 'HT') { |
3505 | - $labeltoshowprice .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3506 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3505 | + $labeltoshowprice .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3506 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3507 | 3507 | } else { |
3508 | - $labeltoshowprice .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3509 | - $labeltoshowhtmlprice .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3508 | + $labeltoshowprice .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3509 | + $labeltoshowhtmlprice .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3510 | 3510 | } |
3511 | 3511 | $outprice_ht = price($objp2->price); |
3512 | 3512 | $outprice_ttc = price($objp2->price_ttc); |
3513 | 3513 | $outpricebasetype = $objp2->price_base_type; |
3514 | 3514 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
3515 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3516 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3515 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3516 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3517 | 3517 | } else { |
3518 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3519 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3518 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3519 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3520 | 3520 | } |
3521 | 3521 | } |
3522 | 3522 | } else { |
@@ -3530,13 +3530,13 @@ discard block |
||
3530 | 3530 | $outqty = $objp->quantity; |
3531 | 3531 | $outdiscount = $objp->remise_percent; |
3532 | 3532 | if ($objp->quantity == 1) { |
3533 | - $labeltoshowprice .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3534 | - $labeltoshowhtmlprice .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3533 | + $labeltoshowprice .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3534 | + $labeltoshowhtmlprice .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3535 | 3535 | $labeltoshowprice .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3536 | 3536 | $labeltoshowhtmlprice .= $langs->transnoentities("Unit"); |
3537 | 3537 | } else { |
3538 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3539 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3538 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3539 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3540 | 3540 | $labeltoshowprice .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
3541 | 3541 | $labeltoshowhtmlprice .= $langs->transnoentities("Units"); |
3542 | 3542 | } |
@@ -3544,16 +3544,16 @@ discard block |
||
3544 | 3544 | $outprice_ht = price($objp->unitprice); |
3545 | 3545 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
3546 | 3546 | $outpricebasetype = $objp->price_base_type; |
3547 | - $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3548 | - $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3547 | + $outtva_tx = $objp->tva_tx; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3548 | + $outdefault_vat_code = $objp->default_vat_code; // This value is the value on product when constructProductListOption is called by select_produits_list even if other field $objp-> are from table price_by_qty |
|
3549 | 3549 | } |
3550 | 3550 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
3551 | - $labeltoshowprice .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3552 | - $labeltoshowhtmlprice .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3551 | + $labeltoshowprice .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3552 | + $labeltoshowhtmlprice .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3553 | 3553 | } |
3554 | 3554 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
3555 | - $labeltoshowprice .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3556 | - $labeltoshowhtmlprice .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3555 | + $labeltoshowprice .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3556 | + $labeltoshowhtmlprice .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3557 | 3557 | } |
3558 | 3558 | |
3559 | 3559 | // Price by customer |
@@ -3562,11 +3562,11 @@ discard block |
||
3562 | 3562 | $found = 1; |
3563 | 3563 | |
3564 | 3564 | if ($objp->custprice_base_type == 'HT') { |
3565 | - $labeltoshowprice .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3566 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3565 | + $labeltoshowprice .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3566 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3567 | 3567 | } else { |
3568 | - $labeltoshowprice .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3569 | - $labeltoshowhtmlprice .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3568 | + $labeltoshowprice .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3569 | + $labeltoshowhtmlprice .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3570 | 3570 | } |
3571 | 3571 | |
3572 | 3572 | $outprice_ht = price($objp->custprice); |
@@ -3580,11 +3580,11 @@ discard block |
||
3580 | 3580 | // If level no defined or multiprice not found, we used the default price |
3581 | 3581 | if (empty($hidepriceinlabel) && !$found) { |
3582 | 3582 | if ($objp->price_base_type == 'HT') { |
3583 | - $labeltoshowprice .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
3584 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3583 | + $labeltoshowprice .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3584 | + $labeltoshowhtmlprice .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
3585 | 3585 | } else { |
3586 | - $labeltoshowprice .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
3587 | - $labeltoshowhtmlprice .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3586 | + $labeltoshowprice .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3587 | + $labeltoshowhtmlprice .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
3588 | 3588 | } |
3589 | 3589 | $outprice_ht = price($objp->price); |
3590 | 3590 | $outprice_ttc = price($objp->price_ttc); |
@@ -3594,14 +3594,14 @@ discard block |
||
3594 | 3594 | } |
3595 | 3595 | |
3596 | 3596 | // Build options |
3597 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
3597 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
3598 | 3598 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
3599 | 3599 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
3600 | - $opt .= ' pbq="' . $objp->price_by_qty_rowid . '" data-pbq="' . $objp->price_by_qty_rowid . '" data-pbqup="' . $objp->price_by_qty_unitprice . '" data-pbqbase="' . $objp->price_by_qty_price_base_type . '" data-pbqqty="' . $objp->price_by_qty_quantity . '" data-pbqpercent="' . $objp->price_by_qty_remise_percent . '"'; |
|
3600 | + $opt .= ' pbq="'.$objp->price_by_qty_rowid.'" data-pbq="'.$objp->price_by_qty_rowid.'" data-pbqup="'.$objp->price_by_qty_unitprice.'" data-pbqbase="'.$objp->price_by_qty_price_base_type.'" data-pbqqty="'.$objp->price_by_qty_quantity.'" data-pbqpercent="'.$objp->price_by_qty_remise_percent.'"'; |
|
3601 | 3601 | } |
3602 | 3602 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
3603 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
3604 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
3603 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
3604 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
3605 | 3605 | } |
3606 | 3606 | |
3607 | 3607 | if ($stocktag == 1) { |
@@ -3696,7 +3696,7 @@ discard block |
||
3696 | 3696 | $selected_input_value = ''; |
3697 | 3697 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
3698 | 3698 | if ($selected > 0) { |
3699 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3699 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
3700 | 3700 | $producttmpselect = new Product($this->db); |
3701 | 3701 | $producttmpselect->fetch($selected); |
3702 | 3702 | $selected_input_value = $producttmpselect->ref; |
@@ -3704,10 +3704,10 @@ discard block |
||
3704 | 3704 | } |
3705 | 3705 | |
3706 | 3706 | // mode=2 means suppliers products |
3707 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
3708 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
3707 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
3708 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, getDolGlobalInt('PRODUIT_USE_SEARCH_TO_SELECT'), 0, $ajaxoptions); |
|
3709 | 3709 | |
3710 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="'.$morecss.'" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
3710 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
3711 | 3711 | } else { |
3712 | 3712 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
3713 | 3713 | } |
@@ -3765,25 +3765,25 @@ discard block |
||
3765 | 3765 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3766 | 3766 | $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; |
3767 | 3767 | } |
3768 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
3769 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
3768 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3769 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
3770 | 3770 | if ($socid > 0) { |
3771 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
3771 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
3772 | 3772 | } |
3773 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3773 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3774 | 3774 | // Units |
3775 | 3775 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3776 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3776 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
3777 | 3777 | } |
3778 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
3778 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
3779 | 3779 | if ($statut != -1) { |
3780 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
3780 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
3781 | 3781 | } |
3782 | 3782 | if (strval($filtertype) != '') { |
3783 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3783 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
3784 | 3784 | } |
3785 | 3785 | if (!empty($filtre)) { |
3786 | - $sql .= " " . $filtre; |
|
3786 | + $sql .= " ".$filtre; |
|
3787 | 3787 | } |
3788 | 3788 | // Add where from hooks |
3789 | 3789 | $parameters = array(); |
@@ -3803,9 +3803,9 @@ discard block |
||
3803 | 3803 | if ($i > 0) { |
3804 | 3804 | $sql .= " AND "; |
3805 | 3805 | } |
3806 | - $sql .= "(pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3806 | + $sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3807 | 3807 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
3808 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3808 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
3809 | 3809 | } |
3810 | 3810 | $sql .= ")"; |
3811 | 3811 | $i++; |
@@ -3814,8 +3814,8 @@ discard block |
||
3814 | 3814 | $sql .= ")"; |
3815 | 3815 | } |
3816 | 3816 | if (isModEnabled('barcode')) { |
3817 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3818 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3817 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3818 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3819 | 3819 | } |
3820 | 3820 | $sql .= ')'; |
3821 | 3821 | } |
@@ -3824,20 +3824,20 @@ discard block |
||
3824 | 3824 | |
3825 | 3825 | // Build output string |
3826 | 3826 | |
3827 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3827 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3828 | 3828 | $result = $this->db->query($sql); |
3829 | 3829 | if ($result) { |
3830 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3831 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3830 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3831 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
3832 | 3832 | |
3833 | 3833 | $num = $this->db->num_rows($result); |
3834 | 3834 | |
3835 | 3835 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
3836 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
3836 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
3837 | 3837 | if (!$selected) { |
3838 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3838 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3839 | 3839 | } else { |
3840 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3840 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
3841 | 3841 | } |
3842 | 3842 | |
3843 | 3843 | $i = 0; |
@@ -3852,7 +3852,7 @@ discard block |
||
3852 | 3852 | |
3853 | 3853 | $outkey = $objp->idprodfournprice; // id in table of price |
3854 | 3854 | if (!$outkey && $alsoproductwithnosupplierprice) { |
3855 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
3855 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
3856 | 3856 | } |
3857 | 3857 | |
3858 | 3858 | $outref = $objp->ref; |
@@ -3867,23 +3867,23 @@ discard block |
||
3867 | 3867 | $outvalUnits = ''; |
3868 | 3868 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3869 | 3869 | if (!empty($objp->unit_short)) { |
3870 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
3870 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
3871 | 3871 | } |
3872 | 3872 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
3873 | 3873 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3874 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3874 | + $outvalUnits .= ' - '.$unitToShow; |
|
3875 | 3875 | } |
3876 | 3876 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3877 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
3878 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3877 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3878 | + $outvalUnits .= ' - '.$unitToShow; |
|
3879 | 3879 | } |
3880 | 3880 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
3881 | 3881 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3882 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3882 | + $outvalUnits .= ' - '.$unitToShow; |
|
3883 | 3883 | } |
3884 | 3884 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
3885 | 3885 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3886 | - $outvalUnits .= ' - ' . $unitToShow; |
|
3886 | + $outvalUnits .= ' - '.$unitToShow; |
|
3887 | 3887 | } |
3888 | 3888 | if ($outdurationvalue && $outdurationunit) { |
3889 | 3889 | $da = array( |
@@ -3894,22 +3894,22 @@ discard block |
||
3894 | 3894 | 'y' => $langs->trans('Year') |
3895 | 3895 | ); |
3896 | 3896 | if (isset($da[$outdurationunit])) { |
3897 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3897 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
3898 | 3898 | } |
3899 | 3899 | } |
3900 | 3900 | } |
3901 | 3901 | |
3902 | 3902 | $objRef = $objp->ref; |
3903 | 3903 | if ($filterkey && $filterkey != '') { |
3904 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3904 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
3905 | 3905 | } |
3906 | 3906 | $objRefFourn = $objp->ref_fourn; |
3907 | 3907 | if ($filterkey && $filterkey != '') { |
3908 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3908 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3909 | 3909 | } |
3910 | 3910 | $label = $objp->label; |
3911 | 3911 | if ($filterkey && $filterkey != '') { |
3912 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3912 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
3913 | 3913 | } |
3914 | 3914 | |
3915 | 3915 | switch ($objp->fk_product_type) { |
@@ -3932,21 +3932,21 @@ discard block |
||
3932 | 3932 | |
3933 | 3933 | $optlabel .= $objp->ref; |
3934 | 3934 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3935 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
3935 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
3936 | 3936 | } |
3937 | 3937 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3938 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
3938 | + $optlabel .= ' ('.$outbarcode.')'; |
|
3939 | 3939 | } |
3940 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3940 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3941 | 3941 | |
3942 | 3942 | $outvallabel = $objRef; |
3943 | 3943 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3944 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
3944 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
3945 | 3945 | } |
3946 | 3946 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3947 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
3947 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
3948 | 3948 | } |
3949 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3949 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
3950 | 3950 | |
3951 | 3951 | // Units |
3952 | 3952 | $optlabel .= $outvalUnits; |
@@ -3963,7 +3963,7 @@ discard block |
||
3963 | 3963 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3964 | 3964 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3965 | 3965 | |
3966 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3966 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3967 | 3967 | $priceparser = new PriceParser($this->db); |
3968 | 3968 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
3969 | 3969 | if ($price_result >= 0) { |
@@ -3974,57 +3974,57 @@ discard block |
||
3974 | 3974 | } |
3975 | 3975 | } |
3976 | 3976 | if ($objp->quantity == 1) { |
3977 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3978 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3977 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3978 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3979 | 3979 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3980 | 3980 | $outvallabel .= $langs->transnoentities("Unit"); |
3981 | 3981 | } else { |
3982 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3983 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3984 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3985 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
3982 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3983 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3984 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3985 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
3986 | 3986 | } |
3987 | 3987 | |
3988 | 3988 | if ($objp->quantity > 1) { |
3989 | - $optlabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3990 | - $outvallabel .= " (" . price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3989 | + $optlabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3990 | + $outvallabel .= " (".price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3991 | 3991 | } |
3992 | 3992 | if ($objp->remise_percent >= 1) { |
3993 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3994 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3993 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3994 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3995 | 3995 | } |
3996 | 3996 | if ($objp->duration) { |
3997 | - $optlabel .= " - " . $objp->duration; |
|
3998 | - $outvallabel .= " - " . $objp->duration; |
|
3997 | + $optlabel .= " - ".$objp->duration; |
|
3998 | + $outvallabel .= " - ".$objp->duration; |
|
3999 | 3999 | } |
4000 | 4000 | if (!$socid) { |
4001 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
4002 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
4001 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
4002 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
4003 | 4003 | } |
4004 | 4004 | if ($objp->supplier_reputation) { |
4005 | 4005 | //TODO dictionary |
4006 | 4006 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
4007 | 4007 | |
4008 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
4009 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
4008 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
4009 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
4010 | 4010 | } |
4011 | 4011 | } else { |
4012 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
4013 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
4012 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
4013 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
4014 | 4014 | } |
4015 | 4015 | |
4016 | 4016 | if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
4017 | 4017 | $novirtualstock = ($showstockinlist == 2); |
4018 | 4018 | |
4019 | 4019 | if ($user->hasRight('stock', 'lire')) { |
4020 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
4020 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS'), 0, $langs, 0, 0); |
|
4021 | 4021 | |
4022 | 4022 | if ($objp->stock > 0) { |
4023 | 4023 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
4024 | 4024 | } elseif ($objp->stock <= 0) { |
4025 | 4025 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
4026 | 4026 | } |
4027 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
4027 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
4028 | 4028 | $optlabel .= '</span>'; |
4029 | 4029 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
4030 | 4030 | $langs->load("stocks"); |
@@ -4034,9 +4034,9 @@ discard block |
||
4034 | 4034 | $tmpproduct->load_virtual_stock(); |
4035 | 4035 | $virtualstock = $tmpproduct->stock_theorique; |
4036 | 4036 | |
4037 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
4037 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
4038 | 4038 | |
4039 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
4039 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
4040 | 4040 | if ($virtualstock > 0) { |
4041 | 4041 | $optlabel .= '<span class="product_line_stock_ok">'; |
4042 | 4042 | } elseif ($virtualstock <= 0) { |
@@ -4050,7 +4050,7 @@ discard block |
||
4050 | 4050 | } |
4051 | 4051 | } |
4052 | 4052 | |
4053 | - $optstart = '<option value="' . $outkey . '"'; |
|
4053 | + $optstart = '<option value="'.$outkey.'"'; |
|
4054 | 4054 | if ($selected && $selected == $objp->idprodfournprice) { |
4055 | 4055 | $optstart .= ' selected'; |
4056 | 4056 | } |
@@ -4059,22 +4059,22 @@ discard block |
||
4059 | 4059 | } |
4060 | 4060 | |
4061 | 4061 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
4062 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
4063 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
4064 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
4065 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
4066 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
4067 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
4068 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
4069 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
4070 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
4071 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
4062 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
4063 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
4064 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
4065 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
4066 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
4067 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
4068 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
4069 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
4070 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
4071 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
4072 | 4072 | if (isModEnabled('multicurrency')) { |
4073 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
4074 | - $optstart .= ' data-multicurrency-unitprice="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
4073 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
4074 | + $optstart .= ' data-multicurrency-unitprice="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
4075 | 4075 | } |
4076 | 4076 | } |
4077 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
4077 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
4078 | 4078 | |
4079 | 4079 | // set $parameters to call hook |
4080 | 4080 | $outarrayentry = array( |
@@ -4083,9 +4083,9 @@ discard block |
||
4083 | 4083 | 'label' => $outvallabel, |
4084 | 4084 | 'labelhtml' => $optlabel, |
4085 | 4085 | 'qty' => $outqty, |
4086 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4087 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4088 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4086 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4087 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4088 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4089 | 4089 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
4090 | 4090 | 'tva_tx' => price2num($objp->tva_tx), |
4091 | 4091 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4115,18 +4115,18 @@ discard block |
||
4115 | 4115 | // Add new entry |
4116 | 4116 | // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax |
4117 | 4117 | // "label" value of json key array is used by jQuery automatically as text for combo box |
4118 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
4118 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
4119 | 4119 | $outarraypush = array( |
4120 | 4120 | 'key' => $outkey, |
4121 | 4121 | 'value' => $outref, |
4122 | 4122 | 'label' => $outvallabel, |
4123 | 4123 | 'labelhtml' => $optlabel, |
4124 | 4124 | 'qty' => $outqty, |
4125 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4125 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
4126 | 4126 | 'price_qty_ht_locale' => price($objp->fprice), |
4127 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4127 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
4128 | 4128 | 'price_unit_ht_locale' => price($objp->unitprice), |
4129 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4129 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
4130 | 4130 | 'tva_tx_formated' => price($objp->tva_tx), |
4131 | 4131 | 'tva_tx' => price2num($objp->tva_tx), |
4132 | 4132 | 'default_vat_code' => $objp->default_vat_code, |
@@ -4159,7 +4159,7 @@ discard block |
||
4159 | 4159 | |
4160 | 4160 | $this->db->free($result); |
4161 | 4161 | |
4162 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
4162 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
4163 | 4163 | $out .= ajax_combobox($htmlname); |
4164 | 4164 | } else { |
4165 | 4165 | dol_print_error($this->db); |
@@ -4191,43 +4191,43 @@ discard block |
||
4191 | 4191 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
4192 | 4192 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
4193 | 4193 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
4194 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
4195 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
4196 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
4197 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
4194 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
4195 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
4196 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
4197 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
4198 | 4198 | $sql .= " AND p.tobuy = 1"; |
4199 | 4199 | $sql .= " AND s.fournisseur = 1"; |
4200 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
4200 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
4201 | 4201 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
4202 | 4202 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
4203 | 4203 | } else { |
4204 | 4204 | $sql .= " ORDER BY pfp.unitprice ASC"; |
4205 | 4205 | } |
4206 | 4206 | |
4207 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
4207 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
4208 | 4208 | $result = $this->db->query($sql); |
4209 | 4209 | |
4210 | 4210 | if ($result) { |
4211 | 4211 | $num = $this->db->num_rows($result); |
4212 | 4212 | |
4213 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4213 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4214 | 4214 | |
4215 | 4215 | if (!$num) { |
4216 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
4216 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
4217 | 4217 | } else { |
4218 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
4218 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
4219 | 4219 | $form .= '<option value="0"> </option>'; |
4220 | 4220 | |
4221 | 4221 | $i = 0; |
4222 | 4222 | while ($i < $num) { |
4223 | 4223 | $objp = $this->db->fetch_object($result); |
4224 | 4224 | |
4225 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
4225 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
4226 | 4226 | //if there is only one supplier, preselect it |
4227 | 4227 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
4228 | 4228 | $opt .= ' selected'; |
4229 | 4229 | } |
4230 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
4230 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
4231 | 4231 | |
4232 | 4232 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
4233 | 4233 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -4237,7 +4237,7 @@ discard block |
||
4237 | 4237 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
4238 | 4238 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
4239 | 4239 | |
4240 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
4240 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
4241 | 4241 | $priceparser = new PriceParser($this->db); |
4242 | 4242 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
4243 | 4243 | if ($price_result >= 0) { |
@@ -4248,10 +4248,10 @@ discard block |
||
4248 | 4248 | } |
4249 | 4249 | } |
4250 | 4250 | if ($objp->quantity == 1) { |
4251 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
4251 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
4252 | 4252 | } |
4253 | 4253 | |
4254 | - $opt .= $objp->quantity . ' '; |
|
4254 | + $opt .= $objp->quantity.' '; |
|
4255 | 4255 | |
4256 | 4256 | if ($objp->quantity == 1) { |
4257 | 4257 | $opt .= $langs->trans("Unit"); |
@@ -4260,10 +4260,10 @@ discard block |
||
4260 | 4260 | } |
4261 | 4261 | if ($objp->quantity > 1) { |
4262 | 4262 | $opt .= " - "; |
4263 | - $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit"); |
|
4263 | + $opt .= price($objp->unitprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit"); |
|
4264 | 4264 | } |
4265 | 4265 | if ($objp->duration) { |
4266 | - $opt .= " - " . $objp->duration; |
|
4266 | + $opt .= " - ".$objp->duration; |
|
4267 | 4267 | } |
4268 | 4268 | $opt .= "</option>\n"; |
4269 | 4269 | |
@@ -4301,8 +4301,8 @@ discard block |
||
4301 | 4301 | dol_syslog(__METHOD__, LOG_DEBUG); |
4302 | 4302 | |
4303 | 4303 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
4304 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
4305 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
4304 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
4305 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
4306 | 4306 | $sql .= " AND active > 0"; |
4307 | 4307 | $sql .= " ORDER BY sortorder"; |
4308 | 4308 | |
@@ -4314,7 +4314,7 @@ discard block |
||
4314 | 4314 | $obj = $this->db->fetch_object($resql); |
4315 | 4315 | |
4316 | 4316 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4317 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4317 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4318 | 4318 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
4319 | 4319 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
4320 | 4320 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4342,7 +4342,7 @@ discard block |
||
4342 | 4342 | // phpcs:enable |
4343 | 4343 | global $langs; |
4344 | 4344 | |
4345 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4345 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4346 | 4346 | if ($num > 0) { |
4347 | 4347 | return 0; // Cache already loaded |
4348 | 4348 | } |
@@ -4352,7 +4352,7 @@ discard block |
||
4352 | 4352 | $langs->load('propal'); |
4353 | 4353 | |
4354 | 4354 | $sql = "SELECT rowid, code, label, position"; |
4355 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
4355 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
4356 | 4356 | $sql .= " WHERE active > 0"; |
4357 | 4357 | |
4358 | 4358 | $resql = $this->db->query($sql); |
@@ -4363,7 +4363,7 @@ discard block |
||
4363 | 4363 | $obj = $this->db->fetch_object($resql); |
4364 | 4364 | |
4365 | 4365 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4366 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4366 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4367 | 4367 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
4368 | 4368 | $this->cache_availability[$obj->rowid]['label'] = $label; |
4369 | 4369 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4395,17 +4395,17 @@ discard block |
||
4395 | 4395 | |
4396 | 4396 | $this->load_cache_availability(); |
4397 | 4397 | |
4398 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4398 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4399 | 4399 | |
4400 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4400 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4401 | 4401 | if ($addempty) { |
4402 | 4402 | print '<option value="0"> </option>'; |
4403 | 4403 | } |
4404 | 4404 | foreach ($this->cache_availability as $id => $arrayavailability) { |
4405 | 4405 | if ($selected == $id) { |
4406 | - print '<option value="' . $id . '" selected>'; |
|
4406 | + print '<option value="'.$id.'" selected>'; |
|
4407 | 4407 | } else { |
4408 | - print '<option value="' . $id . '">'; |
|
4408 | + print '<option value="'.$id.'">'; |
|
4409 | 4409 | } |
4410 | 4410 | print dol_escape_htmltag($arrayavailability['label']); |
4411 | 4411 | print '</option>'; |
@@ -4426,13 +4426,13 @@ discard block |
||
4426 | 4426 | { |
4427 | 4427 | global $langs; |
4428 | 4428 | |
4429 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4429 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4430 | 4430 | if ($num > 0) { |
4431 | 4431 | return 0; // Cache already loaded |
4432 | 4432 | } |
4433 | 4433 | |
4434 | 4434 | $sql = "SELECT rowid, code, label"; |
4435 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
4435 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
4436 | 4436 | $sql .= " WHERE active > 0"; |
4437 | 4437 | |
4438 | 4438 | $resql = $this->db->query($sql); |
@@ -4445,8 +4445,8 @@ discard block |
||
4445 | 4445 | |
4446 | 4446 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4447 | 4447 | $label = ($obj->label != '-' ? $obj->label : ''); |
4448 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
4449 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4448 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
4449 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4450 | 4450 | } |
4451 | 4451 | if ($langs->trans($obj->code) != $obj->code) { |
4452 | 4452 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4486,9 +4486,9 @@ discard block |
||
4486 | 4486 | |
4487 | 4487 | $this->loadCacheInputReason(); |
4488 | 4488 | |
4489 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4489 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4490 | 4490 | if ($addempty) { |
4491 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
4491 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
4492 | 4492 | } |
4493 | 4493 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
4494 | 4494 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4496,9 +4496,9 @@ discard block |
||
4496 | 4496 | } |
4497 | 4497 | |
4498 | 4498 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
4499 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
4499 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
4500 | 4500 | } else { |
4501 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
4501 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
4502 | 4502 | } |
4503 | 4503 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
4504 | 4504 | print $langs->trans($label); |
@@ -4508,7 +4508,7 @@ discard block |
||
4508 | 4508 | if ($user->admin && empty($notooltip)) { |
4509 | 4509 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4510 | 4510 | } |
4511 | - print ajax_combobox('select_' . $htmlname); |
|
4511 | + print ajax_combobox('select_'.$htmlname); |
|
4512 | 4512 | } |
4513 | 4513 | |
4514 | 4514 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4523,7 +4523,7 @@ discard block |
||
4523 | 4523 | // phpcs:enable |
4524 | 4524 | global $langs; |
4525 | 4525 | |
4526 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4526 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4527 | 4527 | if ($num > 0) { |
4528 | 4528 | return $num; // Cache already loaded |
4529 | 4529 | } |
@@ -4533,8 +4533,8 @@ discard block |
||
4533 | 4533 | $this->cache_types_paiements = array(); |
4534 | 4534 | |
4535 | 4535 | $sql = "SELECT id, code, libelle as label, type, active"; |
4536 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
4537 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
4536 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
4537 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
4538 | 4538 | |
4539 | 4539 | $resql = $this->db->query($sql); |
4540 | 4540 | if ($resql) { |
@@ -4544,7 +4544,7 @@ discard block |
||
4544 | 4544 | $obj = $this->db->fetch_object($resql); |
4545 | 4545 | |
4546 | 4546 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4547 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4547 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4548 | 4548 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
4549 | 4549 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
4550 | 4550 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4616,17 +4616,17 @@ discard block |
||
4616 | 4616 | global $langs, $user, $conf; |
4617 | 4617 | |
4618 | 4618 | $out = ''; |
4619 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4619 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
4620 | 4620 | |
4621 | 4621 | $this->load_cache_conditions_paiements(); |
4622 | 4622 | |
4623 | 4623 | // Set default value if not already set by caller |
4624 | 4624 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
4625 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4625 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4626 | 4626 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
4627 | 4627 | } |
4628 | 4628 | |
4629 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4629 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4630 | 4630 | if ($addempty) { |
4631 | 4631 | $out .= '<option value="0"> </option>'; |
4632 | 4632 | } |
@@ -4640,9 +4640,9 @@ discard block |
||
4640 | 4640 | |
4641 | 4641 | if ($selected == $id) { |
4642 | 4642 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
4643 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
4643 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
4644 | 4644 | } else { |
4645 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
4645 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
4646 | 4646 | } |
4647 | 4647 | $label = $arrayconditions['label']; |
4648 | 4648 | |
@@ -4660,21 +4660,21 @@ discard block |
||
4660 | 4660 | $out .= ajax_combobox($htmlname); |
4661 | 4661 | |
4662 | 4662 | if ($deposit_percent >= 0) { |
4663 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
4664 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
4665 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
4663 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
4664 | + $out .= $langs->trans('DepositPercent').' : '; |
|
4665 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
4666 | 4666 | $out .= '</span>'; |
4667 | 4667 | $out .= ' |
4668 | - <script nonce="' . getNonce() . '"> |
|
4668 | + <script nonce="' . getNonce().'"> |
|
4669 | 4669 | $(document).ready(function () { |
4670 | - $("#' . $htmlname . '").change(function () { |
|
4670 | + $("#' . $htmlname.'").change(function () { |
|
4671 | 4671 | let $selected = $(this).find("option:selected"); |
4672 | 4672 | let depositPercent = $selected.attr("data-deposit_percent"); |
4673 | 4673 | |
4674 | 4674 | if (depositPercent.length > 0) { |
4675 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
4675 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
4676 | 4676 | } else { |
4677 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
4677 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
4678 | 4678 | } |
4679 | 4679 | |
4680 | 4680 | return true; |
@@ -4712,7 +4712,7 @@ discard block |
||
4712 | 4712 | |
4713 | 4713 | $out = ''; |
4714 | 4714 | |
4715 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
4715 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
4716 | 4716 | |
4717 | 4717 | $filterarray = array(); |
4718 | 4718 | if ($filtertype == 'CRDT') { |
@@ -4727,11 +4727,11 @@ discard block |
||
4727 | 4727 | |
4728 | 4728 | // Set default value if not already set by caller |
4729 | 4729 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
4730 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4730 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4731 | 4731 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
4732 | 4732 | } |
4733 | 4733 | |
4734 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4734 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4735 | 4735 | if ($empty) { |
4736 | 4736 | $out .= '<option value=""> </option>'; |
4737 | 4737 | } |
@@ -4752,13 +4752,13 @@ discard block |
||
4752 | 4752 | } |
4753 | 4753 | |
4754 | 4754 | if ($format == 0) { |
4755 | - $out .= '<option value="' . $id . '" data-code="'.$arraytypes['code'].'"'; |
|
4755 | + $out .= '<option value="'.$id.'" data-code="'.$arraytypes['code'].'"'; |
|
4756 | 4756 | } elseif ($format == 1) { |
4757 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4757 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4758 | 4758 | } elseif ($format == 2) { |
4759 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4759 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
4760 | 4760 | } elseif ($format == 3) { |
4761 | - $out .= '<option value="' . $id . '"'; |
|
4761 | + $out .= '<option value="'.$id.'"'; |
|
4762 | 4762 | } |
4763 | 4763 | // Print attribute selected or not |
4764 | 4764 | if ($format == 1 || $format == 2) { |
@@ -4788,7 +4788,7 @@ discard block |
||
4788 | 4788 | if ($user->admin && !$noadmininfo) { |
4789 | 4789 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4790 | 4790 | } |
4791 | - $out .= ajax_combobox('select' . $htmlname); |
|
4791 | + $out .= ajax_combobox('select'.$htmlname); |
|
4792 | 4792 | |
4793 | 4793 | if (empty($nooutput)) { |
4794 | 4794 | print $out; |
@@ -4810,22 +4810,22 @@ discard block |
||
4810 | 4810 | { |
4811 | 4811 | global $langs; |
4812 | 4812 | |
4813 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4813 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
4814 | 4814 | $options = array( |
4815 | 4815 | 'HT' => $langs->trans("HT"), |
4816 | 4816 | 'TTC' => $langs->trans("TTC") |
4817 | 4817 | ); |
4818 | 4818 | foreach ($options as $id => $value) { |
4819 | 4819 | if ($selected == $id) { |
4820 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
4820 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
4821 | 4821 | } else { |
4822 | - $return .= '<option value="' . $id . '">' . $value; |
|
4822 | + $return .= '<option value="'.$id.'">'.$value; |
|
4823 | 4823 | } |
4824 | 4824 | $return .= '</option>'; |
4825 | 4825 | } |
4826 | 4826 | $return .= '</select>'; |
4827 | 4827 | if ($addjscombo) { |
4828 | - $return .= ajax_combobox('select_' . $htmlname); |
|
4828 | + $return .= ajax_combobox('select_'.$htmlname); |
|
4829 | 4829 | } |
4830 | 4830 | |
4831 | 4831 | return $return; |
@@ -4843,7 +4843,7 @@ discard block |
||
4843 | 4843 | // phpcs:enable |
4844 | 4844 | global $langs; |
4845 | 4845 | |
4846 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4846 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4847 | 4847 | if ($num > 0) { |
4848 | 4848 | return $num; // Cache already loaded |
4849 | 4849 | } |
@@ -4853,8 +4853,8 @@ discard block |
||
4853 | 4853 | $this->cache_transport_mode = array(); |
4854 | 4854 | |
4855 | 4855 | $sql = "SELECT rowid, code, label, active"; |
4856 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
4857 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
4856 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
4857 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
4858 | 4858 | |
4859 | 4859 | $resql = $this->db->query($sql); |
4860 | 4860 | if ($resql) { |
@@ -4864,7 +4864,7 @@ discard block |
||
4864 | 4864 | $obj = $this->db->fetch_object($resql); |
4865 | 4865 | |
4866 | 4866 | // If traduction exist, we use it else we take the default label |
4867 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4867 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4868 | 4868 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
4869 | 4869 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
4870 | 4870 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4898,11 +4898,11 @@ discard block |
||
4898 | 4898 | { |
4899 | 4899 | global $langs, $user; |
4900 | 4900 | |
4901 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
4901 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
4902 | 4902 | |
4903 | 4903 | $this->load_cache_transport_mode(); |
4904 | 4904 | |
4905 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4905 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
4906 | 4906 | if ($empty) { |
4907 | 4907 | print '<option value=""> </option>'; |
4908 | 4908 | } |
@@ -4918,13 +4918,13 @@ discard block |
||
4918 | 4918 | } |
4919 | 4919 | |
4920 | 4920 | if ($format == 0) { |
4921 | - print '<option value="' . $id . '"'; |
|
4921 | + print '<option value="'.$id.'"'; |
|
4922 | 4922 | } elseif ($format == 1) { |
4923 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4923 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4924 | 4924 | } elseif ($format == 2) { |
4925 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
4925 | + print '<option value="'.$arraytypes['code'].'"'; |
|
4926 | 4926 | } elseif ($format == 3) { |
4927 | - print '<option value="' . $id . '"'; |
|
4927 | + print '<option value="'.$id.'"'; |
|
4928 | 4928 | } |
4929 | 4929 | // If text is selected, we compare with code, else with id |
4930 | 4930 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4975,31 +4975,31 @@ discard block |
||
4975 | 4975 | $langs->load("deliveries"); |
4976 | 4976 | |
4977 | 4977 | $sql = "SELECT rowid, code, libelle as label"; |
4978 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
4978 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
4979 | 4979 | $sql .= " WHERE active > 0"; |
4980 | 4980 | if ($filtre) { |
4981 | - $sql .= " AND " . $filtre; |
|
4981 | + $sql .= " AND ".$filtre; |
|
4982 | 4982 | } |
4983 | 4983 | $sql .= " ORDER BY libelle ASC"; |
4984 | 4984 | |
4985 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
4985 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
4986 | 4986 | $result = $this->db->query($sql); |
4987 | 4987 | if ($result) { |
4988 | 4988 | $num = $this->db->num_rows($result); |
4989 | 4989 | $i = 0; |
4990 | 4990 | if ($num) { |
4991 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4991 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
4992 | 4992 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4993 | 4993 | print '<option value="-1"> </option>'; |
4994 | 4994 | } |
4995 | 4995 | while ($i < $num) { |
4996 | 4996 | $obj = $this->db->fetch_object($result); |
4997 | 4997 | if ($selected == $obj->rowid) { |
4998 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
4998 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
4999 | 4999 | } else { |
5000 | - print '<option value="' . $obj->rowid . '">'; |
|
5000 | + print '<option value="'.$obj->rowid.'">'; |
|
5001 | 5001 | } |
5002 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
5002 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
5003 | 5003 | print '</option>'; |
5004 | 5004 | $i++; |
5005 | 5005 | } |
@@ -5008,7 +5008,7 @@ discard block |
||
5008 | 5008 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
5009 | 5009 | } |
5010 | 5010 | |
5011 | - print ajax_combobox('select' . $htmlname); |
|
5011 | + print ajax_combobox('select'.$htmlname); |
|
5012 | 5012 | } else { |
5013 | 5013 | print $langs->trans("NoShippingMethodDefined"); |
5014 | 5014 | } |
@@ -5033,16 +5033,16 @@ discard block |
||
5033 | 5033 | $langs->load("deliveries"); |
5034 | 5034 | |
5035 | 5035 | if ($htmlname != "none") { |
5036 | - print '<form method="POST" action="' . $page . '">'; |
|
5036 | + print '<form method="POST" action="'.$page.'">'; |
|
5037 | 5037 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
5038 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5038 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5039 | 5039 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
5040 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5040 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5041 | 5041 | print '</form>'; |
5042 | 5042 | } else { |
5043 | 5043 | if ($selected) { |
5044 | 5044 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
5045 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
5045 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
5046 | 5046 | } else { |
5047 | 5047 | print " "; |
5048 | 5048 | } |
@@ -5065,10 +5065,10 @@ discard block |
||
5065 | 5065 | |
5066 | 5066 | $opt = '<option value="" selected></option>'; |
5067 | 5067 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
5068 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
5069 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
5068 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
5069 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
5070 | 5070 | $sql .= ' AND situation_counter >= 1'; |
5071 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
5071 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
5072 | 5072 | $sql .= ' AND type <> 2'; |
5073 | 5073 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
5074 | 5074 | $resql = $this->db->query($sql); |
@@ -5086,19 +5086,19 @@ discard block |
||
5086 | 5086 | //Not prov? |
5087 | 5087 | if (substr($obj->ref, 1, 4) != 'PROV') { |
5088 | 5088 | if ($selected == $obj->rowid) { |
5089 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
5089 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
5090 | 5090 | } else { |
5091 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
5091 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
5092 | 5092 | } |
5093 | 5093 | } |
5094 | 5094 | } |
5095 | 5095 | } |
5096 | 5096 | } |
5097 | 5097 | } else { |
5098 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
5098 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
5099 | 5099 | } |
5100 | 5100 | if ($opt == '<option value ="" selected></option>') { |
5101 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
5101 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
5102 | 5102 | } |
5103 | 5103 | return $opt; |
5104 | 5104 | } |
@@ -5118,12 +5118,12 @@ discard block |
||
5118 | 5118 | |
5119 | 5119 | $langs->load('products'); |
5120 | 5120 | |
5121 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
5121 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
5122 | 5122 | |
5123 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
5123 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
5124 | 5124 | $sql .= ' WHERE active > 0'; |
5125 | 5125 | if (!empty($unit_type)) { |
5126 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
5126 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
5127 | 5127 | } |
5128 | 5128 | $sql .= " ORDER BY sortorder"; |
5129 | 5129 | |
@@ -5135,14 +5135,14 @@ discard block |
||
5135 | 5135 | |
5136 | 5136 | while ($res = $this->db->fetch_object($resql)) { |
5137 | 5137 | $unitLabel = $res->label; |
5138 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
5139 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
5138 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
5139 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
5140 | 5140 | } |
5141 | 5141 | |
5142 | 5142 | if ($selected == $res->rowid) { |
5143 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
5143 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
5144 | 5144 | } else { |
5145 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
5145 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
5146 | 5146 | } |
5147 | 5147 | } |
5148 | 5148 | $return .= '</select>'; |
@@ -5179,29 +5179,29 @@ discard block |
||
5179 | 5179 | $num = 0; |
5180 | 5180 | |
5181 | 5181 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
5182 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
5183 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
5182 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
5183 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
5184 | 5184 | if ($status != 2) { |
5185 | - $sql .= " AND clos = " . (int) $status; |
|
5185 | + $sql .= " AND clos = ".(int) $status; |
|
5186 | 5186 | } |
5187 | 5187 | if ($filtre) { // TODO Support USF |
5188 | - $sql .= " AND " . $filtre; |
|
5188 | + $sql .= " AND ".$filtre; |
|
5189 | 5189 | } |
5190 | 5190 | $sql .= " ORDER BY label"; |
5191 | 5191 | |
5192 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
5192 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
5193 | 5193 | $result = $this->db->query($sql); |
5194 | 5194 | if ($result) { |
5195 | 5195 | $num = $this->db->num_rows($result); |
5196 | 5196 | $i = 0; |
5197 | 5197 | |
5198 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5198 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
5199 | 5199 | |
5200 | 5200 | if ($num == 0) { |
5201 | 5201 | if ($status == 0) { |
5202 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
5202 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
5203 | 5203 | } else { |
5204 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>'; |
|
5204 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>'; |
|
5205 | 5205 | } |
5206 | 5206 | } else { |
5207 | 5207 | if (!empty($useempty) && !is_numeric($useempty)) { |
@@ -5217,25 +5217,25 @@ discard block |
||
5217 | 5217 | $labeltoshow = trim($obj->label); |
5218 | 5218 | $labeltoshowhtml = trim($obj->label); |
5219 | 5219 | if ($showcurrency) { |
5220 | - $labeltoshow .= ' (' . $obj->currency_code . ')'; |
|
5221 | - $labeltoshowhtml .= ' <span class="opacitymedium">(' . $obj->currency_code . ')</span>'; |
|
5220 | + $labeltoshow .= ' ('.$obj->currency_code.')'; |
|
5221 | + $labeltoshowhtml .= ' <span class="opacitymedium">('.$obj->currency_code.')</span>'; |
|
5222 | 5222 | } |
5223 | 5223 | if ($status == 2 && $obj->status == 1) { |
5224 | - $labeltoshow .= ' (' . $langs->trans("Closed") . ')'; |
|
5225 | - $labeltoshowhtml .= ' <span class="opacitymedium">(' . $langs->trans("Closed") . ')</span>'; |
|
5224 | + $labeltoshow .= ' ('.$langs->trans("Closed").')'; |
|
5225 | + $labeltoshowhtml .= ' <span class="opacitymedium">('.$langs->trans("Closed").')</span>'; |
|
5226 | 5226 | } |
5227 | 5227 | |
5228 | 5228 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
5229 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>'; |
|
5229 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'" selected>'; |
|
5230 | 5230 | } else { |
5231 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">'; |
|
5231 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" data-html="'.dolPrintHTMLForAttribute($labeltoshowhtml).'">'; |
|
5232 | 5232 | } |
5233 | 5233 | $out .= $labeltoshow; |
5234 | 5234 | $out .= '</option>'; |
5235 | 5235 | $i++; |
5236 | 5236 | } |
5237 | 5237 | $out .= "</select>"; |
5238 | - $out .= ajax_combobox('select' . $htmlname); |
|
5238 | + $out .= ajax_combobox('select'.$htmlname); |
|
5239 | 5239 | } else { |
5240 | 5240 | dol_print_error($this->db); |
5241 | 5241 | } |
@@ -5274,22 +5274,22 @@ discard block |
||
5274 | 5274 | $num = 0; |
5275 | 5275 | |
5276 | 5276 | $sql = "SELECT rowid, label, bank, status, iban_prefix, bic"; |
5277 | - $sql .= " FROM " . $this->db->prefix() . "societe_rib"; |
|
5278 | - $sql .= " WHERE type = 'ban'"; |
|
5277 | + $sql .= " FROM ".$this->db->prefix()."societe_rib"; |
|
5278 | + $sql .= " WHERE type = 'ban'"; |
|
5279 | 5279 | if ($filtre) { // TODO Support USF |
5280 | - $sql .= " AND " . $filtre; |
|
5280 | + $sql .= " AND ".$filtre; |
|
5281 | 5281 | } |
5282 | 5282 | $sql .= " ORDER BY label"; |
5283 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
5283 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
5284 | 5284 | $result = $this->db->query($sql); |
5285 | 5285 | if ($result) { |
5286 | 5286 | $num = $this->db->num_rows($result); |
5287 | 5287 | $i = 0; |
5288 | 5288 | |
5289 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5289 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
5290 | 5290 | |
5291 | 5291 | if ($num == 0) { |
5292 | - $out .= '<option class="opacitymedium" value="-1">' . $langs->trans("NoBankAccountDefined") . '</span>'; |
|
5292 | + $out .= '<option class="opacitymedium" value="-1">'.$langs->trans("NoBankAccountDefined").'</span>'; |
|
5293 | 5293 | } else { |
5294 | 5294 | if (!empty($useempty) && !is_numeric($useempty)) { |
5295 | 5295 | $out .= '<option value="-1">'.$langs->trans($useempty).'</option>'; |
@@ -5302,19 +5302,19 @@ discard block |
||
5302 | 5302 | $obj = $this->db->fetch_object($result); |
5303 | 5303 | $iban = dolDecrypt($obj->iban_prefix); |
5304 | 5304 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
5305 | - $out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '" selected>'; |
|
5305 | + $out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'" selected>'; |
|
5306 | 5306 | } else { |
5307 | - $out .= '<option value="' . $obj->rowid . '" data-iban-prefix="' . $iban . ' data-bic="' . $obj->bic . '">'; |
|
5307 | + $out .= '<option value="'.$obj->rowid.'" data-iban-prefix="'.$iban.' data-bic="'.$obj->bic.'">'; |
|
5308 | 5308 | } |
5309 | 5309 | $out .= trim($obj->label); |
5310 | 5310 | if ($showibanbic) { |
5311 | - $out .= ' (' . $iban . '/' .$obj->bic. ')'; |
|
5311 | + $out .= ' ('.$iban.'/'.$obj->bic.')'; |
|
5312 | 5312 | } |
5313 | 5313 | $out .= '</option>'; |
5314 | 5314 | $i++; |
5315 | 5315 | } |
5316 | 5316 | $out .= "</select>"; |
5317 | - $out .= ajax_combobox('select' . $htmlname); |
|
5317 | + $out .= ajax_combobox('select'.$htmlname); |
|
5318 | 5318 | } else { |
5319 | 5319 | dol_print_error($this->db); |
5320 | 5320 | } |
@@ -5348,23 +5348,23 @@ discard block |
||
5348 | 5348 | $num = 0; |
5349 | 5349 | |
5350 | 5350 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
5351 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
5351 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
5352 | 5352 | $sql .= " WHERE 1=1"; |
5353 | 5353 | if ($status != 2) { |
5354 | - $sql .= " AND status = " . (int) $status; |
|
5354 | + $sql .= " AND status = ".(int) $status; |
|
5355 | 5355 | } |
5356 | 5356 | if ($filtre) { // TODO Support USF |
5357 | - $sql .= " AND " . $filtre; |
|
5357 | + $sql .= " AND ".$filtre; |
|
5358 | 5358 | } |
5359 | 5359 | $sql .= " ORDER BY name"; |
5360 | 5360 | |
5361 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
5361 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
5362 | 5362 | $result = $this->db->query($sql); |
5363 | 5363 | if ($result) { |
5364 | 5364 | $num = $this->db->num_rows($result); |
5365 | 5365 | $i = 0; |
5366 | 5366 | if ($num) { |
5367 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5367 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
5368 | 5368 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5369 | 5369 | print '<option value="-1"> </option>'; |
5370 | 5370 | } |
@@ -5372,13 +5372,13 @@ discard block |
||
5372 | 5372 | while ($i < $num) { |
5373 | 5373 | $obj = $this->db->fetch_object($result); |
5374 | 5374 | if ($selected == $obj->rowid) { |
5375 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
5375 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
5376 | 5376 | } else { |
5377 | - print '<option value="' . $obj->rowid . '">'; |
|
5377 | + print '<option value="'.$obj->rowid.'">'; |
|
5378 | 5378 | } |
5379 | 5379 | print trim($obj->name); |
5380 | 5380 | if ($status == 2 && $obj->status == 1) { |
5381 | - print ' (' . $langs->trans("Closed") . ')'; |
|
5381 | + print ' ('.$langs->trans("Closed").')'; |
|
5382 | 5382 | } |
5383 | 5383 | print '</option>'; |
5384 | 5384 | $i++; |
@@ -5386,9 +5386,9 @@ discard block |
||
5386 | 5386 | print "</select>"; |
5387 | 5387 | } else { |
5388 | 5388 | if ($status == 0) { |
5389 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
5389 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
5390 | 5390 | } else { |
5391 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
5391 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
5392 | 5392 | } |
5393 | 5393 | } |
5394 | 5394 | |
@@ -5412,20 +5412,20 @@ discard block |
||
5412 | 5412 | { |
5413 | 5413 | global $langs; |
5414 | 5414 | if ($htmlname != "none") { |
5415 | - print '<form method="POST" action="' . $page . '">'; |
|
5415 | + print '<form method="POST" action="'.$page.'">'; |
|
5416 | 5416 | print '<input type="hidden" name="action" value="setbankaccount">'; |
5417 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5417 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5418 | 5418 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
5419 | 5419 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
5420 | 5420 | if ($nbaccountfound > 0) { |
5421 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5421 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5422 | 5422 | } |
5423 | 5423 | print '</form>'; |
5424 | 5424 | } else { |
5425 | 5425 | $langs->load('banks'); |
5426 | 5426 | |
5427 | 5427 | if ($selected) { |
5428 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
5428 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
5429 | 5429 | $bankstatic = new Account($this->db); |
5430 | 5430 | $result = $bankstatic->fetch($selected); |
5431 | 5431 | if ($result) { |
@@ -5452,25 +5452,25 @@ discard block |
||
5452 | 5452 | { |
5453 | 5453 | global $langs; |
5454 | 5454 | if ($htmlname != "none") { |
5455 | - print '<form method="POST" action="' . $page . '">'; |
|
5455 | + print '<form method="POST" action="'.$page.'">'; |
|
5456 | 5456 | print '<input type="hidden" name="action" value="setbankaccountcustomer">'; |
5457 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5457 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
5458 | 5458 | $nbaccountfound = $this->selectRib($selected, $htmlname, $filtre, $addempty, '', $showibanbic); |
5459 | 5459 | if ($nbaccountfound > 0) { |
5460 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5460 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
5461 | 5461 | } |
5462 | 5462 | print '</form>'; |
5463 | 5463 | } else { |
5464 | 5464 | $langs->load('banks'); |
5465 | 5465 | |
5466 | 5466 | if ($selected) { |
5467 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; |
|
5467 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
|
5468 | 5468 | $bankstatic = new CompanyBankAccount($this->db); |
5469 | 5469 | $result = $bankstatic->fetch($selected); |
5470 | 5470 | if ($result) { |
5471 | 5471 | print $bankstatic->label; |
5472 | 5472 | if ($showibanbic) { |
5473 | - print ' (' . $bankstatic->iban . '/' .$bankstatic->bic. ')'; |
|
5473 | + print ' ('.$bankstatic->iban.'/'.$bankstatic->bic.')'; |
|
5474 | 5474 | } |
5475 | 5475 | } |
5476 | 5476 | } else { |
@@ -5506,11 +5506,11 @@ discard block |
||
5506 | 5506 | global $conf, $langs; |
5507 | 5507 | $langs->load("categories"); |
5508 | 5508 | |
5509 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5509 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
5510 | 5510 | |
5511 | 5511 | // For backward compatibility |
5512 | 5512 | if (is_numeric($type)) { |
5513 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5513 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5514 | 5514 | } |
5515 | 5515 | |
5516 | 5516 | if ($type === Categorie::TYPE_BANK_LINE) { |
@@ -5518,8 +5518,8 @@ discard block |
||
5518 | 5518 | $cat = new Categorie($this->db); |
5519 | 5519 | $cate_arbo = array(); |
5520 | 5520 | $sql = "SELECT c.label, c.rowid"; |
5521 | - $sql .= " FROM " . $this->db->prefix() . "categorie as c"; |
|
5522 | - $sql .= " WHERE entity = " . $conf->entity . " AND type = " . ((int) $cat->getMapId()[$type]); |
|
5521 | + $sql .= " FROM ".$this->db->prefix()."categorie as c"; |
|
5522 | + $sql .= " WHERE entity = ".$conf->entity." AND type = ".((int) $cat->getMapId()[$type]); |
|
5523 | 5523 | $sql .= " ORDER BY c.label"; |
5524 | 5524 | $result = $this->db->query($sql); |
5525 | 5525 | if ($result) { |
@@ -5545,12 +5545,12 @@ discard block |
||
5545 | 5545 | $outarrayrichhtml = array(); |
5546 | 5546 | |
5547 | 5547 | |
5548 | - $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
5548 | + $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
5549 | 5549 | if (is_array($cate_arbo)) { |
5550 | 5550 | $num = count($cate_arbo); |
5551 | 5551 | |
5552 | 5552 | if (!$num) { |
5553 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
5553 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
5554 | 5554 | } else { |
5555 | 5555 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5556 | 5556 | $output .= '<option value="-1"> </option>'; |
@@ -5562,15 +5562,15 @@ discard block |
||
5562 | 5562 | $add = ''; |
5563 | 5563 | } |
5564 | 5564 | |
5565 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
5565 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
5566 | 5566 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5567 | 5567 | |
5568 | 5568 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
5569 | 5569 | |
5570 | 5570 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
5571 | 5571 | |
5572 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
5573 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
5572 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
5573 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
5574 | 5574 | $output .= '>'; |
5575 | 5575 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5576 | 5576 | $output .= '</option>'; |
@@ -5616,7 +5616,7 @@ discard block |
||
5616 | 5616 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
5617 | 5617 | { |
5618 | 5618 | // phpcs:enable |
5619 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5619 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5620 | 5620 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
5621 | 5621 | } |
5622 | 5622 | |
@@ -5651,7 +5651,7 @@ discard block |
||
5651 | 5651 | { |
5652 | 5652 | global $langs, $conf; |
5653 | 5653 | |
5654 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
5654 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
5655 | 5655 | $formconfirm = ''; |
5656 | 5656 | $inputok = array(); |
5657 | 5657 | $inputko = array(); |
@@ -5675,27 +5675,27 @@ discard block |
||
5675 | 5675 | foreach ($formquestion as $key => $input) { |
5676 | 5676 | if (is_array($input) && !empty($input)) { |
5677 | 5677 | if ($input['type'] == 'hidden') { |
5678 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5679 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5678 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5679 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5680 | 5680 | |
5681 | - $more .= '<input type="hidden" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . dol_escape_htmltag($input['value']) . '" class="' . $morecss . '"' . $moreattr . '>' . "\n"; |
|
5681 | + $more .= '<input type="hidden" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'" value="'.dol_escape_htmltag($input['value']).'" class="'.$morecss.'"'.$moreattr.'>'."\n"; |
|
5682 | 5682 | } |
5683 | 5683 | } |
5684 | 5684 | } |
5685 | 5685 | |
5686 | 5686 | // Now add questions |
5687 | 5687 | $moreonecolumn = ''; |
5688 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
5688 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
5689 | 5689 | foreach ($formquestion as $key => $input) { |
5690 | 5690 | if (is_array($input) && !empty($input)) { |
5691 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
5692 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
5693 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5691 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
5692 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5693 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
5694 | 5694 | |
5695 | 5695 | if ($input['type'] == 'text') { |
5696 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="text" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
5696 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
5697 | 5697 | } elseif ($input['type'] == 'password') { |
5698 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div><div class="tagtd"><input type="password" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $size . ' value="' . (empty($input['value']) ? '' : $input['value']) . '"' . $moreattr . ' /></div></div>' . "\n"; |
|
5698 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n"; |
|
5699 | 5699 | } elseif ($input['type'] == 'textarea') { |
5700 | 5700 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
5701 | 5701 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5703,8 +5703,8 @@ discard block |
||
5703 | 5703 | $more .= '</textarea>'; |
5704 | 5704 | $more .= '</div></div>'."\n";*/ |
5705 | 5705 | $moreonecolumn .= '<div class="margintoponly">'; |
5706 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
5707 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
5706 | + $moreonecolumn .= $input['label'].'<br>'; |
|
5707 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
5708 | 5708 | $moreonecolumn .= $input['value']; |
5709 | 5709 | $moreonecolumn .= '</textarea>'; |
5710 | 5710 | $moreonecolumn .= '</div>'; |
@@ -5721,20 +5721,20 @@ discard block |
||
5721 | 5721 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
5722 | 5722 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
5723 | 5723 | |
5724 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
5724 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
5725 | 5725 | if (!empty($input['label'])) { |
5726 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
5726 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
5727 | 5727 | } |
5728 | 5728 | if ($input['type'] == 'select') { |
5729 | 5729 | $more .= $this->selectarray($input['name'], $input['values'], isset($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss); |
5730 | 5730 | } else { |
5731 | 5731 | $more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr); |
5732 | 5732 | } |
5733 | - $more .= '</div></div>' . "\n"; |
|
5733 | + $more .= '</div></div>'."\n"; |
|
5734 | 5734 | } elseif ($input['type'] == 'checkbox') { |
5735 | 5735 | $more .= '<div class="tagtr">'; |
5736 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
5737 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
5736 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
5737 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
5738 | 5738 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
5739 | 5739 | $more .= ' checked'; |
5740 | 5740 | } |
@@ -5745,19 +5745,19 @@ discard block |
||
5745 | 5745 | $more .= ' disabled'; |
5746 | 5746 | } |
5747 | 5747 | $more .= ' /></div>'; |
5748 | - $more .= '</div>' . "\n"; |
|
5748 | + $more .= '</div>'."\n"; |
|
5749 | 5749 | } elseif ($input['type'] == 'radio') { |
5750 | 5750 | $i = 0; |
5751 | 5751 | foreach ($input['values'] as $selkey => $selval) { |
5752 | 5752 | $more .= '<div class="tagtr">'; |
5753 | 5753 | if (isset($input['label'])) { |
5754 | 5754 | if ($i == 0) { |
5755 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5755 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5756 | 5756 | } else { |
5757 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
5757 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
5758 | 5758 | } |
5759 | 5759 | } |
5760 | - $more .= '<div class="tagtd' . ($i == 0 ? ' tdtop' : '') . '"><input type="radio" class="flat' . $morecss . '" id="' . dol_escape_htmltag($input['name'] . $selkey) . '" name="' . dol_escape_htmltag($input['name']) . '" value="' . $selkey . '"' . $moreattr; |
|
5760 | + $more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr; |
|
5761 | 5761 | if (!empty($input['disabled'])) { |
5762 | 5762 | $more .= ' disabled'; |
5763 | 5763 | } |
@@ -5765,12 +5765,12 @@ discard block |
||
5765 | 5765 | $more .= ' checked="checked"'; |
5766 | 5766 | } |
5767 | 5767 | $more .= ' /> '; |
5768 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
5769 | - $more .= '</div></div>' . "\n"; |
|
5768 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
5769 | + $more .= '</div></div>'."\n"; |
|
5770 | 5770 | $i++; |
5771 | 5771 | } |
5772 | 5772 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
5773 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5773 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
5774 | 5774 | $more .= '<div class="tagtd">'; |
5775 | 5775 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
5776 | 5776 | $h = $m = 0; |
@@ -5788,24 +5788,24 @@ discard block |
||
5788 | 5788 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
5789 | 5789 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
5790 | 5790 | if (!empty($input['label'])) { |
5791 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
5791 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
5792 | 5792 | } |
5793 | 5793 | $more .= $input['value']; |
5794 | - $more .= '</div></div>' . "\n"; |
|
5794 | + $more .= '</div></div>'."\n"; |
|
5795 | 5795 | } elseif ($input['type'] == 'onecolumn') { |
5796 | 5796 | $moreonecolumn .= '<div class="margintoponly">'; |
5797 | 5797 | $moreonecolumn .= $input['value']; |
5798 | - $moreonecolumn .= '</div>' . "\n"; |
|
5798 | + $moreonecolumn .= '</div>'."\n"; |
|
5799 | 5799 | } elseif ($input['type'] == 'hidden') { |
5800 | 5800 | // Do nothing more, already added by a previous loop |
5801 | 5801 | } elseif ($input['type'] == 'separator') { |
5802 | 5802 | $more .= '<br>'; |
5803 | 5803 | } else { |
5804 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
5804 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
5805 | 5805 | } |
5806 | 5806 | } |
5807 | 5807 | } |
5808 | - $more .= '</div>' . "\n"; |
|
5808 | + $more .= '</div>'."\n"; |
|
5809 | 5809 | $more .= $moreonecolumn; |
5810 | 5810 | } |
5811 | 5811 | |
@@ -5827,10 +5827,10 @@ discard block |
||
5827 | 5827 | $button = $useajax; |
5828 | 5828 | $useajax = 1; |
5829 | 5829 | $autoOpen = false; |
5830 | - $dialogconfirm .= '-' . $button; |
|
5830 | + $dialogconfirm .= '-'.$button; |
|
5831 | 5831 | } |
5832 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
5833 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
5832 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
5833 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
5834 | 5834 | |
5835 | 5835 | // Add input fields into list of fields to read during submit (inputok and inputko) |
5836 | 5836 | if (is_array($formquestion)) { |
@@ -5853,24 +5853,24 @@ discard block |
||
5853 | 5853 | } |
5854 | 5854 | |
5855 | 5855 | // Show JQuery confirm box. |
5856 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
5856 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
5857 | 5857 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
5858 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
5858 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
5859 | 5859 | } |
5860 | 5860 | if (!empty($more)) { |
5861 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
5861 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
5862 | 5862 | } |
5863 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
|
5864 | - $formconfirm .= '</div>' . "\n"; |
|
5863 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
5864 | + $formconfirm .= '</div>'."\n"; |
|
5865 | 5865 | |
5866 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
5867 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5866 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
5867 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
5868 | 5868 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
5869 | 5869 | $formconfirm .= 'jQuery(document).ready(function() { |
5870 | 5870 | $(function() { |
5871 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
5871 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
5872 | 5872 | { |
5873 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
5873 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
5874 | 5874 | if ($newselectedchoice == 'no') { |
5875 | 5875 | $formconfirm .= ' |
5876 | 5876 | open: function() { |
@@ -5880,24 +5880,24 @@ discard block |
||
5880 | 5880 | |
5881 | 5881 | $jsforcursor = ''; |
5882 | 5882 | if ($useajax == 1) { |
5883 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
5884 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
5883 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
5884 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
5885 | 5885 | } |
5886 | 5886 | |
5887 | 5887 | $postconfirmas = 'GET'; |
5888 | 5888 | |
5889 | 5889 | $formconfirm .= ' |
5890 | 5890 | resizable: false, |
5891 | - height: "' . $height . '", |
|
5892 | - width: "' . $width . '", |
|
5891 | + height: "' . $height.'", |
|
5892 | + width: "' . $width.'", |
|
5893 | 5893 | modal: true, |
5894 | 5894 | closeOnEscape: false, |
5895 | 5895 | buttons: { |
5896 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
5897 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5898 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
5899 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5900 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
5896 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
5897 | + var options = "token=' . urlencode(newToken()).'"; |
|
5898 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
5899 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5900 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
5901 | 5901 | |
5902 | 5902 | if (inputok.length > 0) { |
5903 | 5903 | $.each(inputok, function(i, inputname) { |
@@ -5931,11 +5931,11 @@ discard block |
||
5931 | 5931 | } |
5932 | 5932 | $(this).dialog("close"); |
5933 | 5933 | }, |
5934 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
5935 | - var options = "token=' . urlencode(newToken()) . '"; |
|
5936 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
5937 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
5938 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
5934 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
5935 | + var options = "token=' . urlencode(newToken()).'"; |
|
5936 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
5937 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5938 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
5939 | 5939 | if (inputko.length > 0) { |
5940 | 5940 | $.each(inputko, function(i, inputname) { |
5941 | 5941 | var more = ""; |
@@ -5967,10 +5967,10 @@ discard block |
||
5967 | 5967 | } |
5968 | 5968 | ); |
5969 | 5969 | |
5970 | - var button = "' . $button . '"; |
|
5970 | + var button = "' . $button.'"; |
|
5971 | 5971 | if (button.length > 0) { |
5972 | 5972 | $( "#" + button ).click(function() { |
5973 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
5973 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
5974 | 5974 | }); |
5975 | 5975 | } |
5976 | 5976 | }); |
@@ -5978,44 +5978,44 @@ discard block |
||
5978 | 5978 | </script>'; |
5979 | 5979 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
5980 | 5980 | } else { |
5981 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
5981 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
5982 | 5982 | |
5983 | 5983 | if (empty($disableformtag)) { |
5984 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftnoright">' . "\n"; |
|
5984 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftnoright">'."\n"; |
|
5985 | 5985 | } |
5986 | 5986 | |
5987 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
5988 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
5987 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
5988 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
5989 | 5989 | |
5990 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
5990 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
5991 | 5991 | |
5992 | 5992 | // Line title |
5993 | 5993 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
5994 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
5995 | - $formconfirm .= '</td></tr>' . "\n"; |
|
5994 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
5995 | + $formconfirm .= '</td></tr>'."\n"; |
|
5996 | 5996 | |
5997 | 5997 | // Line text |
5998 | 5998 | if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
5999 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
5999 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
6000 | 6000 | } |
6001 | 6001 | |
6002 | 6002 | // Line form fields |
6003 | 6003 | if ($more) { |
6004 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
6004 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
6005 | 6005 | $formconfirm .= $more; |
6006 | - $formconfirm .= '</td></tr>' . "\n"; |
|
6006 | + $formconfirm .= '</td></tr>'."\n"; |
|
6007 | 6007 | } |
6008 | 6008 | |
6009 | 6009 | // Line with question |
6010 | 6010 | $formconfirm .= '<tr class="valid">'; |
6011 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
6011 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
6012 | 6012 | $formconfirm .= '<td class="valid center">'; |
6013 | 6013 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
6014 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
6014 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
6015 | 6015 | $formconfirm .= '</td>'; |
6016 | - $formconfirm .= '</tr>' . "\n"; |
|
6016 | + $formconfirm .= '</tr>'."\n"; |
|
6017 | 6017 | |
6018 | - $formconfirm .= '</table>' . "\n"; |
|
6018 | + $formconfirm .= '</table>'."\n"; |
|
6019 | 6019 | |
6020 | 6020 | if (empty($disableformtag)) { |
6021 | 6021 | $formconfirm .= "</form>\n"; |
@@ -6024,7 +6024,7 @@ discard block |
||
6024 | 6024 | |
6025 | 6025 | if (!empty($conf->use_javascript_ajax)) { |
6026 | 6026 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
6027 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
6027 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
6028 | 6028 | $formconfirm .= ' |
6029 | 6029 | $(document).ready(function () { |
6030 | 6030 | $(".confirmvalidatebutton").on("click", function() { |
@@ -6036,7 +6036,7 @@ discard block |
||
6036 | 6036 | }); |
6037 | 6037 | }); |
6038 | 6038 | '; |
6039 | - $formconfirm .= '</script>' . "\n"; |
|
6039 | + $formconfirm .= '</script>'."\n"; |
|
6040 | 6040 | } |
6041 | 6041 | |
6042 | 6042 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -6068,8 +6068,8 @@ discard block |
||
6068 | 6068 | // phpcs:enable |
6069 | 6069 | global $langs; |
6070 | 6070 | |
6071 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
6072 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
6071 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
6072 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
6073 | 6073 | |
6074 | 6074 | $out = ''; |
6075 | 6075 | |
@@ -6077,11 +6077,11 @@ discard block |
||
6077 | 6077 | |
6078 | 6078 | $langs->load("project"); |
6079 | 6079 | if ($htmlname != "none") { |
6080 | - $out .= '<form method="post" action="' . $page . '">'; |
|
6080 | + $out .= '<form method="post" action="'.$page.'">'; |
|
6081 | 6081 | $out .= '<input type="hidden" name="action" value="classin">'; |
6082 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6082 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6083 | 6083 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
6084 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
6084 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
6085 | 6085 | $out .= '</form>'; |
6086 | 6086 | } else { |
6087 | 6087 | $out .= '<span class="project_head_block">'; |
@@ -6090,7 +6090,7 @@ discard block |
||
6090 | 6090 | $projet->fetch($selected); |
6091 | 6091 | $out .= $projet->getNomUrl(0, '', 1); |
6092 | 6092 | } else { |
6093 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
6093 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
6094 | 6094 | } |
6095 | 6095 | $out .= '</span>'; |
6096 | 6096 | } |
@@ -6127,14 +6127,14 @@ discard block |
||
6127 | 6127 | $out = ''; |
6128 | 6128 | |
6129 | 6129 | if ($htmlname != "none") { |
6130 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
6130 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
6131 | 6131 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
6132 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6132 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6133 | 6133 | if ($type) { |
6134 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
6134 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
6135 | 6135 | } |
6136 | 6136 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
6137 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
6137 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
6138 | 6138 | $out .= '</form>'; |
6139 | 6139 | } else { |
6140 | 6140 | if ($selected) { |
@@ -6179,12 +6179,12 @@ discard block |
||
6179 | 6179 | // phpcs:enable |
6180 | 6180 | global $langs; |
6181 | 6181 | if ($htmlname != "none") { |
6182 | - print '<form method="post" action="' . $page . '">'; |
|
6182 | + print '<form method="post" action="'.$page.'">'; |
|
6183 | 6183 | print '<input type="hidden" name="action" value="setavailability">'; |
6184 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6184 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6185 | 6185 | $this->selectAvailabilityDelay($selected, $htmlname, '', $addempty); |
6186 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
6187 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
6186 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
6187 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
6188 | 6188 | print '</form>'; |
6189 | 6189 | } else { |
6190 | 6190 | if ($selected) { |
@@ -6210,11 +6210,11 @@ discard block |
||
6210 | 6210 | { |
6211 | 6211 | global $langs; |
6212 | 6212 | if ($htmlname != "none") { |
6213 | - print '<form method="post" action="' . $page . '">'; |
|
6213 | + print '<form method="post" action="'.$page.'">'; |
|
6214 | 6214 | print '<input type="hidden" name="action" value="setdemandreason">'; |
6215 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6215 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6216 | 6216 | $this->selectInputReason($selected, $htmlname, '-1', $addempty); |
6217 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
6217 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
6218 | 6218 | print '</form>'; |
6219 | 6219 | } else { |
6220 | 6220 | if ($selected) { |
@@ -6254,17 +6254,17 @@ discard block |
||
6254 | 6254 | $ret = ''; |
6255 | 6255 | |
6256 | 6256 | if ($htmlname != "none") { |
6257 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
6258 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
6259 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6257 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
6258 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
6259 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6260 | 6260 | if ($type) { |
6261 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
6261 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
6262 | 6262 | } |
6263 | 6263 | $ret .= '<table class="nobordernopadding">'; |
6264 | 6264 | $ret .= '<tr><td>'; |
6265 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
6265 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
6266 | 6266 | $ret .= '</td>'; |
6267 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6267 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
6268 | 6268 | $ret .= '</tr></table></form>'; |
6269 | 6269 | } else { |
6270 | 6270 | if ($displayhour) { |
@@ -6299,15 +6299,15 @@ discard block |
||
6299 | 6299 | global $langs; |
6300 | 6300 | |
6301 | 6301 | if ($htmlname != "none") { |
6302 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
6303 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
6304 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6302 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
6303 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
6304 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6305 | 6305 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
6306 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6306 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6307 | 6307 | print '</form>'; |
6308 | 6308 | } else { |
6309 | 6309 | if ($selected) { |
6310 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
6310 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
6311 | 6311 | $theuser = new User($this->db); |
6312 | 6312 | $theuser->fetch($selected); |
6313 | 6313 | print $theuser->getNomUrl(1); |
@@ -6340,14 +6340,14 @@ discard block |
||
6340 | 6340 | |
6341 | 6341 | $out = ''; |
6342 | 6342 | if ($htmlname != "none") { |
6343 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
6343 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
6344 | 6344 | $out .= '<input type="hidden" name="action" value="setmode">'; |
6345 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6345 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6346 | 6346 | if ($type) { |
6347 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
6347 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
6348 | 6348 | } |
6349 | 6349 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
6350 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6350 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6351 | 6351 | $out .= '</form>'; |
6352 | 6352 | } else { |
6353 | 6353 | if ($selected) { |
@@ -6380,11 +6380,11 @@ discard block |
||
6380 | 6380 | { |
6381 | 6381 | global $langs; |
6382 | 6382 | if ($htmlname != "none") { |
6383 | - print '<form method="POST" action="' . $page . '">'; |
|
6383 | + print '<form method="POST" action="'.$page.'">'; |
|
6384 | 6384 | print '<input type="hidden" name="action" value="settransportmode">'; |
6385 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6385 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6386 | 6386 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
6387 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6387 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6388 | 6388 | print '</form>'; |
6389 | 6389 | } else { |
6390 | 6390 | if ($selected) { |
@@ -6411,14 +6411,14 @@ discard block |
||
6411 | 6411 | // phpcs:enable |
6412 | 6412 | global $langs; |
6413 | 6413 | if ($htmlname != "none") { |
6414 | - print '<form method="POST" action="' . $page . '">'; |
|
6414 | + print '<form method="POST" action="'.$page.'">'; |
|
6415 | 6415 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
6416 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6416 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6417 | 6417 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
6418 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6418 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6419 | 6419 | print '</form>'; |
6420 | 6420 | } else { |
6421 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6421 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
6422 | 6422 | print !empty($selected) ? currency_name($selected, 1) : ' '; |
6423 | 6423 | } |
6424 | 6424 | } |
@@ -6440,22 +6440,22 @@ discard block |
||
6440 | 6440 | global $langs, $mysoc, $conf; |
6441 | 6441 | |
6442 | 6442 | if ($htmlname != "none") { |
6443 | - print '<form method="POST" action="' . $page . '">'; |
|
6443 | + print '<form method="POST" action="'.$page.'">'; |
|
6444 | 6444 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
6445 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6446 | - print '<input type="text" class="maxwidth75" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
6445 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6446 | + print '<input type="text" class="maxwidth75" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
6447 | 6447 | print '<select name="calculation_mode" id="calculation_mode">'; |
6448 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
6449 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
6448 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
6449 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
6450 | 6450 | print '</select> '; |
6451 | 6451 | print ajax_combobox("calculation_mode"); |
6452 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6452 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6453 | 6453 | print '</form>'; |
6454 | 6454 | } else { |
6455 | 6455 | if (!empty($rate)) { |
6456 | 6456 | print price($rate, 1, $langs, 0, 0); |
6457 | 6457 | if ($currency && $rate != 1) { |
6458 | - print ' <span class="opacitymedium">(' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')</span>'; |
|
6458 | + print ' <span class="opacitymedium">('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')</span>'; |
|
6459 | 6459 | } |
6460 | 6460 | } else { |
6461 | 6461 | print 1; |
@@ -6485,9 +6485,9 @@ discard block |
||
6485 | 6485 | // phpcs:enable |
6486 | 6486 | global $conf, $langs; |
6487 | 6487 | if ($htmlname != "none") { |
6488 | - print '<form method="post" action="' . $page . '">'; |
|
6488 | + print '<form method="post" action="'.$page.'">'; |
|
6489 | 6489 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
6490 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6490 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6491 | 6491 | print '<div class="inline-block">'; |
6492 | 6492 | if (!empty($discount_type)) { |
6493 | 6493 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6525,24 +6525,24 @@ discard block |
||
6525 | 6525 | print '</div>'; |
6526 | 6526 | if (empty($hidelist)) { |
6527 | 6527 | print '<div class="inline-block" style="padding-right: 10px">'; |
6528 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
6528 | + $newfilter = 'discount_type='.intval($discount_type); |
|
6529 | 6529 | if (!empty($discount_type)) { |
6530 | 6530 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
6531 | 6531 | } else { |
6532 | 6532 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
6533 | 6533 | } |
6534 | 6534 | if ($filter) { |
6535 | - $newfilter .= ' AND (' . $filter . ')'; |
|
6535 | + $newfilter .= ' AND ('.$filter.')'; |
|
6536 | 6536 | } |
6537 | 6537 | // output the combo of discounts |
6538 | 6538 | $nbqualifiedlines = $this->select_remises((string) $selected, $htmlname, $newfilter, $socid, $maxvalue); |
6539 | 6539 | if ($nbqualifiedlines > 0) { |
6540 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
6540 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
6541 | 6541 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
6542 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6542 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6543 | 6543 | } |
6544 | 6544 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
6545 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6545 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
6546 | 6546 | } |
6547 | 6547 | |
6548 | 6548 | print '>'; |
@@ -6582,23 +6582,23 @@ discard block |
||
6582 | 6582 | global $langs; |
6583 | 6583 | |
6584 | 6584 | if ($htmlname != "none") { |
6585 | - print '<form method="post" action="' . $page . '">'; |
|
6585 | + print '<form method="post" action="'.$page.'">'; |
|
6586 | 6586 | print '<input type="hidden" name="action" value="set_contact">'; |
6587 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6587 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6588 | 6588 | print '<table class="nobordernopadding">'; |
6589 | 6589 | print '<tr><td>'; |
6590 | 6590 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
6591 | 6591 | $num = $this->num; |
6592 | 6592 | if ($num == 0) { |
6593 | 6593 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
6594 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
6594 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
6595 | 6595 | } |
6596 | 6596 | print '</td>'; |
6597 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6597 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
6598 | 6598 | print '</tr></table></form>'; |
6599 | 6599 | } else { |
6600 | 6600 | if ($selected) { |
6601 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
6601 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
6602 | 6602 | $contact = new Contact($this->db); |
6603 | 6603 | $contact->fetch($selected); |
6604 | 6604 | print $contact->getFullName($langs); |
@@ -6633,20 +6633,20 @@ discard block |
||
6633 | 6633 | |
6634 | 6634 | $out = ''; |
6635 | 6635 | if ($htmlname != "none") { |
6636 | - $out .= '<form method="post" action="' . $page . '">'; |
|
6636 | + $out .= '<form method="post" action="'.$page.'">'; |
|
6637 | 6637 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
6638 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6638 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6639 | 6639 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
6640 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6640 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
6641 | 6641 | $out .= '</form>'; |
6642 | 6642 | } else { |
6643 | 6643 | if ($selected) { |
6644 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
6644 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
6645 | 6645 | $soc = new Societe($this->db); |
6646 | 6646 | $soc->fetch($selected); |
6647 | 6647 | $out .= $soc->getNomUrl(0, ''); |
6648 | 6648 | } else { |
6649 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
6649 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
6650 | 6650 | } |
6651 | 6651 | } |
6652 | 6652 | |
@@ -6696,22 +6696,22 @@ discard block |
||
6696 | 6696 | $selected = 'EUR'; // Pour compatibilite |
6697 | 6697 | } |
6698 | 6698 | |
6699 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6699 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6700 | 6700 | if ($useempty) { |
6701 | 6701 | $out .= '<option value="-1" selected></option>'; |
6702 | 6702 | } |
6703 | 6703 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6704 | 6704 | $labeltoshow = $currency['label']; |
6705 | 6705 | if ($mode == 1) { |
6706 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
6706 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
6707 | 6707 | } else { |
6708 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
6708 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
6709 | 6709 | } |
6710 | 6710 | |
6711 | 6711 | if ($selected && $selected == $code_iso) { |
6712 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6712 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6713 | 6713 | } else { |
6714 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6714 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
6715 | 6715 | } |
6716 | 6716 | $out .= dol_string_nohtmltag($labeltoshow); |
6717 | 6717 | $out .= '</option>'; |
@@ -6722,7 +6722,7 @@ discard block |
||
6722 | 6722 | } |
6723 | 6723 | |
6724 | 6724 | // Make select dynamic |
6725 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6725 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6726 | 6726 | $out .= ajax_combobox($htmlname); |
6727 | 6727 | |
6728 | 6728 | return $out; |
@@ -6748,10 +6748,10 @@ discard block |
||
6748 | 6748 | |
6749 | 6749 | $TCurrency = array(); |
6750 | 6750 | |
6751 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
6752 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
6751 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
6752 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
6753 | 6753 | if ($filter) { |
6754 | - $sql .= " AND " . $filter; |
|
6754 | + $sql .= " AND ".$filter; |
|
6755 | 6755 | } |
6756 | 6756 | $resql = $this->db->query($sql); |
6757 | 6757 | if ($resql) { |
@@ -6761,7 +6761,7 @@ discard block |
||
6761 | 6761 | } |
6762 | 6762 | |
6763 | 6763 | $out = ''; |
6764 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6764 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
6765 | 6765 | if ($useempty) { |
6766 | 6766 | $out .= '<option value=""> </option>'; |
6767 | 6767 | } |
@@ -6773,13 +6773,13 @@ discard block |
||
6773 | 6773 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
6774 | 6774 | if (isset($TCurrency[$code_iso])) { |
6775 | 6775 | if (!empty($selected) && $selected == $code_iso) { |
6776 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
6776 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
6777 | 6777 | } else { |
6778 | - $out .= '<option value="' . $code_iso . '">'; |
|
6778 | + $out .= '<option value="'.$code_iso.'">'; |
|
6779 | 6779 | } |
6780 | 6780 | |
6781 | 6781 | $out .= $currency['label']; |
6782 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
6782 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
6783 | 6783 | $out .= '</option>'; |
6784 | 6784 | } |
6785 | 6785 | } |
@@ -6788,7 +6788,7 @@ discard block |
||
6788 | 6788 | $out .= '</select>'; |
6789 | 6789 | |
6790 | 6790 | // Make select dynamic |
6791 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6791 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
6792 | 6792 | $out .= ajax_combobox($htmlname); |
6793 | 6793 | |
6794 | 6794 | return $out; |
@@ -6819,7 +6819,7 @@ discard block |
||
6819 | 6819 | $sql .= " WHERE t.fk_pays = c.rowid"; |
6820 | 6820 | $sql .= " AND t.active > 0"; |
6821 | 6821 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
6822 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
6822 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
6823 | 6823 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
6824 | 6824 | |
6825 | 6825 | $resql = $this->db->query($sql); |
@@ -6831,30 +6831,30 @@ discard block |
||
6831 | 6831 | |
6832 | 6832 | $tmparray = array(); |
6833 | 6833 | $tmparray['rowid'] = $obj->rowid; |
6834 | - $tmparray['type_vat'] = $obj->type_vat; |
|
6835 | - $tmparray['code'] = $obj->code; |
|
6834 | + $tmparray['type_vat'] = $obj->type_vat; |
|
6835 | + $tmparray['code'] = $obj->code; |
|
6836 | 6836 | $tmparray['txtva'] = $obj->taux; |
6837 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
6837 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
6838 | 6838 | $tmparray['localtax1'] = $obj->localtax1; |
6839 | 6839 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
6840 | 6840 | $tmparray['localtax2'] = $obj->localtax2; |
6841 | 6841 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
6842 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
6843 | - $tmparray['labelallrates'] = $obj->taux . '/' . ($obj->localtax1 ? $obj->localtax1 : '0') . '/' . ($obj->localtax2 ? $obj->localtax2 : '0') . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6842 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
6843 | + $tmparray['labelallrates'] = $obj->taux.'/'.($obj->localtax1 ? $obj->localtax1 : '0').'/'.($obj->localtax2 ? $obj->localtax2 : '0').($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6844 | 6844 | $positiverates = ''; |
6845 | 6845 | if ($obj->taux) { |
6846 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
6846 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
6847 | 6847 | } |
6848 | 6848 | if ($obj->localtax1) { |
6849 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
6849 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
6850 | 6850 | } |
6851 | 6851 | if ($obj->localtax2) { |
6852 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
6852 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
6853 | 6853 | } |
6854 | 6854 | if (empty($positiverates)) { |
6855 | 6855 | $positiverates = '0'; |
6856 | 6856 | } |
6857 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6857 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
6858 | 6858 | |
6859 | 6859 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
6860 | 6860 | } |
@@ -6874,7 +6874,7 @@ discard block |
||
6874 | 6874 | return -1; |
6875 | 6875 | } |
6876 | 6876 | } else { |
6877 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
6877 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
6878 | 6878 | return -2; |
6879 | 6879 | } |
6880 | 6880 | } |
@@ -6946,9 +6946,9 @@ discard block |
||
6946 | 6946 | // Check parameters |
6947 | 6947 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
6948 | 6948 | if ($societe_vendeuse->id == $mysoc->id) { |
6949 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
6949 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
6950 | 6950 | } else { |
6951 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
6951 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
6952 | 6952 | } |
6953 | 6953 | return $return; |
6954 | 6954 | } |
@@ -6960,12 +6960,12 @@ discard block |
||
6960 | 6960 | // Define list of countries to use to search VAT rates to show |
6961 | 6961 | // First we defined code_country to use to find list |
6962 | 6962 | if (is_object($societe_vendeuse)) { |
6963 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
6963 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
6964 | 6964 | } else { |
6965 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
6965 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
6966 | 6966 | } |
6967 | 6967 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
6968 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6968 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
6969 | 6969 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
6970 | 6970 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
6971 | 6971 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6975,27 +6975,27 @@ discard block |
||
6975 | 6975 | if ($type == 1) { // We know product is a service |
6976 | 6976 | switch ($selectVatComboMode) { |
6977 | 6977 | case '1': |
6978 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6978 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6979 | 6979 | break; |
6980 | 6980 | case '2': |
6981 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
6981 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
6982 | 6982 | break; |
6983 | 6983 | } |
6984 | 6984 | } |
6985 | 6985 | } elseif (!$idprod) { // We don't know type of product |
6986 | 6986 | switch ($selectVatComboMode) { |
6987 | 6987 | case '1': |
6988 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6988 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6989 | 6989 | break; |
6990 | 6990 | case '2': |
6991 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
6991 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
6992 | 6992 | break; |
6993 | 6993 | } |
6994 | 6994 | } else { |
6995 | 6995 | $prodstatic = new Product($this->db); |
6996 | 6996 | $prodstatic->fetch($idprod); |
6997 | 6997 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
6998 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6998 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
6999 | 6999 | } |
7000 | 7000 | } |
7001 | 7001 | } |
@@ -7057,13 +7057,13 @@ discard block |
||
7057 | 7057 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
7058 | 7058 | // of using supplier invoices (this is a very bad idea !) |
7059 | 7059 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
7060 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
7060 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
7061 | 7061 | $disabled = true; |
7062 | 7062 | } |
7063 | 7063 | } |
7064 | 7064 | |
7065 | 7065 | if (!$options_only) { |
7066 | - $return .= '<select class="flat minwidth75imp maxwidth100 right" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
7066 | + $return .= '<select class="flat minwidth75imp maxwidth100 right" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
7067 | 7067 | } |
7068 | 7068 | |
7069 | 7069 | $selectedfound = false; |
@@ -7077,13 +7077,13 @@ discard block |
||
7077 | 7077 | $key = $rate['txtva']; |
7078 | 7078 | $key .= $rate['nprtva'] ? '*' : ''; |
7079 | 7079 | if ($mode > 0 && $rate['code']) { |
7080 | - $key .= ' (' . $rate['code'] . ')'; |
|
7080 | + $key .= ' ('.$rate['code'].')'; |
|
7081 | 7081 | } |
7082 | 7082 | if ($mode < 0) { |
7083 | 7083 | $key = $rate['rowid']; |
7084 | 7084 | } |
7085 | 7085 | |
7086 | - $return .= '<option value="' . $key . '"'; |
|
7086 | + $return .= '<option value="'.$key.'"'; |
|
7087 | 7087 | if (!$selectedfound) { |
7088 | 7088 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
7089 | 7089 | if ($defaultcode == $rate['code']) { |
@@ -7154,7 +7154,7 @@ discard block |
||
7154 | 7154 | public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = 0, $addplusone = '', $adddateof = '') |
7155 | 7155 | { |
7156 | 7156 | // phpcs:enable |
7157 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
7157 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
7158 | 7158 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
7159 | 7159 | if (!empty($nooutput)) { |
7160 | 7160 | return $retstring; |
@@ -7183,11 +7183,11 @@ discard block |
||
7183 | 7183 | { |
7184 | 7184 | global $langs; |
7185 | 7185 | |
7186 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
7186 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
7187 | 7187 | if ($forcenewline) { |
7188 | 7188 | $ret .= '<br>'; |
7189 | 7189 | } |
7190 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
7190 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
7191 | 7191 | return $ret; |
7192 | 7192 | } |
7193 | 7193 | |
@@ -7254,7 +7254,7 @@ discard block |
||
7254 | 7254 | $orig_set_time = $set_time; |
7255 | 7255 | |
7256 | 7256 | if ($set_time === '' && $emptydate == 0) { |
7257 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7257 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
7258 | 7258 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
7259 | 7259 | $set_time = dol_now($gm); |
7260 | 7260 | } else { |
@@ -7326,38 +7326,38 @@ discard block |
||
7326 | 7326 | // Calendrier popup version eldy |
7327 | 7327 | if ($usecalendar == "eldy") { |
7328 | 7328 | // Input area to enter date manually |
7329 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate center" maxlength="11" value="' . $formated_date . '"'; |
|
7329 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
|
7330 | 7330 | $retstring .= ($disabled ? ' disabled' : ''); |
7331 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7331 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7332 | 7332 | $retstring .= ' autocomplete="off">'; |
7333 | 7333 | |
7334 | 7334 | // Icon calendar |
7335 | 7335 | $retstringbuttom = ''; |
7336 | 7336 | if (!$disabled) { |
7337 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
7338 | - $base = DOL_URL_ROOT . '/core/'; |
|
7339 | - $retstringbuttom .= ' onClick="showDP(\'' . dol_escape_js($base) . '\',\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\',\'' . dol_escape_js($langs->defaultlang) . '\');"'; |
|
7340 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
7337 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
7338 | + $base = DOL_URL_ROOT.'/core/'; |
|
7339 | + $retstringbuttom .= ' onClick="showDP(\''.dol_escape_js($base).'\',\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\',\''.dol_escape_js($langs->defaultlang).'\');"'; |
|
7340 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
7341 | 7341 | } else { |
7342 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
7342 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
7343 | 7343 | } |
7344 | - $retstring = $retstringbuttom . $retstring; |
|
7344 | + $retstring = $retstringbuttom.$retstring; |
|
7345 | 7345 | |
7346 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
7347 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
7348 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
7346 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
7347 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
7348 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
7349 | 7349 | } elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
7350 | 7350 | if (!$disabled && $usecalendar != 'html') { |
7351 | 7351 | // Output javascript for datepicker |
7352 | 7352 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
7353 | 7353 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
7354 | 7354 | |
7355 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
7356 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
7357 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
7355 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
7356 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
7357 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
7358 | 7358 | autoclose: true, |
7359 | 7359 | todayHighlight: true, |
7360 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
7360 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
7361 | 7361 | if (!empty($conf->dol_use_jmobile)) { |
7362 | 7362 | $retstring .= " |
7363 | 7363 | beforeShow: function (input, datePicker) { |
@@ -7370,10 +7370,10 @@ discard block |
||
7370 | 7370 | } |
7371 | 7371 | // Note: We don't need monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, they are set globally on datepicker component in lib_head.js.php |
7372 | 7372 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
7373 | - $buttonImage = $calendarpicto ?: DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png"; |
|
7373 | + $buttonImage = $calendarpicto ?: DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png"; |
|
7374 | 7374 | $retstring .= " |
7375 | 7375 | showOn: 'button', /* both has problem with autocompletion */ |
7376 | - buttonImage: '" . $buttonImage . "', |
|
7376 | + buttonImage: '" . $buttonImage."', |
|
7377 | 7377 | buttonImageOnly: true"; |
7378 | 7378 | } |
7379 | 7379 | $retstring .= " |
@@ -7385,46 +7385,46 @@ discard block |
||
7385 | 7385 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
7386 | 7386 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="'.($usecalendar == 'html' ? "date" : "text").'" class="maxwidthdate center" maxlength="11" value="'.$formated_date.'"'; |
7387 | 7387 | $retstring .= ($disabled ? ' disabled' : ''); |
7388 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
7389 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7388 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
7389 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
7390 | 7390 | $retstring .= ' autocomplete="off">'; |
7391 | 7391 | |
7392 | 7392 | // Icone calendrier |
7393 | 7393 | if ($disabled) { |
7394 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
7395 | - $retstring = $retstringbutton . $retstring; |
|
7394 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
7395 | + $retstring = $retstringbutton.$retstring; |
|
7396 | 7396 | } |
7397 | 7397 | |
7398 | 7398 | $retstring .= '</div>'; |
7399 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
7400 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
7401 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
7399 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
7400 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
7401 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
7402 | 7402 | } else { |
7403 | 7403 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
7404 | 7404 | } |
7405 | 7405 | } else { |
7406 | 7406 | // Show date with combo selects |
7407 | 7407 | // Day |
7408 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
7408 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
7409 | 7409 | |
7410 | 7410 | if ($emptydate || $set_time == -1) { |
7411 | 7411 | $retstring .= '<option value="0" selected> </option>'; |
7412 | 7412 | } |
7413 | 7413 | |
7414 | 7414 | for ($day = 1; $day <= 31; $day++) { |
7415 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
7415 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
7416 | 7416 | } |
7417 | 7417 | |
7418 | 7418 | $retstring .= "</select>"; |
7419 | 7419 | |
7420 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
7420 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
7421 | 7421 | if ($emptydate || $set_time == -1) { |
7422 | 7422 | $retstring .= '<option value="0" selected> </option>'; |
7423 | 7423 | } |
7424 | 7424 | |
7425 | 7425 | // Month |
7426 | 7426 | for ($month = 1; $month <= 12; $month++) { |
7427 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
7427 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
7428 | 7428 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
7429 | 7429 | $retstring .= "</option>"; |
7430 | 7430 | } |
@@ -7432,13 +7432,13 @@ discard block |
||
7432 | 7432 | |
7433 | 7433 | // Year |
7434 | 7434 | if ($emptydate || $set_time == -1) { |
7435 | - $retstring .= '<input' . ($disabled ? ' disabled' : '') . ' placeholder="' . dol_escape_htmltag($langs->trans("Year")) . '" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">'; |
|
7435 | + $retstring .= '<input'.($disabled ? ' disabled' : '').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat maxwidth50imp valignmiddle" type="number" min="0" max="3000" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'; |
|
7436 | 7436 | } else { |
7437 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
7437 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
7438 | 7438 | |
7439 | 7439 | $syear = (int) $syear; |
7440 | 7440 | for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
7441 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
7441 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
7442 | 7442 | } |
7443 | 7443 | $retstring .= "</select>\n"; |
7444 | 7444 | } |
@@ -7463,15 +7463,15 @@ discard block |
||
7463 | 7463 | } |
7464 | 7464 | |
7465 | 7465 | // Show hour |
7466 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
7466 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
7467 | 7467 | if ($emptyhours) { |
7468 | 7468 | $retstring .= '<option value="-1"> </option>'; |
7469 | 7469 | } |
7470 | 7470 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
7471 | 7471 | if (strlen($hour) < 2) { |
7472 | - $hour = "0" . $hour; |
|
7472 | + $hour = "0".$hour; |
|
7473 | 7473 | } |
7474 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
7474 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
7475 | 7475 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
7476 | 7476 | $retstring .= '</option>'; |
7477 | 7477 | } |
@@ -7484,17 +7484,17 @@ discard block |
||
7484 | 7484 | |
7485 | 7485 | if ($m) { |
7486 | 7486 | // Show minutes |
7487 | - $retstring .= '<select ' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
7487 | + $retstring .= '<select '.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
7488 | 7488 | if ($emptyhours) { |
7489 | 7489 | $retstring .= '<option value="-1"> </option>'; |
7490 | 7490 | } |
7491 | 7491 | for ($min = 0; $min < 60; $min += $stepminutes) { |
7492 | 7492 | $min_str = sprintf("%02d", $min); |
7493 | - $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
7493 | + $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
|
7494 | 7494 | } |
7495 | 7495 | $retstring .= '</select>'; |
7496 | 7496 | |
7497 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
7497 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
7498 | 7498 | } |
7499 | 7499 | |
7500 | 7500 | if ($d && $h) { |
@@ -7517,10 +7517,10 @@ discard block |
||
7517 | 7517 | |
7518 | 7518 | // Generate the date part, depending on the use or not of the javascript calendar |
7519 | 7519 | if ($addnowlink == 1) { // server time expressed in user time setup |
7520 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
7521 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7522 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7523 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7520 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7521 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7522 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7523 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7524 | 7524 | } elseif ($addnowlink == 2) { |
7525 | 7525 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
7526 | 7526 | * This break application for foreign languages. |
@@ -7529,10 +7529,10 @@ discard block |
||
7529 | 7529 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
7530 | 7530 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
7531 | 7531 | */ |
7532 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
7533 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7534 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7535 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7532 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7533 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7534 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7535 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7536 | 7536 | } |
7537 | 7537 | /*if ($usecalendar == "eldy") |
7538 | 7538 | { |
@@ -7552,11 +7552,11 @@ discard block |
||
7552 | 7552 | } |
7553 | 7553 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
7554 | 7554 | if ($addnowlink == 1) { |
7555 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7556 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7555 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7556 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7557 | 7557 | } elseif ($addnowlink == 2) { |
7558 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
7559 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7558 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
7559 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
7560 | 7560 | } |
7561 | 7561 | |
7562 | 7562 | if ($fullday) { |
@@ -7570,11 +7570,11 @@ discard block |
||
7570 | 7570 | } |
7571 | 7571 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
7572 | 7572 | if ($addnowlink == 1) { |
7573 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7574 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7573 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7574 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7575 | 7575 | } elseif ($addnowlink == 2) { |
7576 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
7577 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7576 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
7577 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
7578 | 7578 | } |
7579 | 7579 | if ($fullday) { |
7580 | 7580 | $reset_scripts .= ' } '; |
@@ -7582,7 +7582,7 @@ discard block |
||
7582 | 7582 | } |
7583 | 7583 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7584 | 7584 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
7585 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
7585 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
7586 | 7586 | $retstring .= $langs->trans("Now"); |
7587 | 7587 | $retstring .= '</button> '; |
7588 | 7588 | } |
@@ -7594,16 +7594,16 @@ discard block |
||
7594 | 7594 | $reset_scripts = ""; |
7595 | 7595 | |
7596 | 7596 | // Generate the date part, depending on the use or not of the javascript calendar |
7597 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
7598 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
7599 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
7600 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7597 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
7598 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7599 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7600 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
7601 | 7601 | // Update the hour part |
7602 | 7602 | if ($h) { |
7603 | 7603 | if ($fullday) { |
7604 | 7604 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7605 | 7605 | } |
7606 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7606 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7607 | 7607 | if ($fullday) { |
7608 | 7608 | $reset_scripts .= ' } '; |
7609 | 7609 | } |
@@ -7613,14 +7613,14 @@ discard block |
||
7613 | 7613 | if ($fullday) { |
7614 | 7614 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7615 | 7615 | } |
7616 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7616 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7617 | 7617 | if ($fullday) { |
7618 | 7618 | $reset_scripts .= ' } '; |
7619 | 7619 | } |
7620 | 7620 | } |
7621 | 7621 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7622 | 7622 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
7623 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
7623 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
7624 | 7624 | $retstring .= $langs->trans("DateStartPlusOne"); |
7625 | 7625 | $retstring .= '</button> '; |
7626 | 7626 | } |
@@ -7678,17 +7678,17 @@ discard block |
||
7678 | 7678 | unset($TDurationTypes[$value]); |
7679 | 7679 | } |
7680 | 7680 | |
7681 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
7681 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
7682 | 7682 | foreach ($TDurationTypes as $key => $typeduration) { |
7683 | - $retstring .= '<option value="' . $key . '"'; |
|
7683 | + $retstring .= '<option value="'.$key.'"'; |
|
7684 | 7684 | if ($key == $selected) { |
7685 | 7685 | $retstring .= " selected"; |
7686 | 7686 | } |
7687 | - $retstring .= ">" . $typeduration . "</option>"; |
|
7687 | + $retstring .= ">".$typeduration."</option>"; |
|
7688 | 7688 | } |
7689 | 7689 | $retstring .= "</select>"; |
7690 | 7690 | |
7691 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
7691 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
7692 | 7692 | |
7693 | 7693 | return $retstring; |
7694 | 7694 | } |
@@ -7720,30 +7720,30 @@ discard block |
||
7720 | 7720 | |
7721 | 7721 | // Hours |
7722 | 7722 | if ($iSecond != '') { |
7723 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7723 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
7724 | 7724 | |
7725 | 7725 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
7726 | 7726 | $minSelected = convertSecondToTime($iSecond, 'min'); |
7727 | 7727 | } |
7728 | 7728 | |
7729 | 7729 | if ($typehour == 'select') { |
7730 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
7730 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
7731 | 7731 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
7732 | - $retstring .= '<option value="' . $hour . '"'; |
|
7732 | + $retstring .= '<option value="'.$hour.'"'; |
|
7733 | 7733 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
7734 | 7734 | $retstring .= " selected"; |
7735 | 7735 | } |
7736 | - $retstring .= ">" . $hour . "</option>"; |
|
7736 | + $retstring .= ">".$hour."</option>"; |
|
7737 | 7737 | } |
7738 | 7738 | $retstring .= "</select>"; |
7739 | 7739 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
7740 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
7740 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
7741 | 7741 | } else { |
7742 | 7742 | return 'BadValueForParameterTypeHour'; |
7743 | 7743 | } |
7744 | 7744 | |
7745 | 7745 | if ($typehour != 'text') { |
7746 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
7746 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
7747 | 7747 | } else { |
7748 | 7748 | $retstring .= '<span class="">:</span>'; |
7749 | 7749 | } |
@@ -7758,21 +7758,21 @@ discard block |
||
7758 | 7758 | } |
7759 | 7759 | |
7760 | 7760 | if ($typehour == 'select' || $typehour == 'textselect') { |
7761 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
7761 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
7762 | 7762 | for ($min = 0; $min <= 55; $min += 5) { |
7763 | - $retstring .= '<option value="' . $min . '"'; |
|
7763 | + $retstring .= '<option value="'.$min.'"'; |
|
7764 | 7764 | if (is_numeric($minSelected) && $minSelected == $min) { |
7765 | 7765 | $retstring .= ' selected'; |
7766 | 7766 | } |
7767 | - $retstring .= '>' . $min . '</option>'; |
|
7767 | + $retstring .= '>'.$min.'</option>'; |
|
7768 | 7768 | } |
7769 | 7769 | $retstring .= "</select>"; |
7770 | 7770 | } elseif ($typehour == 'text') { |
7771 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
7771 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
7772 | 7772 | } |
7773 | 7773 | |
7774 | 7774 | if ($typehour != 'text') { |
7775 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
7775 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
7776 | 7776 | } |
7777 | 7777 | |
7778 | 7778 | $retstring .= "</span>"; |
@@ -7820,7 +7820,7 @@ discard block |
||
7820 | 7820 | $placeholder = ''; |
7821 | 7821 | |
7822 | 7822 | if ($selected && empty($selected_input_value)) { |
7823 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7823 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7824 | 7824 | $tickettmpselect = new Ticket($this->db); |
7825 | 7825 | $tickettmpselect->fetch($selected); |
7826 | 7826 | $selected_input_value = $tickettmpselect->ref; |
@@ -7828,17 +7828,17 @@ discard block |
||
7828 | 7828 | } |
7829 | 7829 | |
7830 | 7830 | $urloption = ''; |
7831 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7831 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7832 | 7832 | |
7833 | 7833 | if (empty($hidelabel)) { |
7834 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7834 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
7835 | 7835 | } elseif ($hidelabel > 1) { |
7836 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7836 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
7837 | 7837 | if ($hidelabel == 2) { |
7838 | 7838 | $out .= img_picto($langs->trans("Search"), 'search'); |
7839 | 7839 | } |
7840 | 7840 | } |
7841 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
7841 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
7842 | 7842 | if ($hidelabel == 3) { |
7843 | 7843 | $out .= img_picto($langs->trans("Search"), 'search'); |
7844 | 7844 | } |
@@ -7882,8 +7882,8 @@ discard block |
||
7882 | 7882 | |
7883 | 7883 | $sql = "SELECT "; |
7884 | 7884 | $sql .= $selectFields; |
7885 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
7886 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
7885 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
7886 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
7887 | 7887 | |
7888 | 7888 | // Add criteria on ref/label |
7889 | 7889 | if ($filterkey != '') { |
@@ -7899,7 +7899,7 @@ discard block |
||
7899 | 7899 | if ($i > 0) { |
7900 | 7900 | $sql .= " AND "; |
7901 | 7901 | } |
7902 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7902 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7903 | 7903 | $sql .= ")"; |
7904 | 7904 | $i++; |
7905 | 7905 | } |
@@ -7912,22 +7912,22 @@ discard block |
||
7912 | 7912 | $sql .= $this->db->plimit($limit, 0); |
7913 | 7913 | |
7914 | 7914 | // Build output string |
7915 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
7915 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
7916 | 7916 | $result = $this->db->query($sql); |
7917 | 7917 | if ($result) { |
7918 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7919 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
7918 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7919 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
7920 | 7920 | |
7921 | 7921 | $num = $this->db->num_rows($result); |
7922 | 7922 | |
7923 | 7923 | $events = array(); |
7924 | 7924 | |
7925 | 7925 | if (!$forcecombo) { |
7926 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7926 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
7927 | 7927 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('TICKET_USE_SEARCH_TO_SELECT')); |
7928 | 7928 | } |
7929 | 7929 | |
7930 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7930 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
7931 | 7931 | |
7932 | 7932 | $textifempty = ''; |
7933 | 7933 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7944,7 +7944,7 @@ discard block |
||
7944 | 7944 | } |
7945 | 7945 | } |
7946 | 7946 | if ($showempty) { |
7947 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7947 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
7948 | 7948 | } |
7949 | 7949 | |
7950 | 7950 | $i = 0; |
@@ -7999,13 +7999,13 @@ discard block |
||
7999 | 7999 | $outkey = $objp->rowid; |
8000 | 8000 | $outref = $objp->ref; |
8001 | 8001 | |
8002 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
8002 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
8003 | 8003 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
8004 | 8004 | $opt .= '>'; |
8005 | 8005 | $opt .= $objp->ref; |
8006 | 8006 | $objRef = $objp->ref; |
8007 | 8007 | if (!empty($filterkey) && $filterkey != '') { |
8008 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
8008 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
8009 | 8009 | } |
8010 | 8010 | |
8011 | 8011 | $opt .= "</option>\n"; |
@@ -8046,7 +8046,7 @@ discard block |
||
8046 | 8046 | $placeholder = ''; |
8047 | 8047 | |
8048 | 8048 | if ($selected && empty($selected_input_value)) { |
8049 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
8049 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
8050 | 8050 | $projecttmpselect = new Project($this->db); |
8051 | 8051 | $projecttmpselect->fetch($selected); |
8052 | 8052 | $selected_input_value = $projecttmpselect->ref; |
@@ -8054,17 +8054,17 @@ discard block |
||
8054 | 8054 | } |
8055 | 8055 | |
8056 | 8056 | $urloption = ''; |
8057 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
8057 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
8058 | 8058 | |
8059 | 8059 | if (empty($hidelabel)) { |
8060 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
8060 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
8061 | 8061 | } elseif ($hidelabel > 1) { |
8062 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
8062 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
8063 | 8063 | if ($hidelabel == 2) { |
8064 | 8064 | $out .= img_picto($langs->trans("Search"), 'search'); |
8065 | 8065 | } |
8066 | 8066 | } |
8067 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
8067 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
8068 | 8068 | if ($hidelabel == 3) { |
8069 | 8069 | $out .= img_picto($langs->trans("Search"), 'search'); |
8070 | 8070 | } |
@@ -8107,8 +8107,8 @@ discard block |
||
8107 | 8107 | |
8108 | 8108 | $sql = "SELECT "; |
8109 | 8109 | $sql .= $selectFields; |
8110 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
8111 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
8110 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
8111 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
8112 | 8112 | |
8113 | 8113 | // Add criteria on ref/label |
8114 | 8114 | if ($filterkey != '') { |
@@ -8124,7 +8124,7 @@ discard block |
||
8124 | 8124 | if ($i > 0) { |
8125 | 8125 | $sql .= " AND "; |
8126 | 8126 | } |
8127 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
8127 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
8128 | 8128 | $sql .= ""; |
8129 | 8129 | $i++; |
8130 | 8130 | } |
@@ -8137,22 +8137,22 @@ discard block |
||
8137 | 8137 | $sql .= $this->db->plimit($limit, 0); |
8138 | 8138 | |
8139 | 8139 | // Build output string |
8140 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
8140 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
8141 | 8141 | $result = $this->db->query($sql); |
8142 | 8142 | if ($result) { |
8143 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
8144 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
8143 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
8144 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
8145 | 8145 | |
8146 | 8146 | $num = $this->db->num_rows($result); |
8147 | 8147 | |
8148 | 8148 | $events = array(); |
8149 | 8149 | |
8150 | 8150 | if (!$forcecombo) { |
8151 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8151 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8152 | 8152 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT')); |
8153 | 8153 | } |
8154 | 8154 | |
8155 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
8155 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
8156 | 8156 | |
8157 | 8157 | $textifempty = ''; |
8158 | 8158 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8169,7 +8169,7 @@ discard block |
||
8169 | 8169 | } |
8170 | 8170 | } |
8171 | 8171 | if ($showempty) { |
8172 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
8172 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
8173 | 8173 | } |
8174 | 8174 | |
8175 | 8175 | $i = 0; |
@@ -8227,13 +8227,13 @@ discard block |
||
8227 | 8227 | $outlabel = $objp->label; |
8228 | 8228 | $outtype = $objp->fk_product_type; |
8229 | 8229 | |
8230 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
8230 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
8231 | 8231 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
8232 | 8232 | $opt .= '>'; |
8233 | 8233 | $opt .= $objp->ref; |
8234 | 8234 | $objRef = $objp->ref; |
8235 | 8235 | if (!empty($filterkey) && $filterkey != '') { |
8236 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
8236 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
8237 | 8237 | } |
8238 | 8238 | |
8239 | 8239 | $opt .= "</option>\n"; |
@@ -8275,7 +8275,7 @@ discard block |
||
8275 | 8275 | $placeholder = ''; |
8276 | 8276 | |
8277 | 8277 | if ($selected && empty($selected_input_value)) { |
8278 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
8278 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
8279 | 8279 | $adherenttmpselect = new Adherent($this->db); |
8280 | 8280 | $adherenttmpselect->fetch($selected); |
8281 | 8281 | $selected_input_value = $adherenttmpselect->ref; |
@@ -8284,17 +8284,17 @@ discard block |
||
8284 | 8284 | |
8285 | 8285 | $urloption = ''; |
8286 | 8286 | |
8287 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
8287 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
8288 | 8288 | |
8289 | 8289 | if (empty($hidelabel)) { |
8290 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
8290 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
8291 | 8291 | } elseif ($hidelabel > 1) { |
8292 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
8292 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
8293 | 8293 | if ($hidelabel == 2) { |
8294 | 8294 | $out .= img_picto($langs->trans("Search"), 'search'); |
8295 | 8295 | } |
8296 | 8296 | } |
8297 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
8297 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
8298 | 8298 | if ($hidelabel == 3) { |
8299 | 8299 | $out .= img_picto($langs->trans("Search"), 'search'); |
8300 | 8300 | } |
@@ -8339,8 +8339,8 @@ discard block |
||
8339 | 8339 | |
8340 | 8340 | $sql = "SELECT "; |
8341 | 8341 | $sql .= $selectFields; |
8342 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
8343 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
8342 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
8343 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
8344 | 8344 | |
8345 | 8345 | // Add criteria on ref/label |
8346 | 8346 | if ($filterkey != '') { |
@@ -8356,8 +8356,8 @@ discard block |
||
8356 | 8356 | if ($i > 0) { |
8357 | 8357 | $sql .= " AND "; |
8358 | 8358 | } |
8359 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
8360 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
8359 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
8360 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
8361 | 8361 | $i++; |
8362 | 8362 | } |
8363 | 8363 | if (count($search_crit) > 1) { |
@@ -8366,27 +8366,27 @@ discard block |
||
8366 | 8366 | $sql .= ')'; |
8367 | 8367 | } |
8368 | 8368 | if ($status != -1) { |
8369 | - $sql .= ' AND statut = ' . ((int) $status); |
|
8369 | + $sql .= ' AND statut = '.((int) $status); |
|
8370 | 8370 | } |
8371 | 8371 | $sql .= $this->db->plimit($limit, 0); |
8372 | 8372 | |
8373 | 8373 | // Build output string |
8374 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
8374 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
8375 | 8375 | $result = $this->db->query($sql); |
8376 | 8376 | if ($result) { |
8377 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
8378 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
8377 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
8378 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
8379 | 8379 | |
8380 | 8380 | $num = $this->db->num_rows($result); |
8381 | 8381 | |
8382 | 8382 | $events = array(); |
8383 | 8383 | |
8384 | 8384 | if (!$forcecombo) { |
8385 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8385 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8386 | 8386 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
8387 | 8387 | } |
8388 | 8388 | |
8389 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
8389 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
8390 | 8390 | |
8391 | 8391 | $textifempty = ''; |
8392 | 8392 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -8403,7 +8403,7 @@ discard block |
||
8403 | 8403 | } |
8404 | 8404 | } |
8405 | 8405 | if ($showempty) { |
8406 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
8406 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
8407 | 8407 | } |
8408 | 8408 | |
8409 | 8409 | $i = 0; |
@@ -8459,11 +8459,11 @@ discard block |
||
8459 | 8459 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
8460 | 8460 | $outtype = $objp->fk_adherent_type; |
8461 | 8461 | |
8462 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
8462 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
8463 | 8463 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
8464 | 8464 | $opt .= '>'; |
8465 | 8465 | if (!empty($filterkey) && $filterkey != '') { |
8466 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
8466 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
8467 | 8467 | } |
8468 | 8468 | $opt .= $outlabel; |
8469 | 8469 | $opt .= "</option>\n"; |
@@ -8518,8 +8518,8 @@ discard block |
||
8518 | 8518 | $objecttmp = null; |
8519 | 8519 | $InfoFieldList = array(); |
8520 | 8520 | $classname = ''; |
8521 | - $filter = ''; // Ensure filter has value (for static analysis) |
|
8522 | - $sortfield = ''; // Ensure filter has value (for static analysis) |
|
8521 | + $filter = ''; // Ensure filter has value (for static analysis) |
|
8522 | + $sortfield = ''; // Ensure filter has value (for static analysis) |
|
8523 | 8523 | |
8524 | 8524 | if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
8525 | 8525 | // Example: $objectfield = 'product:options_package' or 'myobject@mymodule:options_myfield' |
@@ -8563,9 +8563,9 @@ discard block |
||
8563 | 8563 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
8564 | 8564 | $reg = array(); |
8565 | 8565 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
8566 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8566 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8567 | 8567 | } |
8568 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8568 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8569 | 8569 | |
8570 | 8570 | $classname = $InfoFieldList[0]; |
8571 | 8571 | $classpath = empty($InfoFieldList[1]) ? '' : $InfoFieldList[1]; |
@@ -8596,8 +8596,8 @@ discard block |
||
8596 | 8596 | ); |
8597 | 8597 | |
8598 | 8598 | if (!is_object($objecttmp)) { |
8599 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
8600 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
8599 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc, LOG_WARNING); |
|
8600 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield.', objectdesc='.$objectdesc; |
|
8601 | 8601 | } |
8602 | 8602 | '@phan-var-force CommonObject $objecttmp'; |
8603 | 8603 | /** @var CommonObject $objecttmp */ |
@@ -8609,9 +8609,9 @@ discard block |
||
8609 | 8609 | if ($prefixforautocompletemode == 'product') { |
8610 | 8610 | $prefixforautocompletemode = 'produit'; |
8611 | 8611 | } |
8612 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8612 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8613 | 8613 | |
8614 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
8614 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
8615 | 8615 | |
8616 | 8616 | // Generate the combo HTML component |
8617 | 8617 | $out = ''; |
@@ -8640,13 +8640,13 @@ discard block |
||
8640 | 8640 | } |
8641 | 8641 | |
8642 | 8642 | // Set url and param to call to get json of the search results |
8643 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
8644 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
8643 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
8644 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
8645 | 8645 | |
8646 | 8646 | // Activate the auto complete using ajax call. |
8647 | 8647 | $out .= ajax_autocompleter((string) $preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalInt($confkeyforautocompletemode), 0); |
8648 | 8648 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
8649 | - $out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />'; |
|
8649 | + $out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' />'; |
|
8650 | 8650 | } else { |
8651 | 8651 | // Immediate load of table record. |
8652 | 8652 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8686,16 +8686,16 @@ discard block |
||
8686 | 8686 | if ($prefixforautocompletemode == 'societe') { |
8687 | 8687 | $prefixforautocompletemode = 'company'; |
8688 | 8688 | } |
8689 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8689 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8690 | 8690 | |
8691 | 8691 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
8692 | 8692 | $tmpfieldstoshow = ''; |
8693 | 8693 | foreach ($objecttmp->fields as $key => $val) { |
8694 | - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
8694 | + if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
8695 | 8695 | continue; |
8696 | 8696 | } |
8697 | 8697 | if (!empty($val['showoncombobox'])) { |
8698 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
8698 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
8699 | 8699 | } |
8700 | 8700 | } |
8701 | 8701 | if ($tmpfieldstoshow) { |
@@ -8732,25 +8732,25 @@ discard block |
||
8732 | 8732 | $num = 0; |
8733 | 8733 | |
8734 | 8734 | // Search data |
8735 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . " as t"; |
|
8735 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)." as t"; |
|
8736 | 8736 | if (!empty($objecttmp->isextrafieldmanaged)) { |
8737 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($objecttmp->table_element) . "_extrafields as e ON t.rowid = e.fk_object"; |
|
8737 | + $sql .= " LEFT JOIN ".$this->db->prefix().$this->db->sanitize($objecttmp->table_element)."_extrafields as e ON t.rowid = e.fk_object"; |
|
8738 | 8738 | } |
8739 | 8739 | if (!empty($objecttmp->parent_element)) { |
8740 | 8740 | $parent_properties = getElementProperties($objecttmp->parent_element); |
8741 | - $sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($parent_properties['table_element']) . " as o ON o.rowid = t.".$objecttmp->fk_parent_attribute; |
|
8741 | + $sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($parent_properties['table_element'])." as o ON o.rowid = t.".$objecttmp->fk_parent_attribute; |
|
8742 | 8742 | } |
8743 | 8743 | if (in_array($objecttmp->parent_element, ['commande', 'propal', 'facture', 'expedition'])) { |
8744 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product as p ON p.rowid = t.fk_product"; |
|
8744 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = t.fk_product"; |
|
8745 | 8745 | } |
8746 | 8746 | if (isset($objecttmp->ismultientitymanaged)) { |
8747 | 8747 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8748 | 8748 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
8749 | - $sql .= " INNER JOIN " . $this->db->prefix() . $this->db->sanitize($tmparray[1]) . " as parenttable ON parenttable.rowid = t." . $this->db->sanitize($tmparray[0]); |
|
8749 | + $sql .= " INNER JOIN ".$this->db->prefix().$this->db->sanitize($tmparray[1])." as parenttable ON parenttable.rowid = t.".$this->db->sanitize($tmparray[0]); |
|
8750 | 8750 | } |
8751 | 8751 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8752 | 8752 | if (!$user->hasRight('societe', 'client', 'voir')) { |
8753 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
8753 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
8754 | 8754 | } |
8755 | 8755 | } |
8756 | 8756 | } |
@@ -8770,21 +8770,21 @@ discard block |
||
8770 | 8770 | $sql .= " WHERE 1=1"; |
8771 | 8771 | if (isset($objecttmp->ismultientitymanaged)) { |
8772 | 8772 | if ($objecttmp->ismultientitymanaged == 1) { |
8773 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
8773 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
8774 | 8774 | } |
8775 | 8775 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8776 | - $sql .= " AND parenttable.entity = t." . $this->db->sanitize($tmparray[0]); |
|
8776 | + $sql .= " AND parenttable.entity = t.".$this->db->sanitize($tmparray[0]); |
|
8777 | 8777 | } |
8778 | 8778 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
8779 | 8779 | if ($objecttmp->element == 'societe') { |
8780 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
8780 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
8781 | 8781 | } else { |
8782 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
8782 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
8783 | 8783 | } |
8784 | 8784 | } |
8785 | 8785 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8786 | 8786 | if (!$user->hasRight('societe', 'client', 'voir')) { |
8787 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
8787 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
8788 | 8788 | } |
8789 | 8789 | } |
8790 | 8790 | } |
@@ -8802,7 +8802,7 @@ discard block |
||
8802 | 8802 | $errormessage = ''; |
8803 | 8803 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
8804 | 8804 | if ($errormessage) { |
8805 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
8805 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
8806 | 8806 | } |
8807 | 8807 | } |
8808 | 8808 | } |
@@ -8814,7 +8814,7 @@ discard block |
||
8814 | 8814 | $resql = $this->db->query($sql); |
8815 | 8815 | if ($resql) { |
8816 | 8816 | // Construct $out and $outarray |
8817 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
8817 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
8818 | 8818 | |
8819 | 8819 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
8820 | 8820 | $textifempty = ' '; |
@@ -8828,7 +8828,7 @@ discard block |
||
8828 | 8828 | } |
8829 | 8829 | } |
8830 | 8830 | if ($showempty) { |
8831 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
8831 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
8832 | 8832 | } |
8833 | 8833 | |
8834 | 8834 | $num = $this->db->num_rows($resql); |
@@ -8851,9 +8851,9 @@ discard block |
||
8851 | 8851 | } |
8852 | 8852 | if (empty($outputmode)) { |
8853 | 8853 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
8854 | - $out .= '<option value="' . $obj->rowid . '" selected data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8854 | + $out .= '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8855 | 8855 | } else { |
8856 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8856 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
8857 | 8857 | } |
8858 | 8858 | } else { |
8859 | 8859 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8866,10 +8866,10 @@ discard block |
||
8866 | 8866 | } |
8867 | 8867 | } |
8868 | 8868 | |
8869 | - $out .= '</select>' . "\n"; |
|
8869 | + $out .= '</select>'."\n"; |
|
8870 | 8870 | |
8871 | 8871 | if (!$forcecombo) { |
8872 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8872 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
8873 | 8873 | $out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
8874 | 8874 | } |
8875 | 8875 | } else { |
@@ -8933,8 +8933,8 @@ discard block |
||
8933 | 8933 | } |
8934 | 8934 | } |
8935 | 8935 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
8936 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
8937 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
8936 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
8937 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
8938 | 8938 | $out .= '>'."\n"; |
8939 | 8939 | |
8940 | 8940 | if ($show_empty) { |
@@ -8945,7 +8945,7 @@ discard block |
||
8945 | 8945 | if (!is_numeric($show_empty)) { |
8946 | 8946 | $textforempty = $show_empty; |
8947 | 8947 | } |
8948 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
8948 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
8949 | 8949 | } |
8950 | 8950 | if (is_array($array)) { |
8951 | 8951 | // Translate |
@@ -8970,7 +8970,7 @@ discard block |
||
8970 | 8970 | $value = $tmpvalue['label']; |
8971 | 8971 | //$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
8972 | 8972 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
8973 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
8973 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
8974 | 8974 | } else { |
8975 | 8975 | $value = $tmpvalue; |
8976 | 8976 | //$valuehtml = $tmpvalue; |
@@ -8986,9 +8986,9 @@ discard block |
||
8986 | 8986 | } |
8987 | 8987 | if ($key_in_label) { |
8988 | 8988 | if (empty($nohtmlescape)) { |
8989 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8989 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8990 | 8990 | } else { |
8991 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8991 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8992 | 8992 | } |
8993 | 8993 | } else { |
8994 | 8994 | if (empty($nohtmlescape)) { |
@@ -9000,8 +9000,8 @@ discard block |
||
9000 | 9000 | $selectOptionValue = ' '; |
9001 | 9001 | } |
9002 | 9002 | } |
9003 | - $out .= '<option value="' . $key . '"'; |
|
9004 | - $out .= $style . $disabled; |
|
9003 | + $out .= '<option value="'.$key.'"'; |
|
9004 | + $out .= $style.$disabled; |
|
9005 | 9005 | if (is_array($id)) { |
9006 | 9006 | if (in_array($key, $id) && !$disabled) { |
9007 | 9007 | $out .= ' selected'; // To preselect a value |
@@ -9013,7 +9013,7 @@ discard block |
||
9013 | 9013 | } |
9014 | 9014 | } |
9015 | 9015 | if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
9016 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
9016 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
9017 | 9017 | } |
9018 | 9018 | |
9019 | 9019 | if (is_array($tmpvalue)) { |
@@ -9036,7 +9036,7 @@ discard block |
||
9036 | 9036 | // Add code for jquery to use multiselect |
9037 | 9037 | if ($addjscombo && $jsbeautify) { |
9038 | 9038 | // Enhance with select2 |
9039 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
9039 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
9040 | 9040 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
9041 | 9041 | } |
9042 | 9042 | |
@@ -9064,28 +9064,28 @@ discard block |
||
9064 | 9064 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
9065 | 9065 | { |
9066 | 9066 | global $conf; |
9067 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
9067 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
9068 | 9068 | |
9069 | 9069 | // TODO Use an internal dolibarr component instead of select2 |
9070 | 9070 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
9071 | 9071 | return ''; |
9072 | 9072 | } |
9073 | 9073 | |
9074 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
9074 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
9075 | 9075 | |
9076 | 9076 | $outdelayed = ''; |
9077 | 9077 | if (!empty($conf->use_javascript_ajax)) { |
9078 | 9078 | $tmpplugin = 'select2'; |
9079 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
9080 | - <script nonce="' . getNonce() . '"> |
|
9079 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
9080 | + <script nonce="' . getNonce().'"> |
|
9081 | 9081 | $(document).ready(function () { |
9082 | 9082 | |
9083 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
9083 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
9084 | 9084 | |
9085 | - $(".' . $htmlname . '").select2({ |
|
9085 | + $(".' . $htmlname.'").select2({ |
|
9086 | 9086 | ajax: { |
9087 | 9087 | dir: "ltr", |
9088 | - url: "' . $url . '", |
|
9088 | + url: "' . $url.'", |
|
9089 | 9089 | dataType: \'json\', |
9090 | 9090 | delay: 250, |
9091 | 9091 | data: function (params) { |
@@ -9112,9 +9112,9 @@ discard block |
||
9112 | 9112 | }, |
9113 | 9113 | language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage, |
9114 | 9114 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
9115 | - placeholder: \'' . dol_escape_js($placeholder) . '\', |
|
9115 | + placeholder: \'' . dol_escape_js($placeholder).'\', |
|
9116 | 9116 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
9117 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
9117 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
9118 | 9118 | formatResult: function (result, container, query, escapeMarkup) { |
9119 | 9119 | return escapeMarkup(result.text); |
9120 | 9120 | }, |
@@ -9122,10 +9122,10 @@ discard block |
||
9122 | 9122 | |
9123 | 9123 | ' . ($callurlonselect ? ' |
9124 | 9124 | /* Code to execute a GET when we select a value */ |
9125 | - $(".' . $htmlname . '").change(function() { |
|
9126 | - var selected = $(\'.' . dol_escape_js($htmlname) . '\').val(); |
|
9125 | + $(".' . $htmlname.'").change(function() { |
|
9126 | + var selected = $(\'.' . dol_escape_js($htmlname).'\').val(); |
|
9127 | 9127 | console.log("We select in selectArrayAjax the entry "+selected) |
9128 | - $(\'.' . dol_escape_js($htmlname) . '\').val(""); /* reset visible combo value */ |
|
9128 | + $(\'.' . dol_escape_js($htmlname).'\').val(""); /* reset visible combo value */ |
|
9129 | 9129 | $.each( saveRemoteData, function( key, value ) { |
9130 | 9130 | if (key == selected) |
9131 | 9131 | { |
@@ -9133,7 +9133,7 @@ discard block |
||
9133 | 9133 | location.assign(value.url); |
9134 | 9134 | } |
9135 | 9135 | }); |
9136 | - });' : '') . ' |
|
9136 | + });' : '').' |
|
9137 | 9137 | |
9138 | 9138 | }); |
9139 | 9139 | </script>'; |
@@ -9169,14 +9169,14 @@ discard block |
||
9169 | 9169 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
9170 | 9170 | { |
9171 | 9171 | global $conf; |
9172 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
9172 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
9173 | 9173 | |
9174 | 9174 | // TODO Use an internal dolibarr component instead of select2 |
9175 | 9175 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
9176 | 9176 | return ''; |
9177 | 9177 | } |
9178 | 9178 | |
9179 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
9179 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
9180 | 9180 | |
9181 | 9181 | $formattedarrayresult = array(); |
9182 | 9182 | |
@@ -9191,20 +9191,20 @@ discard block |
||
9191 | 9191 | $outdelayed = ''; |
9192 | 9192 | if (!empty($conf->use_javascript_ajax)) { |
9193 | 9193 | $tmpplugin = 'select2'; |
9194 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
9195 | - <script nonce="' . getNonce() . '"> |
|
9194 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
9195 | + <script nonce="' . getNonce().'"> |
|
9196 | 9196 | $(document).ready(function () { |
9197 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
9197 | + var data = ' . json_encode($formattedarrayresult).'; |
|
9198 | 9198 | |
9199 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
9199 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
9200 | 9200 | |
9201 | - $(\'.' . dol_escape_js($htmlname) . '\').select2({ |
|
9201 | + $(\'.' . dol_escape_js($htmlname).'\').select2({ |
|
9202 | 9202 | data: data, |
9203 | 9203 | language: (typeof select2arrayoflanguage === \'undefined\') ? \'en\' : select2arrayoflanguage, |
9204 | 9204 | containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new <span class="select2-selection...> tag */ |
9205 | - placeholder: \'' . dol_escape_js($placeholder) . '\', |
|
9205 | + placeholder: \'' . dol_escape_js($placeholder).'\', |
|
9206 | 9206 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
9207 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
9207 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
9208 | 9208 | formatResult: function (result, container, query, escapeMarkup) { |
9209 | 9209 | return escapeMarkup(result.text); |
9210 | 9210 | }, |
@@ -9243,11 +9243,11 @@ discard block |
||
9243 | 9243 | |
9244 | 9244 | ' . ($callurlonselect ? ' |
9245 | 9245 | /* Code to execute a GET when we select a value */ |
9246 | - $(\'.' . dol_escape_js($htmlname) . '\').change(function() { |
|
9247 | - var selected = $(\'.' . dol_escape_js($htmlname) . '\').val(); |
|
9246 | + $(\'.' . dol_escape_js($htmlname).'\').change(function() { |
|
9247 | + var selected = $(\'.' . dol_escape_js($htmlname).'\').val(); |
|
9248 | 9248 | console.log("We select "+selected) |
9249 | 9249 | |
9250 | - $(\'.' . dol_escape_js($htmlname) . '\').val(""); /* reset visible combo value */ |
|
9250 | + $(\'.' . dol_escape_js($htmlname).'\').val(""); /* reset visible combo value */ |
|
9251 | 9251 | $.each( saveRemoteData, function( key, value ) { |
9252 | 9252 | if (key == selected) |
9253 | 9253 | { |
@@ -9255,7 +9255,7 @@ discard block |
||
9255 | 9255 | location.assign(value.url); |
9256 | 9256 | } |
9257 | 9257 | }); |
9258 | - });' : '') . ' |
|
9258 | + });' : '').' |
|
9259 | 9259 | |
9260 | 9260 | }); |
9261 | 9261 | </script>'; |
@@ -9303,7 +9303,7 @@ discard block |
||
9303 | 9303 | $useenhancedmultiselect = 0; |
9304 | 9304 | if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
9305 | 9305 | if ($addjscombo) { |
9306 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
9306 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
9307 | 9307 | } |
9308 | 9308 | } |
9309 | 9309 | |
@@ -9312,7 +9312,7 @@ discard block |
||
9312 | 9312 | // submitted to nothing. |
9313 | 9313 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
9314 | 9314 | // Output select component |
9315 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', (string) $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
9315 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', (string) $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
9316 | 9316 | if (is_array($array) && !empty($array)) { |
9317 | 9317 | if ($value_as_key) { |
9318 | 9318 | $array = array_combine($array, $array); |
@@ -9333,33 +9333,33 @@ discard block |
||
9333 | 9333 | $tmplabelhtml = empty($value['labelhtml']) ? (empty($value['data-html']) ? '' : $value['data-html']) : $value['labelhtml']; |
9334 | 9334 | } |
9335 | 9335 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
9336 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
9336 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
9337 | 9337 | |
9338 | - $out .= '<option value="' . $tmpkey . '"'; |
|
9338 | + $out .= '<option value="'.$tmpkey.'"'; |
|
9339 | 9339 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
9340 | 9340 | $out .= ' selected'; |
9341 | 9341 | } |
9342 | 9342 | if (!empty($tmplabelhtml)) { |
9343 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
9343 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
9344 | 9344 | } else { |
9345 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
9346 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
9345 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
9346 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
9347 | 9347 | } |
9348 | 9348 | $out .= '>'; |
9349 | 9349 | $out .= dol_htmlentitiesbr($newval); |
9350 | - $out .= '</option>' . "\n"; |
|
9350 | + $out .= '</option>'."\n"; |
|
9351 | 9351 | } |
9352 | 9352 | } |
9353 | 9353 | } |
9354 | - $out .= '</select>' . "\n"; |
|
9354 | + $out .= '</select>'."\n"; |
|
9355 | 9355 | |
9356 | 9356 | // Add code for jquery to use multiselect |
9357 | 9357 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
9358 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
9359 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
9358 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
9359 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
9360 | 9360 | if ($addjscombo == 1) { |
9361 | 9361 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
9362 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
9362 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
9363 | 9363 | // If property data-html set, we decode html entities and use this. |
9364 | 9364 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
9365 | 9365 | $out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
@@ -9367,26 +9367,26 @@ discard block |
||
9367 | 9367 | $out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
9368 | 9368 | $out .= ' }'."\n"; |
9369 | 9369 | $out .= ' return record.text;'; |
9370 | - $out .= '}' . "\n"; |
|
9371 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
9370 | + $out .= '}'."\n"; |
|
9371 | + $out .= 'function formatSelection(record) {'."\n"; |
|
9372 | 9372 | if ($elemtype == 'category') { |
9373 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
9373 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
9374 | 9374 | } else { |
9375 | 9375 | $out .= 'return record.text;'; |
9376 | 9376 | } |
9377 | - $out .= '}' . "\n"; |
|
9377 | + $out .= '}'."\n"; |
|
9378 | 9378 | $out .= '$(document).ready(function () { |
9379 | - $(\'#' . dol_escape_js($htmlname) . '\').' . $tmpplugin . '({'; |
|
9379 | + $(\'#' . dol_escape_js($htmlname).'\').'.$tmpplugin.'({'; |
|
9380 | 9380 | if ($placeholder) { |
9381 | 9381 | $out .= ' |
9382 | 9382 | placeholder: { |
9383 | 9383 | id: \'-1\', |
9384 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
9384 | + text: \'' . dol_escape_js($placeholder).'\' |
|
9385 | 9385 | },'; |
9386 | 9386 | } |
9387 | 9387 | $out .= ' dir: \'ltr\', |
9388 | 9388 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
9389 | - dropdownCssClass: \'' . dol_escape_js($morecss) . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
9389 | + dropdownCssClass: \'' . dol_escape_js($morecss).'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
9390 | 9390 | // Specify format function for dropdown item |
9391 | 9391 | formatResult: formatResult, |
9392 | 9392 | templateResult: formatResult, /* For 4.0 */ |
@@ -9399,21 +9399,21 @@ discard block |
||
9399 | 9399 | |
9400 | 9400 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
9401 | 9401 | the size only if component is not hidden by default on load */ |
9402 | - $(\'#' . dol_escape_js($htmlname) . ' + .select2\').addClass(\'' . dol_escape_js($morecss) . '\'); |
|
9402 | + $(\'#' . dol_escape_js($htmlname).' + .select2\').addClass(\''.dol_escape_js($morecss).'\'); |
|
9403 | 9403 | });' . "\n"; |
9404 | 9404 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
9405 | 9405 | // Add other js lib |
9406 | 9406 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
9407 | 9407 | // ... |
9408 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . dol_escape_js($htmlname) . '\');'; |
|
9408 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.dol_escape_js($htmlname).'\');'; |
|
9409 | 9409 | $out .= '$(document).ready(function () { |
9410 | - $(\'#' . dol_escape_js($htmlname) . '\').multiSelect({ |
|
9410 | + $(\'#' . dol_escape_js($htmlname).'\').multiSelect({ |
|
9411 | 9411 | containerHTML: \'<div class="multi-select-container">\', |
9412 | 9412 | menuHTML: \'<div class="multi-select-menu">\', |
9413 | - buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss) . '">\', |
|
9413 | + buttonHTML: \'<span class="multi-select-button ' . dol_escape_js($morecss).'">\', |
|
9414 | 9414 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
9415 | 9415 | activeClass: \'multi-select-container--open\', |
9416 | - noneText: \'' . dol_escape_js($placeholder) . '\' |
|
9416 | + noneText: \'' . dol_escape_js($placeholder).'\' |
|
9417 | 9417 | }); |
9418 | 9418 | })'; |
9419 | 9419 | } |
@@ -9446,7 +9446,7 @@ discard block |
||
9446 | 9446 | return ''; |
9447 | 9447 | } |
9448 | 9448 | |
9449 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
9449 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
9450 | 9450 | |
9451 | 9451 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
9452 | 9452 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -9489,19 +9489,19 @@ discard block |
||
9489 | 9489 | } |
9490 | 9490 | |
9491 | 9491 | // Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
9492 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
9493 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
9492 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((!array_key_exists('checked', $val) || empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
9493 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
9494 | 9494 | } |
9495 | 9495 | } |
9496 | 9496 | |
9497 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
9497 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
9498 | 9498 | |
9499 | 9499 | <dl class="dropdown"> |
9500 | 9500 | <dt> |
9501 | - <a href="#' . $htmlname . '"> |
|
9502 | - ' . img_picto('', 'list') . ' |
|
9501 | + <a href="#' . $htmlname.'"> |
|
9502 | + ' . img_picto('', 'list').' |
|
9503 | 9503 | </a> |
9504 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
9504 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
9505 | 9505 | </dt> |
9506 | 9506 | <dd class="dropdowndd"> |
9507 | 9507 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9513,19 +9513,19 @@ discard block |
||
9513 | 9513 | </dd> |
9514 | 9514 | </dl> |
9515 | 9515 | |
9516 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
9516 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
9517 | 9517 | jQuery(document).ready(function () { |
9518 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
9518 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
9519 | 9519 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
9520 | 9520 | |
9521 | 9521 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
9522 | 9522 | |
9523 | 9523 | var title = $(this).val() + ","; |
9524 | 9524 | if ($(this).is(\':checked\')) { |
9525 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
9525 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
9526 | 9526 | } |
9527 | 9527 | else { |
9528 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
9528 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
9529 | 9529 | } |
9530 | 9530 | // Now, we submit page |
9531 | 9531 | //$(this).parents(\'form:first\').submit(); |
@@ -9556,7 +9556,7 @@ discard block |
||
9556 | 9556 | */ |
9557 | 9557 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
9558 | 9558 | { |
9559 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
9559 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
9560 | 9560 | |
9561 | 9561 | $cat = new Categorie($this->db); |
9562 | 9562 | $categories = $cat->containing($id, $type); |
@@ -9566,13 +9566,13 @@ discard block |
||
9566 | 9566 | foreach ($categories as $c) { |
9567 | 9567 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
9568 | 9568 | foreach ($ways as $way) { |
9569 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
9569 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
9570 | 9570 | } |
9571 | 9571 | } |
9572 | 9572 | if (empty($toprint)) { |
9573 | 9573 | return ''; |
9574 | 9574 | } else { |
9575 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
9575 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
9576 | 9576 | } |
9577 | 9577 | } |
9578 | 9578 | |
@@ -9621,15 +9621,15 @@ discard block |
||
9621 | 9621 | |
9622 | 9622 | |
9623 | 9623 | print '<div class="div-table-responsive-no-min">'; |
9624 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
9624 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
9625 | 9625 | |
9626 | 9626 | print '<tr class="liste_titre">'; |
9627 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
9628 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
9627 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
9628 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
9629 | 9629 | print '<td class="center"></td>'; |
9630 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
9631 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9632 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
9630 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
9631 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9632 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
9633 | 9633 | print '<td></td>'; |
9634 | 9634 | print '</tr>'; |
9635 | 9635 | |
@@ -9648,13 +9648,13 @@ discard block |
||
9648 | 9648 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
9649 | 9649 | $element = $regs[1]; |
9650 | 9650 | $subelement = $regs[2]; |
9651 | - $tplpath = $element . '/' . $subelement; |
|
9651 | + $tplpath = $element.'/'.$subelement; |
|
9652 | 9652 | } |
9653 | 9653 | $tplname = 'linkedobjectblock'; |
9654 | 9654 | |
9655 | 9655 | // To work with non standard path |
9656 | 9656 | if ($objecttype == 'facture') { |
9657 | - $tplpath = 'compta/' . $element; |
|
9657 | + $tplpath = 'compta/'.$element; |
|
9658 | 9658 | if (!isModEnabled('invoice')) { |
9659 | 9659 | continue; // Do not show if module disabled |
9660 | 9660 | } |
@@ -9665,7 +9665,7 @@ discard block |
||
9665 | 9665 | continue; // Do not show if module disabled |
9666 | 9666 | } |
9667 | 9667 | } elseif ($objecttype == 'propal') { |
9668 | - $tplpath = 'comm/' . $element; |
|
9668 | + $tplpath = 'comm/'.$element; |
|
9669 | 9669 | if (!isModEnabled('propal')) { |
9670 | 9670 | continue; // Do not show if module disabled |
9671 | 9671 | } |
@@ -9718,7 +9718,7 @@ discard block |
||
9718 | 9718 | $linkedObjectBlock = $objects; |
9719 | 9719 | |
9720 | 9720 | // Output template part (modules that overwrite templates must declare this into descriptor) |
9721 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
9721 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
9722 | 9722 | foreach ($dirtpls as $reldir) { |
9723 | 9723 | $reldir = rtrim($reldir, '/'); |
9724 | 9724 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9726,7 +9726,7 @@ discard block |
||
9726 | 9726 | $noMoreLinkedObjectBlockAfter = 1; |
9727 | 9727 | } |
9728 | 9728 | |
9729 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
9729 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
9730 | 9730 | if ($res) { |
9731 | 9731 | $nboftypesoutput++; |
9732 | 9732 | break; |
@@ -9735,7 +9735,7 @@ discard block |
||
9735 | 9735 | } |
9736 | 9736 | |
9737 | 9737 | if (!$nboftypesoutput) { |
9738 | - print '<tr><td colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
9738 | + print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
9739 | 9739 | } |
9740 | 9740 | |
9741 | 9741 | print '</table>'; |
@@ -9783,14 +9783,14 @@ discard block |
||
9783 | 9783 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
9784 | 9784 | $listofidcompanytoscan = (int) $object->thirdparty->id; |
9785 | 9785 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
9786 | - $listofidcompanytoscan .= ',' . (int) $object->thirdparty->parent; |
|
9786 | + $listofidcompanytoscan .= ','.(int) $object->thirdparty->parent; |
|
9787 | 9787 | } |
9788 | 9788 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
9789 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
9789 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
9790 | 9790 | $tmpproject = new Project($this->db); |
9791 | 9791 | $tmpproject->fetch($object->fk_project); |
9792 | 9792 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
9793 | - $listofidcompanytoscan .= ',' . (int) $tmpproject->socid; |
|
9793 | + $listofidcompanytoscan .= ','.(int) $tmpproject->socid; |
|
9794 | 9794 | } |
9795 | 9795 | unset($tmpproject); |
9796 | 9796 | } |
@@ -9800,75 +9800,75 @@ discard block |
||
9800 | 9800 | 'enabled' => isModEnabled('propal'), |
9801 | 9801 | 'perms' => 1, |
9802 | 9802 | 'label' => 'LinkToProposal', |
9803 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''), |
|
9803 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('propal').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''), |
|
9804 | 9804 | ), |
9805 | 9805 | 'shipping' => array( |
9806 | 9806 | 'enabled' => isModEnabled('shipping'), |
9807 | 9807 | 'perms' => 1, |
9808 | 9808 | 'label' => 'LinkToExpedition', |
9809 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''), |
|
9809 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('shipping').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 2' : ''), |
|
9810 | 9810 | ), |
9811 | 9811 | 'order' => array( |
9812 | 9812 | 'enabled' => isModEnabled('order'), |
9813 | 9813 | 'perms' => 1, |
9814 | 9814 | 'label' => 'LinkToOrder', |
9815 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''), |
|
9815 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande').')'.($dontIncludeCompletedItems ? ' AND t.facture < 1' : ''), |
|
9816 | 9816 | 'linkname' => 'commande', |
9817 | 9817 | ), |
9818 | 9818 | 'invoice' => array( |
9819 | 9819 | 'enabled' => isModEnabled('invoice'), |
9820 | 9820 | 'perms' => 1, |
9821 | 9821 | 'label' => 'LinkToInvoice', |
9822 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), |
|
9822 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), |
|
9823 | 9823 | 'linkname' => 'facture', |
9824 | 9824 | ), |
9825 | 9825 | 'invoice_template' => array( |
9826 | 9826 | 'enabled' => isModEnabled('invoice'), |
9827 | 9827 | 'perms' => 1, |
9828 | 9828 | 'label' => 'LinkToTemplateInvoice', |
9829 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), |
|
9829 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('invoice').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), |
|
9830 | 9830 | ), |
9831 | 9831 | 'contrat' => array( |
9832 | 9832 | 'enabled' => isModEnabled('contract'), |
9833 | 9833 | 'perms' => 1, |
9834 | 9834 | 'label' => 'LinkToContract', |
9835 | 9835 | 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht |
9836 | - FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier', |
|
9836 | + FROM " . $this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier', |
|
9837 | 9837 | ), |
9838 | 9838 | 'fichinter' => array( |
9839 | 9839 | 'enabled' => isModEnabled('intervention'), |
9840 | 9840 | 'perms' => 1, |
9841 | 9841 | 'label' => 'LinkToIntervention', |
9842 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')', |
|
9842 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')', |
|
9843 | 9843 | ), |
9844 | 9844 | 'supplier_proposal' => array( |
9845 | 9845 | 'enabled' => isModEnabled('supplier_proposal'), |
9846 | 9846 | 'perms' => 1, |
9847 | 9847 | 'label' => 'LinkToSupplierProposal', |
9848 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('supplier_proposal') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''), |
|
9848 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 4' : ''), |
|
9849 | 9849 | ), |
9850 | 9850 | 'order_supplier' => array( |
9851 | 9851 | 'enabled' => isModEnabled("supplier_order"), |
9852 | 9852 | 'perms' => 1, |
9853 | 9853 | 'label' => 'LinkToSupplierOrder', |
9854 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande_fournisseur') . ')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''), |
|
9854 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'.($dontIncludeCompletedItems ? ' AND t.billed < 1' : ''), |
|
9855 | 9855 | ), |
9856 | 9856 | 'invoice_supplier' => array( |
9857 | 9857 | 'enabled' => isModEnabled("supplier_invoice"), |
9858 | 9858 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
9859 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('facture_fourn') . ')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), |
|
9859 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'.($dontIncludeCompletedItems ? ' AND t.paye < 1' : ''), |
|
9860 | 9860 | ), |
9861 | 9861 | 'ticket' => array( |
9862 | 9862 | 'enabled' => isModEnabled('ticket'), |
9863 | 9863 | 'perms' => 1, |
9864 | 9864 | 'label' => 'LinkToTicket', |
9865 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('ticket') . ')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''), |
|
9865 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'.($dontIncludeCompletedItems ? ' AND t.fk_statut < 8' : ''), |
|
9866 | 9866 | ), |
9867 | 9867 | 'mo' => array( |
9868 | 9868 | 'enabled' => isModEnabled('mrp'), |
9869 | 9869 | 'perms' => 1, |
9870 | 9870 | 'label' => 'LinkToMo', |
9871 | - 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM " . $this->db->prefix() . "societe as s INNER JOIN " . $this->db->prefix() . "mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('mo') . ')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''), |
|
9871 | + 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix()."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')'.($dontIncludeCompletedItems ? ' AND t.status < 3' : ''), |
|
9872 | 9872 | ), |
9873 | 9873 | ); |
9874 | 9874 | } |
@@ -9910,23 +9910,23 @@ discard block |
||
9910 | 9910 | } |
9911 | 9911 | |
9912 | 9912 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
9913 | - $htmltoenteralink .= '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
9913 | + $htmltoenteralink .= '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
9914 | 9914 | |
9915 | 9915 | // Section for free ref input |
9916 | 9916 | if (!getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
9917 | 9917 | $htmltoenteralink .= '<br>'."\n"; |
9918 | 9918 | $htmltoenteralink .= '<!-- form to add a link from anywhere -->'."\n"; |
9919 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
9920 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9919 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
9920 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9921 | 9921 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlinkbyref">'; |
9922 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9923 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9922 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9923 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9924 | 9924 | $htmltoenteralink .= '<table class="noborder">'; |
9925 | 9925 | $htmltoenteralink .= '<tr class="liste_titre">'; |
9926 | 9926 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
9927 | - $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
9928 | - $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
9929 | - $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
9927 | + $htmltoenteralink .= '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
9928 | + $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
9929 | + $htmltoenteralink .= '<input type="submit" class="button smallpaddingimp" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
9930 | 9930 | $htmltoenteralink .= '</tr>'; |
9931 | 9931 | $htmltoenteralink .= '</table>'; |
9932 | 9932 | $htmltoenteralink .= '</form>'; |
@@ -9945,18 +9945,18 @@ discard block |
||
9945 | 9945 | $htmltoenteralink .= '<br>'; |
9946 | 9946 | } |
9947 | 9947 | $htmltoenteralink .= '<!-- form to add a link from object to same thirdparty -->'."\n"; |
9948 | - $htmltoenteralink .= '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
9949 | - $htmltoenteralink .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
9948 | + $htmltoenteralink .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
9949 | + $htmltoenteralink .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9950 | 9950 | $htmltoenteralink .= '<input type="hidden" name="action" value="addlink">'; |
9951 | - $htmltoenteralink .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9952 | - $htmltoenteralink .= '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9951 | + $htmltoenteralink .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9952 | + $htmltoenteralink .= '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
9953 | 9953 | $htmltoenteralink .= '<table class="noborder">'; |
9954 | 9954 | $htmltoenteralink .= '<tr class="liste_titre">'; |
9955 | 9955 | $htmltoenteralink .= '<td class="nowrap"></td>'; |
9956 | - $htmltoenteralink .= '<td>' . $langs->trans("Ref") . '</td>'; |
|
9957 | - $htmltoenteralink .= '<td>' . $langs->trans("RefCustomer") . '</td>'; |
|
9958 | - $htmltoenteralink .= '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
9959 | - $htmltoenteralink .= '<td>' . $langs->trans("Company") . '</td>'; |
|
9956 | + $htmltoenteralink .= '<td>'.$langs->trans("Ref").'</td>'; |
|
9957 | + $htmltoenteralink .= '<td>'.$langs->trans("RefCustomer").'</td>'; |
|
9958 | + $htmltoenteralink .= '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9959 | + $htmltoenteralink .= '<td>'.$langs->trans("Company").'</td>'; |
|
9960 | 9960 | $htmltoenteralink .= '</tr>'; |
9961 | 9961 | while ($i < $num) { |
9962 | 9962 | $objp = $this->db->fetch_object($resqllist); |
@@ -9971,30 +9971,30 @@ discard block |
||
9971 | 9971 | if ($alreadylinked) { |
9972 | 9972 | $htmltoenteralink .= img_picto('', 'link'); |
9973 | 9973 | } else { |
9974 | - $htmltoenteralink .= '<input type="checkbox" name="idtolinkto[' . $key . '_' . $objp->rowid . ']" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
9974 | + $htmltoenteralink .= '<input type="checkbox" name="idtolinkto['.$key.'_'.$objp->rowid.']" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
9975 | 9975 | } |
9976 | 9976 | $htmltoenteralink .= '</td>'; |
9977 | - $htmltoenteralink .= '<td><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
9978 | - $htmltoenteralink .= '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
9977 | + $htmltoenteralink .= '<td><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
9978 | + $htmltoenteralink .= '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
9979 | 9979 | $htmltoenteralink .= '<td class="right">'; |
9980 | 9980 | if ($possiblelink['label'] == 'LinkToContract') { |
9981 | - $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
9981 | + $htmltoenteralink .= $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
9982 | 9982 | } |
9983 | - $htmltoenteralink .= '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
9983 | + $htmltoenteralink .= '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
9984 | 9984 | $htmltoenteralink .= '</td>'; |
9985 | - $htmltoenteralink .= '<td>' . $objp->name . '</td>'; |
|
9985 | + $htmltoenteralink .= '<td>'.$objp->name.'</td>'; |
|
9986 | 9986 | $htmltoenteralink .= '</tr>'; |
9987 | 9987 | $i++; |
9988 | 9988 | } |
9989 | 9989 | $htmltoenteralink .= '</table>'; |
9990 | 9990 | $htmltoenteralink .= '<div class="center">'; |
9991 | 9991 | if ($num) { |
9992 | - $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="' . $langs->trans('ToLink') . '">'; |
|
9992 | + $htmltoenteralink .= '<input type="submit" class="button valignmiddle marginleftonly marginrightonly smallpaddingimp" value="'.$langs->trans('ToLink').'">'; |
|
9993 | 9993 | } |
9994 | 9994 | if (empty($conf->use_javascript_ajax)) { |
9995 | - $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9995 | + $htmltoenteralink .= '<input type="submit" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9996 | 9996 | } else { |
9997 | - $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9997 | + $htmltoenteralink .= '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly smallpaddingimp" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
9998 | 9998 | } |
9999 | 9999 | $htmltoenteralink .= '</form>'; |
10000 | 10000 | } |
@@ -10008,10 +10008,10 @@ discard block |
||
10008 | 10008 | |
10009 | 10009 | // Complete the list for the combo box |
10010 | 10010 | if ($num > 0 || !getDolGlobalString('MAIN_HIDE_LINK_BY_REF_IN_LINKTO')) { |
10011 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
10011 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
10012 | 10012 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
10013 | 10013 | } else { |
10014 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
10014 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
10015 | 10015 | } |
10016 | 10016 | } |
10017 | 10017 | } |
@@ -10021,11 +10021,11 @@ discard block |
||
10021 | 10021 | <dl class="dropdown" id="linktoobjectname"> |
10022 | 10022 | '; |
10023 | 10023 | if (!empty($conf->use_javascript_ajax)) { |
10024 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
10024 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
10025 | 10025 | } |
10026 | 10026 | $linktoelem .= '<dd> |
10027 | 10027 | <div class="multiselectlinkto"> |
10028 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
10028 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
10029 | 10029 | </ul> |
10030 | 10030 | </div> |
10031 | 10031 | </dd> |
@@ -10036,7 +10036,7 @@ discard block |
||
10036 | 10036 | |
10037 | 10037 | if (!empty($conf->use_javascript_ajax)) { |
10038 | 10038 | print '<!-- Add js to show linkto box --> |
10039 | - <script nonce="' . getNonce() . '"> |
|
10039 | + <script nonce="' . getNonce().'"> |
|
10040 | 10040 | jQuery(document).ready(function() { |
10041 | 10041 | jQuery(".linkto").click(function() { |
10042 | 10042 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -10083,19 +10083,19 @@ discard block |
||
10083 | 10083 | |
10084 | 10084 | $disabled = ($disabled ? ' disabled' : ''); |
10085 | 10085 | |
10086 | - $resultyesno = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
10086 | + $resultyesno = '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
10087 | 10087 | if ($useempty) { |
10088 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
10088 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
10089 | 10089 | } |
10090 | 10090 | if (("$value" == 'yes') || ($value == 1)) { |
10091 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
10092 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
10091 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
10092 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
10093 | 10093 | } else { |
10094 | 10094 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
10095 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
10096 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
10095 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
10096 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
10097 | 10097 | } |
10098 | - $resultyesno .= '</select>' . "\n"; |
|
10098 | + $resultyesno .= '</select>'."\n"; |
|
10099 | 10099 | |
10100 | 10100 | if ($addjscombo) { |
10101 | 10101 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -10119,12 +10119,12 @@ discard block |
||
10119 | 10119 | { |
10120 | 10120 | // phpcs:enable |
10121 | 10121 | $sql = "SELECT rowid, label"; |
10122 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
10123 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
10122 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
10123 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
10124 | 10124 | $sql .= " ORDER BY rowid"; |
10125 | 10125 | $result = $this->db->query($sql); |
10126 | 10126 | if ($result) { |
10127 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
10127 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
10128 | 10128 | if ($useempty) { |
10129 | 10129 | print '<option value="-1"> </option>'; |
10130 | 10130 | } |
@@ -10134,9 +10134,9 @@ discard block |
||
10134 | 10134 | while ($i < $num) { |
10135 | 10135 | $obj = $this->db->fetch_object($result); |
10136 | 10136 | if ($selected == $obj->rowid) { |
10137 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
10137 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
10138 | 10138 | } else { |
10139 | - print '<option value="' . $obj->rowid . '">'; |
|
10139 | + print '<option value="'.$obj->rowid.'">'; |
|
10140 | 10140 | } |
10141 | 10141 | print $obj->label; |
10142 | 10142 | print '</option>'; |
@@ -10227,8 +10227,8 @@ discard block |
||
10227 | 10227 | $stringforfirstkey .= ' CTL +'; |
10228 | 10228 | } |
10229 | 10229 | |
10230 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_previous) . $moreparam . '"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
10231 | - $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="' . $navurl . '?' . $paramid . '=' . urlencode($object->ref_next) . $moreparam . '"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
10230 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" alt="'.dol_escape_htmltag($langs->trans("Previous")).'" title="'.$stringforfirstkey.' p" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'"><i class="fa fa-chevron-left"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-left opacitymedium"></i></span>'; |
|
10231 | + $next_ref = $object->ref_next ? '<a accesskey="n" alt="'.dol_escape_htmltag($langs->trans("Next")).'" title="'.$stringforfirstkey.' n" class="classfortooltip" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'"><i class="fa fa-chevron-right"></i></a>' : '<span class="inactive"><i class="fa fa-chevron-right opacitymedium"></i></span>'; |
|
10232 | 10232 | } |
10233 | 10233 | |
10234 | 10234 | //print "xx".$previous_ref."x".$next_ref; |
@@ -10236,18 +10236,18 @@ discard block |
||
10236 | 10236 | |
10237 | 10237 | // Right part of banner |
10238 | 10238 | if ($morehtmlright) { |
10239 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
10239 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
10240 | 10240 | } |
10241 | 10241 | |
10242 | 10242 | if ($previous_ref || $next_ref || $morehtml) { |
10243 | 10243 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
10244 | 10244 | } |
10245 | 10245 | if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
10246 | - $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
10246 | + $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
10247 | 10247 | } |
10248 | 10248 | if ($shownav && ($previous_ref || $next_ref)) { |
10249 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
10250 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
10249 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
10250 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
10251 | 10251 | } |
10252 | 10252 | if ($previous_ref || $next_ref || $morehtml) { |
10253 | 10253 | $ret .= '</ul></div>'; |
@@ -10262,7 +10262,7 @@ discard block |
||
10262 | 10262 | $morehtmlstatus = $hookmanager->resPrint; |
10263 | 10263 | } |
10264 | 10264 | if ($morehtmlstatus) { |
10265 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
10265 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
10266 | 10266 | } |
10267 | 10267 | |
10268 | 10268 | $parameters = array(); |
@@ -10276,14 +10276,14 @@ discard block |
||
10276 | 10276 | // Left part of banner |
10277 | 10277 | if ($morehtmlleft) { |
10278 | 10278 | if ($conf->browser->layout == 'phone') { |
10279 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
10279 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
10280 | 10280 | } else { |
10281 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
10281 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
10282 | 10282 | } |
10283 | 10283 | } |
10284 | 10284 | |
10285 | 10285 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
10286 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
10286 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
10287 | 10287 | |
10288 | 10288 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
10289 | 10289 | if ($object->element == 'societe') { |
@@ -10297,7 +10297,7 @@ discard block |
||
10297 | 10297 | |
10298 | 10298 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
10299 | 10299 | if (!is_object($extralanguages)) { |
10300 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
10300 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
10301 | 10301 | $extralanguages = new ExtraLanguages($this->db); |
10302 | 10302 | } |
10303 | 10303 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -10312,21 +10312,21 @@ discard block |
||
10312 | 10312 | if ($object->array_languages['name'][$extralangcode]) { |
10313 | 10313 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
10314 | 10314 | } else { |
10315 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
10315 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
10316 | 10316 | } |
10317 | 10317 | } |
10318 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
10318 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
10319 | 10319 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
10320 | 10320 | } |
10321 | 10321 | } |
10322 | 10322 | } elseif ($object->element == 'member') { |
10323 | 10323 | '@phan-var-force Adherent $object'; |
10324 | - $ret .= $object->ref . '<br>'; |
|
10324 | + $ret .= $object->ref.'<br>'; |
|
10325 | 10325 | $fullname = $object->getFullName($langs); |
10326 | 10326 | if ($object->morphy == 'mor' && $object->societe) { |
10327 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
10327 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
10328 | 10328 | } else { |
10329 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
10329 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
10330 | 10330 | } |
10331 | 10331 | } elseif (in_array($object->element, array('contact', 'user'))) { |
10332 | 10332 | $ret .= '<span class="valignmiddle">'.dol_htmlentities($object->getFullName($langs)).'</span>'.$addgendertxt; |
@@ -10334,7 +10334,7 @@ discard block |
||
10334 | 10334 | $ret .= dol_htmlentities($object->name); |
10335 | 10335 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
10336 | 10336 | '@phan-var-force ActionComm $object'; |
10337 | - $ret .= $object->ref . '<br>' . $object->label; |
|
10337 | + $ret .= $object->ref.'<br>'.$object->label; |
|
10338 | 10338 | } elseif (in_array($object->element, array('adherent_type'))) { |
10339 | 10339 | $ret .= $object->label; |
10340 | 10340 | } elseif ($object->element == 'ecm_directories') { |
@@ -10387,9 +10387,9 @@ discard block |
||
10387 | 10387 | } |
10388 | 10388 | |
10389 | 10389 | // Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
10390 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
10391 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
10392 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
10390 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
10391 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
10392 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
10393 | 10393 | |
10394 | 10394 | return $out; |
10395 | 10395 | } |
@@ -10416,7 +10416,7 @@ discard block |
||
10416 | 10416 | global $conf, $langs; |
10417 | 10417 | |
10418 | 10418 | $entity = (empty($object->entity) ? $conf->entity : $object->entity); |
10419 | - $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
10419 | + $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
10420 | 10420 | |
10421 | 10421 | $dir = ''; |
10422 | 10422 | $file = ''; |
@@ -10429,28 +10429,28 @@ discard block |
||
10429 | 10429 | if (!empty($object->logo)) { |
10430 | 10430 | if (dolIsAllowedForPreview($object->logo)) { |
10431 | 10431 | if ((string) $imagesize == 'mini') { |
10432 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
10432 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
10433 | 10433 | } elseif ((string) $imagesize == 'small') { |
10434 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
10434 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
10435 | 10435 | } else { |
10436 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
10436 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
10437 | 10437 | } |
10438 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
10438 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
10439 | 10439 | } |
10440 | 10440 | } |
10441 | 10441 | $email = $object->email; |
10442 | 10442 | } elseif ($modulepart == 'contact') { |
10443 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
10443 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
10444 | 10444 | if (!empty($object->photo)) { |
10445 | 10445 | if (dolIsAllowedForPreview($object->photo)) { |
10446 | 10446 | if ((string) $imagesize == 'mini') { |
10447 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
10447 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
10448 | 10448 | } elseif ((string) $imagesize == 'small') { |
10449 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
10449 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
10450 | 10450 | } else { |
10451 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
10451 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
10452 | 10452 | } |
10453 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
10453 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
10454 | 10454 | } |
10455 | 10455 | } |
10456 | 10456 | $email = $object->email; |
@@ -10460,17 +10460,17 @@ discard block |
||
10460 | 10460 | if (!empty($object->photo)) { |
10461 | 10461 | if (dolIsAllowedForPreview($object->photo)) { |
10462 | 10462 | if ((string) $imagesize == 'mini') { |
10463 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
10463 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
10464 | 10464 | } elseif ((string) $imagesize == 'small') { |
10465 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
10465 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
10466 | 10466 | } else { |
10467 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
10467 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
10468 | 10468 | } |
10469 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
10469 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
10470 | 10470 | } |
10471 | 10471 | } |
10472 | 10472 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
10473 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
10473 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
10474 | 10474 | } |
10475 | 10475 | $email = $object->email; |
10476 | 10476 | $capture = 'user'; |
@@ -10479,17 +10479,17 @@ discard block |
||
10479 | 10479 | if (!empty($object->photo)) { |
10480 | 10480 | if (dolIsAllowedForPreview($object->photo)) { |
10481 | 10481 | if ((string) $imagesize == 'mini') { |
10482 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
10482 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
10483 | 10483 | } elseif ((string) $imagesize == 'small') { |
10484 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
10484 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
10485 | 10485 | } else { |
10486 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
10486 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
10487 | 10487 | } |
10488 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
10488 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
10489 | 10489 | } |
10490 | 10490 | } |
10491 | 10491 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
10492 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
10492 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
10493 | 10493 | } |
10494 | 10494 | $email = $object->email; |
10495 | 10495 | $capture = 'user'; |
@@ -10515,35 +10515,35 @@ discard block |
||
10515 | 10515 | $ret = ''; |
10516 | 10516 | |
10517 | 10517 | if ($dir) { |
10518 | - if ($file && file_exists($dir . "/" . $file)) { |
|
10518 | + if ($file && file_exists($dir."/".$file)) { |
|
10519 | 10519 | if ($addlinktofullsize) { |
10520 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
10520 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
10521 | 10521 | if ($urladvanced) { |
10522 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
10522 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
10523 | 10523 | } else { |
10524 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
10524 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
10525 | 10525 | } |
10526 | 10526 | } |
10527 | - $ret .= '<img alt="" class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . ' photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($file) . '&cache=' . $cache . '">'; |
|
10527 | + $ret .= '<img alt="" class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').' photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">'; |
|
10528 | 10528 | if ($addlinktofullsize) { |
10529 | 10529 | $ret .= '</a>'; |
10530 | 10530 | } |
10531 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
10531 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
10532 | 10532 | if ($addlinktofullsize) { |
10533 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
10533 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
10534 | 10534 | if ($urladvanced) { |
10535 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
10535 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
10536 | 10536 | } else { |
10537 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
10537 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
10538 | 10538 | } |
10539 | 10539 | } |
10540 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="Photo alt" id="photologo' . (preg_replace('/[^a-z]/i', '_', $file)) . '" class="' . $cssclass . '" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($altfile) . '&cache=' . $cache . '">'; |
|
10540 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i', '_', $file)).'" class="'.$cssclass.'" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">'; |
|
10541 | 10541 | if ($addlinktofullsize) { |
10542 | 10542 | $ret .= '</a>'; |
10543 | 10543 | } |
10544 | 10544 | } else { |
10545 | 10545 | $nophoto = '/public/theme/common/nophoto.png'; |
10546 | - $defaultimg = 'identicon'; // For gravatar |
|
10546 | + $defaultimg = 'identicon'; // For gravatar |
|
10547 | 10547 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
10548 | 10548 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
10549 | 10549 | $nophoto = 'company'; |
@@ -10561,13 +10561,13 @@ discard block |
||
10561 | 10561 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
10562 | 10562 | // see https://gravatar.com/site/implement/images/php/ |
10563 | 10563 | $ret .= '<!-- Put link to gravatar -->'; |
10564 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" title="' . $email . ' Gravatar avatar" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="https://www.gravatar.com/avatar/' . dol_hash(strtolower(trim($email)), 'sha256', 1) . '?s=' . $width . '&d=' . $defaultimg . '">'; // gravatar need md5 hash |
|
10564 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.dol_hash(strtolower(trim($email)), 'sha256', 1).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash |
|
10565 | 10565 | } else { |
10566 | 10566 | if ($nophoto == 'company') { |
10567 | - $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
10567 | + $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
10568 | 10568 | //$ret .= '<div class="difforspanimgright"></div>'; |
10569 | 10569 | } else { |
10570 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
10570 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
10571 | 10571 | } |
10572 | 10572 | } |
10573 | 10573 | } |
@@ -10578,15 +10578,15 @@ discard block |
||
10578 | 10578 | } |
10579 | 10579 | $ret .= '<table class="nobordernopadding centpercent">'; |
10580 | 10580 | if ($object->photo) { |
10581 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
10581 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
10582 | 10582 | } |
10583 | 10583 | $ret .= '<tr><td class="tdoverflow">'; |
10584 | 10584 | $maxfilesizearray = getMaxFileSizeArray(); |
10585 | 10585 | $maxmin = $maxfilesizearray['maxmin']; |
10586 | 10586 | if ($maxmin > 0) { |
10587 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
10587 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
10588 | 10588 | } |
10589 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
10589 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
10590 | 10590 | $ret .= '</td></tr>'; |
10591 | 10591 | $ret .= '</table>'; |
10592 | 10592 | } |
@@ -10640,38 +10640,38 @@ discard block |
||
10640 | 10640 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
10641 | 10641 | $sql .= ", e.label"; |
10642 | 10642 | } |
10643 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
10643 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
10644 | 10644 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
10645 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
10645 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
10646 | 10646 | if ($force_entity) { |
10647 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
10647 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
10648 | 10648 | } else { |
10649 | 10649 | $sql .= " WHERE ug.entity IS NOT NULL"; |
10650 | 10650 | } |
10651 | 10651 | } else { |
10652 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
10652 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
10653 | 10653 | } |
10654 | 10654 | if (is_array($exclude) && $excludeGroups) { |
10655 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
10655 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
10656 | 10656 | } |
10657 | 10657 | if (is_array($include) && $includeGroups) { |
10658 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
10658 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
10659 | 10659 | } |
10660 | 10660 | $sql .= " ORDER BY ug.nom ASC"; |
10661 | 10661 | |
10662 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
10662 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
10663 | 10663 | $resql = $this->db->query($sql); |
10664 | 10664 | if ($resql) { |
10665 | 10665 | // Enhance with select2 |
10666 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10666 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
10667 | 10667 | |
10668 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
10668 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
10669 | 10669 | |
10670 | 10670 | $num = $this->db->num_rows($resql); |
10671 | 10671 | $i = 0; |
10672 | 10672 | if ($num) { |
10673 | 10673 | if ($show_empty && !$multiple) { |
10674 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
10674 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
10675 | 10675 | } |
10676 | 10676 | |
10677 | 10677 | while ($i < $num) { |
@@ -10684,11 +10684,11 @@ discard block |
||
10684 | 10684 | $label = $obj->name; |
10685 | 10685 | $labelhtml = $obj->name; |
10686 | 10686 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
10687 | - $label .= " (" . $obj->label . ")"; |
|
10688 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
10687 | + $label .= " (".$obj->label.")"; |
|
10688 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
10689 | 10689 | } |
10690 | 10690 | |
10691 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
10691 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
10692 | 10692 | if ($disableline) { |
10693 | 10693 | $out .= ' disabled'; |
10694 | 10694 | } |
@@ -10704,9 +10704,9 @@ discard block |
||
10704 | 10704 | } |
10705 | 10705 | } else { |
10706 | 10706 | if ($show_empty) { |
10707 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
10707 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
10708 | 10708 | } |
10709 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
10709 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
10710 | 10710 | } |
10711 | 10711 | $out .= '</select>'; |
10712 | 10712 | |
@@ -10750,25 +10750,25 @@ discard block |
||
10750 | 10750 | $out = ''; |
10751 | 10751 | |
10752 | 10752 | if (!empty($conf->use_javascript_ajax)) { |
10753 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
10753 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
10754 | 10754 | } |
10755 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10755 | + $out .= '<script nonce="'.getNonce().'"> |
|
10756 | 10756 | $(document).ready(function() { |
10757 | - $("#' . $cssclass . 's").click(function() { |
|
10757 | + $("#' . $cssclass.'s").click(function() { |
|
10758 | 10758 | if($(this).is(\':checked\')){ |
10759 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
10760 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
10759 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
10760 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
10761 | 10761 | } |
10762 | 10762 | else |
10763 | 10763 | { |
10764 | 10764 | console.log("We uncheck all"); |
10765 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
10765 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
10766 | 10766 | }' . "\n"; |
10767 | 10767 | if ($calljsfunction) { |
10768 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10768 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10769 | 10769 | } |
10770 | 10770 | $out .= ' }); |
10771 | - $(".' . $cssclass . '").change(function() { |
|
10771 | + $(".' . $cssclass.'").change(function() { |
|
10772 | 10772 | $(this).closest("tr").toggleClass("highlight", this.checked); |
10773 | 10773 | }); |
10774 | 10774 | }); |
@@ -10813,67 +10813,67 @@ discard block |
||
10813 | 10813 | global $langs, $user; |
10814 | 10814 | |
10815 | 10815 | $out = ''; |
10816 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
10817 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
10816 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
10817 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
10818 | 10818 | if (!empty($excludeid)) { |
10819 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
10819 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
10820 | 10820 | } |
10821 | 10821 | $sql .= " ORDER BY label"; |
10822 | 10822 | |
10823 | 10823 | $resql = $this->db->query($sql); |
10824 | 10824 | if ($resql) { |
10825 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
10825 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
10826 | 10826 | if ($useempty) { |
10827 | 10827 | $out .= '<option value="0"> </option>'; |
10828 | 10828 | } |
10829 | 10829 | |
10830 | 10830 | while ($obj = $this->db->fetch_object($resql)) { |
10831 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
10831 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
10832 | 10832 | } |
10833 | 10833 | $out .= '</select>'; |
10834 | - $out .= ajax_combobox('select_' . $htmlname); |
|
10834 | + $out .= ajax_combobox('select_'.$htmlname); |
|
10835 | 10835 | |
10836 | 10836 | if (!empty($htmlname) && $user->admin && $info_admin) { |
10837 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10837 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10838 | 10838 | } |
10839 | 10839 | |
10840 | 10840 | if (!empty($target)) { |
10841 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10841 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10842 | 10842 | $resql = $this->db->query($sql); |
10843 | 10843 | if ($resql) { |
10844 | 10844 | if ($this->db->num_rows($resql) > 0) { |
10845 | 10845 | $obj = $this->db->fetch_object($resql); |
10846 | - $out .= '<script nonce="' . getNonce() . '"> |
|
10846 | + $out .= '<script nonce="'.getNonce().'"> |
|
10847 | 10847 | $(function() { |
10848 | - $("select[name=' . $target . ']").on("change", function() { |
|
10848 | + $("select[name=' . $target.']").on("change", function() { |
|
10849 | 10849 | var current_val = $(this).val(); |
10850 | - if (current_val == ' . $obj->id . ') {'; |
|
10850 | + if (current_val == ' . $obj->id.') {'; |
|
10851 | 10851 | if (!empty($default_selected) || !empty($selected)) { |
10852 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
10852 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
10853 | 10853 | } |
10854 | 10854 | |
10855 | 10855 | $out .= ' |
10856 | - $("select[name=' . $htmlname . ']").change(); |
|
10856 | + $("select[name=' . $htmlname.']").change(); |
|
10857 | 10857 | } |
10858 | 10858 | }); |
10859 | 10859 | |
10860 | - $("select[name=' . $htmlname . ']").change(function() { |
|
10860 | + $("select[name=' . $htmlname.']").change(function() { |
|
10861 | 10861 | |
10862 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
10862 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
10863 | 10863 | // get price of kilometer to fill the unit price |
10864 | 10864 | $.ajax({ |
10865 | 10865 | method: "POST", |
10866 | 10866 | dataType: "json", |
10867 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
10868 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
10867 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
10868 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
10869 | 10869 | }).done(function( data, textStatus, jqXHR ) { |
10870 | 10870 | console.log(data); |
10871 | 10871 | if (typeof data.up != "undefined") { |
10872 | 10872 | $("input[name=value_unit]").val(data.up); |
10873 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
10873 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
10874 | 10874 | } else { |
10875 | 10875 | $("input[name=value_unit]").val(""); |
10876 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
10876 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
10877 | 10877 | } |
10878 | 10878 | }); |
10879 | 10879 | } |
@@ -10903,18 +10903,18 @@ discard block |
||
10903 | 10903 | global $conf, $langs; |
10904 | 10904 | |
10905 | 10905 | $out = ''; |
10906 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
10907 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
10906 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
10907 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
10908 | 10908 | |
10909 | 10909 | $resql = $this->db->query($sql); |
10910 | 10910 | if ($resql) { |
10911 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10911 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10912 | 10912 | if ($useempty) { |
10913 | 10913 | $out .= '<option value="0"></option>'; |
10914 | 10914 | } |
10915 | 10915 | |
10916 | 10916 | while ($obj = $this->db->fetch_object($resql)) { |
10917 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
10917 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
10918 | 10918 | } |
10919 | 10919 | $out .= '</select>'; |
10920 | 10920 | } else { |
@@ -10945,12 +10945,12 @@ discard block |
||
10945 | 10945 | |
10946 | 10946 | $resql = $this->db->query($sql); |
10947 | 10947 | if ($resql) { |
10948 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10948 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
10949 | 10949 | if ($useempty) { |
10950 | 10950 | $out .= '<option value="0"></option>'; |
10951 | 10951 | } |
10952 | 10952 | if ($allchoice) { |
10953 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
10953 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
10954 | 10954 | } |
10955 | 10955 | |
10956 | 10956 | $field = 'code'; |
@@ -10960,7 +10960,7 @@ discard block |
||
10960 | 10960 | |
10961 | 10961 | while ($obj = $this->db->fetch_object($resql)) { |
10962 | 10962 | $key = $langs->trans($obj->code); |
10963 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
10963 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
10964 | 10964 | } |
10965 | 10965 | $out .= '</select>'; |
10966 | 10966 | |
@@ -10994,7 +10994,7 @@ discard block |
||
10994 | 10994 | { |
10995 | 10995 | global $user, $conf, $langs; |
10996 | 10996 | |
10997 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
10997 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
10998 | 10998 | |
10999 | 10999 | if (is_null($usertofilter)) { |
11000 | 11000 | $usertofilter = $user; |
@@ -11018,10 +11018,10 @@ discard block |
||
11018 | 11018 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
11019 | 11019 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
11020 | 11020 | $sql .= ' s.nom as name'; |
11021 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
11022 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
11023 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
11024 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
11021 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
11022 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
11023 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
11024 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
11025 | 11025 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
11026 | 11026 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
11027 | 11027 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -11032,14 +11032,14 @@ discard block |
||
11032 | 11032 | if ($resql) { |
11033 | 11033 | // Use select2 selector |
11034 | 11034 | if (!empty($conf->use_javascript_ajax)) { |
11035 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
11035 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
11036 | 11036 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
11037 | 11037 | $out .= $comboenhancement; |
11038 | 11038 | $morecss = 'minwidth200imp maxwidth500'; |
11039 | 11039 | } |
11040 | 11040 | |
11041 | 11041 | if (empty($option_only)) { |
11042 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
11042 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
11043 | 11043 | } |
11044 | 11044 | if (!empty($show_empty)) { |
11045 | 11045 | $out .= '<option value="0" class="optiongrey">'; |
@@ -11069,33 +11069,33 @@ discard block |
||
11069 | 11069 | if ($showproject == 'all') { |
11070 | 11070 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
11071 | 11071 | if ($obj->name) { |
11072 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
11072 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
11073 | 11073 | } |
11074 | 11074 | |
11075 | 11075 | $disabled = 0; |
11076 | 11076 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
11077 | 11077 | $disabled = 1; |
11078 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
11078 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
11079 | 11079 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
11080 | 11080 | if ($discard_closed == 2) { |
11081 | 11081 | $disabled = 1; |
11082 | 11082 | } |
11083 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
11083 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
11084 | 11084 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
11085 | 11085 | $disabled = 1; |
11086 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
11086 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
11087 | 11087 | } |
11088 | 11088 | } |
11089 | 11089 | |
11090 | 11090 | if (!empty($selected) && $selected == $obj->rowid) { |
11091 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
11091 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
11092 | 11092 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
11093 | - $out .= '>' . $labeltoshow . '</option>'; |
|
11093 | + $out .= '>'.$labeltoshow.'</option>'; |
|
11094 | 11094 | } else { |
11095 | 11095 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
11096 | 11096 | $resultat = ''; |
11097 | 11097 | } else { |
11098 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
11098 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
11099 | 11099 | if ($disabled) { |
11100 | 11100 | $resultat .= ' disabled'; |
11101 | 11101 | } |
@@ -11147,22 +11147,22 @@ discard block |
||
11147 | 11147 | |
11148 | 11148 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
11149 | 11149 | //$sql.= ', el.fk_source'; |
11150 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
11151 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
11150 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
11151 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
11152 | 11152 | $sql .= " ORDER BY f.titre ASC"; |
11153 | 11153 | |
11154 | 11154 | $resql = $this->db->query($sql); |
11155 | 11155 | if ($resql) { |
11156 | 11156 | // Use select2 selector |
11157 | 11157 | if (!empty($conf->use_javascript_ajax)) { |
11158 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
11158 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
11159 | 11159 | $comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
11160 | 11160 | $out .= $comboenhancement; |
11161 | 11161 | $morecss = 'minwidth200imp maxwidth500'; |
11162 | 11162 | } |
11163 | 11163 | |
11164 | 11164 | if (empty($option_only)) { |
11165 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
11165 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
11166 | 11166 | } |
11167 | 11167 | if (!empty($show_empty)) { |
11168 | 11168 | $out .= '<option value="0" class="optiongrey">'; |
@@ -11181,19 +11181,19 @@ discard block |
||
11181 | 11181 | $disabled = 0; |
11182 | 11182 | if (!empty($obj->suspended)) { |
11183 | 11183 | $disabled = 1; |
11184 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
11184 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
11185 | 11185 | } |
11186 | 11186 | |
11187 | 11187 | |
11188 | 11188 | if (!empty($selected) && $selected == $obj->rowid) { |
11189 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
11189 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
11190 | 11190 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
11191 | - $out .= '>' . $labeltoshow . '</option>'; |
|
11191 | + $out .= '>'.$labeltoshow.'</option>'; |
|
11192 | 11192 | } else { |
11193 | 11193 | if ($disabled && ($selected != $obj->rowid)) { |
11194 | 11194 | $resultat = ''; |
11195 | 11195 | } else { |
11196 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
11196 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
11197 | 11197 | if ($disabled) { |
11198 | 11198 | $resultat .= ' disabled'; |
11199 | 11199 | } |
@@ -11238,14 +11238,14 @@ discard block |
||
11238 | 11238 | $formother = new FormOther($this->db); |
11239 | 11239 | |
11240 | 11240 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
11241 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
11241 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
11242 | 11242 | } |
11243 | 11243 | |
11244 | 11244 | $ret = ''; |
11245 | 11245 | |
11246 | 11246 | $ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
11247 | 11247 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
11248 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
11248 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
11249 | 11249 | $ret .= '</a>'; |
11250 | 11250 | |
11251 | 11251 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -11289,30 +11289,30 @@ discard block |
||
11289 | 11289 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
11290 | 11290 | } |
11291 | 11291 | $ret .= "<!-- We store the full Universal Search String into this field. For example: (t.ref:like:'SO-%') AND ((t.ref:like:'CO-%') OR (t.ref:like:'AA%')) -->"; |
11292 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
11292 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
11293 | 11293 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
11294 | 11294 | |
11295 | 11295 | // TODO : Use $arrayoffiltercriterias instead of $arrayofcriterias |
11296 | 11296 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
11297 | 11297 | foreach ($arrayofcriterias as $criteria) { |
11298 | 11298 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
11299 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
11299 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
11300 | 11300 | continue; |
11301 | 11301 | } |
11302 | 11302 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
11303 | 11303 | continue; |
11304 | 11304 | } |
11305 | 11305 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
11306 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
11307 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
11308 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
11309 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
11310 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
11311 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
11312 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
11313 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
11306 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
11307 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
11308 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
11309 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
11310 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
11311 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
11312 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
11313 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
11314 | 11314 | } else { |
11315 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
11315 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
11316 | 11316 | } |
11317 | 11317 | } |
11318 | 11318 | } |
@@ -11320,7 +11320,7 @@ discard block |
||
11320 | 11320 | $ret .= '</div>'; |
11321 | 11321 | |
11322 | 11322 | $ret .= "<!-- Field to enter a generic filter string: t.ref:like:'SO-%', t.date_creation:<:'20160101', t.date_creation:<:'2016-01-01 12:30:00', t.nature:is:NULL, t.field2:isnot:NULL -->\n"; |
11323 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
11323 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
11324 | 11324 | |
11325 | 11325 | $ret .= '</div>'; |
11326 | 11326 | $ret .= '</div>'; |
@@ -11377,7 +11377,7 @@ discard block |
||
11377 | 11377 | // Convert $arrayoffiltercriterias into a json object that can be used in jquery to build the search component dynamically |
11378 | 11378 | $arrayoffiltercriterias_json = json_encode($arrayoffiltercriterias); |
11379 | 11379 | $ret .= '<script> |
11380 | - var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json . '; |
|
11380 | + var arrayoffiltercriterias = ' . $arrayoffiltercriterias_json.'; |
|
11381 | 11381 | </script>'; |
11382 | 11382 | |
11383 | 11383 | |
@@ -11391,9 +11391,9 @@ discard block |
||
11391 | 11391 | $ret .= '<div class="search-component-assistance">'; |
11392 | 11392 | $ret .= '<div>'; |
11393 | 11393 | |
11394 | - $ret .= '<p class="assistance-title">' . img_picto('', 'filter') . ' ' . $langs->trans('FilterAssistance') . ' </p>'; |
|
11394 | + $ret .= '<p class="assistance-title">'.img_picto('', 'filter').' '.$langs->trans('FilterAssistance').' </p>'; |
|
11395 | 11395 | |
11396 | - $ret .= '<p class="assistance-errors error" style="display:none">' . $langs->trans('AllFieldsRequired') . ' </p>'; |
|
11396 | + $ret .= '<p class="assistance-errors error" style="display:none">'.$langs->trans('AllFieldsRequired').' </p>'; |
|
11397 | 11397 | |
11398 | 11398 | $ret .= '<div class="operand">'; |
11399 | 11399 | $ret .= $form->selectarray('search_filter_field', $arrayoffilterfieldslabel, '', $langs->trans("Fields"), 0, 0, '', 0, 0, 0, '', 'width250', 1); |
@@ -11407,7 +11407,7 @@ discard block |
||
11407 | 11407 | $ret .= '</select>'; |
11408 | 11408 | $ret .= '<script>$(document).ready(function() {'; |
11409 | 11409 | $ret .= ' $(".operator-selector").select2({'; |
11410 | - $ret .= ' placeholder: \'' . dol_escape_js($langs->trans('Operator')) . '\''; |
|
11410 | + $ret .= ' placeholder: \''.dol_escape_js($langs->trans('Operator')).'\''; |
|
11411 | 11411 | $ret .= ' });'; |
11412 | 11412 | $ret .= '});</script>'; |
11413 | 11413 | $ret .= '</div>'; |
@@ -11416,12 +11416,12 @@ discard block |
||
11416 | 11416 | |
11417 | 11417 | $ret .= '<div class="value">'; |
11418 | 11418 | // Input field for entering values |
11419 | - $ret .= '<input type="text" class="flat width100 value-input" placeholder="' . dolPrintHTML($langs->trans('Value')) . '">'; |
|
11419 | + $ret .= '<input type="text" class="flat width100 value-input" placeholder="'.dolPrintHTML($langs->trans('Value')).'">'; |
|
11420 | 11420 | |
11421 | 11421 | // Date selector |
11422 | 11422 | $dateOne = ''; |
11423 | 11423 | $ret .= '<span class="date-one" style="display:none">'; |
11424 | - $ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, ''); |
|
11424 | + $ret .= $form->selectDate(($dateOne ? $dateOne : -1), 'dateone', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, ''); |
|
11425 | 11425 | $ret .= '</span>'; |
11426 | 11426 | |
11427 | 11427 | // Value selector (will be populated dynamically) based on search_filter_field value if a selected value has an array of values |
@@ -11430,7 +11430,7 @@ discard block |
||
11430 | 11430 | $ret .= '<script> |
11431 | 11431 | $(document).ready(function() { |
11432 | 11432 | $("#value-selector").select2({ |
11433 | - placeholder: "' . dol_escape_js($langs->trans('Value')) . '" |
|
11433 | + placeholder: "' . dol_escape_js($langs->trans('Value')).'" |
|
11434 | 11434 | }); |
11435 | 11435 | $("#value-selector").hide(); |
11436 | 11436 | $("#value-selector").next(".select2-container").hide(); |
@@ -11440,7 +11440,7 @@ discard block |
||
11440 | 11440 | $ret .= '</div>'; |
11441 | 11441 | |
11442 | 11442 | $ret .= '<div class="btn-div">'; |
11443 | - $ret .= '<button class="button buttongen button-save add-filter-btn" type="button">' . $langs->trans("addToFilter") . '</button>'; |
|
11443 | + $ret .= '<button class="button buttongen button-save add-filter-btn" type="button">'.$langs->trans("addToFilter").'</button>'; |
|
11444 | 11444 | $ret .= '</div>'; |
11445 | 11445 | |
11446 | 11446 | $ret .= '</div>'; |
@@ -11606,7 +11606,7 @@ discard block |
||
11606 | 11606 | |
11607 | 11607 | $TModels = array(); |
11608 | 11608 | |
11609 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
11609 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
11610 | 11610 | $formmail = new FormMail($this->db); |
11611 | 11611 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
11612 | 11612 | |
@@ -11619,20 +11619,20 @@ discard block |
||
11619 | 11619 | } |
11620 | 11620 | } |
11621 | 11621 | |
11622 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
11622 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
11623 | 11623 | |
11624 | 11624 | foreach ($TModels as $id_model => $label_model) { |
11625 | - $retstring .= '<option value="' . $id_model . '"'; |
|
11625 | + $retstring .= '<option value="'.$id_model.'"'; |
|
11626 | 11626 | if (!empty($selected) && $selected == $id_model) { |
11627 | 11627 | $retstring .= "selected"; |
11628 | 11628 | } |
11629 | - $retstring .= ">" . $label_model . "</option>"; |
|
11629 | + $retstring .= ">".$label_model."</option>"; |
|
11630 | 11630 | } |
11631 | 11631 | |
11632 | 11632 | $retstring .= "</select>"; |
11633 | 11633 | |
11634 | 11634 | if ($addjscombo) { |
11635 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
11635 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
11636 | 11636 | } |
11637 | 11637 | |
11638 | 11638 | return $retstring; |
@@ -11683,16 +11683,16 @@ discard block |
||
11683 | 11683 | |
11684 | 11684 | foreach ($buttons as $button) { |
11685 | 11685 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
11686 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->transnoentities($button['label_key'])) . '">'; |
|
11686 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->transnoentities($button['label_key'])).'">'; |
|
11687 | 11687 | } |
11688 | 11688 | $retstring .= $withoutdiv ? '' : '</div>'; |
11689 | 11689 | |
11690 | 11690 | if ($dol_openinpopup) { |
11691 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . dol_escape_htmltag($dol_openinpopup) . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
11692 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
11691 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.dol_escape_htmltag($dol_openinpopup).' context, so we enable the close of dialog on cancel -->'."\n"; |
|
11692 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
11693 | 11693 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
11694 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup) . '\'); |
|
11695 | - window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup) . '\').dialog(\'close\'); |
|
11694 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . dol_escape_js($dol_openinpopup).'\'); |
|
11695 | + window.parent.jQuery(\'#idfordialog' . dol_escape_js($dol_openinpopup).'\').dialog(\'close\'); |
|
11696 | 11696 | });'; |
11697 | 11697 | $retstring .= '</script>'; |
11698 | 11698 | } |
@@ -11721,7 +11721,7 @@ discard block |
||
11721 | 11721 | dol_syslog(__METHOD__, LOG_DEBUG); |
11722 | 11722 | |
11723 | 11723 | $sql = "SELECT rowid, code, label as label"; |
11724 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
11724 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
11725 | 11725 | $sql .= " WHERE active = 1"; |
11726 | 11726 | |
11727 | 11727 | $resql = $this->db->query($sql); |
@@ -11732,7 +11732,7 @@ discard block |
||
11732 | 11732 | $obj = $this->db->fetch_object($resql); |
11733 | 11733 | |
11734 | 11734 | // If translation exists, we use it, otherwise we take the default wording |
11735 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
11735 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
11736 | 11736 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
11737 | 11737 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
11738 | 11738 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -11764,18 +11764,18 @@ discard block |
||
11764 | 11764 | global $langs, $user; |
11765 | 11765 | |
11766 | 11766 | $out = ''; |
11767 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
11767 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
11768 | 11768 | |
11769 | 11769 | $this->load_cache_invoice_subtype(); |
11770 | 11770 | |
11771 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
11771 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
11772 | 11772 | if ($addempty) { |
11773 | 11773 | $out .= '<option value="0"> </option>'; |
11774 | 11774 | } |
11775 | 11775 | |
11776 | 11776 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
11777 | 11777 | $label = $subtype['label']; |
11778 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
11778 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
11779 | 11779 | if ($selected == $subtype['rowid']) { |
11780 | 11780 | $out .= ' selected="selected"'; |
11781 | 11781 | } |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); |
114 | 114 | $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); |
115 | 115 | |
116 | -$pastmonth = null; // Initialise, could be unset |
|
117 | -$pastmonthyear = null; // Initialise, could be unset |
|
116 | +$pastmonth = null; // Initialise, could be unset |
|
117 | +$pastmonthyear = null; // Initialise, could be unset |
|
118 | 118 | |
119 | 119 | if (empty($date_startmonth)) { |
120 | 120 | // Period by default on transfer |
@@ -165,13 +165,13 @@ discard block |
||
165 | 165 | $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd"; |
166 | 166 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; |
167 | 167 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
168 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
168 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
169 | 169 | } |
170 | 170 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; |
171 | 171 | $sql .= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture"; |
172 | 172 | $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
173 | 173 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
174 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
174 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
175 | 175 | } |
176 | 176 | $parameters = array(); |
177 | 177 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | // $compta_revenuestamp = getDolGlobalString('ACCOUNTING_REVENUESTAMP_SOLD_ACCOUNT', 'NotDefined'); |
249 | 249 | |
250 | - $tax_id = $obj->tva_tx . ($obj->vat_src_code ? ' (' . $obj->vat_src_code . ')' : ''); |
|
250 | + $tax_id = $obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''); |
|
251 | 251 | if (array_key_exists($tax_id, $vatdata_cache)) { |
252 | 252 | $vatdata = $vatdata_cache[$tax_id]; |
253 | 253 | } else { |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | $buyer = new Societe($db); |
256 | 256 | $buyer->fetch($obj->socid); |
257 | 257 | } else { |
258 | - $buyer = null; // We don't need the buyer in this case |
|
258 | + $buyer = null; // We don't need the buyer in this case |
|
259 | 259 | } |
260 | 260 | $seller = $mysoc; |
261 | 261 | $vatdata = getTaxesFromId($tax_id, $buyer, $seller, 0); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | // Move a part of the retained warrenty into the account of warranty |
333 | 333 | if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY') && $obj->retained_warranty > 0) { |
334 | - $retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value) |
|
334 | + $retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value) |
|
335 | 335 | $tabwarranty[$obj->rowid][$compta_soc] += $retained_warranty; |
336 | 336 | $total_ttc -= $retained_warranty; |
337 | 337 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $totalcredit = 0; |
505 | 505 | $totaldebit = 0; |
506 | 506 | |
507 | - $db->begin(); // We accept transaction into loop, so if we hang, we can continue transfer from the last error |
|
507 | + $db->begin(); // We accept transaction into loop, so if we hang, we can continue transfer from the last error |
|
508 | 508 | |
509 | 509 | $companystatic->id = $tabcompany[$key]['id']; |
510 | 510 | $companystatic->name = $tabcompany[$key]['name']; |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | } |
643 | 643 | } else { |
644 | 644 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { |
645 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; |
|
645 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; |
|
646 | 646 | $lettering_static = new Lettering($db); |
647 | 647 | |
648 | 648 | $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | |
738 | 738 | foreach ($arrayofvat[$key] as $k => $mt) { |
739 | 739 | if ($mt) { |
740 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache for label |
|
740 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache for label |
|
741 | 741 | $label_account = $accountingaccount->label; |
742 | 742 | |
743 | 743 | $bookkeeping = new BookKeeping($db); |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | if (isset($tabrevenuestamp[$key]) && is_array($tabrevenuestamp[$key])) { |
799 | 799 | foreach ($tabrevenuestamp[$key] as $k => $mt) { |
800 | 800 | if ($mt) { |
801 | - $accountingaccount->fetch(0, $k, true); // TODO Use a cache for label |
|
801 | + $accountingaccount->fetch(0, $k, true); // TODO Use a cache for label |
|
802 | 802 | $label_account = $accountingaccount->label; |
803 | 803 | |
804 | 804 | $bookkeeping = new BookKeeping($db); |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | $companystatic->id = $tabcompany[$key]['id']; |
922 | 922 | $companystatic->name = $tabcompany[$key]['name']; |
923 | 923 | $companystatic->accountancy_code_customer_general = (!empty($tabcompany[$key]['accountancy_code_customer_general']) && $tabcompany[$key]['accountancy_code_customer_general'] != '-1') ? $tabcompany[$key]['accountancy_code_customer_general'] : $cptcli; |
924 | - $companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated |
|
924 | + $companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated |
|
925 | 925 | $companystatic->code_compta_client = $tabcompany[$key]['code_compta']; |
926 | 926 | $companystatic->code_client = $tabcompany[$key]['code_client']; |
927 | 927 | $companystatic->client = 3; |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | // Button to write into Ledger |
1112 | - $acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['','-1']); |
|
1112 | + $acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['', '-1']); |
|
1113 | 1113 | if ($acctCustomerNotConfigured) { |
1114 | 1114 | print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
1115 | 1115 | $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
@@ -1245,13 +1245,13 @@ discard block |
||
1245 | 1245 | foreach ($tabwarranty[$key] as $k => $mt) { |
1246 | 1246 | print '<tr class="oddeven">'; |
1247 | 1247 | print "<!-- Thirdparty warranty -->"; |
1248 | - print "<td>" . $date . "</td>"; |
|
1249 | - print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; |
|
1248 | + print "<td>".$date."</td>"; |
|
1249 | + print "<td>".$invoicestatic->getNomUrl(1)."</td>"; |
|
1250 | 1250 | // Account |
1251 | 1251 | print "<td>"; |
1252 | 1252 | $accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY')); |
1253 | 1253 | if (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1254 | - print '<span class="error">' . $langs->trans("MainAccountForRetainedWarrantyNotDefined") . '</span>'; |
|
1254 | + print '<span class="error">'.$langs->trans("MainAccountForRetainedWarrantyNotDefined").'</span>'; |
|
1255 | 1255 | } else { |
1256 | 1256 | print $accountoshow; |
1257 | 1257 | } |
@@ -1260,14 +1260,14 @@ discard block |
||
1260 | 1260 | print "<td>"; |
1261 | 1261 | $accountoshow = length_accounta($k); |
1262 | 1262 | if (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1263 | - print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>'; |
|
1263 | + print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>'; |
|
1264 | 1264 | } else { |
1265 | 1265 | print $accountoshow; |
1266 | 1266 | } |
1267 | 1267 | print '</td>'; |
1268 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0), $invoicestatic->ref, $langs->trans("RetainedWarranty")) . "</td>"; |
|
1269 | - print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1270 | - print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1268 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0), $invoicestatic->ref, $langs->trans("RetainedWarranty"))."</td>"; |
|
1269 | + print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1270 | + print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1271 | 1271 | print "</tr>"; |
1272 | 1272 | } |
1273 | 1273 | } |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | print $accountoshow; |
1297 | 1297 | } |
1298 | 1298 | print '</td>'; |
1299 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $langs->trans("SubledgerAccount")) . "</td>"; |
|
1299 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $langs->trans("SubledgerAccount"))."</td>"; |
|
1300 | 1300 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
1301 | 1301 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
1302 | 1302 | print "</tr>"; |
@@ -1334,12 +1334,12 @@ discard block |
||
1334 | 1334 | print length_accounta($tabcompany[$key]['code_compta']); |
1335 | 1335 | } |
1336 | 1336 | } elseif (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1337 | - print '<span class="error">' . $langs->trans("ThirdpartyAccountNotDefined") . '</span>'; |
|
1337 | + print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>'; |
|
1338 | 1338 | } |
1339 | 1339 | print '</td>'; |
1340 | 1340 | $companystatic->id = $tabcompany[$key]['id']; |
1341 | 1341 | $companystatic->name = $tabcompany[$key]['name']; |
1342 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $accountingaccount->label) . "</td>"; |
|
1342 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $accountingaccount->label)."</td>"; |
|
1343 | 1343 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
1344 | 1344 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
1345 | 1345 | print "</tr>"; |
@@ -1382,7 +1382,7 @@ discard block |
||
1382 | 1382 | $tmpvatrate = (empty($def_tva[$key][$k]) ? (empty($arrayofvat[$key][$k]) ? '' : $arrayofvat[$key][$k]) : implode(', ', $def_tva[$key][$k])); |
1383 | 1383 | $labelvatrate = $langs->trans("Taxes").' '.$tmpvatrate.' %'; |
1384 | 1384 | $labelvatrate .= ($numtax ? ' - Localtax '.$numtax : ''); |
1385 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $labelvatrate) . "</td>"; |
|
1385 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $labelvatrate)."</td>"; |
|
1386 | 1386 | print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
1387 | 1387 | print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
1388 | 1388 | print "</tr>"; |
@@ -1397,13 +1397,13 @@ discard block |
||
1397 | 1397 | foreach ($tabrevenuestamp[$key] as $k => $mt) { |
1398 | 1398 | print '<tr class="oddeven">'; |
1399 | 1399 | print "<!-- Thirdparty revenuestamp -->"; |
1400 | - print "<td>" . $date . "</td>"; |
|
1401 | - print "<td>" . $invoicestatic->getNomUrl(1) . "</td>"; |
|
1400 | + print "<td>".$date."</td>"; |
|
1401 | + print "<td>".$invoicestatic->getNomUrl(1)."</td>"; |
|
1402 | 1402 | // Account |
1403 | 1403 | print "<td>"; |
1404 | 1404 | $accountoshow = length_accountg($k); |
1405 | 1405 | if (($accountoshow == "") || $accountoshow == 'NotDefined') { |
1406 | - print '<span class="error">' . $langs->trans("MainAccountForRevenueStampSaleNotDefined") . '</span>'; |
|
1406 | + print '<span class="error">'.$langs->trans("MainAccountForRevenueStampSaleNotDefined").'</span>'; |
|
1407 | 1407 | } else { |
1408 | 1408 | print $accountoshow; |
1409 | 1409 | } |
@@ -1411,9 +1411,9 @@ discard block |
||
1411 | 1411 | // Subledger account |
1412 | 1412 | print "<td>"; |
1413 | 1413 | print '</td>'; |
1414 | - print "<td>" . $bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $langs->trans("RevenueStamp")) . "</td>"; |
|
1415 | - print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
1416 | - print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
1414 | + print "<td>".$bookkeepingstatic->accountingLabelForOperation($companystatic->getNomUrl(0, 'customer'), $invoicestatic->ref, $langs->trans("RevenueStamp"))."</td>"; |
|
1415 | + print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
1416 | + print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
1417 | 1417 | print "</tr>"; |
1418 | 1418 | } |
1419 | 1419 | } |
@@ -1082,8 +1082,8 @@ discard block |
||
1082 | 1082 | $sql .= ", '".$this->db->escape($this->ip)."'"; |
1083 | 1083 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
1084 | 1084 | $sql .= ", ".(empty($this->vat_reverse_charge) ? '0' : '1'); |
1085 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1086 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1085 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1086 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1087 | 1087 | } |
1088 | 1088 | $sql .= ")"; |
1089 | 1089 | |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | if ($ret >= 0) { |
1139 | - if (! $notrigger) { |
|
1139 | + if (!$notrigger) { |
|
1140 | 1140 | // Call trigger |
1141 | 1141 | $result = $this->call_trigger('COMPANY_CREATE', $user); |
1142 | 1142 | if ($result < 0) { |
@@ -1384,7 +1384,7 @@ discard block |
||
1384 | 1384 | if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { |
1385 | 1385 | $langs->loadLangs(array("errors", 'compta')); |
1386 | 1386 | $error++; |
1387 | - $this->errors[] = $langs->trans('CustomerAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1387 | + $this->errors[] = $langs->trans('CustomerAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1388 | 1388 | } |
1389 | 1389 | } |
1390 | 1390 | |
@@ -1392,7 +1392,7 @@ discard block |
||
1392 | 1392 | if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) { |
1393 | 1393 | $langs->loadLangs(array("errors", 'compta')); |
1394 | 1394 | $error++; |
1395 | - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1395 | + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1396 | 1396 | } |
1397 | 1397 | } elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && !empty($this->fournisseur)) { |
1398 | 1398 | // Check for unicity |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { |
1401 | 1401 | $langs->loadLangs(array("errors", 'compta')); |
1402 | 1402 | $error++; |
1403 | - $this->errors[] = $langs->trans('SupplierAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1403 | + $this->errors[] = $langs->trans('SupplierAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1404 | 1404 | } |
1405 | 1405 | } |
1406 | 1406 | |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) { |
1409 | 1409 | $langs->loadLangs(array("errors", 'compta')); |
1410 | 1410 | $error++; |
1411 | - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
1411 | + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
1412 | 1412 | } |
1413 | 1413 | } |
1414 | 1414 | } |
@@ -1453,17 +1453,17 @@ discard block |
||
1453 | 1453 | $now = dol_now(); |
1454 | 1454 | |
1455 | 1455 | // Clean parameters |
1456 | - $this->id = $id; |
|
1457 | - $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); |
|
1456 | + $this->id = $id; |
|
1457 | + $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); |
|
1458 | 1458 | $this->name = $this->name ? trim($this->name) : trim((string) $this->nom); |
1459 | 1459 | $this->nom = $this->name; // For backward compatibility |
1460 | - $this->name_alias = trim((string) $this->name_alias); |
|
1460 | + $this->name_alias = trim((string) $this->name_alias); |
|
1461 | 1461 | $this->ref_ext = (empty($this->ref_ext) ? '' : trim($this->ref_ext)); |
1462 | 1462 | $this->address = trim((string) $this->address); |
1463 | 1463 | $this->zip = trim((string) $this->zip); |
1464 | 1464 | $this->town = trim((string) $this->town); |
1465 | - $this->state_id = (is_numeric($this->state_id)) ? (int) $this->state_id : 0; |
|
1466 | - $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; |
|
1465 | + $this->state_id = (is_numeric($this->state_id)) ? (int) $this->state_id : 0; |
|
1466 | + $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; |
|
1467 | 1467 | $this->phone = trim((string) $this->phone); |
1468 | 1468 | $this->phone = preg_replace("/\s/", "", $this->phone); |
1469 | 1469 | $this->phone = preg_replace("/\./", "", $this->phone); |
@@ -1473,7 +1473,7 @@ discard block |
||
1473 | 1473 | $this->fax = trim((string) $this->fax); |
1474 | 1474 | $this->fax = preg_replace("/\s/", "", $this->fax); |
1475 | 1475 | $this->fax = preg_replace("/\./", "", $this->fax); |
1476 | - $this->email = trim((string) $this->email); |
|
1476 | + $this->email = trim((string) $this->email); |
|
1477 | 1477 | $this->url = $this->url ? clean_url($this->url, 0) : ''; |
1478 | 1478 | $this->note_private = (empty($this->note_private) ? '' : trim($this->note_private)); |
1479 | 1479 | $this->note_public = (empty($this->note_public) ? '' : trim($this->note_public)); |
@@ -1483,14 +1483,14 @@ discard block |
||
1483 | 1483 | $this->idprof4 = trim((string) $this->idprof4); |
1484 | 1484 | $this->idprof5 = (!empty($this->idprof5) ? trim($this->idprof5) : ''); |
1485 | 1485 | $this->idprof6 = (!empty($this->idprof6) ? trim($this->idprof6) : ''); |
1486 | - $this->prefix_comm = trim((string) $this->prefix_comm); |
|
1486 | + $this->prefix_comm = trim((string) $this->prefix_comm); |
|
1487 | 1487 | $this->outstanding_limit = price2num($this->outstanding_limit); |
1488 | 1488 | $this->order_min_amount = price2num($this->order_min_amount); |
1489 | 1489 | $this->supplier_order_min_amount = price2num($this->supplier_order_min_amount); |
1490 | 1490 | |
1491 | 1491 | $this->tva_assuj = (is_numeric($this->tva_assuj)) ? (int) trim((string) $this->tva_assuj) : 0; |
1492 | 1492 | $this->tva_intra = dol_sanitizeFileName($this->tva_intra, ''); |
1493 | - $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1; |
|
1493 | + $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1; |
|
1494 | 1494 | if (empty($this->status)) { |
1495 | 1495 | $this->status = 0; |
1496 | 1496 | } |
@@ -1642,7 +1642,7 @@ discard block |
||
1642 | 1642 | $sql .= ",tva_assuj = ".($this->tva_assuj != '' ? "'".$this->db->escape($this->tva_assuj)."'" : "null"); |
1643 | 1643 | $sql .= ",tva_intra = '".$this->db->escape($this->tva_intra)."'"; |
1644 | 1644 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
1645 | - $sql .= ",vat_reverse_charge = " . ($this->vat_reverse_charge != '' ? "'" . $this->db->escape($this->vat_reverse_charge) . "'" : 0); |
|
1645 | + $sql .= ",vat_reverse_charge = ".($this->vat_reverse_charge != '' ? "'".$this->db->escape($this->vat_reverse_charge)."'" : 0); |
|
1646 | 1646 | } |
1647 | 1647 | $sql .= ",status = ".((int) $this->status); |
1648 | 1648 | |
@@ -1703,8 +1703,8 @@ discard block |
||
1703 | 1703 | $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null'); |
1704 | 1704 | $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; |
1705 | 1705 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
1706 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
1707 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
1706 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
1707 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
1708 | 1708 | if ($customer) { |
1709 | 1709 | $sql .= ", accountancy_code_customer_general = ".(!empty($this->accountancy_code_customer_general) ? "'".$this->db->escape($this->accountancy_code_customer_general)."'" : "null"); |
1710 | 1710 | $sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); |
@@ -2102,7 +2102,7 @@ discard block |
||
2102 | 2102 | $this->vat_reverse_charge = 0; |
2103 | 2103 | } |
2104 | 2104 | |
2105 | - $this->status = $obj->status; |
|
2105 | + $this->status = $obj->status; |
|
2106 | 2106 | |
2107 | 2107 | // Local Taxes |
2108 | 2108 | $this->localtax1_assuj = $obj->localtax1_assuj; |
@@ -2129,7 +2129,7 @@ discard block |
||
2129 | 2129 | |
2130 | 2130 | $this->mode_reglement_id = $obj->mode_reglement; |
2131 | 2131 | $this->cond_reglement_id = $obj->cond_reglement; |
2132 | - $this->deposit_percent = $obj->deposit_percent; |
|
2132 | + $this->deposit_percent = $obj->deposit_percent; |
|
2133 | 2133 | $this->transport_mode_id = $obj->transport_mode; |
2134 | 2134 | $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; |
2135 | 2135 | $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; |
@@ -2699,10 +2699,10 @@ discard block |
||
2699 | 2699 | $reparray[$i]['firstname'] = $obj->firstname; |
2700 | 2700 | $reparray[$i]['email'] = $obj->email; |
2701 | 2701 | $reparray[$i]['phone'] = $obj->office_phone; |
2702 | - $reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone |
|
2702 | + $reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone |
|
2703 | 2703 | $reparray[$i]['office_fax'] = $obj->office_fax; |
2704 | - $reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile |
|
2705 | - $reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile |
|
2704 | + $reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile |
|
2705 | + $reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile |
|
2706 | 2706 | $reparray[$i]['job'] = $obj->job; |
2707 | 2707 | $reparray[$i]['statut'] = $obj->status; // deprecated |
2708 | 2708 | $reparray[$i]['status'] = $obj->status; |
@@ -2915,7 +2915,7 @@ discard block |
||
2915 | 2915 | $datas['status'] = ' '.$this->getLibStatut(5); |
2916 | 2916 | } |
2917 | 2917 | if (isset($this->client) && isset($this->fournisseur)) { |
2918 | - $datas['type'] = ' ' . $this->getTypeUrl(1, '', 0, 'span'); |
|
2918 | + $datas['type'] = ' '.$this->getTypeUrl(1, '', 0, 'span'); |
|
2919 | 2919 | } |
2920 | 2920 | $datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag(dol_string_nohtmltag($this->name)); |
2921 | 2921 | if (!empty($this->name_alias) && empty($noaliasinname)) { |
@@ -2983,9 +2983,9 @@ discard block |
||
2983 | 2983 | } |
2984 | 2984 | // show categories for this record only in ajax to not overload lists |
2985 | 2985 | if (!$nofetch && isModEnabled('category') && $this->client) { |
2986 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
2986 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
2987 | 2987 | $form = new Form($this->db); |
2988 | - $datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); |
|
2988 | + $datas['categories_customer'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); |
|
2989 | 2989 | } |
2990 | 2990 | if (!empty($this->code_fournisseur) && $this->fournisseur) { |
2991 | 2991 | $datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur; |
@@ -2996,9 +2996,9 @@ discard block |
||
2996 | 2996 | } |
2997 | 2997 | // show categories for this record only in ajax to not overload lists |
2998 | 2998 | if (!$nofetch && isModEnabled('category') && $this->fournisseur) { |
2999 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
2999 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
3000 | 3000 | $form = new Form($this->db); |
3001 | - $datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); |
|
3001 | + $datas['categories_supplier'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); |
|
3002 | 3002 | } |
3003 | 3003 | |
3004 | 3004 | $datas['divclose'] = '</div>'; |
@@ -3546,7 +3546,7 @@ discard block |
||
3546 | 3546 | { |
3547 | 3547 | // phpcs:enable |
3548 | 3548 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
3549 | - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND default_rib = 1 AND fk_soc = ". (int) $this->id; |
|
3549 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND default_rib = 1 AND fk_soc = ".(int) $this->id; |
|
3550 | 3550 | $resql = $this->db->query($sql); |
3551 | 3551 | if (!$resql) { |
3552 | 3552 | $this->error = $this->db->lasterror(); |
@@ -3936,7 +3936,7 @@ discard block |
||
3936 | 3936 | global $langs; |
3937 | 3937 | |
3938 | 3938 | if ($company_id > 0) { |
3939 | - $sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = ".((int) $company_id); |
|
3939 | + $sql = "SELECT parent FROM ".MAIN_DB_PREFIX."societe WHERE rowid = ".((int) $company_id); |
|
3940 | 3940 | $resql = $this->db->query($sql); |
3941 | 3941 | if ($resql) { |
3942 | 3942 | if ($obj = $this->db->fetch_object($resql)) { |
@@ -4552,7 +4552,7 @@ discard block |
||
4552 | 4552 | $country_code = $country_label = ''; |
4553 | 4553 | if (getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')) { |
4554 | 4554 | $tmp = explode(':', getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')); |
4555 | - $country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0; |
|
4555 | + $country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0; |
|
4556 | 4556 | if (!empty($tmp[1])) { // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label" |
4557 | 4557 | $country_code = $tmp[1]; |
4558 | 4558 | $country_label = $tmp[2]; |
@@ -5429,7 +5429,7 @@ discard block |
||
5429 | 5429 | if (method_exists($this, 'getLibStatut')) { |
5430 | 5430 | $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>'; |
5431 | 5431 | } |
5432 | - $return .= '</div>'; // end info-box-content |
|
5432 | + $return .= '</div>'; // end info-box-content |
|
5433 | 5433 | $return .= '</div>'; |
5434 | 5434 | $return .= '</div>'; |
5435 | 5435 | |
@@ -5533,7 +5533,7 @@ discard block |
||
5533 | 5533 | global $conf, $langs, $hookmanager, $user, $action; |
5534 | 5534 | |
5535 | 5535 | $error = 0; |
5536 | - $soc_origin = new Societe($this->db); // The thirdparty that we will delete |
|
5536 | + $soc_origin = new Societe($this->db); // The thirdparty that we will delete |
|
5537 | 5537 | |
5538 | 5538 | dol_syslog("mergeCompany merge thirdparty id=".$soc_origin_id." (will be deleted) into the thirdparty id=".$this->id); |
5539 | 5539 |