|
@@ -122,7 +122,7 @@ discard block |
|
|
block discarded – undo |
122
|
122
|
if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
123
|
123
|
if (!empty($perm)) { |
124
|
124
|
$tmp = explode(':', $typeofdata); |
125
|
|
- $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
125
|
+ $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
126
|
126
|
if ($fieldrequired) { |
127
|
127
|
$ret .= '<span class="fieldrequired">'; |
128
|
128
|
} |
|
@@ -134,7 +134,7 @@ discard block |
|
|
block discarded – undo |
134
|
134
|
if ($fieldrequired) { |
135
|
135
|
$ret .= '</span>'; |
136
|
136
|
} |
137
|
|
- $ret .= '</div>' . "\n"; |
|
137
|
+ $ret .= '</div>'."\n"; |
138
|
138
|
} else { |
139
|
139
|
if ($fieldrequired) { |
140
|
140
|
$ret .= '<span class="fieldrequired">'; |
|
@@ -172,8 +172,8 @@ discard block |
|
|
block discarded – undo |
172
|
172
|
if (empty($notabletag) && $perm) { |
173
|
173
|
$ret .= '<td class="right">'; |
174
|
174
|
} |
175
|
|
- if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
176
|
|
- $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>'; |
|
175
|
+ if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
176
|
+ $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>'; |
177
|
177
|
} |
178
|
178
|
if (!empty($notabletag) && $notabletag == 1) { |
179
|
179
|
if ($text) { |
|
@@ -240,7 +240,7 @@ discard block |
|
|
block discarded – undo |
240
|
240
|
} elseif ($reg[1] == 'int') { |
241
|
241
|
$typeofdata = 'numeric'; |
242
|
242
|
} else { |
243
|
|
- return 'ErrorBadParameter ' . $typeofdata; |
|
243
|
+ return 'ErrorBadParameter '.$typeofdata; |
244
|
244
|
} |
245
|
245
|
} |
246
|
246
|
|
|
@@ -251,13 +251,13 @@ discard block |
|
|
block discarded – undo |
251
|
251
|
if ($editaction == '') { |
252
|
252
|
$editaction = GETPOST('action', 'aZ09'); |
253
|
253
|
} |
254
|
|
- $editmode = ($editaction == 'edit' . $htmlname); |
|
254
|
+ $editmode = ($editaction == 'edit'.$htmlname); |
255
|
255
|
if ($editmode) { // edit mode |
256
|
256
|
$ret .= "\n"; |
257
|
|
- $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
258
|
|
- $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
259
|
|
- $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
260
|
|
- $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
257
|
+ $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
258
|
+ $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
259
|
+ $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
260
|
+ $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
261
|
261
|
if (empty($notabletag)) { |
262
|
262
|
$ret .= '<table class="nobordernopadding centpercent">'; |
263
|
263
|
} |
|
@@ -266,28 +266,28 @@ discard block |
|
|
block discarded – undo |
266
|
266
|
} |
267
|
267
|
if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
268
|
268
|
$tmp = explode(':', $typeofdata); |
269
|
|
- $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
269
|
+ $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
270
|
270
|
} elseif (preg_match('/^(integer)/', $typeofdata)) { |
271
|
271
|
$tmp = explode(':', $typeofdata); |
272
|
272
|
$valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
273
|
|
- $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
273
|
+ $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
274
|
274
|
} elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
275
|
275
|
$tmp = explode(':', $typeofdata); |
276
|
276
|
$valuetoshow = price2num($editvalue ? $editvalue : $value); |
277
|
|
- $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
277
|
+ $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
278
|
278
|
} elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
279
|
279
|
$tmp = explode(':', $typeofdata); |
280
|
|
- $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
280
|
+ $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
281
|
281
|
} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
282
|
282
|
$tmp = explode(':', $typeofdata); |
283
|
283
|
$cols = (empty($tmp[2]) ? '' : $tmp[2]); |
284
|
284
|
$morealt = ''; |
285
|
285
|
if (preg_match('/%/', $cols)) { |
286
|
|
- $morealt = ' style="width: ' . $cols . '"'; |
|
286
|
+ $morealt = ' style="width: '.$cols.'"'; |
287
|
287
|
$cols = ''; |
288
|
288
|
} |
289
|
289
|
$valuetoshow = ($editvalue ? $editvalue : $value); |
290
|
|
- $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
290
|
+ $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
291
|
291
|
// textarea convert automatically entities chars into simple chars. |
292
|
292
|
// 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 wysiwig is off. |
293
|
293
|
$valuetoshow = str_replace('&', '&', $valuetoshow); |
|
@@ -297,12 +297,12 @@ discard block |
|
|
block discarded – undo |
297
|
297
|
$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
298
|
298
|
$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
299
|
299
|
$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
300
|
|
- $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
300
|
+ $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
301
|
301
|
} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
302
|
302
|
$addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
303
|
303
|
$adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
304
|
304
|
$labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
305
|
|
- $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
305
|
+ $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
306
|
306
|
} elseif (preg_match('/^select;/', $typeofdata)) { |
307
|
307
|
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
308
|
308
|
$arraylist = array(); |
|
@@ -316,7 +316,7 @@ discard block |
|
|
block discarded – undo |
316
|
316
|
// TODO Not yet implemented. See code for extrafields |
317
|
317
|
} elseif (preg_match('/^ckeditor/', $typeofdata)) { |
318
|
318
|
$tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
319
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
319
|
+ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
320
|
320
|
$doleditor = new DolEditor($htmlname, ($editvalue ? $editvalue : $value), (empty($tmp[2]) ? '' : $tmp[2]), (empty($tmp[3]) ? '100' : $tmp[3]), (empty($tmp[1]) ? 'dolibarr_notes' : $tmp[1]), 'In', (empty($tmp[5]) ? 0 : $tmp[5]), (isset($tmp[8]) ? ($tmp[8] ? true : false) : true), true, (empty($tmp[6]) ? '20' : $tmp[6]), (empty($tmp[7]) ? '100' : $tmp[7])); |
321
|
321
|
$ret .= $doleditor->Create(1); |
322
|
322
|
} elseif ($typeofdata == 'asis') { |
|
@@ -331,19 +331,19 @@ discard block |
|
|
block discarded – undo |
331
|
331
|
$ret .= '<td>'; |
332
|
332
|
} |
333
|
333
|
//else $ret.='<div class="clearboth"></div>'; |
334
|
|
- $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
334
|
+ $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
335
|
335
|
if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
336
|
|
- $ret .= '<br>' . "\n"; |
|
336
|
+ $ret .= '<br>'."\n"; |
337
|
337
|
} |
338
|
|
- $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
338
|
+ $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
339
|
339
|
if (empty($notabletag)) { |
340
|
340
|
$ret .= '</td>'; |
341
|
341
|
} |
342
|
342
|
|
343
|
343
|
if (empty($notabletag)) { |
344
|
|
- $ret .= '</tr></table>' . "\n"; |
|
344
|
+ $ret .= '</tr></table>'."\n"; |
345
|
345
|
} |
346
|
|
- $ret .= '</form>' . "\n"; |
|
346
|
+ $ret .= '</form>'."\n"; |
347
|
347
|
} else { // view mode |
348
|
348
|
if (preg_match('/^email/', $typeofdata)) { |
349
|
349
|
$ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
|
@@ -355,15 +355,15 @@ discard block |
|
|
block discarded – undo |
355
|
355
|
$ret .= ($value != '' ? price($value, 0, $langs, 0, -1, -1, $conf->currency) : ''); |
356
|
356
|
} elseif (preg_match('/^checkbox/', $typeofdata)) { |
357
|
357
|
$tmp = explode(':', $typeofdata); |
358
|
|
- $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
358
|
+ $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
359
|
359
|
} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
360
|
360
|
$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
361
|
361
|
} elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
362
|
362
|
$ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
363
|
363
|
} elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
364
|
|
- $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
364
|
+ $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
365
|
365
|
} elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
366
|
|
- $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
366
|
+ $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
367
|
367
|
} elseif (preg_match('/^select;/', $typeofdata)) { |
368
|
368
|
$arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
369
|
369
|
$arraylist = array(); |
|
@@ -374,9 +374,9 @@ discard block |
|
|
block discarded – undo |
374
|
374
|
$ret .= $arraylist[$value]; |
375
|
375
|
if ($htmlname == 'fk_product_type') { |
376
|
376
|
if ($value == 0) { |
377
|
|
- $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
377
|
+ $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
378
|
378
|
} else { |
379
|
|
- $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
379
|
+ $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
380
|
380
|
} |
381
|
381
|
} |
382
|
382
|
} elseif (preg_match('/^ckeditor/', $typeofdata)) { |
|
@@ -384,7 +384,7 @@ discard block |
|
|
block discarded – undo |
384
|
384
|
if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
385
|
385
|
$firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
386
|
386
|
$firstline = preg_replace('/[\n\r].*/', '', $firstline); |
387
|
|
- $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
387
|
+ $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
388
|
388
|
} |
389
|
389
|
// We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
390
|
390
|
// clean data from some dangerous html |
|
@@ -393,7 +393,7 @@ discard block |
|
|
block discarded – undo |
393
|
393
|
if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
394
|
394
|
$ret .= dol_escape_htmltag($value); |
395
|
395
|
} else { |
396
|
|
- $ret .= $value; // $value must be already html escaped. |
|
396
|
+ $ret .= $value; // $value must be already html escaped. |
397
|
397
|
} |
398
|
398
|
} |
399
|
399
|
|
|
@@ -431,7 +431,7 @@ discard block |
|
|
block discarded – undo |
431
|
431
|
|
432
|
432
|
if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
433
|
433
|
if (!is_object($extralanguages)) { |
434
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
434
|
+ include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
435
|
435
|
$extralanguages = new ExtraLanguages($this->db); |
436
|
436
|
} |
437
|
437
|
$extralanguages->fetch_name_extralanguages('societe'); |
|
@@ -440,17 +440,17 @@ discard block |
|
|
block discarded – undo |
440
|
440
|
return ''; // No extralang field to show |
441
|
441
|
} |
442
|
442
|
|
443
|
|
- $result .= '<!-- Widget for translation -->' . "\n"; |
444
|
|
- $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
443
|
+ $result .= '<!-- Widget for translation -->'."\n"; |
|
444
|
+ $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
445
|
445
|
$s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
446
|
446
|
$result .= $s; |
447
|
447
|
$result .= '</div>'; |
448
|
448
|
|
449
|
|
- $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
449
|
+ $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
450
|
450
|
|
451
|
451
|
$resultforextrlang = ''; |
452
|
452
|
foreach ($arrayoflangcode as $langcode) { |
453
|
|
- $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
453
|
+ $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
454
|
454
|
if (empty($valuetoshow)) { |
455
|
455
|
$object->fetchValuesForExtraLanguages(); |
456
|
456
|
//var_dump($object->array_languages); |
|
@@ -462,17 +462,17 @@ discard block |
|
|
block discarded – undo |
462
|
462
|
|
463
|
463
|
// TODO Use the showInputField() method of ExtraLanguages object |
464
|
464
|
if ($typeofdata == 'textarea') { |
465
|
|
- $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
465
|
+ $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
466
|
466
|
$resultforextrlang .= $valuetoshow; |
467
|
467
|
$resultforextrlang .= '</textarea>'; |
468
|
468
|
} else { |
469
|
|
- $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
469
|
+ $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
470
|
470
|
} |
471
|
471
|
} |
472
|
472
|
$result .= $resultforextrlang; |
473
|
473
|
|
474
|
474
|
$result .= '</div>'; |
475
|
|
- $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
475
|
+ $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
476
|
476
|
} |
477
|
477
|
|
478
|
478
|
return $result; |
|
@@ -535,7 +535,7 @@ discard block |
|
|
block discarded – undo |
535
|
535
|
if (!empty($tmp[2])) { |
536
|
536
|
$savemethod = $tmp[2]; |
537
|
537
|
} |
538
|
|
- $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
538
|
+ $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
539
|
539
|
} elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
540
|
540
|
$tmp = explode(':', $inputType); |
541
|
541
|
$inputType = $tmp[0]; |
|
@@ -546,7 +546,7 @@ discard block |
|
|
block discarded – undo |
546
|
546
|
$savemethod = $tmp[2]; |
547
|
547
|
} |
548
|
548
|
|
549
|
|
- $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
549
|
+ $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
550
|
550
|
} elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
551
|
551
|
$tmp = explode(':', $inputType); |
552
|
552
|
$inputType = $tmp[0]; |
|
@@ -577,40 +577,40 @@ discard block |
|
|
block discarded – undo |
577
|
577
|
} |
578
|
578
|
|
579
|
579
|
if (isModEnabled('fckeditor')) { |
580
|
|
- $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
580
|
+ $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
581
|
581
|
} else { |
582
|
582
|
$inputType = 'textarea'; |
583
|
583
|
} |
584
|
584
|
} |
585
|
585
|
|
586
|
|
- $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
587
|
|
- $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
588
|
|
- $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
589
|
|
- $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
586
|
+ $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
587
|
+ $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
588
|
+ $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
589
|
+ $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
590
|
590
|
if (!empty($savemethod)) { |
591
|
|
- $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
591
|
+ $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
592
|
592
|
} |
593
|
593
|
if (!empty($ext_element)) { |
594
|
|
- $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
594
|
+ $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
595
|
595
|
} |
596
|
596
|
if (!empty($custommsg)) { |
597
|
597
|
if (is_array($custommsg)) { |
598
|
598
|
if (!empty($custommsg['success'])) { |
599
|
|
- $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
599
|
+ $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
600
|
600
|
} |
601
|
601
|
if (!empty($custommsg['error'])) { |
602
|
|
- $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
602
|
+ $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
603
|
603
|
} |
604
|
604
|
} else { |
605
|
|
- $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
605
|
+ $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
606
|
606
|
} |
607
|
607
|
} |
608
|
608
|
if ($inputType == 'textarea') { |
609
|
|
- $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
610
|
|
- $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
609
|
+ $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
610
|
+ $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
611
|
611
|
} |
612
|
|
- $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
613
|
|
- $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
612
|
+ $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
613
|
+ $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
614
|
614
|
} else { |
615
|
615
|
$out = $value; |
616
|
616
|
} |
|
@@ -639,12 +639,12 @@ discard block |
|
|
block discarded – undo |
639
|
639
|
public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
640
|
640
|
{ |
641
|
641
|
if ($incbefore) { |
642
|
|
- $text = $incbefore . $text; |
|
642
|
+ $text = $incbefore.$text; |
643
|
643
|
} |
644
|
644
|
if (!$htmltext) { |
645
|
645
|
return $text; |
646
|
646
|
} |
647
|
|
- $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
647
|
+ $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
648
|
648
|
|
649
|
649
|
$tag = 'td'; |
650
|
650
|
if ($notabs == 2) { |
|
@@ -658,11 +658,11 @@ discard block |
|
|
block discarded – undo |
658
|
658
|
|
659
|
659
|
$extrastyle = ''; |
660
|
660
|
if ($direction < 0) { |
661
|
|
- $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
661
|
+ $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
662
|
662
|
$extrastyle = 'padding: 0px; padding-left: 3px;'; |
663
|
663
|
} |
664
|
664
|
if ($direction > 0) { |
665
|
|
- $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
665
|
+ $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
666
|
666
|
$extrastyle = 'padding: 0px; padding-right: 3px;'; |
667
|
667
|
} |
668
|
668
|
|
|
@@ -675,53 +675,53 @@ discard block |
|
|
block discarded – undo |
675
|
675
|
$htmltext = str_replace('"', '"', $htmltext); |
676
|
676
|
} else { |
677
|
677
|
$classfortooltip = 'classfortooltiponclick'; |
678
|
|
- $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
678
|
+ $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
679
|
679
|
} |
680
|
680
|
if ($tooltipon == 2 || $tooltipon == 3) { |
681
|
|
- $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
681
|
+ $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
682
|
682
|
if ($tooltiptrigger == '') { |
683
|
|
- $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
683
|
+ $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
684
|
684
|
} else { |
685
|
|
- $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
685
|
+ $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
686
|
686
|
} |
687
|
687
|
} else { |
688
|
|
- $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
688
|
+ $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
689
|
689
|
} |
690
|
690
|
if ($tooltipon == 1 || $tooltipon == 3) { |
691
|
|
- $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
691
|
+ $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
692
|
692
|
if ($tooltiptrigger == '') { |
693
|
|
- $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
693
|
+ $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
694
|
694
|
} else { |
695
|
|
- $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
695
|
+ $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
696
|
696
|
} |
697
|
697
|
} else { |
698
|
|
- $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
698
|
+ $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
699
|
699
|
} |
700
|
700
|
if (empty($notabs)) { |
701
|
701
|
$s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
702
|
702
|
} elseif ($notabs == 2) { |
703
|
|
- $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
703
|
+ $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
704
|
704
|
} |
705
|
705
|
// Define value if value is before |
706
|
706
|
if ($direction < 0) { |
707
|
|
- $s .= '<' . $tag . $paramfortooltipimg; |
|
707
|
+ $s .= '<'.$tag.$paramfortooltipimg; |
708
|
708
|
if ($tag == 'td') { |
709
|
709
|
$s .= ' class="valigntop" width="14"'; |
710
|
710
|
} |
711
|
|
- $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
711
|
+ $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
712
|
712
|
} |
713
|
713
|
// Use another method to help avoid having a space in value in order to use this value with jquery |
714
|
714
|
// Define label |
715
|
715
|
if ((string) $text != '') { |
716
|
|
- $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
716
|
+ $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
717
|
717
|
} |
718
|
718
|
// Define value if value is after |
719
|
719
|
if ($direction > 0) { |
720
|
|
- $s .= '<' . $tag . $paramfortooltipimg; |
|
720
|
+ $s .= '<'.$tag.$paramfortooltipimg; |
721
|
721
|
if ($tag == 'td') { |
722
|
722
|
$s .= ' class="valignmiddle" width="14"'; |
723
|
723
|
} |
724
|
|
- $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
724
|
+ $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
725
|
725
|
} |
726
|
726
|
if (empty($notabs)) { |
727
|
727
|
$s .= '</tr></table>'; |
|
@@ -828,7 +828,7 @@ discard block |
|
|
block discarded – undo |
828
|
828
|
|
829
|
829
|
$disabled = 0; |
830
|
830
|
$ret = '<div class="centpercent center">'; |
831
|
|
- $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
831
|
+ $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
832
|
832
|
|
833
|
833
|
// 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. |
834
|
834
|
$parameters = array(); |
|
@@ -838,9 +838,9 @@ discard block |
|
|
block discarded – undo |
838
|
838
|
return; |
839
|
839
|
} |
840
|
840
|
if (empty($reshook)) { |
841
|
|
- $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
841
|
+ $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
842
|
842
|
foreach ($arrayofaction as $code => $label) { |
843
|
|
- $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
843
|
+ $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
844
|
844
|
} |
845
|
845
|
} |
846
|
846
|
$ret .= $hookmanager->resPrint; |
|
@@ -848,17 +848,17 @@ discard block |
|
|
block discarded – undo |
848
|
848
|
$ret .= '</select>'; |
849
|
849
|
|
850
|
850
|
if (empty($conf->dol_optimize_smallscreen)) { |
851
|
|
- $ret .= ajax_combobox('.' . $name . 'select'); |
|
851
|
+ $ret .= ajax_combobox('.'.$name.'select'); |
852
|
852
|
} |
853
|
853
|
|
854
|
854
|
// 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 |
855
|
855
|
$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. |
856
|
|
- $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")) . '">'; |
|
856
|
+ $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")).'">'; |
857
|
857
|
$ret .= '</div>'; |
858
|
858
|
|
859
|
859
|
if (!empty($conf->use_javascript_ajax)) { |
860
|
860
|
$ret .= '<!-- JS CODE TO ENABLE mass action select --> |
861
|
|
- <script nonce="' . getNonce() . '"> |
|
861
|
+ <script nonce="' . getNonce().'"> |
862
|
862
|
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 */ |
863
|
863
|
{ |
864
|
864
|
atleastoneselected=0; |
|
@@ -869,11 +869,11 @@ discard block |
|
|
block discarded – undo |
869
|
869
|
|
870
|
870
|
console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
871
|
871
|
|
872
|
|
- if (atleastoneselected || ' . $alwaysvisible . ') |
|
872
|
+ if (atleastoneselected || ' . $alwaysvisible.') |
873
|
873
|
{ |
874
|
874
|
jQuery("."+name).show(); |
875
|
|
- ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
876
|
|
- ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
875
|
+ ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
876
|
+ ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
877
|
877
|
} |
878
|
878
|
else |
879
|
879
|
{ |
|
@@ -883,11 +883,11 @@ discard block |
|
|
block discarded – undo |
883
|
883
|
} |
884
|
884
|
|
885
|
885
|
jQuery(document).ready(function () { |
886
|
|
- initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
887
|
|
- jQuery(".' . $cssclass . '").click(function() { |
888
|
|
- initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
886
|
+ initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
887
|
+ jQuery(".' . $cssclass.'").click(function() { |
|
888
|
+ initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
889
|
889
|
}); |
890
|
|
- jQuery(".' . $name . 'select").change(function() { |
|
890
|
+ jQuery(".' . $name.'select").change(function() { |
891
|
891
|
var massaction = $( this ).val(); |
892
|
892
|
var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
893
|
893
|
if (massaction == "builddoc") |
|
@@ -895,18 +895,18 @@ discard block |
|
|
block discarded – undo |
895
|
895
|
urlform = urlform + "#show_files"; |
896
|
896
|
} |
897
|
897
|
$( this ).closest("form").attr("action", urlform); |
898
|
|
- console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
898
|
+ console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
899
|
899
|
/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
900
|
900
|
if ($(this).val() != \'0\') |
901
|
901
|
{ |
902
|
|
- jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
903
|
|
- jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
904
|
|
- jQuery(".' . $name . '"+massaction).show(); |
|
902
|
+ jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
903
|
+ jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
904
|
+ jQuery(".' . $name.'"+massaction).show(); |
905
|
905
|
} |
906
|
906
|
else |
907
|
907
|
{ |
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 |
|
|
block discarded – undo |
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 |
|
|
block discarded – undo |
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 |
|
|
block discarded – undo |
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 |
|
|
block discarded – undo |
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 .= $labeltoshow; |
1041
|
|
- $out .= '</option>' . "\n"; |
|
1041
|
+ $out .= '</option>'."\n"; |
1042
|
1042
|
} |
1043
|
1043
|
} |
1044
|
1044
|
$out .= '</select>'; |
|
@@ -1047,8 +1047,8 @@ discard block |
|
|
block discarded – undo |
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 |
|
|
block discarded – undo |
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 |
|
|
block discarded – undo |
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']) { |
|
@@ -1127,13 +1127,13 @@ discard block |
|
|
block discarded – undo |
1127
|
1127
|
$out .= '</select>'; |
1128
|
1128
|
|
1129
|
1129
|
if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
1130
|
|
- $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
1130
|
+ $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
1131
|
1131
|
$moreattrib .= ' autocomplete="off"'; |
1132
|
1132
|
} |
1133
|
|
- $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
1133
|
+ $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
1134
|
1134
|
|
1135
|
1135
|
if (!empty($page)) { |
1136
|
|
- $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
1136
|
+ $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
1137
|
1137
|
} |
1138
|
1138
|
} else { |
1139
|
1139
|
dol_print_error($this->db); |
|
@@ -1164,9 +1164,9 @@ discard block |
|
|
block discarded – undo |
1164
|
1164
|
if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
1165
|
1165
|
|| (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
1166
|
1166
|
if (empty($hidetext)) { |
1167
|
|
- print $langs->trans("Type") . ': '; |
|
1167
|
+ print $langs->trans("Type").': '; |
1168
|
1168
|
} |
1169
|
|
- print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
1169
|
+ print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
1170
|
1170
|
if ($showempty) { |
1171
|
1171
|
print '<option value="-1"'; |
1172
|
1172
|
if ($selected == -1) { |
|
@@ -1185,28 +1185,28 @@ discard block |
|
|
block discarded – undo |
1185
|
1185
|
if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
1186
|
1186
|
print ' selected'; |
1187
|
1187
|
} |
1188
|
|
- print '>' . $langs->trans("Product"); |
|
1188
|
+ print '>'.$langs->trans("Product"); |
1189
|
1189
|
|
1190
|
1190
|
print '<option value="1"'; |
1191
|
1191
|
if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
1192
|
1192
|
print ' selected'; |
1193
|
1193
|
} |
1194
|
|
- print '>' . $langs->trans("Service"); |
|
1194
|
+ print '>'.$langs->trans("Service"); |
1195
|
1195
|
|
1196
|
1196
|
print '</select>'; |
1197
|
|
- print ajax_combobox('select_' . $htmlname); |
|
1197
|
+ print ajax_combobox('select_'.$htmlname); |
1198
|
1198
|
//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
1199
|
1199
|
} |
1200
|
1200
|
if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
1201
|
1201
|
print $langs->trans("Service"); |
1202
|
|
- print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
1202
|
+ print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
1203
|
1203
|
} |
1204
|
1204
|
if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
1205
|
1205
|
print $langs->trans("Product"); |
1206
|
|
- print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
1206
|
+ print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
1207
|
1207
|
} |
1208
|
1208
|
if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
1209
|
|
- 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 |
|
1209
|
+ 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 |
1210
|
1210
|
} |
1211
|
1211
|
} |
1212
|
1212
|
|
|
@@ -1232,7 +1232,7 @@ discard block |
|
|
block discarded – undo |
1232
|
1232
|
$langs->load("trips"); |
1233
|
1233
|
|
1234
|
1234
|
$sql = "SELECT c.code, c.label"; |
1235
|
|
- $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
1235
|
+ $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
1236
|
1236
|
$sql .= " WHERE active > 0"; |
1237
|
1237
|
|
1238
|
1238
|
$resql = $this->db->query($sql); |
|
@@ -1273,11 +1273,11 @@ discard block |
|
|
block discarded – undo |
1273
|
1273
|
// phpcs:enable |
1274
|
1274
|
global $user, $langs; |
1275
|
1275
|
|
1276
|
|
- dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
1276
|
+ dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
1277
|
1277
|
|
1278
|
1278
|
$this->load_cache_types_fees(); |
1279
|
1279
|
|
1280
|
|
- print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
1280
|
+ print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
1281
|
1281
|
if ($showempty) { |
1282
|
1282
|
print '<option value="-1"'; |
1283
|
1283
|
if ($selected == -1) { |
|
@@ -1287,7 +1287,7 @@ discard block |
|
|
block discarded – undo |
1287
|
1287
|
} |
1288
|
1288
|
|
1289
|
1289
|
foreach ($this->cache_types_fees as $key => $value) { |
1290
|
|
- print '<option value="' . $key . '"'; |
|
1290
|
+ print '<option value="'.$key.'"'; |
1291
|
1291
|
if ($key == $selected) { |
1292
|
1292
|
print ' selected'; |
1293
|
1293
|
} |
|
@@ -1338,12 +1338,12 @@ discard block |
|
|
block discarded – undo |
1338
|
1338
|
$ajaxoptions = array(); |
1339
|
1339
|
} |
1340
|
1340
|
|
1341
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1341
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
1342
|
1342
|
|
1343
|
1343
|
// No immediate load of all database |
1344
|
1344
|
$placeholder = ''; |
1345
|
1345
|
if ($selected && empty($selected_input_value)) { |
1346
|
|
- require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
1346
|
+ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
1347
|
1347
|
$societetmp = new Societe($this->db); |
1348
|
1348
|
$societetmp->fetch($selected); |
1349
|
1349
|
$selected_input_value = $societetmp->name; |
|
@@ -1351,25 +1351,25 @@ discard block |
|
|
block discarded – undo |
1351
|
1351
|
} |
1352
|
1352
|
|
1353
|
1353
|
// mode 1 |
1354
|
|
- $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)) : ''); |
|
1354
|
+ $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)) : ''); |
1355
|
1355
|
|
1356
|
1356
|
$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
1357
|
1357
|
if (empty($hidelabel)) { |
1358
|
|
- print $langs->trans("RefOrLabel") . ' : '; |
|
1358
|
+ print $langs->trans("RefOrLabel").' : '; |
1359
|
1359
|
} elseif ($hidelabel > 1) { |
1360
|
1360
|
$placeholder = $langs->trans("RefOrLabel"); |
1361
|
1361
|
if ($hidelabel == 2) { |
1362
|
1362
|
$out .= img_picto($langs->trans("Search"), 'search'); |
1363
|
1363
|
} |
1364
|
1364
|
} |
1365
|
|
- $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' : '') . ' />'; |
|
1365
|
+ $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' : '').' />'; |
1366
|
1366
|
if ($hidelabel == 3) { |
1367
|
1367
|
$out .= img_picto($langs->trans("Search"), 'search'); |
1368
|
1368
|
} |
1369
|
1369
|
|
1370
|
1370
|
$out .= ajax_event($htmlname, $events); |
1371
|
1371
|
|
1372
|
|
- $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
1372
|
+ $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
1373
|
1373
|
} else { |
1374
|
1374
|
// Immediate load of all database |
1375
|
1375
|
$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
|
@@ -1454,30 +1454,30 @@ discard block |
|
|
block discarded – undo |
1454
|
1454
|
$sql .= ", s.address, s.zip, s.town"; |
1455
|
1455
|
$sql .= ", dictp.code as country_code"; |
1456
|
1456
|
} |
1457
|
|
- $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
1457
|
+ $sql .= " FROM ".$this->db->prefix()."societe as s"; |
1458
|
1458
|
if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
1459
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
1459
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
1460
|
1460
|
} |
1461
|
1461
|
if (!$user->hasRight('societe', 'client', 'voir')) { |
1462
|
|
- $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
1462
|
+ $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
1463
|
1463
|
} |
1464
|
|
- $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
1464
|
+ $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
1465
|
1465
|
if (!empty($user->socid)) { |
1466
|
|
- $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
1466
|
+ $sql .= " AND s.rowid = ".((int) $user->socid); |
1467
|
1467
|
} |
1468
|
1468
|
if ($filter) { |
1469
|
1469
|
// $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
1470
|
1470
|
// if not, by testSqlAndScriptInject() only. |
1471
|
|
- $sql .= " AND (" . $filter . ")"; |
|
1471
|
+ $sql .= " AND (".$filter.")"; |
1472
|
1472
|
} |
1473
|
1473
|
if (!$user->hasRight('societe', 'client', 'voir')) { |
1474
|
|
- $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
1474
|
+ $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
1475
|
1475
|
} |
1476
|
1476
|
if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
1477
|
1477
|
$sql .= " AND s.status <> 0"; |
1478
|
1478
|
} |
1479
|
1479
|
if (!empty($excludeids)) { |
1480
|
|
- $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
1480
|
+ $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
1481
|
1481
|
} |
1482
|
1482
|
// Add where from hooks |
1483
|
1483
|
$parameters = array(); |
|
@@ -1497,17 +1497,17 @@ discard block |
|
|
block discarded – undo |
1497
|
1497
|
if ($i > 0) { |
1498
|
1498
|
$sql .= " AND "; |
1499
|
1499
|
} |
1500
|
|
- $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
1500
|
+ $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
1501
|
1501
|
$i++; |
1502
|
1502
|
} |
1503
|
1503
|
if (count($search_crit) > 1) { |
1504
|
1504
|
$sql .= ")"; |
1505
|
1505
|
} |
1506
|
1506
|
if (isModEnabled('barcode')) { |
1507
|
|
- $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1507
|
+ $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
1508
|
1508
|
} |
1509
|
|
- $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
1510
|
|
- $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
1509
|
+ $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
1510
|
+ $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
1511
|
1511
|
$sql .= ")"; |
1512
|
1512
|
} |
1513
|
1513
|
$sql .= $this->db->order("nom", "ASC"); |
|
@@ -1518,7 +1518,7 @@ discard block |
|
|
block discarded – undo |
1518
|
1518
|
$resql = $this->db->query($sql); |
1519
|
1519
|
if ($resql) { |
1520
|
1520
|
// Construct $out and $outarray |
1521
|
|
- $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
1521
|
+ $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
1522
|
1522
|
|
1523
|
1523
|
$textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
1524
|
1524
|
if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
|
@@ -1531,7 +1531,7 @@ discard block |
|
|
block discarded – undo |
1531
|
1531
|
} |
1532
|
1532
|
} |
1533
|
1533
|
if ($showempty) { |
1534
|
|
- $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
1534
|
+ $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
1535
|
1535
|
} |
1536
|
1536
|
|
1537
|
1537
|
$companytemp = new Societe($this->db); |
|
@@ -1544,18 +1544,18 @@ discard block |
|
|
block discarded – undo |
1544
|
1544
|
$label = ''; |
1545
|
1545
|
if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
1546
|
1546
|
if (($obj->client) && (!empty($obj->code_client))) { |
1547
|
|
- $label = $obj->code_client . ' - '; |
|
1547
|
+ $label = $obj->code_client.' - '; |
1548
|
1548
|
} |
1549
|
1549
|
if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
1550
|
|
- $label .= $obj->code_fournisseur . ' - '; |
|
1550
|
+ $label .= $obj->code_fournisseur.' - '; |
1551
|
1551
|
} |
1552
|
|
- $label .= ' ' . $obj->name; |
|
1552
|
+ $label .= ' '.$obj->name; |
1553
|
1553
|
} else { |
1554
|
1554
|
$label = $obj->name; |
1555
|
1555
|
} |
1556
|
1556
|
|
1557
|
1557
|
if (!empty($obj->name_alias)) { |
1558
|
|
- $label .= ' (' . $obj->name_alias . ')'; |
|
1558
|
+ $label .= ' ('.$obj->name_alias.')'; |
1559
|
1559
|
} |
1560
|
1560
|
|
1561
|
1561
|
if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
|
@@ -1570,7 +1570,7 @@ discard block |
|
|
block discarded – undo |
1570
|
1570
|
$companytemp->fournisseur = $obj->fournisseur; |
1571
|
1571
|
$tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
1572
|
1572
|
if ($tmptype) { |
1573
|
|
- $labelhtml .= ' ' . $tmptype; |
|
1573
|
+ $labelhtml .= ' '.$tmptype; |
1574
|
1574
|
} |
1575
|
1575
|
|
1576
|
1576
|
if ($obj->client || $obj->fournisseur) { |
|
@@ -1580,10 +1580,10 @@ discard block |
|
|
block discarded – undo |
1580
|
1580
|
$label .= $langs->trans("Customer"); |
1581
|
1581
|
} |
1582
|
1582
|
if ($obj->client == 2 || $obj->client == 3) { |
1583
|
|
- $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
1583
|
+ $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
1584
|
1584
|
} |
1585
|
1585
|
if ($obj->fournisseur) { |
1586
|
|
- $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
1586
|
+ $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
1587
|
1587
|
} |
1588
|
1588
|
if ($obj->client || $obj->fournisseur) { |
1589
|
1589
|
$label .= ')'; |
|
@@ -1591,9 +1591,9 @@ discard block |
|
|
block discarded – undo |
1591
|
1591
|
} |
1592
|
1592
|
|
1593
|
1593
|
if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
1594
|
|
- $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
1594
|
+ $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
1595
|
1595
|
if (!empty($obj->country_code)) { |
1596
|
|
- $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
1596
|
+ $s .= ', '.$langs->trans('Country'.$obj->country_code); |
1597
|
1597
|
} |
1598
|
1598
|
$label .= $s; |
1599
|
1599
|
$labelhtml .= $s; |
|
@@ -1601,9 +1601,9 @@ discard block |
|
|
block discarded – undo |
1601
|
1601
|
|
1602
|
1602
|
if (empty($outputmode)) { |
1603
|
1603
|
if (in_array($obj->rowid, $selected)) { |
1604
|
|
- $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>'; |
|
1604
|
+ $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>'; |
1605
|
1605
|
} else { |
1606
|
|
- $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
1606
|
+ $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
1607
|
1607
|
} |
1608
|
1608
|
} else { |
1609
|
1609
|
array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
|
@@ -1615,9 +1615,9 @@ discard block |
|
|
block discarded – undo |
1615
|
1615
|
} |
1616
|
1616
|
} |
1617
|
1617
|
} |
1618
|
|
- $out .= '</select>' . "\n"; |
|
1618
|
+ $out .= '</select>'."\n"; |
1619
|
1619
|
if (!$forcecombo) { |
1620
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1620
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
1621
|
1621
|
$out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
1622
|
1622
|
} |
1623
|
1623
|
} else { |
|
@@ -1653,18 +1653,18 @@ discard block |
|
|
block discarded – undo |
1653
|
1653
|
// On recherche les remises |
1654
|
1654
|
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
1655
|
1655
|
$sql .= " re.description, re.fk_facture_source"; |
1656
|
|
- $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
1657
|
|
- $sql .= " WHERE re.fk_soc = " . (int) $socid; |
1658
|
|
- $sql .= " AND re.entity = " . $conf->entity; |
|
1656
|
+ $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
1657
|
+ $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
1658
|
+ $sql .= " AND re.entity = ".$conf->entity; |
1659
|
1659
|
if ($filter) { |
1660
|
|
- $sql .= " AND " . $filter; |
|
1660
|
+ $sql .= " AND ".$filter; |
1661
|
1661
|
} |
1662
|
1662
|
$sql .= " ORDER BY re.description ASC"; |
1663
|
1663
|
|
1664
|
|
- dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
1664
|
+ dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
1665
|
1665
|
$resql = $this->db->query($sql); |
1666
|
1666
|
if ($resql) { |
1667
|
|
- print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
1667
|
+ print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
1668
|
1668
|
$num = $this->db->num_rows($resql); |
1669
|
1669
|
|
1670
|
1670
|
$qualifiedlines = $num; |
|
@@ -1702,16 +1702,16 @@ discard block |
|
|
block discarded – undo |
1702
|
1702
|
if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
1703
|
1703
|
$tmpfac = new Facture($this->db); |
1704
|
1704
|
if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
1705
|
|
- $desc = $desc . ' - ' . $tmpfac->ref; |
|
1705
|
+ $desc = $desc.' - '.$tmpfac->ref; |
1706
|
1706
|
} |
1707
|
1707
|
} |
1708
|
1708
|
|
1709
|
|
- print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
1709
|
+ print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
1710
|
1710
|
$i++; |
1711
|
1711
|
} |
1712
|
1712
|
} |
1713
|
1713
|
print '</select>'; |
1714
|
|
- print ajax_combobox('select_' . $htmlname); |
|
1714
|
+ print ajax_combobox('select_'.$htmlname); |
1715
|
1715
|
|
1716
|
1716
|
return $qualifiedlines; |
1717
|
1717
|
} else { |
|
@@ -1792,7 +1792,7 @@ discard block |
|
|
block discarded – undo |
1792
|
1792
|
$out = ''; |
1793
|
1793
|
|
1794
|
1794
|
if (!is_object($hookmanager)) { |
1795
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
1795
|
+ include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
1796
|
1796
|
$hookmanager = new HookManager($this->db); |
1797
|
1797
|
} |
1798
|
1798
|
|
|
@@ -1801,13 +1801,13 @@ discard block |
|
|
block discarded – undo |
1801
|
1801
|
if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
1802
|
1802
|
$sql .= ", s.nom as company, s.town AS company_town"; |
1803
|
1803
|
} |
1804
|
|
- $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
1804
|
+ $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
1805
|
1805
|
if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
1806
|
|
- $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
1806
|
+ $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
1807
|
1807
|
} |
1808
|
|
- $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
1808
|
+ $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
1809
|
1809
|
if ($socid > 0 || $socid == -1) { |
1810
|
|
- $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
1810
|
+ $sql .= " AND sp.fk_soc = ".((int) $socid); |
1811
|
1811
|
} |
1812
|
1812
|
if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
1813
|
1813
|
$sql .= " AND sp.statut <> 0"; |
|
@@ -1818,30 +1818,30 @@ discard block |
|
|
block discarded – undo |
1818
|
1818
|
$sql .= $hookmanager->resPrint; |
1819
|
1819
|
$sql .= " ORDER BY sp.lastname ASC"; |
1820
|
1820
|
|
1821
|
|
- dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
1821
|
+ dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
1822
|
1822
|
$resql = $this->db->query($sql); |
1823
|
1823
|
if ($resql) { |
1824
|
1824
|
$num = $this->db->num_rows($resql); |
1825
|
1825
|
|
1826
|
1826
|
if ($htmlname != 'none' && !$options_only) { |
1827
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
1827
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
1828
|
1828
|
} |
1829
|
1829
|
|
1830
|
1830
|
if ($showempty && !is_numeric($showempty)) { |
1831
|
1831
|
$textforempty = $showempty; |
1832
|
|
- $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
1832
|
+ $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
1833
|
1833
|
} else { |
1834
|
1834
|
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
1835
|
|
- $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
1835
|
+ $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
1836
|
1836
|
} |
1837
|
1837
|
if ($showempty == 2) { |
1838
|
|
- $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
1838
|
+ $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
1839
|
1839
|
} |
1840
|
1840
|
} |
1841
|
1841
|
|
1842
|
1842
|
$i = 0; |
1843
|
1843
|
if ($num) { |
1844
|
|
- include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
1844
|
+ include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
1845
|
1845
|
$contactstatic = new Contact($this->db); |
1846
|
1846
|
|
1847
|
1847
|
while ($i < $num) { |
|
@@ -1877,7 +1877,7 @@ discard block |
|
|
block discarded – undo |
1877
|
1877
|
} |
1878
|
1878
|
$extendedInfos = implode(' - ', $extendedInfos); |
1879
|
1879
|
if (!empty($extendedInfos)) { |
1880
|
|
- $extendedInfos = ' - ' . $extendedInfos; |
|
1880
|
+ $extendedInfos = ' - '.$extendedInfos; |
1881
|
1881
|
} |
1882
|
1882
|
} |
1883
|
1883
|
|
|
@@ -1894,42 +1894,42 @@ discard block |
|
|
block discarded – undo |
1894
|
1894
|
$disabled = 1; |
1895
|
1895
|
} |
1896
|
1896
|
if (!empty($selected) && in_array($obj->rowid, $selected)) { |
1897
|
|
- $out .= '<option value="' . $obj->rowid . '"'; |
|
1897
|
+ $out .= '<option value="'.$obj->rowid.'"'; |
1898
|
1898
|
if ($disabled) { |
1899
|
1899
|
$out .= ' disabled'; |
1900
|
1900
|
} |
1901
|
1901
|
$out .= ' selected>'; |
1902
|
|
- $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1902
|
+ $out .= $contactstatic->getFullName($langs).$extendedInfos; |
1903
|
1903
|
if ($showfunction && $obj->poste) { |
1904
|
|
- $out .= ' (' . $obj->poste . ')'; |
|
1904
|
+ $out .= ' ('.$obj->poste.')'; |
1905
|
1905
|
} |
1906
|
1906
|
if (($showsoc > 0) && $obj->company) { |
1907
|
|
- $out .= ' - (' . $obj->company . ')'; |
|
1907
|
+ $out .= ' - ('.$obj->company.')'; |
1908
|
1908
|
} |
1909
|
1909
|
$out .= '</option>'; |
1910
|
1910
|
} else { |
1911
|
|
- $out .= '<option value="' . $obj->rowid . '"'; |
|
1911
|
+ $out .= '<option value="'.$obj->rowid.'"'; |
1912
|
1912
|
if ($disabled) { |
1913
|
1913
|
$out .= ' disabled'; |
1914
|
1914
|
} |
1915
|
1915
|
$out .= '>'; |
1916
|
|
- $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1916
|
+ $out .= $contactstatic->getFullName($langs).$extendedInfos; |
1917
|
1917
|
if ($showfunction && $obj->poste) { |
1918
|
|
- $out .= ' (' . $obj->poste . ')'; |
|
1918
|
+ $out .= ' ('.$obj->poste.')'; |
1919
|
1919
|
} |
1920
|
1920
|
if (($showsoc > 0) && $obj->company) { |
1921
|
|
- $out .= ' - (' . $obj->company . ')'; |
|
1921
|
+ $out .= ' - ('.$obj->company.')'; |
1922
|
1922
|
} |
1923
|
1923
|
$out .= '</option>'; |
1924
|
1924
|
} |
1925
|
1925
|
} else { |
1926
|
1926
|
if (in_array($obj->rowid, $selected)) { |
1927
|
|
- $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
1927
|
+ $out .= $contactstatic->getFullName($langs).$extendedInfos; |
1928
|
1928
|
if ($showfunction && $obj->poste) { |
1929
|
|
- $out .= ' (' . $obj->poste . ')'; |
|
1929
|
+ $out .= ' ('.$obj->poste.')'; |
1930
|
1930
|
} |
1931
|
1931
|
if (($showsoc > 0) && $obj->company) { |
1932
|
|
- $out .= ' - (' . $obj->company . ')'; |
|
1932
|
+ $out .= ' - ('.$obj->company.')'; |
1933
|
1933
|
} |
1934
|
1934
|
} |
1935
|
1935
|
} |
|
@@ -1938,7 +1938,7 @@ discard block |
|
|
block discarded – undo |
1938
|
1938
|
} |
1939
|
1939
|
} else { |
1940
|
1940
|
$labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
1941
|
|
- $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
1941
|
+ $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
1942
|
1942
|
$out .= $labeltoshow; |
1943
|
1943
|
$out .= '</option>'; |
1944
|
1944
|
} |
|
@@ -1959,7 +1959,7 @@ discard block |
|
|
block discarded – undo |
1959
|
1959
|
} |
1960
|
1960
|
|
1961
|
1961
|
if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
1962
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
1962
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
1963
|
1963
|
$out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
1964
|
1964
|
} |
1965
|
1965
|
|
|
@@ -2068,14 +2068,14 @@ discard block |
|
|
block discarded – undo |
2068
|
2068
|
if ($showlabelofentity) { |
2069
|
2069
|
$sql .= ", e.label"; |
2070
|
2070
|
} |
2071
|
|
- $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
2071
|
+ $sql .= " FROM ".$this->db->prefix()."user as u"; |
2072
|
2072
|
if ($showlabelofentity) { |
2073
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
2073
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
2074
|
2074
|
} |
2075
|
2075
|
// Condition here should be the same than into societe->getSalesRepresentatives(). |
2076
|
2076
|
if ($userissuperadminentityone && $force_entity != 'default') { |
2077
|
2077
|
if (!empty($force_entity)) { |
2078
|
|
- $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
2078
|
+ $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
2079
|
2079
|
} else { |
2080
|
2080
|
$sql .= " WHERE u.entity IS NOT NULL"; |
2081
|
2081
|
} |
|
@@ -2083,18 +2083,18 @@ discard block |
|
|
block discarded – undo |
2083
|
2083
|
if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
2084
|
2084
|
$sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
2085
|
2085
|
} else { |
2086
|
|
- $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
2086
|
+ $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
2087
|
2087
|
} |
2088
|
2088
|
} |
2089
|
2089
|
|
2090
|
2090
|
if (!empty($user->socid)) { |
2091
|
|
- $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
2091
|
+ $sql .= " AND u.fk_soc = ".((int) $user->socid); |
2092
|
2092
|
} |
2093
|
2093
|
if (is_array($exclude) && $excludeUsers) { |
2094
|
|
- $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
2094
|
+ $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
2095
|
2095
|
} |
2096
|
2096
|
if ($includeUsers) { |
2097
|
|
- $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
2097
|
+ $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
2098
|
2098
|
} |
2099
|
2099
|
if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
2100
|
2100
|
$sql .= " AND u.statut <> 0"; |
|
@@ -2106,7 +2106,7 @@ discard block |
|
|
block discarded – undo |
2106
|
2106
|
$sql .= " AND u.fk_soc IS NULL"; |
2107
|
2107
|
} |
2108
|
2108
|
if (!empty($morefilter)) { |
2109
|
|
- $sql .= " " . $morefilter; |
|
2109
|
+ $sql .= " ".$morefilter; |
2110
|
2110
|
} |
2111
|
2111
|
|
2112
|
2112
|
//Add hook to filter on user (for example on usergroup define in custom modules) |
|
@@ -2121,7 +2121,7 @@ discard block |
|
|
block discarded – undo |
2121
|
2121
|
$sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
2122
|
2122
|
} |
2123
|
2123
|
|
2124
|
|
- dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
2124
|
+ dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
2125
|
2125
|
|
2126
|
2126
|
$resql = $this->db->query($sql); |
2127
|
2127
|
if ($resql) { |
|
@@ -2129,7 +2129,7 @@ discard block |
|
|
block discarded – undo |
2129
|
2129
|
$i = 0; |
2130
|
2130
|
if ($num) { |
2131
|
2131
|
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
2132
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
2132
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
2133
|
2133
|
if ($show_empty && !$multiple) { |
2134
|
2134
|
$textforempty = ' '; |
2135
|
2135
|
if (!empty($conf->use_javascript_ajax)) { |
|
@@ -2138,10 +2138,10 @@ discard block |
|
|
block discarded – undo |
2138
|
2138
|
if (!is_numeric($show_empty)) { |
2139
|
2139
|
$textforempty = $show_empty; |
2140
|
2140
|
} |
2141
|
|
- $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
2141
|
+ $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
2142
|
2142
|
} |
2143
|
2143
|
if ($show_every) { |
2144
|
|
- $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
2144
|
+ $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
2145
|
2145
|
} |
2146
|
2146
|
|
2147
|
2147
|
$userstatic = new User($this->db); |
|
@@ -2188,21 +2188,21 @@ discard block |
|
|
block discarded – undo |
2188
|
2188
|
} |
2189
|
2189
|
if ($showstatus >= 0) { |
2190
|
2190
|
if ($obj->status == 1 && $showstatus == 1) { |
2191
|
|
- $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
2192
|
|
- $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
2191
|
+ $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
2192
|
+ $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
2193
|
2193
|
} |
2194
|
2194
|
if ($obj->status == 0 && $showstatus == 1) { |
2195
|
|
- $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
2196
|
|
- $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
2195
|
+ $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
2196
|
+ $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
2197
|
2197
|
} |
2198
|
2198
|
} |
2199
|
2199
|
if ($showlabelofentity) { |
2200
|
2200
|
if (empty($obj->entity)) { |
2201
|
|
- $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
2202
|
|
- $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
2201
|
+ $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
2202
|
+ $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
2203
|
2203
|
} else { |
2204
|
2204
|
if ($obj->entity != $conf->entity) { |
2205
|
|
- $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
2205
|
+ $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
2206
|
2206
|
$moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
2207
|
2207
|
} |
2208
|
2208
|
} |
|
@@ -2211,13 +2211,13 @@ discard block |
|
|
block discarded – undo |
2211
|
2211
|
$moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
2212
|
2212
|
if (!empty($disableline) && $disableline != '1') { |
2213
|
2213
|
// Add text from $enableonlytext parameter |
2214
|
|
- $moreinfo .= ' - ' . $disableline; |
2215
|
|
- $moreinfohtml .= ' - ' . $disableline; |
|
2214
|
+ $moreinfo .= ' - '.$disableline; |
|
2215
|
+ $moreinfohtml .= ' - '.$disableline; |
2216
|
2216
|
} |
2217
|
2217
|
$labeltoshow .= $moreinfo; |
2218
|
2218
|
$labeltoshowhtml .= $moreinfohtml; |
2219
|
2219
|
|
2220
|
|
- $out .= '<option value="' . $obj->rowid . '"'; |
|
2220
|
+ $out .= '<option value="'.$obj->rowid.'"'; |
2221
|
2221
|
if (!empty($disableline)) { |
2222
|
2222
|
$out .= ' disabled'; |
2223
|
2223
|
} |
|
@@ -2225,7 +2225,7 @@ discard block |
|
|
block discarded – undo |
2225
|
2225
|
$out .= ' selected'; |
2226
|
2226
|
} |
2227
|
2227
|
$out .= ' data-html="'; |
2228
|
|
- $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
2228
|
+ $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
2229
|
2229
|
if ($showstatus >= 0 && $obj->status == 0) { |
2230
|
2230
|
$outhtml .= '<strike class="opacitymediumxxx">'; |
2231
|
2231
|
} |
|
@@ -2238,7 +2238,7 @@ discard block |
|
|
block discarded – undo |
2238
|
2238
|
$out .= $labeltoshow; |
2239
|
2239
|
$out .= '</option>'; |
2240
|
2240
|
|
2241
|
|
- $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
2241
|
+ $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
2242
|
2242
|
$outarray2[$userstatic->id] = array( |
2243
|
2243
|
'id' => $userstatic->id, |
2244
|
2244
|
'label' => $labeltoshow, |
|
@@ -2250,14 +2250,14 @@ discard block |
|
|
block discarded – undo |
2250
|
2250
|
$i++; |
2251
|
2251
|
} |
2252
|
2252
|
} else { |
2253
|
|
- $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
2254
|
|
- $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
2253
|
+ $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
2254
|
+ $out .= '<option value="">'.$langs->trans("None").'</option>'; |
2255
|
2255
|
} |
2256
|
2256
|
$out .= '</select>'; |
2257
|
2257
|
|
2258
|
2258
|
if ($num && !$forcecombo) { |
2259
|
2259
|
// Enhance with select2 |
2260
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2260
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
2261
|
2261
|
$out .= ajax_combobox($htmlname); |
2262
|
2262
|
} |
2263
|
2263
|
} else { |
|
@@ -2331,16 +2331,16 @@ discard block |
|
|
block discarded – undo |
2331
|
2331
|
$out .= $userstatic->getNomUrl(-1); |
2332
|
2332
|
if ($i == 0) { |
2333
|
2333
|
$ownerid = $value['id']; |
2334
|
|
- $out .= ' (' . $langs->trans("Owner") . ')'; |
|
2334
|
+ $out .= ' ('.$langs->trans("Owner").')'; |
2335
|
2335
|
} |
2336
|
2336
|
if ($nbassignetouser > 1 && $action != 'view') { |
2337
|
|
- $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 . '">'; |
|
2337
|
+ $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.'">'; |
2338
|
2338
|
} |
2339
|
2339
|
// Show my availability |
2340
|
2340
|
if ($showproperties) { |
2341
|
2341
|
if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
2342
|
2342
|
$out .= '<div class="myavailability inline-block">'; |
2343
|
|
- $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>'; |
|
2343
|
+ $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>'; |
2344
|
2344
|
$out .= '</div>'; |
2345
|
2345
|
} |
2346
|
2346
|
} |
|
@@ -2357,15 +2357,15 @@ discard block |
|
|
block discarded – undo |
2357
|
2357
|
// Method with no ajax |
2358
|
2358
|
if ($action != 'view') { |
2359
|
2359
|
$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
2360
|
|
- $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2360
|
+ $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
2361
|
2361
|
$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
2362
|
2362
|
$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
2363
|
|
- $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
2364
|
|
- $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
2363
|
+ $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
2364
|
+ $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
2365
|
2365
|
$out .= '});'; |
2366
|
2366
|
$out .= '})</script>'; |
2367
|
2367
|
$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2368
|
|
- $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2368
|
+ $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
2369
|
2369
|
$out .= '<br>'; |
2370
|
2370
|
} |
2371
|
2371
|
|
|
@@ -2424,13 +2424,13 @@ discard block |
|
|
block discarded – undo |
2424
|
2424
|
$resourcestatic->fetch($value['id']); |
2425
|
2425
|
$out .= $resourcestatic->getNomUrl(-1); |
2426
|
2426
|
if ($nbassignetoresource > 1 && $action != 'view') { |
2427
|
|
- $out .= ' <input type="image" style="border: 0px;" src="' . img_picto($langs->trans("Remove"), 'delete', '', 0, 1) . '" value="' . $resourcestatic->id . '" class="removedassigned reposition" id="removedassignedresource_' . $resourcestatic->id . '" name="removedassignedresource_' . $resourcestatic->id . '">'; |
|
2427
|
+ $out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$resourcestatic->id.'" class="removedassigned reposition" id="removedassignedresource_'.$resourcestatic->id.'" name="removedassignedresource_'.$resourcestatic->id.'">'; |
2428
|
2428
|
} |
2429
|
2429
|
// Show my availability |
2430
|
2430
|
if ($showproperties) { |
2431
|
2431
|
if (is_array($listofresourceid) && count($listofresourceid)) { |
2432
|
2432
|
$out .= '<div class="myavailability inline-block">'; |
2433
|
|
- $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>'; |
|
2433
|
+ $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>'; |
2434
|
2434
|
$out .= '</div>'; |
2435
|
2435
|
} |
2436
|
2436
|
} |
|
@@ -2447,11 +2447,11 @@ discard block |
|
|
block discarded – undo |
2447
|
2447
|
// Method with no ajax |
2448
|
2448
|
if ($action != 'view') { |
2449
|
2449
|
$out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
2450
|
|
- $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
2450
|
+ $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
2451
|
2451
|
$out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
2452
|
2452
|
$out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
2453
|
|
- $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
2454
|
|
- $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
2453
|
+ $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
2454
|
+ $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
2455
|
2455
|
$out .= '});'; |
2456
|
2456
|
$out .= '})</script>'; |
2457
|
2457
|
|
|
@@ -2459,7 +2459,7 @@ discard block |
|
|
block discarded – undo |
2459
|
2459
|
$out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
2460
|
2460
|
$out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, array(), 2, 0); |
2461
|
2461
|
//$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
2462
|
|
- $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
2462
|
+ $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
2463
|
2463
|
$out .= '<br>'; |
2464
|
2464
|
} |
2465
|
2465
|
|
|
@@ -2520,7 +2520,7 @@ discard block |
|
|
block discarded – undo |
2520
|
2520
|
$placeholder = ''; |
2521
|
2521
|
|
2522
|
2522
|
if ($selected && empty($selected_input_value)) { |
2523
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2523
|
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
2524
|
2524
|
$producttmpselect = new Product($this->db); |
2525
|
2525
|
$producttmpselect->fetch($selected); |
2526
|
2526
|
$selected_input_value = $producttmpselect->ref; |
|
@@ -2535,17 +2535,17 @@ discard block |
|
|
block discarded – undo |
2535
|
2535
|
} |
2536
|
2536
|
} |
2537
|
2537
|
// mode=1 means customers products |
2538
|
|
- $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; |
2539
|
|
- $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
2538
|
+ $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; |
|
2539
|
+ $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
2540
|
2540
|
|
2541
|
2541
|
if (isModEnabled('variants') && is_array($selected_combinations)) { |
2542
|
2542
|
// Code to automatically insert with javascript the select of attributes under the select of product |
2543
|
2543
|
// when a parent of variant has been selected. |
2544
|
2544
|
$out .= ' |
2545
|
2545
|
<!-- script to auto show attributes select tags if a variant was selected --> |
2546
|
|
- <script nonce="' . getNonce() . '"> |
|
2546
|
+ <script nonce="' . getNonce().'"> |
2547
|
2547
|
// auto show attributes fields |
2548
|
|
- selected = ' . json_encode($selected_combinations) . '; |
|
2548
|
+ selected = ' . json_encode($selected_combinations).'; |
2549
|
2549
|
combvalues = {}; |
2550
|
2550
|
|
2551
|
2551
|
jQuery(document).ready(function () { |
|
@@ -2556,7 +2556,7 @@ discard block |
|
|
block discarded – undo |
2556
|
2556
|
} |
2557
|
2557
|
}); |
2558
|
2558
|
|
2559
|
|
- jQuery("input#' . $htmlname . '").change(function () { |
|
2559
|
+ jQuery("input#' . $htmlname.'").change(function () { |
2560
|
2560
|
|
2561
|
2561
|
if (!jQuery(this).val()) { |
2562
|
2562
|
jQuery(\'div#attributes_box\').empty(); |
|
@@ -2565,7 +2565,7 @@ discard block |
|
|
block discarded – undo |
2565
|
2565
|
|
2566
|
2566
|
console.log("A change has started. We get variants fields to inject html select"); |
2567
|
2567
|
|
2568
|
|
- jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
2568
|
+ jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
2569
|
2569
|
id: jQuery(this).val() |
2570
|
2570
|
}, function (data) { |
2571
|
2571
|
jQuery(\'div#attributes_box\').empty(); |
|
@@ -2608,21 +2608,21 @@ discard block |
|
|
block discarded – undo |
2608
|
2608
|
}) |
2609
|
2609
|
}); |
2610
|
2610
|
|
2611
|
|
- ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
2611
|
+ ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
2612
|
2612
|
}); |
2613
|
2613
|
</script> |
2614
|
2614
|
'; |
2615
|
2615
|
} |
2616
|
2616
|
|
2617
|
2617
|
if (empty($hidelabel)) { |
2618
|
|
- $out .= $langs->trans("RefOrLabel") . ' : '; |
|
2618
|
+ $out .= $langs->trans("RefOrLabel").' : '; |
2619
|
2619
|
} elseif ($hidelabel > 1) { |
2620
|
|
- $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
2620
|
+ $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
2621
|
2621
|
if ($hidelabel == 2) { |
2622
|
2622
|
$out .= img_picto($langs->trans("Search"), 'search'); |
2623
|
2623
|
} |
2624
|
2624
|
} |
2625
|
|
- $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
2625
|
+ $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
2626
|
2626
|
if ($hidelabel == 3) { |
2627
|
2627
|
$out .= img_picto($langs->trans("Search"), 'search'); |
2628
|
2628
|
} |
|
@@ -2659,33 +2659,33 @@ discard block |
|
|
block discarded – undo |
2659
|
2659
|
// phpcs:enable |
2660
|
2660
|
global $conf, $user, $langs, $db; |
2661
|
2661
|
|
2662
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
2662
|
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
2663
|
2663
|
|
2664
|
2664
|
$error = 0; |
2665
|
2665
|
$out = ''; |
2666
|
2666
|
|
2667
|
2667
|
if (!$forcecombo) { |
2668
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2668
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
2669
|
2669
|
$events = array(); |
2670
|
2670
|
$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2671
|
2671
|
} |
2672
|
2672
|
|
2673
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2673
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
2674
|
2674
|
|
2675
|
2675
|
$sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
2676
|
|
- $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
2677
|
|
- $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
2676
|
+ $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
2677
|
+ $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
2678
|
2678
|
if (!empty($status)) { |
2679
|
|
- $sql .= ' AND status = ' . (int) $status; |
|
2679
|
+ $sql .= ' AND status = '.(int) $status; |
2680
|
2680
|
} |
2681
|
2681
|
if (!empty($type)) { |
2682
|
|
- $sql .= ' AND bomtype = ' . (int) $type; |
|
2682
|
+ $sql .= ' AND bomtype = '.(int) $type; |
2683
|
2683
|
} |
2684
|
2684
|
if (!empty($TProducts)) { |
2685
|
|
- $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
2685
|
+ $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
2686
|
2686
|
} |
2687
|
2687
|
if (!empty($limit)) { |
2688
|
|
- $sql .= ' LIMIT ' . (int) $limit; |
|
2688
|
+ $sql .= ' LIMIT '.(int) $limit; |
2689
|
2689
|
} |
2690
|
2690
|
$resql = $db->query($sql); |
2691
|
2691
|
if ($resql) { |
|
@@ -2699,11 +2699,11 @@ discard block |
|
|
block discarded – undo |
2699
|
2699
|
while ($obj = $db->fetch_object($resql)) { |
2700
|
2700
|
$product = new Product($db); |
2701
|
2701
|
$res = $product->fetch($obj->fk_product); |
2702
|
|
- $out .= '<option value="' . $obj->rowid . '"'; |
|
2702
|
+ $out .= '<option value="'.$obj->rowid.'"'; |
2703
|
2703
|
if ($obj->rowid == $selected) { |
2704
|
2704
|
$out .= 'selected'; |
2705
|
2705
|
} |
2706
|
|
- $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
2706
|
+ $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
2707
|
2707
|
} |
2708
|
2708
|
} else { |
2709
|
2709
|
$error++; |
|
@@ -2760,7 +2760,7 @@ discard block |
|
|
block discarded – undo |
2760
|
2760
|
|
2761
|
2761
|
$warehouseStatusArray = array(); |
2762
|
2762
|
if (!empty($warehouseStatus)) { |
2763
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
2763
|
+ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
2764
|
2764
|
if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
2765
|
2765
|
$warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
2766
|
2766
|
} |
|
@@ -2774,9 +2774,9 @@ discard block |
|
|
block discarded – undo |
2774
|
2774
|
|
2775
|
2775
|
$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"; |
2776
|
2776
|
if (count($warehouseStatusArray)) { |
2777
|
|
- $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 |
|
2777
|
+ $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 |
2778
|
2778
|
} else { |
2779
|
|
- $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
2779
|
+ $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
2780
|
2780
|
} |
2781
|
2781
|
|
2782
|
2782
|
$sql = "SELECT "; |
|
@@ -2792,9 +2792,9 @@ discard block |
|
|
block discarded – undo |
2792
|
2792
|
|
2793
|
2793
|
if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
2794
|
2794
|
//Product category |
2795
|
|
- $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
2796
|
|
- FROM " . $this->db->prefix() . "categorie_product |
2797
|
|
- WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
2795
|
+ $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
2796
|
+ FROM " . $this->db->prefix()."categorie_product |
|
2797
|
+ WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
2798
|
2798
|
LIMIT 1 |
2799
|
2799
|
) AS categorie_product_id "; |
2800
|
2800
|
} |
|
@@ -2820,15 +2820,15 @@ discard block |
|
|
block discarded – undo |
2820
|
2820
|
} |
2821
|
2821
|
// Price by quantity |
2822
|
2822
|
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
2823
|
|
- $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
2823
|
+ $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
2824
|
2824
|
if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
2825
|
|
- $sql .= " AND price_level = " . ((int) $price_level); |
|
2825
|
+ $sql .= " AND price_level = ".((int) $price_level); |
2826
|
2826
|
} |
2827
|
2827
|
$sql .= " ORDER BY date_price"; |
2828
|
2828
|
$sql .= " DESC LIMIT 1) as price_rowid"; |
2829
|
|
- $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 |
|
2829
|
+ $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 |
2830
|
2830
|
if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
2831
|
|
- $sql .= " AND price_level = " . ((int) $price_level); |
|
2831
|
+ $sql .= " AND price_level = ".((int) $price_level); |
2832
|
2832
|
} |
2833
|
2833
|
$sql .= " ORDER BY date_price"; |
2834
|
2834
|
$sql .= " DESC LIMIT 1) as price_by_qty"; |
|
@@ -2837,58 +2837,58 @@ discard block |
|
|
block discarded – undo |
2837
|
2837
|
|
2838
|
2838
|
$sql .= " FROM ".$this->db->prefix()."product as p"; |
2839
|
2839
|
// Add from (left join) from hooks |
2840
|
|
- $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2840
|
+ $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
2841
|
2841
|
$reshook = $hookmanager->executeHooks('selectProductsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
2842
|
2842
|
$sql .= $hookmanager->resPrint; |
2843
|
2843
|
|
2844
|
2844
|
if (count($warehouseStatusArray)) { |
2845
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
2846
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
2847
|
|
- $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. |
|
2845
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
2846
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
2847
|
+ $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. |
2848
|
2848
|
} |
2849
|
2849
|
|
2850
|
2850
|
// include search in supplier ref |
2851
|
2851
|
if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
2852
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
2852
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
2853
|
2853
|
} |
2854
|
2854
|
|
2855
|
2855
|
//Price by customer |
2856
|
2856
|
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
2857
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
2857
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
2858
|
2858
|
} |
2859
|
2859
|
// Units |
2860
|
2860
|
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
2861
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
2861
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
2862
|
2862
|
} |
2863
|
2863
|
// Multilang : we add translation |
2864
|
2864
|
if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2865
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
2865
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
2866
|
2866
|
if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
2867
|
|
- require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
2867
|
+ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
2868
|
2868
|
$soc = new Societe($this->db); |
2869
|
2869
|
$result = $soc->fetch($socid); |
2870
|
2870
|
if ($result > 0 && !empty($soc->default_lang)) { |
2871
|
|
- $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
2871
|
+ $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
2872
|
2872
|
} else { |
2873
|
|
- $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
2873
|
+ $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
2874
|
2874
|
} |
2875
|
2875
|
} else { |
2876
|
|
- $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
2876
|
+ $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
2877
|
2877
|
} |
2878
|
2878
|
} |
2879
|
2879
|
|
2880
|
2880
|
if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
2881
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
2881
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
2882
|
2882
|
} |
2883
|
2883
|
|
2884
|
|
- $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
2884
|
+ $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
2885
|
2885
|
|
2886
|
2886
|
if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
2887
|
2887
|
$sql .= " AND pac.rowid IS NULL"; |
2888
|
2888
|
} |
2889
|
2889
|
|
2890
|
2890
|
if ($finished == 0) { |
2891
|
|
- $sql .= " AND p.finished = " . ((int) $finished); |
|
2891
|
+ $sql .= " AND p.finished = ".((int) $finished); |
2892
|
2892
|
} elseif ($finished == 1) { |
2893
|
2893
|
$sql .= " AND p.finished = ".((int) $finished); |
2894
|
2894
|
} |
|
@@ -2896,18 +2896,18 @@ discard block |
|
|
block discarded – undo |
2896
|
2896
|
$sql .= " AND p.tosell = ".((int) $status); |
2897
|
2897
|
} |
2898
|
2898
|
if ($status_purchase >= 0) { |
2899
|
|
- $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
2899
|
+ $sql .= " AND p.tobuy = ".((int) $status_purchase); |
2900
|
2900
|
} |
2901
|
2901
|
// Filter by product type |
2902
|
2902
|
if (strval($filtertype) != '') { |
2903
|
|
- $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
2903
|
+ $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
2904
|
2904
|
} elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
2905
|
2905
|
$sql .= " AND p.fk_product_type = 1"; |
2906
|
2906
|
} elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
2907
|
2907
|
$sql .= " AND p.fk_product_type = 0"; |
2908
|
2908
|
} |
2909
|
2909
|
// Add where from hooks |
2910
|
|
- $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
2910
|
+ $parameters = array(); // @phan-suppress-current-line PhanPluginRedundantAssignment |
2911
|
2911
|
$reshook = $hookmanager->executeHooks('selectProductsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
2912
|
2912
|
$sql .= $hookmanager->resPrint; |
2913
|
2913
|
// Add criteria on ref/label |
|
@@ -2924,21 +2924,21 @@ discard block |
|
|
block discarded – undo |
2924
|
2924
|
if ($i > 0) { |
2925
|
2925
|
$sql .= " AND "; |
2926
|
2926
|
} |
2927
|
|
- $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2927
|
+ $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
2928
|
2928
|
if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2929
|
|
- $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2929
|
+ $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
2930
|
2930
|
} |
2931
|
2931
|
if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
2932
|
|
- $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2932
|
+ $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
2933
|
2933
|
} |
2934
|
2934
|
if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
2935
|
|
- $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2935
|
+ $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
2936
|
2936
|
if (getDolGlobalInt('MAIN_MULTILANGS')) { |
2937
|
|
- $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2937
|
+ $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
2938
|
2938
|
} |
2939
|
2939
|
} |
2940
|
2940
|
if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
2941
|
|
- $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
2941
|
+ $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
2942
|
2942
|
} |
2943
|
2943
|
$sql .= ")"; |
2944
|
2944
|
$i++; |
|
@@ -2947,12 +2947,12 @@ discard block |
|
|
block discarded – undo |
2947
|
2947
|
$sql .= ")"; |
2948
|
2948
|
} |
2949
|
2949
|
if (isModEnabled('barcode')) { |
2950
|
|
- $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
2950
|
+ $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
2951
|
2951
|
} |
2952
|
2952
|
$sql .= ')'; |
2953
|
2953
|
} |
2954
|
2954
|
if (count($warehouseStatusArray)) { |
2955
|
|
- $sql .= " GROUP BY " . $selectFields; |
|
2955
|
+ $sql .= " GROUP BY ".$selectFields; |
2956
|
2956
|
} |
2957
|
2957
|
|
2958
|
2958
|
//Sort by category |
|
@@ -2967,23 +2967,23 @@ discard block |
|
|
block discarded – undo |
2967
|
2967
|
$sql .= $this->db->plimit($limit, 0); |
2968
|
2968
|
|
2969
|
2969
|
// Build output string |
2970
|
|
- dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
2970
|
+ dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
2971
|
2971
|
$result = $this->db->query($sql); |
2972
|
2972
|
if ($result) { |
2973
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
2974
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
2975
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
2973
|
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
2974
|
+ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
2975
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
2976
|
2976
|
|
2977
|
2977
|
$num = $this->db->num_rows($result); |
2978
|
2978
|
|
2979
|
2979
|
$events = array(); |
2980
|
2980
|
|
2981
|
2981
|
if (!$forcecombo) { |
2982
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
2982
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
2983
|
2983
|
$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
2984
|
2984
|
} |
2985
|
2985
|
|
2986
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
2986
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
2987
|
2987
|
|
2988
|
2988
|
$textifempty = ''; |
2989
|
2989
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
|
@@ -3000,7 +3000,7 @@ discard block |
|
|
block discarded – undo |
3000
|
3000
|
} |
3001
|
3001
|
} |
3002
|
3002
|
if ($showempty) { |
3003
|
|
- $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
3003
|
+ $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
3004
|
3004
|
} |
3005
|
3005
|
|
3006
|
3006
|
$i = 0; |
|
@@ -3011,11 +3011,11 @@ discard block |
|
|
block discarded – undo |
3011
|
3011
|
|
3012
|
3012
|
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 |
3013
|
3013
|
$sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
3014
|
|
- $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
3015
|
|
- $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
3014
|
+ $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
3015
|
+ $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
3016
|
3016
|
$sql .= " ORDER BY quantity ASC"; |
3017
|
3017
|
|
3018
|
|
- dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
3018
|
+ dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
3019
|
3019
|
$result2 = $this->db->query($sql); |
3020
|
3020
|
if ($result2) { |
3021
|
3021
|
$nb_prices = $this->db->num_rows($result2); |
|
@@ -3053,7 +3053,7 @@ discard block |
|
|
block discarded – undo |
3053
|
3053
|
$price_product = new Product($this->db); |
3054
|
3054
|
$price_product->fetch($objp->rowid, '', '', 1); |
3055
|
3055
|
|
3056
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3056
|
+ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
3057
|
3057
|
$priceparser = new PriceParser($this->db); |
3058
|
3058
|
$price_result = $priceparser->parseProduct($price_product); |
3059
|
3059
|
if ($price_result >= 0) { |
|
@@ -3137,7 +3137,7 @@ discard block |
|
|
block discarded – undo |
3137
|
3137
|
$label = $objp->label_translated; |
3138
|
3138
|
} |
3139
|
3139
|
if (!empty($filterkey) && $filterkey != '') { |
3140
|
|
- $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3140
|
+ $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
3141
|
3141
|
} |
3142
|
3142
|
|
3143
|
3143
|
$outkey = $objp->rowid; |
|
@@ -3158,32 +3158,32 @@ discard block |
|
|
block discarded – undo |
3158
|
3158
|
$outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
3159
|
3159
|
|
3160
|
3160
|
if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3161
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
3161
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
3162
|
3162
|
} |
3163
|
3163
|
|
3164
|
3164
|
// Units |
3165
|
3165
|
$outvalUnits = ''; |
3166
|
3166
|
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3167
|
3167
|
if (!empty($objp->unit_short)) { |
3168
|
|
- $outvalUnits .= ' - ' . $objp->unit_short; |
|
3168
|
+ $outvalUnits .= ' - '.$objp->unit_short; |
3169
|
3169
|
} |
3170
|
3170
|
} |
3171
|
3171
|
if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
3172
|
3172
|
if (!empty($objp->weight) && $objp->weight_units !== null) { |
3173
|
3173
|
$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3174
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3174
|
+ $outvalUnits .= ' - '.$unitToShow; |
3175
|
3175
|
} |
3176
|
3176
|
if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3177
|
|
- $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
3178
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3177
|
+ $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3178
|
+ $outvalUnits .= ' - '.$unitToShow; |
3179
|
3179
|
} |
3180
|
3180
|
if (!empty($objp->surface) && $objp->surface_units !== null) { |
3181
|
3181
|
$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3182
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3182
|
+ $outvalUnits .= ' - '.$unitToShow; |
3183
|
3183
|
} |
3184
|
3184
|
if (!empty($objp->volume) && $objp->volume_units !== null) { |
3185
|
3185
|
$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3186
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3186
|
+ $outvalUnits .= ' - '.$unitToShow; |
3187
|
3187
|
} |
3188
|
3188
|
} |
3189
|
3189
|
if ($outdurationvalue && $outdurationunit) { |
|
@@ -3195,14 +3195,14 @@ discard block |
|
|
block discarded – undo |
3195
|
3195
|
'y' => $langs->trans('Year') |
3196
|
3196
|
); |
3197
|
3197
|
if (isset($da[$outdurationunit])) { |
3198
|
|
- $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3198
|
+ $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
3199
|
3199
|
} |
3200
|
3200
|
} |
3201
|
3201
|
|
3202
|
|
- $opt = '<option value="' . $objp->rowid . '"'; |
|
3202
|
+ $opt = '<option value="'.$objp->rowid.'"'; |
3203
|
3203
|
$opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
3204
|
3204
|
if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
3205
|
|
- $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 . '"'; |
|
3205
|
+ $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.'"'; |
3206
|
3206
|
} |
3207
|
3207
|
if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
3208
|
3208
|
if ($user->hasRight('stock', 'lire')) { |
|
@@ -3214,36 +3214,36 @@ discard block |
|
|
block discarded – undo |
3214
|
3214
|
} |
3215
|
3215
|
} |
3216
|
3216
|
if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
3217
|
|
- $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
3218
|
|
- $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
3217
|
+ $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
3218
|
+ $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
3219
|
3219
|
} |
3220
|
3220
|
$opt .= '>'; |
3221
|
3221
|
$opt .= $objp->ref; |
3222
|
3222
|
if (!empty($objp->custref)) { |
3223
|
|
- $opt .= ' (' . $objp->custref . ')'; |
|
3223
|
+ $opt .= ' ('.$objp->custref.')'; |
3224
|
3224
|
} |
3225
|
3225
|
if ($outbarcode) { |
3226
|
|
- $opt .= ' (' . $outbarcode . ')'; |
|
3226
|
+ $opt .= ' ('.$outbarcode.')'; |
3227
|
3227
|
} |
3228
|
|
- $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3228
|
+ $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
3229
|
3229
|
if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3230
|
|
- $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
3230
|
+ $opt .= ' ('.getCountry($outorigin, 1).')'; |
3231
|
3231
|
} |
3232
|
3232
|
|
3233
|
3233
|
$objRef = $objp->ref; |
3234
|
3234
|
if (!empty($objp->custref)) { |
3235
|
|
- $objRef .= ' (' . $objp->custref . ')'; |
|
3235
|
+ $objRef .= ' ('.$objp->custref.')'; |
3236
|
3236
|
} |
3237
|
3237
|
if (!empty($filterkey) && $filterkey != '') { |
3238
|
|
- $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3238
|
+ $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
3239
|
3239
|
} |
3240
|
3240
|
$outval .= $objRef; |
3241
|
3241
|
if ($outbarcode) { |
3242
|
|
- $outval .= ' (' . $outbarcode . ')'; |
|
3242
|
+ $outval .= ' ('.$outbarcode.')'; |
3243
|
3243
|
} |
3244
|
|
- $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3244
|
+ $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
3245
|
3245
|
if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
3246
|
|
- $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
3246
|
+ $outval .= ' ('.getCountry($outorigin, 1).')'; |
3247
|
3247
|
} |
3248
|
3248
|
|
3249
|
3249
|
// Units |
|
@@ -3256,35 +3256,35 @@ discard block |
|
|
block discarded – undo |
3256
|
3256
|
// If we need a particular price level (from 1 to n) |
3257
|
3257
|
if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { |
3258
|
3258
|
$sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
3259
|
|
- $sql .= " FROM " . $this->db->prefix() . "product_price"; |
3260
|
|
- $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
3261
|
|
- $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
3262
|
|
- $sql .= " AND price_level = " . ((int) $price_level); |
|
3259
|
+ $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
3260
|
+ $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
3261
|
+ $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
3262
|
+ $sql .= " AND price_level = ".((int) $price_level); |
3263
|
3263
|
$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
3264
|
3264
|
$sql .= " LIMIT 1"; |
3265
|
3265
|
|
3266
|
|
- dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
3266
|
+ dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
3267
|
3267
|
$result2 = $this->db->query($sql); |
3268
|
3268
|
if ($result2) { |
3269
|
3269
|
$objp2 = $this->db->fetch_object($result2); |
3270
|
3270
|
if ($objp2) { |
3271
|
3271
|
$found = 1; |
3272
|
3272
|
if ($objp2->price_base_type == 'HT') { |
3273
|
|
- $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
3274
|
|
- $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3273
|
+ $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3274
|
+ $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
3275
|
3275
|
} else { |
3276
|
|
- $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
3277
|
|
- $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3276
|
+ $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3277
|
+ $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
3278
|
3278
|
} |
3279
|
3279
|
$outprice_ht = price($objp2->price); |
3280
|
3280
|
$outprice_ttc = price($objp2->price_ttc); |
3281
|
3281
|
$outpricebasetype = $objp2->price_base_type; |
3282
|
3282
|
if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
3283
|
|
- $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
3284
|
|
- $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
3283
|
+ $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
3284
|
+ $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
3285
|
3285
|
} else { |
3286
|
|
- $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
3287
|
|
- $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
3286
|
+ $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
3287
|
+ $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
3288
|
3288
|
} |
3289
|
3289
|
} |
3290
|
3290
|
} else { |
|
@@ -3298,13 +3298,13 @@ discard block |
|
|
block discarded – undo |
3298
|
3298
|
$outqty = $objp->quantity; |
3299
|
3299
|
$outdiscount = $objp->remise_percent; |
3300
|
3300
|
if ($objp->quantity == 1) { |
3301
|
|
- $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
3302
|
|
- $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3301
|
+ $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3302
|
+ $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
3303
|
3303
|
$opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3304
|
3304
|
$outval .= $langs->transnoentities("Unit"); |
3305
|
3305
|
} else { |
3306
|
|
- $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
3307
|
|
- $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
3306
|
+ $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3307
|
+ $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
3308
|
3308
|
$opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
3309
|
3309
|
$outval .= $langs->transnoentities("Units"); |
3310
|
3310
|
} |
|
@@ -3312,16 +3312,16 @@ discard block |
|
|
block discarded – undo |
3312
|
3312
|
$outprice_ht = price($objp->unitprice); |
3313
|
3313
|
$outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
3314
|
3314
|
$outpricebasetype = $objp->price_base_type; |
3315
|
|
- $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 |
3316
|
|
- $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 |
|
3315
|
+ $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 |
|
3316
|
+ $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 |
3317
|
3317
|
} |
3318
|
3318
|
if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
3319
|
|
- $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
3320
|
|
- $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
3319
|
+ $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
3320
|
+ $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
3321
|
3321
|
} |
3322
|
3322
|
if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
3323
|
|
- $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
3324
|
|
- $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3323
|
+ $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3324
|
+ $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
3325
|
3325
|
} |
3326
|
3326
|
|
3327
|
3327
|
// Price by customer |
|
@@ -3330,11 +3330,11 @@ discard block |
|
|
block discarded – undo |
3330
|
3330
|
$found = 1; |
3331
|
3331
|
|
3332
|
3332
|
if ($objp->custprice_base_type == 'HT') { |
3333
|
|
- $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
3334
|
|
- $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3333
|
+ $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3334
|
+ $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
3335
|
3335
|
} else { |
3336
|
|
- $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
3337
|
|
- $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3336
|
+ $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3337
|
+ $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
3338
|
3338
|
} |
3339
|
3339
|
|
3340
|
3340
|
$outprice_ht = price($objp->custprice); |
|
@@ -3348,11 +3348,11 @@ discard block |
|
|
block discarded – undo |
3348
|
3348
|
// If level no defined or multiprice not found, we used the default price |
3349
|
3349
|
if (empty($hidepriceinlabel) && !$found) { |
3350
|
3350
|
if ($objp->price_base_type == 'HT') { |
3351
|
|
- $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
3352
|
|
- $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
3351
|
+ $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
3352
|
+ $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
3353
|
3353
|
} else { |
3354
|
|
- $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
3355
|
|
- $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
3354
|
+ $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
3355
|
+ $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
3356
|
3356
|
} |
3357
|
3357
|
$outprice_ht = price($objp->price); |
3358
|
3358
|
$outprice_ttc = price($objp->price_ttc); |
|
@@ -3363,14 +3363,14 @@ discard block |
|
|
block discarded – undo |
3363
|
3363
|
|
3364
|
3364
|
if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
3365
|
3365
|
if ($user->hasRight('stock', 'lire')) { |
3366
|
|
- $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3366
|
+ $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
3367
|
3367
|
|
3368
|
3368
|
if ($objp->stock > 0) { |
3369
|
3369
|
$outval .= ' - <span class="product_line_stock_ok">'; |
3370
|
3370
|
} elseif ($objp->stock <= 0) { |
3371
|
3371
|
$outval .= ' - <span class="product_line_stock_too_low">'; |
3372
|
3372
|
} |
3373
|
|
- $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3373
|
+ $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
3374
|
3374
|
$outval .= '</span>'; |
3375
|
3375
|
if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
3376
|
3376
|
$langs->load("stocks"); |
|
@@ -3380,9 +3380,9 @@ discard block |
|
|
block discarded – undo |
3380
|
3380
|
$tmpproduct->load_virtual_stock(); |
3381
|
3381
|
$virtualstock = $tmpproduct->stock_theorique; |
3382
|
3382
|
|
3383
|
|
- $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3383
|
+ $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
3384
|
3384
|
|
3385
|
|
- $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3385
|
+ $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
3386
|
3386
|
if ($virtualstock > 0) { |
3387
|
3387
|
$outval .= '<span class="product_line_stock_ok">'; |
3388
|
3388
|
} elseif ($virtualstock <= 0) { |
|
@@ -3460,7 +3460,7 @@ discard block |
|
|
block discarded – undo |
3460
|
3460
|
$selected_input_value = ''; |
3461
|
3461
|
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
3462
|
3462
|
if ($selected > 0) { |
3463
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
3463
|
+ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
3464
|
3464
|
$producttmpselect = new Product($this->db); |
3465
|
3465
|
$producttmpselect->fetch($selected); |
3466
|
3466
|
$selected_input_value = $producttmpselect->ref; |
|
@@ -3468,10 +3468,10 @@ discard block |
|
|
block discarded – undo |
3468
|
3468
|
} |
3469
|
3469
|
|
3470
|
3470
|
// mode=2 means suppliers products |
3471
|
|
- $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
3472
|
|
- print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
3471
|
+ $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
3472
|
+ print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
3473
|
3473
|
|
3474
|
|
- print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
3474
|
+ print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
3475
|
3475
|
} else { |
3476
|
3476
|
print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
3477
|
3477
|
} |
|
@@ -3531,25 +3531,25 @@ discard block |
|
|
block discarded – undo |
3531
|
3531
|
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3532
|
3532
|
$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"; |
3533
|
3533
|
} |
3534
|
|
- $sql .= " FROM " . $this->db->prefix() . "product as p"; |
3535
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
3534
|
+ $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3535
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
3536
|
3536
|
if ($socid > 0) { |
3537
|
|
- $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
3537
|
+ $sql .= " AND pfp.fk_soc = ".((int) $socid); |
3538
|
3538
|
} |
3539
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
3539
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
3540
|
3540
|
// Units |
3541
|
3541
|
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3542
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
3542
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
3543
|
3543
|
} |
3544
|
|
- $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
3544
|
+ $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
3545
|
3545
|
if ($statut != -1) { |
3546
|
|
- $sql .= " AND p.tobuy = " . ((int) $statut); |
|
3546
|
+ $sql .= " AND p.tobuy = ".((int) $statut); |
3547
|
3547
|
} |
3548
|
3548
|
if (strval($filtertype) != '') { |
3549
|
|
- $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
3549
|
+ $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
3550
|
3550
|
} |
3551
|
3551
|
if (!empty($filtre)) { |
3552
|
|
- $sql .= " " . $filtre; |
|
3552
|
+ $sql .= " ".$filtre; |
3553
|
3553
|
} |
3554
|
3554
|
// Add where from hooks |
3555
|
3555
|
$parameters = array(); |
|
@@ -3569,9 +3569,9 @@ discard block |
|
|
block discarded – undo |
3569
|
3569
|
if ($i > 0) { |
3570
|
3570
|
$sql .= " AND "; |
3571
|
3571
|
} |
3572
|
|
- $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) . "%'"; |
|
3572
|
+ $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)."%'"; |
3573
|
3573
|
if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
3574
|
|
- $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
3574
|
+ $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
3575
|
3575
|
} |
3576
|
3576
|
$sql .= ")"; |
3577
|
3577
|
$i++; |
|
@@ -3580,8 +3580,8 @@ discard block |
|
|
block discarded – undo |
3580
|
3580
|
$sql .= ")"; |
3581
|
3581
|
} |
3582
|
3582
|
if (isModEnabled('barcode')) { |
3583
|
|
- $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
3584
|
|
- $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
3583
|
+ $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
3584
|
+ $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
3585
|
3585
|
} |
3586
|
3586
|
$sql .= ')'; |
3587
|
3587
|
} |
|
@@ -3590,20 +3590,20 @@ discard block |
|
|
block discarded – undo |
3590
|
3590
|
|
3591
|
3591
|
// Build output string |
3592
|
3592
|
|
3593
|
|
- dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
3593
|
+ dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
3594
|
3594
|
$result = $this->db->query($sql); |
3595
|
3595
|
if ($result) { |
3596
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
3597
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
3596
|
+ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
3597
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
3598
|
3598
|
|
3599
|
3599
|
$num = $this->db->num_rows($result); |
3600
|
3600
|
|
3601
|
3601
|
//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
3602
|
|
- $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
3602
|
+ $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
3603
|
3603
|
if (!$selected) { |
3604
|
|
- $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3604
|
+ $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
3605
|
3605
|
} else { |
3606
|
|
- $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
3606
|
+ $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
3607
|
3607
|
} |
3608
|
3608
|
|
3609
|
3609
|
$i = 0; |
|
@@ -3618,7 +3618,7 @@ discard block |
|
|
block discarded – undo |
3618
|
3618
|
|
3619
|
3619
|
$outkey = $objp->idprodfournprice; // id in table of price |
3620
|
3620
|
if (!$outkey && $alsoproductwithnosupplierprice) { |
3621
|
|
- $outkey = 'idprod_' . $objp->rowid; // id of product |
|
3621
|
+ $outkey = 'idprod_'.$objp->rowid; // id of product |
3622
|
3622
|
} |
3623
|
3623
|
|
3624
|
3624
|
$outref = $objp->ref; |
|
@@ -3633,23 +3633,23 @@ discard block |
|
|
block discarded – undo |
3633
|
3633
|
$outvalUnits = ''; |
3634
|
3634
|
if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
3635
|
3635
|
if (!empty($objp->unit_short)) { |
3636
|
|
- $outvalUnits .= ' - ' . $objp->unit_short; |
|
3636
|
+ $outvalUnits .= ' - '.$objp->unit_short; |
3637
|
3637
|
} |
3638
|
3638
|
if (!empty($objp->weight) && $objp->weight_units !== null) { |
3639
|
3639
|
$unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
3640
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3640
|
+ $outvalUnits .= ' - '.$unitToShow; |
3641
|
3641
|
} |
3642
|
3642
|
if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
3643
|
|
- $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
3644
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3643
|
+ $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
3644
|
+ $outvalUnits .= ' - '.$unitToShow; |
3645
|
3645
|
} |
3646
|
3646
|
if (!empty($objp->surface) && $objp->surface_units !== null) { |
3647
|
3647
|
$unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
3648
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3648
|
+ $outvalUnits .= ' - '.$unitToShow; |
3649
|
3649
|
} |
3650
|
3650
|
if (!empty($objp->volume) && $objp->volume_units !== null) { |
3651
|
3651
|
$unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
3652
|
|
- $outvalUnits .= ' - ' . $unitToShow; |
|
3652
|
+ $outvalUnits .= ' - '.$unitToShow; |
3653
|
3653
|
} |
3654
|
3654
|
if ($outdurationvalue && $outdurationunit) { |
3655
|
3655
|
$da = array( |
|
@@ -3660,22 +3660,22 @@ discard block |
|
|
block discarded – undo |
3660
|
3660
|
'y' => $langs->trans('Year') |
3661
|
3661
|
); |
3662
|
3662
|
if (isset($da[$outdurationunit])) { |
3663
|
|
- $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
3663
|
+ $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
3664
|
3664
|
} |
3665
|
3665
|
} |
3666
|
3666
|
} |
3667
|
3667
|
|
3668
|
3668
|
$objRef = $objp->ref; |
3669
|
3669
|
if ($filterkey && $filterkey != '') { |
3670
|
|
- $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
3670
|
+ $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
3671
|
3671
|
} |
3672
|
3672
|
$objRefFourn = $objp->ref_fourn; |
3673
|
3673
|
if ($filterkey && $filterkey != '') { |
3674
|
|
- $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
3674
|
+ $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
3675
|
3675
|
} |
3676
|
3676
|
$label = $objp->label; |
3677
|
3677
|
if ($filterkey && $filterkey != '') { |
3678
|
|
- $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
3678
|
+ $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
3679
|
3679
|
} |
3680
|
3680
|
|
3681
|
3681
|
switch ($objp->fk_product_type) { |
|
@@ -3698,21 +3698,21 @@ discard block |
|
|
block discarded – undo |
3698
|
3698
|
|
3699
|
3699
|
$optlabel .= $objp->ref; |
3700
|
3700
|
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3701
|
|
- $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
3701
|
+ $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
3702
|
3702
|
} |
3703
|
3703
|
if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3704
|
|
- $optlabel .= ' (' . $outbarcode . ')'; |
|
3704
|
+ $optlabel .= ' ('.$outbarcode.')'; |
3705
|
3705
|
} |
3706
|
|
- $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3706
|
+ $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
3707
|
3707
|
|
3708
|
3708
|
$outvallabel = $objRef; |
3709
|
3709
|
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
3710
|
|
- $outvallabel .= ' (' . $objRefFourn . ')'; |
|
3710
|
+ $outvallabel .= ' ('.$objRefFourn.')'; |
3711
|
3711
|
} |
3712
|
3712
|
if (isModEnabled('barcode') && !empty($objp->barcode)) { |
3713
|
|
- $outvallabel .= ' (' . $outbarcode . ')'; |
|
3713
|
+ $outvallabel .= ' ('.$outbarcode.')'; |
3714
|
3714
|
} |
3715
|
|
- $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
3715
|
+ $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
3716
|
3716
|
|
3717
|
3717
|
// Units |
3718
|
3718
|
$optlabel .= $outvalUnits; |
|
@@ -3729,7 +3729,7 @@ discard block |
|
|
block discarded – undo |
3729
|
3729
|
$prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3730
|
3730
|
$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
3731
|
3731
|
|
3732
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3732
|
+ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
3733
|
3733
|
$priceparser = new PriceParser($this->db); |
3734
|
3734
|
$price_result = $priceparser->parseProductSupplier($prod_supplier); |
3735
|
3735
|
if ($price_result >= 0) { |
|
@@ -3740,57 +3740,57 @@ discard block |
|
|
block discarded – undo |
3740
|
3740
|
} |
3741
|
3741
|
} |
3742
|
3742
|
if ($objp->quantity == 1) { |
3743
|
|
- $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
3744
|
|
- $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
3743
|
+ $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
3744
|
+ $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
3745
|
3745
|
$optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
3746
|
3746
|
$outvallabel .= $langs->transnoentities("Unit"); |
3747
|
3747
|
} else { |
3748
|
|
- $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
3749
|
|
- $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
3750
|
|
- $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
3751
|
|
- $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
3748
|
+ $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3749
|
+ $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
3750
|
+ $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
3751
|
+ $outvallabel .= ' '.$langs->transnoentities("Units"); |
3752
|
3752
|
} |
3753
|
3753
|
|
3754
|
3754
|
if ($objp->quantity > 1) { |
3755
|
|
- $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 |
3756
|
|
- $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 |
|
3755
|
+ $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 |
|
3756
|
+ $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 |
3757
|
3757
|
} |
3758
|
3758
|
if ($objp->remise_percent >= 1) { |
3759
|
|
- $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
3760
|
|
- $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
3759
|
+ $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
3760
|
+ $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
3761
|
3761
|
} |
3762
|
3762
|
if ($objp->duration) { |
3763
|
|
- $optlabel .= " - " . $objp->duration; |
3764
|
|
- $outvallabel .= " - " . $objp->duration; |
|
3763
|
+ $optlabel .= " - ".$objp->duration; |
|
3764
|
+ $outvallabel .= " - ".$objp->duration; |
3765
|
3765
|
} |
3766
|
3766
|
if (!$socid) { |
3767
|
|
- $optlabel .= " - " . dol_trunc($objp->name, 8); |
3768
|
|
- $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
3767
|
+ $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
3768
|
+ $outvallabel .= " - ".dol_trunc($objp->name, 8); |
3769
|
3769
|
} |
3770
|
3770
|
if ($objp->supplier_reputation) { |
3771
|
3771
|
//TODO dictionary |
3772
|
3772
|
$reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
3773
|
3773
|
|
3774
|
|
- $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
3775
|
|
- $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
3774
|
+ $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
3775
|
+ $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
3776
|
3776
|
} |
3777
|
3777
|
} else { |
3778
|
|
- $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
3779
|
|
- $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
3778
|
+ $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
3779
|
+ $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
3780
|
3780
|
} |
3781
|
3781
|
|
3782
|
3782
|
if (isModEnabled('stock') && $showstockinlist && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
3783
|
3783
|
$novirtualstock = ($showstockinlist == 2); |
3784
|
3784
|
|
3785
|
3785
|
if ($user->hasRight('stock', 'lire')) { |
3786
|
|
- $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
3786
|
+ $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
3787
|
3787
|
|
3788
|
3788
|
if ($objp->stock > 0) { |
3789
|
3789
|
$optlabel .= ' - <span class="product_line_stock_ok">'; |
3790
|
3790
|
} elseif ($objp->stock <= 0) { |
3791
|
3791
|
$optlabel .= ' - <span class="product_line_stock_too_low">'; |
3792
|
3792
|
} |
3793
|
|
- $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
3793
|
+ $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
3794
|
3794
|
$optlabel .= '</span>'; |
3795
|
3795
|
if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
3796
|
3796
|
$langs->load("stocks"); |
|
@@ -3800,9 +3800,9 @@ discard block |
|
|
block discarded – undo |
3800
|
3800
|
$tmpproduct->load_virtual_stock(); |
3801
|
3801
|
$virtualstock = $tmpproduct->stock_theorique; |
3802
|
3802
|
|
3803
|
|
- $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
3803
|
+ $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
3804
|
3804
|
|
3805
|
|
- $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
3805
|
+ $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
3806
|
3806
|
if ($virtualstock > 0) { |
3807
|
3807
|
$optlabel .= '<span class="product_line_stock_ok">'; |
3808
|
3808
|
} elseif ($virtualstock <= 0) { |
|
@@ -3816,7 +3816,7 @@ discard block |
|
|
block discarded – undo |
3816
|
3816
|
} |
3817
|
3817
|
} |
3818
|
3818
|
|
3819
|
|
- $optstart = '<option value="' . $outkey . '"'; |
|
3819
|
+ $optstart = '<option value="'.$outkey.'"'; |
3820
|
3820
|
if ($selected && $selected == $objp->idprodfournprice) { |
3821
|
3821
|
$optstart .= ' selected'; |
3822
|
3822
|
} |
|
@@ -3825,31 +3825,31 @@ discard block |
|
|
block discarded – undo |
3825
|
3825
|
} |
3826
|
3826
|
|
3827
|
3827
|
if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
3828
|
|
- $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
3829
|
|
- $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
3830
|
|
- $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
3831
|
|
- $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
3832
|
|
- $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
3833
|
|
- $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
3834
|
|
- $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
3835
|
|
- $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
3836
|
|
- $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
3837
|
|
- $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
3828
|
+ $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
3829
|
+ $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
3830
|
+ $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
3831
|
+ $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
3832
|
+ $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
3833
|
+ $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
3834
|
+ $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
3835
|
+ $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
3836
|
+ $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
3837
|
+ $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
3838
|
3838
|
if (isModEnabled('multicurrency')) { |
3839
|
|
- $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
3840
|
|
- $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
3839
|
+ $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
3840
|
+ $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
3841
|
3841
|
} |
3842
|
3842
|
} |
3843
|
|
- $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
3843
|
+ $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
3844
|
3844
|
|
3845
|
3845
|
$outarrayentry = array( |
3846
|
3846
|
'key' => $outkey, |
3847
|
3847
|
'value' => $outref, |
3848
|
3848
|
'label' => $outvallabel, |
3849
|
3849
|
'qty' => $outqty, |
3850
|
|
- 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
3851
|
|
- 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
3852
|
|
- 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3850
|
+ 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3851
|
+ 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3852
|
+ 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
3853
|
3853
|
'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
3854
|
3854
|
'tva_tx' => price2num($objp->tva_tx), |
3855
|
3855
|
'default_vat_code' => $objp->default_vat_code, |
|
@@ -3878,17 +3878,17 @@ discard block |
|
|
block discarded – undo |
3878
|
3878
|
// Add new entry |
3879
|
3879
|
// "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 |
3880
|
3880
|
// "label" value of json key array is used by jQuery automatically as text for combo box |
3881
|
|
- $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
3881
|
+ $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
3882
|
3882
|
$outarraypush = array( |
3883
|
3883
|
'key' => $outkey, |
3884
|
3884
|
'value' => $outref, |
3885
|
3885
|
'label' => $outvallabel, |
3886
|
3886
|
'qty' => $outqty, |
3887
|
|
- 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
3887
|
+ 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
3888
|
3888
|
'price_qty_ht_locale' => price($objp->fprice), |
3889
|
|
- 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
3889
|
+ 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
3890
|
3890
|
'price_unit_ht_locale' => price($objp->unitprice), |
3891
|
|
- 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
3891
|
+ 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
3892
|
3892
|
'tva_tx_formated' => price($objp->tva_tx), |
3893
|
3893
|
'tva_tx' => price2num($objp->tva_tx), |
3894
|
3894
|
'default_vat_code' => $objp->default_vat_code, |
|
@@ -3920,7 +3920,7 @@ discard block |
|
|
block discarded – undo |
3920
|
3920
|
|
3921
|
3921
|
$this->db->free($result); |
3922
|
3922
|
|
3923
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
3923
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
3924
|
3924
|
$out .= ajax_combobox($htmlname); |
3925
|
3925
|
} else { |
3926
|
3926
|
dol_print_error($this->db); |
|
@@ -3952,43 +3952,43 @@ discard block |
|
|
block discarded – undo |
3952
|
3952
|
$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
3953
|
3953
|
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
3954
|
3954
|
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
3955
|
|
- $sql .= " FROM " . $this->db->prefix() . "product as p"; |
3956
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
3957
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
3958
|
|
- $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
3955
|
+ $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
3956
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
3957
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
3958
|
+ $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
3959
|
3959
|
$sql .= " AND p.tobuy = 1"; |
3960
|
3960
|
$sql .= " AND s.fournisseur = 1"; |
3961
|
|
- $sql .= " AND p.rowid = " . ((int) $productid); |
|
3961
|
+ $sql .= " AND p.rowid = ".((int) $productid); |
3962
|
3962
|
if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
3963
|
3963
|
$sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
3964
|
3964
|
} else { |
3965
|
3965
|
$sql .= " ORDER BY pfp.unitprice ASC"; |
3966
|
3966
|
} |
3967
|
3967
|
|
3968
|
|
- dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
3968
|
+ dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
3969
|
3969
|
$result = $this->db->query($sql); |
3970
|
3970
|
|
3971
|
3971
|
if ($result) { |
3972
|
3972
|
$num = $this->db->num_rows($result); |
3973
|
3973
|
|
3974
|
|
- $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
3974
|
+ $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
3975
|
3975
|
|
3976
|
3976
|
if (!$num) { |
3977
|
|
- $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
3977
|
+ $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
3978
|
3978
|
} else { |
3979
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
3979
|
+ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
3980
|
3980
|
$form .= '<option value="0"> </option>'; |
3981
|
3981
|
|
3982
|
3982
|
$i = 0; |
3983
|
3983
|
while ($i < $num) { |
3984
|
3984
|
$objp = $this->db->fetch_object($result); |
3985
|
3985
|
|
3986
|
|
- $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
3986
|
+ $opt = '<option value="'.$objp->idprodfournprice.'"'; |
3987
|
3987
|
//if there is only one supplier, preselect it |
3988
|
3988
|
if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
3989
|
3989
|
$opt .= ' selected'; |
3990
|
3990
|
} |
3991
|
|
- $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
3991
|
+ $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
3992
|
3992
|
|
3993
|
3993
|
if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
3994
|
3994
|
$prod_supplier = new ProductFournisseur($this->db); |
|
@@ -3998,7 +3998,7 @@ discard block |
|
|
block discarded – undo |
3998
|
3998
|
$prod_supplier->fourn_tva_tx = $objp->tva_tx; |
3999
|
3999
|
$prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
4000
|
4000
|
|
4001
|
|
- require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
4001
|
+ require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
4002
|
4002
|
$priceparser = new PriceParser($this->db); |
4003
|
4003
|
$price_result = $priceparser->parseProductSupplier($prod_supplier); |
4004
|
4004
|
if ($price_result >= 0) { |
|
@@ -4009,10 +4009,10 @@ discard block |
|
|
block discarded – undo |
4009
|
4009
|
} |
4010
|
4010
|
} |
4011
|
4011
|
if ($objp->quantity == 1) { |
4012
|
|
- $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
4012
|
+ $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
4013
|
4013
|
} |
4014
|
4014
|
|
4015
|
|
- $opt .= $objp->quantity . ' '; |
|
4015
|
+ $opt .= $objp->quantity.' '; |
4016
|
4016
|
|
4017
|
4017
|
if ($objp->quantity == 1) { |
4018
|
4018
|
$opt .= $langs->trans("Unit"); |
|
@@ -4021,10 +4021,10 @@ discard block |
|
|
block discarded – undo |
4021
|
4021
|
} |
4022
|
4022
|
if ($objp->quantity > 1) { |
4023
|
4023
|
$opt .= " - "; |
4024
|
|
- $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"); |
|
4024
|
+ $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"); |
4025
|
4025
|
} |
4026
|
4026
|
if ($objp->duration) { |
4027
|
|
- $opt .= " - " . $objp->duration; |
|
4027
|
+ $opt .= " - ".$objp->duration; |
4028
|
4028
|
} |
4029
|
4029
|
$opt .= "</option>\n"; |
4030
|
4030
|
|
|
@@ -4062,8 +4062,8 @@ discard block |
|
|
block discarded – undo |
4062
|
4062
|
dol_syslog(__METHOD__, LOG_DEBUG); |
4063
|
4063
|
|
4064
|
4064
|
$sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
4065
|
|
- $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
4066
|
|
- $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
4065
|
+ $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
4066
|
+ $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
4067
|
4067
|
$sql .= " AND active > 0"; |
4068
|
4068
|
$sql .= " ORDER BY sortorder"; |
4069
|
4069
|
|
|
@@ -4075,7 +4075,7 @@ discard block |
|
|
block discarded – undo |
4075
|
4075
|
$obj = $this->db->fetch_object($resql); |
4076
|
4076
|
|
4077
|
4077
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4078
|
|
- $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4078
|
+ $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
4079
|
4079
|
$this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
4080
|
4080
|
$this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
4081
|
4081
|
$this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
|
@@ -4103,7 +4103,7 @@ discard block |
|
|
block discarded – undo |
4103
|
4103
|
// phpcs:enable |
4104
|
4104
|
global $langs; |
4105
|
4105
|
|
4106
|
|
- $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
4106
|
+ $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
4107
|
4107
|
if ($num > 0) { |
4108
|
4108
|
return 0; // Cache already loaded |
4109
|
4109
|
} |
|
@@ -4113,7 +4113,7 @@ discard block |
|
|
block discarded – undo |
4113
|
4113
|
$langs->load('propal'); |
4114
|
4114
|
|
4115
|
4115
|
$sql = "SELECT rowid, code, label, position"; |
4116
|
|
- $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
4116
|
+ $sql .= " FROM ".$this->db->prefix().'c_availability'; |
4117
|
4117
|
$sql .= " WHERE active > 0"; |
4118
|
4118
|
|
4119
|
4119
|
$resql = $this->db->query($sql); |
|
@@ -4124,7 +4124,7 @@ discard block |
|
|
block discarded – undo |
4124
|
4124
|
$obj = $this->db->fetch_object($resql); |
4125
|
4125
|
|
4126
|
4126
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4127
|
|
- $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4127
|
+ $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
4128
|
4128
|
$this->cache_availability[$obj->rowid]['code'] = $obj->code; |
4129
|
4129
|
$this->cache_availability[$obj->rowid]['label'] = $label; |
4130
|
4130
|
$this->cache_availability[$obj->rowid]['position'] = $obj->position; |
|
@@ -4156,17 +4156,17 @@ discard block |
|
|
block discarded – undo |
4156
|
4156
|
|
4157
|
4157
|
$this->load_cache_availability(); |
4158
|
4158
|
|
4159
|
|
- dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4159
|
+ dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
4160
|
4160
|
|
4161
|
|
- print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4161
|
+ print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
4162
|
4162
|
if ($addempty) { |
4163
|
4163
|
print '<option value="0"> </option>'; |
4164
|
4164
|
} |
4165
|
4165
|
foreach ($this->cache_availability as $id => $arrayavailability) { |
4166
|
4166
|
if ($selected == $id) { |
4167
|
|
- print '<option value="' . $id . '" selected>'; |
|
4167
|
+ print '<option value="'.$id.'" selected>'; |
4168
|
4168
|
} else { |
4169
|
|
- print '<option value="' . $id . '">'; |
|
4169
|
+ print '<option value="'.$id.'">'; |
4170
|
4170
|
} |
4171
|
4171
|
print dol_escape_htmltag($arrayavailability['label']); |
4172
|
4172
|
print '</option>'; |
|
@@ -4187,13 +4187,13 @@ discard block |
|
|
block discarded – undo |
4187
|
4187
|
{ |
4188
|
4188
|
global $langs; |
4189
|
4189
|
|
4190
|
|
- $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
4190
|
+ $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
4191
|
4191
|
if ($num > 0) { |
4192
|
4192
|
return 0; // Cache already loaded |
4193
|
4193
|
} |
4194
|
4194
|
|
4195
|
4195
|
$sql = "SELECT rowid, code, label"; |
4196
|
|
- $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
4196
|
+ $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
4197
|
4197
|
$sql .= " WHERE active > 0"; |
4198
|
4198
|
|
4199
|
4199
|
$resql = $this->db->query($sql); |
|
@@ -4206,8 +4206,8 @@ discard block |
|
|
block discarded – undo |
4206
|
4206
|
|
4207
|
4207
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4208
|
4208
|
$label = ($obj->label != '-' ? $obj->label : ''); |
4209
|
|
- if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
4210
|
|
- $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
4209
|
+ if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
4210
|
+ $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
4211
|
4211
|
} |
4212
|
4212
|
if ($langs->trans($obj->code) != $obj->code) { |
4213
|
4213
|
$label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
|
@@ -4247,9 +4247,9 @@ discard block |
|
|
block discarded – undo |
4247
|
4247
|
|
4248
|
4248
|
$this->loadCacheInputReason(); |
4249
|
4249
|
|
4250
|
|
- print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4250
|
+ print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
4251
|
4251
|
if ($addempty) { |
4252
|
|
- print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
4252
|
+ print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
4253
|
4253
|
} |
4254
|
4254
|
foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
4255
|
4255
|
if ($arraydemandreason['code'] == $exclude) { |
|
@@ -4257,9 +4257,9 @@ discard block |
|
|
block discarded – undo |
4257
|
4257
|
} |
4258
|
4258
|
|
4259
|
4259
|
if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
4260
|
|
- print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
4260
|
+ print '<option value="'.$arraydemandreason['id'].'" selected>'; |
4261
|
4261
|
} else { |
4262
|
|
- print '<option value="' . $arraydemandreason['id'] . '">'; |
|
4262
|
+ print '<option value="'.$arraydemandreason['id'].'">'; |
4263
|
4263
|
} |
4264
|
4264
|
$label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
4265
|
4265
|
print $langs->trans($label); |
|
@@ -4269,7 +4269,7 @@ discard block |
|
|
block discarded – undo |
4269
|
4269
|
if ($user->admin && empty($notooltip)) { |
4270
|
4270
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4271
|
4271
|
} |
4272
|
|
- print ajax_combobox('select_' . $htmlname); |
|
4272
|
+ print ajax_combobox('select_'.$htmlname); |
4273
|
4273
|
} |
4274
|
4274
|
|
4275
|
4275
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
@@ -4284,7 +4284,7 @@ discard block |
|
|
block discarded – undo |
4284
|
4284
|
// phpcs:enable |
4285
|
4285
|
global $langs; |
4286
|
4286
|
|
4287
|
|
- $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
4287
|
+ $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
4288
|
4288
|
if ($num > 0) { |
4289
|
4289
|
return $num; // Cache already loaded |
4290
|
4290
|
} |
|
@@ -4294,8 +4294,8 @@ discard block |
|
|
block discarded – undo |
4294
|
4294
|
$this->cache_types_paiements = array(); |
4295
|
4295
|
|
4296
|
4296
|
$sql = "SELECT id, code, libelle as label, type, active"; |
4297
|
|
- $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
4298
|
|
- $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
4297
|
+ $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
4298
|
+ $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
4299
|
4299
|
|
4300
|
4300
|
$resql = $this->db->query($sql); |
4301
|
4301
|
if ($resql) { |
|
@@ -4305,7 +4305,7 @@ discard block |
|
|
block discarded – undo |
4305
|
4305
|
$obj = $this->db->fetch_object($resql); |
4306
|
4306
|
|
4307
|
4307
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par default |
4308
|
|
- $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4308
|
+ $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
4309
|
4309
|
$this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
4310
|
4310
|
$this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
4311
|
4311
|
$this->cache_types_paiements[$obj->id]['label'] = $label; |
|
@@ -4377,17 +4377,17 @@ discard block |
|
|
block discarded – undo |
4377
|
4377
|
global $langs, $user, $conf; |
4378
|
4378
|
|
4379
|
4379
|
$out = ''; |
4380
|
|
- dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
4380
|
+ dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
4381
|
4381
|
|
4382
|
4382
|
$this->load_cache_conditions_paiements(); |
4383
|
4383
|
|
4384
|
4384
|
// Set default value if not already set by caller |
4385
|
4385
|
if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
4386
|
|
- dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
4386
|
+ dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
4387
|
4387
|
$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
4388
|
4388
|
} |
4389
|
4389
|
|
4390
|
|
- $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4390
|
+ $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
4391
|
4391
|
if ($addempty) { |
4392
|
4392
|
$out .= '<option value="0"> </option>'; |
4393
|
4393
|
} |
|
@@ -4401,9 +4401,9 @@ discard block |
|
|
block discarded – undo |
4401
|
4401
|
|
4402
|
4402
|
if ($selected == $id) { |
4403
|
4403
|
$selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
4404
|
|
- $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
4404
|
+ $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
4405
|
4405
|
} else { |
4406
|
|
- $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
4406
|
+ $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
4407
|
4407
|
} |
4408
|
4408
|
$label = $arrayconditions['label']; |
4409
|
4409
|
|
|
@@ -4421,21 +4421,21 @@ discard block |
|
|
block discarded – undo |
4421
|
4421
|
$out .= ajax_combobox($htmlname); |
4422
|
4422
|
|
4423
|
4423
|
if ($deposit_percent >= 0) { |
4424
|
|
- $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
4425
|
|
- $out .= $langs->trans('DepositPercent') . ' : '; |
4426
|
|
- $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
4424
|
+ $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
4425
|
+ $out .= $langs->trans('DepositPercent').' : '; |
|
4426
|
+ $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
4427
|
4427
|
$out .= '</span>'; |
4428
|
4428
|
$out .= ' |
4429
|
|
- <script nonce="' . getNonce() . '"> |
|
4429
|
+ <script nonce="' . getNonce().'"> |
4430
|
4430
|
$(document).ready(function () { |
4431
|
|
- $("#' . $htmlname . '").change(function () { |
|
4431
|
+ $("#' . $htmlname.'").change(function () { |
4432
|
4432
|
let $selected = $(this).find("option:selected"); |
4433
|
4433
|
let depositPercent = $selected.attr("data-deposit_percent"); |
4434
|
4434
|
|
4435
|
4435
|
if (depositPercent.length > 0) { |
4436
|
|
- $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
4436
|
+ $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
4437
|
4437
|
} else { |
4438
|
|
- $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
4438
|
+ $("#' . $htmlname.'_deposit_percent_container").hide(); |
4439
|
4439
|
} |
4440
|
4440
|
|
4441
|
4441
|
return true; |
|
@@ -4473,7 +4473,7 @@ discard block |
|
|
block discarded – undo |
4473
|
4473
|
|
4474
|
4474
|
$out = ''; |
4475
|
4475
|
|
4476
|
|
- dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
4476
|
+ dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
4477
|
4477
|
|
4478
|
4478
|
$filterarray = array(); |
4479
|
4479
|
if ($filtertype == 'CRDT') { |
|
@@ -4488,11 +4488,11 @@ discard block |
|
|
block discarded – undo |
4488
|
4488
|
|
4489
|
4489
|
// Set default value if not already set by caller |
4490
|
4490
|
if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
4491
|
|
- dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
4491
|
+ dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
4492
|
4492
|
$selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
4493
|
4493
|
} |
4494
|
4494
|
|
4495
|
|
- $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4495
|
+ $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
4496
|
4496
|
if ($empty) { |
4497
|
4497
|
$out .= '<option value=""> </option>'; |
4498
|
4498
|
} |
|
@@ -4513,13 +4513,13 @@ discard block |
|
|
block discarded – undo |
4513
|
4513
|
} |
4514
|
4514
|
|
4515
|
4515
|
if ($format == 0) { |
4516
|
|
- $out .= '<option value="' . $id . '"'; |
|
4516
|
+ $out .= '<option value="'.$id.'"'; |
4517
|
4517
|
} elseif ($format == 1) { |
4518
|
|
- $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4518
|
+ $out .= '<option value="'.$arraytypes['code'].'"'; |
4519
|
4519
|
} elseif ($format == 2) { |
4520
|
|
- $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
4520
|
+ $out .= '<option value="'.$arraytypes['code'].'"'; |
4521
|
4521
|
} elseif ($format == 3) { |
4522
|
|
- $out .= '<option value="' . $id . '"'; |
|
4522
|
+ $out .= '<option value="'.$id.'"'; |
4523
|
4523
|
} |
4524
|
4524
|
// Print attribute selected or not |
4525
|
4525
|
if ($format == 1 || $format == 2) { |
|
@@ -4549,7 +4549,7 @@ discard block |
|
|
block discarded – undo |
4549
|
4549
|
if ($user->admin && !$noadmininfo) { |
4550
|
4550
|
$out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4551
|
4551
|
} |
4552
|
|
- $out .= ajax_combobox('select' . $htmlname); |
|
4552
|
+ $out .= ajax_combobox('select'.$htmlname); |
4553
|
4553
|
|
4554
|
4554
|
if (empty($nooutput)) { |
4555
|
4555
|
print $out; |
|
@@ -4571,22 +4571,22 @@ discard block |
|
|
block discarded – undo |
4571
|
4571
|
{ |
4572
|
4572
|
global $langs; |
4573
|
4573
|
|
4574
|
|
- $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
4574
|
+ $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
4575
|
4575
|
$options = array( |
4576
|
4576
|
'HT' => $langs->trans("HT"), |
4577
|
4577
|
'TTC' => $langs->trans("TTC") |
4578
|
4578
|
); |
4579
|
4579
|
foreach ($options as $id => $value) { |
4580
|
4580
|
if ($selected == $id) { |
4581
|
|
- $return .= '<option value="' . $id . '" selected>' . $value; |
|
4581
|
+ $return .= '<option value="'.$id.'" selected>'.$value; |
4582
|
4582
|
} else { |
4583
|
|
- $return .= '<option value="' . $id . '">' . $value; |
|
4583
|
+ $return .= '<option value="'.$id.'">'.$value; |
4584
|
4584
|
} |
4585
|
4585
|
$return .= '</option>'; |
4586
|
4586
|
} |
4587
|
4587
|
$return .= '</select>'; |
4588
|
4588
|
if ($addjscombo) { |
4589
|
|
- $return .= ajax_combobox('select_' . $htmlname); |
|
4589
|
+ $return .= ajax_combobox('select_'.$htmlname); |
4590
|
4590
|
} |
4591
|
4591
|
|
4592
|
4592
|
return $return; |
|
@@ -4604,7 +4604,7 @@ discard block |
|
|
block discarded – undo |
4604
|
4604
|
// phpcs:enable |
4605
|
4605
|
global $langs; |
4606
|
4606
|
|
4607
|
|
- $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
4607
|
+ $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
4608
|
4608
|
if ($num > 0) { |
4609
|
4609
|
return $num; // Cache already loaded |
4610
|
4610
|
} |
|
@@ -4614,8 +4614,8 @@ discard block |
|
|
block discarded – undo |
4614
|
4614
|
$this->cache_transport_mode = array(); |
4615
|
4615
|
|
4616
|
4616
|
$sql = "SELECT rowid, code, label, active"; |
4617
|
|
- $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
4618
|
|
- $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
4617
|
+ $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
4618
|
+ $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
4619
|
4619
|
|
4620
|
4620
|
$resql = $this->db->query($sql); |
4621
|
4621
|
if ($resql) { |
|
@@ -4625,7 +4625,7 @@ discard block |
|
|
block discarded – undo |
4625
|
4625
|
$obj = $this->db->fetch_object($resql); |
4626
|
4626
|
|
4627
|
4627
|
// If traduction exist, we use it else we take the default label |
4628
|
|
- $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
4628
|
+ $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
4629
|
4629
|
$this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
4630
|
4630
|
$this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
4631
|
4631
|
$this->cache_transport_mode[$obj->rowid]['label'] = $label; |
|
@@ -4659,11 +4659,11 @@ discard block |
|
|
block discarded – undo |
4659
|
4659
|
{ |
4660
|
4660
|
global $langs, $user; |
4661
|
4661
|
|
4662
|
|
- dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
4662
|
+ dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
4663
|
4663
|
|
4664
|
4664
|
$this->load_cache_transport_mode(); |
4665
|
4665
|
|
4666
|
|
- print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
4666
|
+ print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
4667
|
4667
|
if ($empty) { |
4668
|
4668
|
print '<option value=""> </option>'; |
4669
|
4669
|
} |
|
@@ -4679,13 +4679,13 @@ discard block |
|
|
block discarded – undo |
4679
|
4679
|
} |
4680
|
4680
|
|
4681
|
4681
|
if ($format == 0) { |
4682
|
|
- print '<option value="' . $id . '"'; |
|
4682
|
+ print '<option value="'.$id.'"'; |
4683
|
4683
|
} elseif ($format == 1) { |
4684
|
|
- print '<option value="' . $arraytypes['code'] . '"'; |
|
4684
|
+ print '<option value="'.$arraytypes['code'].'"'; |
4685
|
4685
|
} elseif ($format == 2) { |
4686
|
|
- print '<option value="' . $arraytypes['code'] . '"'; |
|
4686
|
+ print '<option value="'.$arraytypes['code'].'"'; |
4687
|
4687
|
} elseif ($format == 3) { |
4688
|
|
- print '<option value="' . $id . '"'; |
|
4688
|
+ print '<option value="'.$id.'"'; |
4689
|
4689
|
} |
4690
|
4690
|
// If text is selected, we compare with code, else with id |
4691
|
4691
|
if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
|
@@ -4733,31 +4733,31 @@ discard block |
|
|
block discarded – undo |
4733
|
4733
|
$langs->load("deliveries"); |
4734
|
4734
|
|
4735
|
4735
|
$sql = "SELECT rowid, code, libelle as label"; |
4736
|
|
- $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
4736
|
+ $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
4737
|
4737
|
$sql .= " WHERE active > 0"; |
4738
|
4738
|
if ($filtre) { |
4739
|
|
- $sql .= " AND " . $filtre; |
|
4739
|
+ $sql .= " AND ".$filtre; |
4740
|
4740
|
} |
4741
|
4741
|
$sql .= " ORDER BY libelle ASC"; |
4742
|
4742
|
|
4743
|
|
- dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
4743
|
+ dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
4744
|
4744
|
$result = $this->db->query($sql); |
4745
|
4745
|
if ($result) { |
4746
|
4746
|
$num = $this->db->num_rows($result); |
4747
|
4747
|
$i = 0; |
4748
|
4748
|
if ($num) { |
4749
|
|
- print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4749
|
+ print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
4750
|
4750
|
if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4751
|
4751
|
print '<option value="-1"> </option>'; |
4752
|
4752
|
} |
4753
|
4753
|
while ($i < $num) { |
4754
|
4754
|
$obj = $this->db->fetch_object($result); |
4755
|
4755
|
if ($selected == $obj->rowid) { |
4756
|
|
- print '<option value="' . $obj->rowid . '" selected>'; |
|
4756
|
+ print '<option value="'.$obj->rowid.'" selected>'; |
4757
|
4757
|
} else { |
4758
|
|
- print '<option value="' . $obj->rowid . '">'; |
|
4758
|
+ print '<option value="'.$obj->rowid.'">'; |
4759
|
4759
|
} |
4760
|
|
- print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
4760
|
+ print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
4761
|
4761
|
print '</option>'; |
4762
|
4762
|
$i++; |
4763
|
4763
|
} |
|
@@ -4766,7 +4766,7 @@ discard block |
|
|
block discarded – undo |
4766
|
4766
|
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
4767
|
4767
|
} |
4768
|
4768
|
|
4769
|
|
- print ajax_combobox('select' . $htmlname); |
|
4769
|
+ print ajax_combobox('select'.$htmlname); |
4770
|
4770
|
} else { |
4771
|
4771
|
print $langs->trans("NoShippingMethodDefined"); |
4772
|
4772
|
} |
|
@@ -4791,16 +4791,16 @@ discard block |
|
|
block discarded – undo |
4791
|
4791
|
$langs->load("deliveries"); |
4792
|
4792
|
|
4793
|
4793
|
if ($htmlname != "none") { |
4794
|
|
- print '<form method="POST" action="' . $page . '">'; |
|
4794
|
+ print '<form method="POST" action="'.$page.'">'; |
4795
|
4795
|
print '<input type="hidden" name="action" value="setshippingmethod">'; |
4796
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
4796
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
4797
|
4797
|
$this->selectShippingMethod($selected, $htmlname, '', $addempty); |
4798
|
|
- print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
4798
|
+ print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
4799
|
4799
|
print '</form>'; |
4800
|
4800
|
} else { |
4801
|
4801
|
if ($selected) { |
4802
|
4802
|
$code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
4803
|
|
- print $langs->trans("SendingMethod" . strtoupper($code)); |
|
4803
|
+ print $langs->trans("SendingMethod".strtoupper($code)); |
4804
|
4804
|
} else { |
4805
|
4805
|
print " "; |
4806
|
4806
|
} |
|
@@ -4823,10 +4823,10 @@ discard block |
|
|
block discarded – undo |
4823
|
4823
|
|
4824
|
4824
|
$opt = '<option value="" selected></option>'; |
4825
|
4825
|
$sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
4826
|
|
- $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
4827
|
|
- $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
4826
|
+ $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
4827
|
+ $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
4828
|
4828
|
$sql .= ' AND situation_counter >= 1'; |
4829
|
|
- $sql .= ' AND fk_soc = ' . (int) $socid; |
|
4829
|
+ $sql .= ' AND fk_soc = '.(int) $socid; |
4830
|
4830
|
$sql .= ' AND type <> 2'; |
4831
|
4831
|
$sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
4832
|
4832
|
$resql = $this->db->query($sql); |
|
@@ -4844,19 +4844,19 @@ discard block |
|
|
block discarded – undo |
4844
|
4844
|
//Not prov? |
4845
|
4845
|
if (substr($obj->ref, 1, 4) != 'PROV') { |
4846
|
4846
|
if ($selected == $obj->rowid) { |
4847
|
|
- $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
4847
|
+ $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
4848
|
4848
|
} else { |
4849
|
|
- $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
4849
|
+ $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
4850
|
4850
|
} |
4851
|
4851
|
} |
4852
|
4852
|
} |
4853
|
4853
|
} |
4854
|
4854
|
} |
4855
|
4855
|
} else { |
4856
|
|
- dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
4856
|
+ dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
4857
|
4857
|
} |
4858
|
4858
|
if ($opt == '<option value ="" selected></option>') { |
4859
|
|
- $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
4859
|
+ $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
4860
|
4860
|
} |
4861
|
4861
|
return $opt; |
4862
|
4862
|
} |
|
@@ -4876,12 +4876,12 @@ discard block |
|
|
block discarded – undo |
4876
|
4876
|
|
4877
|
4877
|
$langs->load('products'); |
4878
|
4878
|
|
4879
|
|
- $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
4879
|
+ $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
4880
|
4880
|
|
4881
|
|
- $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
4881
|
+ $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
4882
|
4882
|
$sql .= ' WHERE active > 0'; |
4883
|
4883
|
if (!empty($unit_type)) { |
4884
|
|
- $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
4884
|
+ $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
4885
|
4885
|
} |
4886
|
4886
|
$sql .= " ORDER BY sortorder"; |
4887
|
4887
|
|
|
@@ -4893,14 +4893,14 @@ discard block |
|
|
block discarded – undo |
4893
|
4893
|
|
4894
|
4894
|
while ($res = $this->db->fetch_object($resql)) { |
4895
|
4895
|
$unitLabel = $res->label; |
4896
|
|
- if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
4897
|
|
- $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
4896
|
+ if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
4897
|
+ $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
4898
|
4898
|
} |
4899
|
4899
|
|
4900
|
4900
|
if ($selected == $res->rowid) { |
4901
|
|
- $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
4901
|
+ $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
4902
|
4902
|
} else { |
4903
|
|
- $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
4903
|
+ $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
4904
|
4904
|
} |
4905
|
4905
|
} |
4906
|
4906
|
$return .= '</select>'; |
|
@@ -4935,23 +4935,23 @@ discard block |
|
|
block discarded – undo |
4935
|
4935
|
$num = 0; |
4936
|
4936
|
|
4937
|
4937
|
$sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
4938
|
|
- $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
4939
|
|
- $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
4938
|
+ $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
4939
|
+ $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
4940
|
4940
|
if ($status != 2) { |
4941
|
|
- $sql .= " AND clos = " . (int) $status; |
|
4941
|
+ $sql .= " AND clos = ".(int) $status; |
4942
|
4942
|
} |
4943
|
4943
|
if ($filtre) { // TODO Support USF |
4944
|
|
- $sql .= " AND " . $filtre; |
|
4944
|
+ $sql .= " AND ".$filtre; |
4945
|
4945
|
} |
4946
|
4946
|
$sql .= " ORDER BY label"; |
4947
|
4947
|
|
4948
|
|
- dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
4948
|
+ dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
4949
|
4949
|
$result = $this->db->query($sql); |
4950
|
4950
|
if ($result) { |
4951
|
4951
|
$num = $this->db->num_rows($result); |
4952
|
4952
|
$i = 0; |
4953
|
4953
|
if ($num) { |
4954
|
|
- $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
4954
|
+ $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
4955
|
4955
|
if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
4956
|
4956
|
$out .= '<option value="-1"> </option>'; |
4957
|
4957
|
} |
|
@@ -4959,27 +4959,27 @@ discard block |
|
|
block discarded – undo |
4959
|
4959
|
while ($i < $num) { |
4960
|
4960
|
$obj = $this->db->fetch_object($result); |
4961
|
4961
|
if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
4962
|
|
- $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
4962
|
+ $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
4963
|
4963
|
} else { |
4964
|
|
- $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
4964
|
+ $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
4965
|
4965
|
} |
4966
|
4966
|
$out .= trim($obj->label); |
4967
|
4967
|
if ($showcurrency) { |
4968
|
|
- $out .= ' (' . $obj->currency_code . ')'; |
|
4968
|
+ $out .= ' ('.$obj->currency_code.')'; |
4969
|
4969
|
} |
4970
|
4970
|
if ($status == 2 && $obj->status == 1) { |
4971
|
|
- $out .= ' (' . $langs->trans("Closed") . ')'; |
|
4971
|
+ $out .= ' ('.$langs->trans("Closed").')'; |
4972
|
4972
|
} |
4973
|
4973
|
$out .= '</option>'; |
4974
|
4974
|
$i++; |
4975
|
4975
|
} |
4976
|
4976
|
$out .= "</select>"; |
4977
|
|
- $out .= ajax_combobox('select' . $htmlname); |
|
4977
|
+ $out .= ajax_combobox('select'.$htmlname); |
4978
|
4978
|
} else { |
4979
|
4979
|
if ($status == 0) { |
4980
|
|
- $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
4980
|
+ $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
4981
|
4981
|
} else { |
4982
|
|
- $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
4982
|
+ $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
4983
|
4983
|
} |
4984
|
4984
|
} |
4985
|
4985
|
} else { |
|
@@ -5015,23 +5015,23 @@ discard block |
|
|
block discarded – undo |
5015
|
5015
|
$num = 0; |
5016
|
5016
|
|
5017
|
5017
|
$sql = "SELECT rowid, name, fk_country, status, entity"; |
5018
|
|
- $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
5018
|
+ $sql .= " FROM ".$this->db->prefix()."establishment"; |
5019
|
5019
|
$sql .= " WHERE 1=1"; |
5020
|
5020
|
if ($status != 2) { |
5021
|
|
- $sql .= " AND status = " . (int) $status; |
|
5021
|
+ $sql .= " AND status = ".(int) $status; |
5022
|
5022
|
} |
5023
|
5023
|
if ($filtre) { // TODO Support USF |
5024
|
|
- $sql .= " AND " . $filtre; |
|
5024
|
+ $sql .= " AND ".$filtre; |
5025
|
5025
|
} |
5026
|
5026
|
$sql .= " ORDER BY name"; |
5027
|
5027
|
|
5028
|
|
- dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
5028
|
+ dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
5029
|
5029
|
$result = $this->db->query($sql); |
5030
|
5030
|
if ($result) { |
5031
|
5031
|
$num = $this->db->num_rows($result); |
5032
|
5032
|
$i = 0; |
5033
|
5033
|
if ($num) { |
5034
|
|
- print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
5034
|
+ print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
5035
|
5035
|
if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5036
|
5036
|
print '<option value="-1"> </option>'; |
5037
|
5037
|
} |
|
@@ -5039,13 +5039,13 @@ discard block |
|
|
block discarded – undo |
5039
|
5039
|
while ($i < $num) { |
5040
|
5040
|
$obj = $this->db->fetch_object($result); |
5041
|
5041
|
if ($selected == $obj->rowid) { |
5042
|
|
- print '<option value="' . $obj->rowid . '" selected>'; |
|
5042
|
+ print '<option value="'.$obj->rowid.'" selected>'; |
5043
|
5043
|
} else { |
5044
|
|
- print '<option value="' . $obj->rowid . '">'; |
|
5044
|
+ print '<option value="'.$obj->rowid.'">'; |
5045
|
5045
|
} |
5046
|
5046
|
print trim($obj->name); |
5047
|
5047
|
if ($status == 2 && $obj->status == 1) { |
5048
|
|
- print ' (' . $langs->trans("Closed") . ')'; |
|
5048
|
+ print ' ('.$langs->trans("Closed").')'; |
5049
|
5049
|
} |
5050
|
5050
|
print '</option>'; |
5051
|
5051
|
$i++; |
|
@@ -5053,9 +5053,9 @@ discard block |
|
|
block discarded – undo |
5053
|
5053
|
print "</select>"; |
5054
|
5054
|
} else { |
5055
|
5055
|
if ($status == 0) { |
5056
|
|
- print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
5056
|
+ print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
5057
|
5057
|
} else { |
5058
|
|
- print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
5058
|
+ print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
5059
|
5059
|
} |
5060
|
5060
|
} |
5061
|
5061
|
|
|
@@ -5079,20 +5079,20 @@ discard block |
|
|
block discarded – undo |
5079
|
5079
|
{ |
5080
|
5080
|
global $langs; |
5081
|
5081
|
if ($htmlname != "none") { |
5082
|
|
- print '<form method="POST" action="' . $page . '">'; |
|
5082
|
+ print '<form method="POST" action="'.$page.'">'; |
5083
|
5083
|
print '<input type="hidden" name="action" value="setbankaccount">'; |
5084
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5084
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
5085
|
5085
|
print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
5086
|
5086
|
$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
5087
|
5087
|
if ($nbaccountfound > 0) { |
5088
|
|
- print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5088
|
+ print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
5089
|
5089
|
} |
5090
|
5090
|
print '</form>'; |
5091
|
5091
|
} else { |
5092
|
5092
|
$langs->load('banks'); |
5093
|
5093
|
|
5094
|
5094
|
if ($selected) { |
5095
|
|
- require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
5095
|
+ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
5096
|
5096
|
$bankstatic = new Account($this->db); |
5097
|
5097
|
$result = $bankstatic->fetch($selected); |
5098
|
5098
|
if ($result) { |
|
@@ -5131,19 +5131,19 @@ discard block |
|
|
block discarded – undo |
5131
|
5131
|
global $conf, $langs; |
5132
|
5132
|
$langs->load("categories"); |
5133
|
5133
|
|
5134
|
|
- include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
5134
|
+ include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
5135
|
5135
|
|
5136
|
5136
|
// For backward compatibility |
5137
|
5137
|
if (is_numeric($type)) { |
5138
|
|
- dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
5138
|
+ dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
5139
|
5139
|
} |
5140
|
5140
|
|
5141
|
5141
|
if ($type === Categorie::TYPE_BANK_LINE) { |
5142
|
5142
|
// TODO Move this into common category feature |
5143
|
5143
|
$cate_arbo = array(); |
5144
|
5144
|
$sql = "SELECT c.label, c.rowid"; |
5145
|
|
- $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
5146
|
|
- $sql .= " WHERE entity = " . $conf->entity; |
|
5145
|
+ $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
5146
|
+ $sql .= " WHERE entity = ".$conf->entity; |
5147
|
5147
|
$sql .= " ORDER BY c.label"; |
5148
|
5148
|
$result = $this->db->query($sql); |
5149
|
5149
|
if ($result) { |
|
@@ -5169,12 +5169,12 @@ discard block |
|
|
block discarded – undo |
5169
|
5169
|
$outarrayrichhtml = array(); |
5170
|
5170
|
|
5171
|
5171
|
|
5172
|
|
- $output = '<select class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
5172
|
+ $output = '<select class="flat minwidth100'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
5173
|
5173
|
if (is_array($cate_arbo)) { |
5174
|
5174
|
$num = count($cate_arbo); |
5175
|
5175
|
|
5176
|
5176
|
if (!$num) { |
5177
|
|
- $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
5177
|
+ $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
5178
|
5178
|
} else { |
5179
|
5179
|
if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
5180
|
5180
|
$output .= '<option value="-1"> </option>'; |
|
@@ -5186,15 +5186,15 @@ discard block |
|
|
block discarded – undo |
5186
|
5186
|
$add = ''; |
5187
|
5187
|
} |
5188
|
5188
|
|
5189
|
|
- $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
5189
|
+ $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
5190
|
5190
|
$labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5191
|
5191
|
|
5192
|
5192
|
$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
5193
|
5193
|
|
5194
|
5194
|
$outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
5195
|
5195
|
|
5196
|
|
- $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
5197
|
|
- $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
5196
|
+ $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
5197
|
+ $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
5198
|
5198
|
$output .= '>'; |
5199
|
5199
|
$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
5200
|
5200
|
$output .= '</option>'; |
|
@@ -5236,7 +5236,7 @@ discard block |
|
|
block discarded – undo |
5236
|
5236
|
public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
5237
|
5237
|
{ |
5238
|
5238
|
// phpcs:enable |
5239
|
|
- dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
5239
|
+ dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
5240
|
5240
|
print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
5241
|
5241
|
} |
5242
|
5242
|
|
|
@@ -5271,7 +5271,7 @@ discard block |
|
|
block discarded – undo |
5271
|
5271
|
{ |
5272
|
5272
|
global $langs, $conf; |
5273
|
5273
|
|
5274
|
|
- $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
5274
|
+ $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
5275
|
5275
|
$formconfirm = ''; |
5276
|
5276
|
$inputok = array(); |
5277
|
5277
|
$inputko = array(); |
|
@@ -5295,27 +5295,27 @@ discard block |
|
|
block discarded – undo |
5295
|
5295
|
foreach ($formquestion as $key => $input) { |
5296
|
5296
|
if (is_array($input) && !empty($input)) { |
5297
|
5297
|
if ($input['type'] == 'hidden') { |
5298
|
|
- $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
5299
|
|
- $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5298
|
+ $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5299
|
+ $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
5300
|
5300
|
|
5301
|
|
- $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"; |
|
5301
|
+ $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"; |
5302
|
5302
|
} |
5303
|
5303
|
} |
5304
|
5304
|
} |
5305
|
5305
|
|
5306
|
5306
|
// Now add questions |
5307
|
5307
|
$moreonecolumn = ''; |
5308
|
|
- $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
5308
|
+ $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
5309
|
5309
|
foreach ($formquestion as $key => $input) { |
5310
|
5310
|
if (is_array($input) && !empty($input)) { |
5311
|
|
- $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
5312
|
|
- $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
5313
|
|
- $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
5311
|
+ $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
5312
|
+ $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
5313
|
+ $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
5314
|
5314
|
|
5315
|
5315
|
if ($input['type'] == 'text') { |
5316
|
|
- $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"; |
|
5316
|
+ $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"; |
5317
|
5317
|
} elseif ($input['type'] == 'password') { |
5318
|
|
- $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"; |
|
5318
|
+ $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"; |
5319
|
5319
|
} elseif ($input['type'] == 'textarea') { |
5320
|
5320
|
/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
5321
|
5321
|
$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
|
@@ -5323,8 +5323,8 @@ discard block |
|
|
block discarded – undo |
5323
|
5323
|
$more .= '</textarea>'; |
5324
|
5324
|
$more .= '</div></div>'."\n";*/ |
5325
|
5325
|
$moreonecolumn .= '<div class="margintoponly">'; |
5326
|
|
- $moreonecolumn .= $input['label'] . '<br>'; |
5327
|
|
- $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
5326
|
+ $moreonecolumn .= $input['label'].'<br>'; |
|
5327
|
+ $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
5328
|
5328
|
$moreonecolumn .= $input['value']; |
5329
|
5329
|
$moreonecolumn .= '</textarea>'; |
5330
|
5330
|
$moreonecolumn .= '</div>'; |
|
@@ -5341,20 +5341,20 @@ discard block |
|
|
block discarded – undo |
5341
|
5341
|
$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
5342
|
5342
|
$sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
5343
|
5343
|
|
5344
|
|
- $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
5344
|
+ $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
5345
|
5345
|
if (!empty($input['label'])) { |
5346
|
|
- $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
5346
|
+ $more .= $input['label'].'</div><div class="tagtd left">'; |
5347
|
5347
|
} |
5348
|
5348
|
if ($input['type'] == 'select') { |
5349
|
5349
|
$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); |
5350
|
5350
|
} else { |
5351
|
5351
|
$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); |
5352
|
5352
|
} |
5353
|
|
- $more .= '</div></div>' . "\n"; |
|
5353
|
+ $more .= '</div></div>'."\n"; |
5354
|
5354
|
} elseif ($input['type'] == 'checkbox') { |
5355
|
5355
|
$more .= '<div class="tagtr">'; |
5356
|
|
- $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
5357
|
|
- $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
5356
|
+ $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
5357
|
+ $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
5358
|
5358
|
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
5359
|
5359
|
$more .= ' checked'; |
5360
|
5360
|
} |
|
@@ -5365,19 +5365,19 @@ discard block |
|
|
block discarded – undo |
5365
|
5365
|
$more .= ' disabled'; |
5366
|
5366
|
} |
5367
|
5367
|
$more .= ' /></div>'; |
5368
|
|
- $more .= '</div>' . "\n"; |
|
5368
|
+ $more .= '</div>'."\n"; |
5369
|
5369
|
} elseif ($input['type'] == 'radio') { |
5370
|
5370
|
$i = 0; |
5371
|
5371
|
foreach ($input['values'] as $selkey => $selval) { |
5372
|
5372
|
$more .= '<div class="tagtr">'; |
5373
|
5373
|
if (isset($input['label'])) { |
5374
|
5374
|
if ($i == 0) { |
5375
|
|
- $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5375
|
+ $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
5376
|
5376
|
} else { |
5377
|
|
- $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
5377
|
+ $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
5378
|
5378
|
} |
5379
|
5379
|
} |
5380
|
|
- $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; |
|
5380
|
+ $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; |
5381
|
5381
|
if (!empty($input['disabled'])) { |
5382
|
5382
|
$more .= ' disabled'; |
5383
|
5383
|
} |
|
@@ -5385,12 +5385,12 @@ discard block |
|
|
block discarded – undo |
5385
|
5385
|
$more .= ' checked="checked"'; |
5386
|
5386
|
} |
5387
|
5387
|
$more .= ' /> '; |
5388
|
|
- $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
5389
|
|
- $more .= '</div></div>' . "\n"; |
|
5388
|
+ $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
5389
|
+ $more .= '</div></div>'."\n"; |
5390
|
5390
|
$i++; |
5391
|
5391
|
} |
5392
|
5392
|
} elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
5393
|
|
- $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
5393
|
+ $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
5394
|
5394
|
$more .= '<div class="tagtd">'; |
5395
|
5395
|
$addnowlink = (empty($input['datenow']) ? 0 : 1); |
5396
|
5396
|
$h = $m = 0; |
|
@@ -5408,24 +5408,24 @@ discard block |
|
|
block discarded – undo |
5408
|
5408
|
} elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
5409
|
5409
|
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
5410
|
5410
|
if (!empty($input['label'])) { |
5411
|
|
- $more .= $input['label'] . '</div><div class="tagtd">'; |
|
5411
|
+ $more .= $input['label'].'</div><div class="tagtd">'; |
5412
|
5412
|
} |
5413
|
5413
|
$more .= $input['value']; |
5414
|
|
- $more .= '</div></div>' . "\n"; |
|
5414
|
+ $more .= '</div></div>'."\n"; |
5415
|
5415
|
} elseif ($input['type'] == 'onecolumn') { |
5416
|
5416
|
$moreonecolumn .= '<div class="margintoponly">'; |
5417
|
5417
|
$moreonecolumn .= $input['value']; |
5418
|
|
- $moreonecolumn .= '</div>' . "\n"; |
|
5418
|
+ $moreonecolumn .= '</div>'."\n"; |
5419
|
5419
|
} elseif ($input['type'] == 'hidden') { |
5420
|
5420
|
// Do nothing more, already added by a previous loop |
5421
|
5421
|
} elseif ($input['type'] == 'separator') { |
5422
|
5422
|
$more .= '<br>'; |
5423
|
5423
|
} else { |
5424
|
|
- $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
5424
|
+ $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
5425
|
5425
|
} |
5426
|
5426
|
} |
5427
|
5427
|
} |
5428
|
|
- $more .= '</div>' . "\n"; |
|
5428
|
+ $more .= '</div>'."\n"; |
5429
|
5429
|
$more .= $moreonecolumn; |
5430
|
5430
|
} |
5431
|
5431
|
|
|
@@ -5447,10 +5447,10 @@ discard block |
|
|
block discarded – undo |
5447
|
5447
|
$button = $useajax; |
5448
|
5448
|
$useajax = 1; |
5449
|
5449
|
$autoOpen = false; |
5450
|
|
- $dialogconfirm .= '-' . $button; |
|
5450
|
+ $dialogconfirm .= '-'.$button; |
5451
|
5451
|
} |
5452
|
|
- $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
5453
|
|
- $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
5452
|
+ $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
5453
|
+ $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
5454
|
5454
|
|
5455
|
5455
|
// Add input fields into list of fields to read during submit (inputok and inputko) |
5456
|
5456
|
if (is_array($formquestion)) { |
|
@@ -5473,24 +5473,24 @@ discard block |
|
|
block discarded – undo |
5473
|
5473
|
} |
5474
|
5474
|
|
5475
|
5475
|
// Show JQuery confirm box. |
5476
|
|
- $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
5476
|
+ $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
5477
|
5477
|
if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
5478
|
|
- $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
5478
|
+ $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
5479
|
5479
|
} |
5480
|
5480
|
if (!empty($more)) { |
5481
|
|
- $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
5481
|
+ $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
5482
|
5482
|
} |
5483
|
|
- $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help(0, '') . ' ' . $question . '</div>' : ''); |
5484
|
|
- $formconfirm .= '</div>' . "\n"; |
|
5483
|
+ $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help(0, '').' '.$question.'</div>' : ''); |
|
5484
|
+ $formconfirm .= '</div>'."\n"; |
5485
|
5485
|
|
5486
|
|
- $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
5487
|
|
- $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5486
|
+ $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
5487
|
+ $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
5488
|
5488
|
$formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
5489
|
5489
|
$formconfirm .= 'jQuery(document).ready(function() { |
5490
|
5490
|
$(function() { |
5491
|
|
- $( "#' . $dialogconfirm . '" ).dialog( |
|
5491
|
+ $( "#' . $dialogconfirm.'" ).dialog( |
5492
|
5492
|
{ |
5493
|
|
- autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
5493
|
+ autoOpen: ' . ($autoOpen ? "true" : "false").','; |
5494
|
5494
|
if ($newselectedchoice == 'no') { |
5495
|
5495
|
$formconfirm .= ' |
5496
|
5496
|
open: function() { |
|
@@ -5500,24 +5500,24 @@ discard block |
|
|
block discarded – undo |
5500
|
5500
|
|
5501
|
5501
|
$jsforcursor = ''; |
5502
|
5502
|
if ($useajax == 1) { |
5503
|
|
- $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
5504
|
|
- $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
5503
|
+ $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
5504
|
+ $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
5505
|
5505
|
} |
5506
|
5506
|
|
5507
|
5507
|
$postconfirmas = 'GET'; |
5508
|
5508
|
|
5509
|
5509
|
$formconfirm .= ' |
5510
|
5510
|
resizable: false, |
5511
|
|
- height: "' . $height . '", |
5512
|
|
- width: "' . $width . '", |
|
5511
|
+ height: "' . $height.'", |
|
5512
|
+ width: "' . $width.'", |
5513
|
5513
|
modal: true, |
5514
|
5514
|
closeOnEscape: false, |
5515
|
5515
|
buttons: { |
5516
|
|
- "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
5517
|
|
- var options = "token=' . urlencode(newToken()) . '"; |
5518
|
|
- var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
5519
|
|
- var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
5520
|
|
- var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
5516
|
+ "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
5517
|
+ var options = "token=' . urlencode(newToken()).'"; |
|
5518
|
+ var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
5519
|
+ var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5520
|
+ var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
5521
|
5521
|
|
5522
|
5522
|
if (inputok.length > 0) { |
5523
|
5523
|
$.each(inputok, function(i, inputname) { |
|
@@ -5551,11 +5551,11 @@ discard block |
|
|
block discarded – undo |
5551
|
5551
|
} |
5552
|
5552
|
$(this).dialog("close"); |
5553
|
5553
|
}, |
5554
|
|
- "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
5555
|
|
- var options = "token=' . urlencode(newToken()) . '"; |
5556
|
|
- var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
5557
|
|
- var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
5558
|
|
- var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
5554
|
+ "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
5555
|
+ var options = "token=' . urlencode(newToken()).'"; |
|
5556
|
+ var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
5557
|
+ var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
5558
|
+ var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
5559
|
5559
|
if (inputko.length > 0) { |
5560
|
5560
|
$.each(inputko, function(i, inputname) { |
5561
|
5561
|
var more = ""; |
|
@@ -5587,10 +5587,10 @@ discard block |
|
|
block discarded – undo |
5587
|
5587
|
} |
5588
|
5588
|
); |
5589
|
5589
|
|
5590
|
|
- var button = "' . $button . '"; |
|
5590
|
+ var button = "' . $button.'"; |
5591
|
5591
|
if (button.length > 0) { |
5592
|
5592
|
$( "#" + button ).click(function() { |
5593
|
|
- $("#' . $dialogconfirm . '").dialog("open"); |
|
5593
|
+ $("#' . $dialogconfirm.'").dialog("open"); |
5594
|
5594
|
}); |
5595
|
5595
|
} |
5596
|
5596
|
}); |
|
@@ -5598,44 +5598,44 @@ discard block |
|
|
block discarded – undo |
5598
|
5598
|
</script>'; |
5599
|
5599
|
$formconfirm .= "<!-- end ajax formconfirm -->\n"; |
5600
|
5600
|
} else { |
5601
|
|
- $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
5601
|
+ $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
5602
|
5602
|
|
5603
|
5603
|
if (empty($disableformtag)) { |
5604
|
|
- $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
5604
|
+ $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
5605
|
5605
|
} |
5606
|
5606
|
|
5607
|
|
- $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
5608
|
|
- $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
5607
|
+ $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
5608
|
+ $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
5609
|
5609
|
|
5610
|
|
- $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
5610
|
+ $formconfirm .= '<table class="valid centpercent">'."\n"; |
5611
|
5611
|
|
5612
|
5612
|
// Line title |
5613
|
5613
|
$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
5614
|
|
- $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
5615
|
|
- $formconfirm .= '</td></tr>' . "\n"; |
|
5614
|
+ $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
5615
|
+ $formconfirm .= '</td></tr>'."\n"; |
5616
|
5616
|
|
5617
|
5617
|
// Line text |
5618
|
5618
|
if (is_array($formquestion) && array_key_exists('text', $formquestion) && !empty($formquestion['text'])) { |
5619
|
|
- $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
5619
|
+ $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
5620
|
5620
|
} |
5621
|
5621
|
|
5622
|
5622
|
// Line form fields |
5623
|
5623
|
if ($more) { |
5624
|
|
- $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
5624
|
+ $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
5625
|
5625
|
$formconfirm .= $more; |
5626
|
|
- $formconfirm .= '</td></tr>' . "\n"; |
|
5626
|
+ $formconfirm .= '</td></tr>'."\n"; |
5627
|
5627
|
} |
5628
|
5628
|
|
5629
|
5629
|
// Line with question |
5630
|
5630
|
$formconfirm .= '<tr class="valid">'; |
5631
|
|
- $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
5631
|
+ $formconfirm .= '<td class="valid">'.$question.'</td>'; |
5632
|
5632
|
$formconfirm .= '<td class="valid center">'; |
5633
|
5633
|
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
5634
|
|
- $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
5634
|
+ $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
5635
|
5635
|
$formconfirm .= '</td>'; |
5636
|
|
- $formconfirm .= '</tr>' . "\n"; |
|
5636
|
+ $formconfirm .= '</tr>'."\n"; |
5637
|
5637
|
|
5638
|
|
- $formconfirm .= '</table>' . "\n"; |
|
5638
|
+ $formconfirm .= '</table>'."\n"; |
5639
|
5639
|
|
5640
|
5640
|
if (empty($disableformtag)) { |
5641
|
5641
|
$formconfirm .= "</form>\n"; |
|
@@ -5644,7 +5644,7 @@ discard block |
|
|
block discarded – undo |
5644
|
5644
|
|
5645
|
5645
|
if (!empty($conf->use_javascript_ajax)) { |
5646
|
5646
|
$formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
5647
|
|
- $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
5647
|
+ $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
5648
|
5648
|
$formconfirm .= ' |
5649
|
5649
|
$(document).ready(function () { |
5650
|
5650
|
$(".confirmvalidatebutton").on("click", function() { |
|
@@ -5656,7 +5656,7 @@ discard block |
|
|
block discarded – undo |
5656
|
5656
|
}); |
5657
|
5657
|
}); |
5658
|
5658
|
'; |
5659
|
|
- $formconfirm .= '</script>' . "\n"; |
|
5659
|
+ $formconfirm .= '</script>'."\n"; |
5660
|
5660
|
} |
5661
|
5661
|
|
5662
|
5662
|
$formconfirm .= "<!-- end formconfirm -->\n"; |
|
@@ -5688,8 +5688,8 @@ discard block |
|
|
block discarded – undo |
5688
|
5688
|
// phpcs:enable |
5689
|
5689
|
global $langs; |
5690
|
5690
|
|
5691
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
5692
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
5691
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
5692
|
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
5693
|
5693
|
|
5694
|
5694
|
$out = ''; |
5695
|
5695
|
|
|
@@ -5697,11 +5697,11 @@ discard block |
|
|
block discarded – undo |
5697
|
5697
|
|
5698
|
5698
|
$langs->load("project"); |
5699
|
5699
|
if ($htmlname != "none") { |
5700
|
|
- $out .= '<form method="post" action="' . $page . '">'; |
|
5700
|
+ $out .= '<form method="post" action="'.$page.'">'; |
5701
|
5701
|
$out .= '<input type="hidden" name="action" value="classin">'; |
5702
|
|
- $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5702
|
+ $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
5703
|
5703
|
$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
5704
|
|
- $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5704
|
+ $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
5705
|
5705
|
$out .= '</form>'; |
5706
|
5706
|
} else { |
5707
|
5707
|
$out .= '<span class="project_head_block">'; |
|
@@ -5710,7 +5710,7 @@ discard block |
|
|
block discarded – undo |
5710
|
5710
|
$projet->fetch($selected); |
5711
|
5711
|
$out .= $projet->getNomUrl(0, '', 1); |
5712
|
5712
|
} else { |
5713
|
|
- $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
5713
|
+ $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
5714
|
5714
|
} |
5715
|
5715
|
$out .= '</span>'; |
5716
|
5716
|
} |
|
@@ -5747,14 +5747,14 @@ discard block |
|
|
block discarded – undo |
5747
|
5747
|
$out = ''; |
5748
|
5748
|
|
5749
|
5749
|
if ($htmlname != "none") { |
5750
|
|
- $out .= '<form method="POST" action="' . $page . '">'; |
|
5750
|
+ $out .= '<form method="POST" action="'.$page.'">'; |
5751
|
5751
|
$out .= '<input type="hidden" name="action" value="setconditions">'; |
5752
|
|
- $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5752
|
+ $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
5753
|
5753
|
if ($type) { |
5754
|
|
- $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5754
|
+ $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
5755
|
5755
|
} |
5756
|
5756
|
$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
5757
|
|
- $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5757
|
+ $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
5758
|
5758
|
$out .= '</form>'; |
5759
|
5759
|
} else { |
5760
|
5760
|
if ($selected) { |
|
@@ -5799,12 +5799,12 @@ discard block |
|
|
block discarded – undo |
5799
|
5799
|
// phpcs:enable |
5800
|
5800
|
global $langs; |
5801
|
5801
|
if ($htmlname != "none") { |
5802
|
|
- print '<form method="post" action="' . $page . '">'; |
|
5802
|
+ print '<form method="post" action="'.$page.'">'; |
5803
|
5803
|
print '<input type="hidden" name="action" value="setavailability">'; |
5804
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5804
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
5805
|
5805
|
$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
5806
|
|
- print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
5807
|
|
- print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
5806
|
+ print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
5807
|
+ print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
5808
|
5808
|
print '</form>'; |
5809
|
5809
|
} else { |
5810
|
5810
|
if ($selected) { |
|
@@ -5830,11 +5830,11 @@ discard block |
|
|
block discarded – undo |
5830
|
5830
|
{ |
5831
|
5831
|
global $langs; |
5832
|
5832
|
if ($htmlname != "none") { |
5833
|
|
- print '<form method="post" action="' . $page . '">'; |
|
5833
|
+ print '<form method="post" action="'.$page.'">'; |
5834
|
5834
|
print '<input type="hidden" name="action" value="setdemandreason">'; |
5835
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5835
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
5836
|
5836
|
$this->selectInputReason($selected, $htmlname, -1, $addempty); |
5837
|
|
- print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
5837
|
+ print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
5838
|
5838
|
print '</form>'; |
5839
|
5839
|
} else { |
5840
|
5840
|
if ($selected) { |
|
@@ -5874,17 +5874,17 @@ discard block |
|
|
block discarded – undo |
5874
|
5874
|
$ret = ''; |
5875
|
5875
|
|
5876
|
5876
|
if ($htmlname != "none") { |
5877
|
|
- $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
5878
|
|
- $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
5879
|
|
- $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5877
|
+ $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
5878
|
+ $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
5879
|
+ $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
5880
|
5880
|
if ($type) { |
5881
|
|
- $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5881
|
+ $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
5882
|
5882
|
} |
5883
|
5883
|
$ret .= '<table class="nobordernopadding">'; |
5884
|
5884
|
$ret .= '<tr><td>'; |
5885
|
|
- $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
5885
|
+ $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
5886
|
5886
|
$ret .= '</td>'; |
5887
|
|
- $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
5887
|
+ $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
5888
|
5888
|
$ret .= '</tr></table></form>'; |
5889
|
5889
|
} else { |
5890
|
5890
|
if ($displayhour) { |
|
@@ -5919,15 +5919,15 @@ discard block |
|
|
block discarded – undo |
5919
|
5919
|
global $langs; |
5920
|
5920
|
|
5921
|
5921
|
if ($htmlname != "none") { |
5922
|
|
- print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
5923
|
|
- print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
5924
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5922
|
+ print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
5923
|
+ print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
5924
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
5925
|
5925
|
print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
5926
|
|
- print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5926
|
+ print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
5927
|
5927
|
print '</form>'; |
5928
|
5928
|
} else { |
5929
|
5929
|
if ($selected) { |
5930
|
|
- require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
5930
|
+ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
5931
|
5931
|
$theuser = new User($this->db); |
5932
|
5932
|
$theuser->fetch($selected); |
5933
|
5933
|
print $theuser->getNomUrl(1); |
|
@@ -5960,14 +5960,14 @@ discard block |
|
|
block discarded – undo |
5960
|
5960
|
|
5961
|
5961
|
$out = ''; |
5962
|
5962
|
if ($htmlname != "none") { |
5963
|
|
- $out .= '<form method="POST" action="' . $page . '">'; |
|
5963
|
+ $out .= '<form method="POST" action="'.$page.'">'; |
5964
|
5964
|
$out .= '<input type="hidden" name="action" value="setmode">'; |
5965
|
|
- $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
5965
|
+ $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
5966
|
5966
|
if ($type) { |
5967
|
|
- $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
5967
|
+ $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
5968
|
5968
|
} |
5969
|
5969
|
$out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
5970
|
|
- $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
5970
|
+ $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
5971
|
5971
|
$out .= '</form>'; |
5972
|
5972
|
} else { |
5973
|
5973
|
if ($selected) { |
|
@@ -6000,11 +6000,11 @@ discard block |
|
|
block discarded – undo |
6000
|
6000
|
{ |
6001
|
6001
|
global $langs; |
6002
|
6002
|
if ($htmlname != "none") { |
6003
|
|
- print '<form method="POST" action="' . $page . '">'; |
|
6003
|
+ print '<form method="POST" action="'.$page.'">'; |
6004
|
6004
|
print '<input type="hidden" name="action" value="settransportmode">'; |
6005
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6005
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
6006
|
6006
|
$this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
6007
|
|
- print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6007
|
+ print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
6008
|
6008
|
print '</form>'; |
6009
|
6009
|
} else { |
6010
|
6010
|
if ($selected) { |
|
@@ -6031,14 +6031,14 @@ discard block |
|
|
block discarded – undo |
6031
|
6031
|
// phpcs:enable |
6032
|
6032
|
global $langs; |
6033
|
6033
|
if ($htmlname != "none") { |
6034
|
|
- print '<form method="POST" action="' . $page . '">'; |
|
6034
|
+ print '<form method="POST" action="'.$page.'">'; |
6035
|
6035
|
print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
6036
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6036
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
6037
|
6037
|
print $this->selectMultiCurrency($selected, $htmlname, 0); |
6038
|
|
- print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6038
|
+ print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
6039
|
6039
|
print '</form>'; |
6040
|
6040
|
} else { |
6041
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6041
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
6042
|
6042
|
print !empty($selected) ? currency_name($selected, 1) : ' '; |
6043
|
6043
|
} |
6044
|
6044
|
} |
|
@@ -6060,21 +6060,21 @@ discard block |
|
|
block discarded – undo |
6060
|
6060
|
global $langs, $mysoc, $conf; |
6061
|
6061
|
|
6062
|
6062
|
if ($htmlname != "none") { |
6063
|
|
- print '<form method="POST" action="' . $page . '">'; |
|
6063
|
+ print '<form method="POST" action="'.$page.'">'; |
6064
|
6064
|
print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
6065
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
6066
|
|
- print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
6065
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
6066
|
+ print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
6067
|
6067
|
print '<select name="calculation_mode">'; |
6068
|
|
- print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
6069
|
|
- print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
6068
|
+ print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
6069
|
+ print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
6070
|
6070
|
print '</select> '; |
6071
|
|
- print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6071
|
+ print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
6072
|
6072
|
print '</form>'; |
6073
|
6073
|
} else { |
6074
|
6074
|
if (!empty($rate)) { |
6075
|
6075
|
print price($rate, 1, $langs, 0, 0); |
6076
|
6076
|
if ($currency && $rate != 1) { |
6077
|
|
- print ' (' . price($rate, 1, $langs, 0, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
6077
|
+ print ' ('.price($rate, 1, $langs, 0, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
6078
|
6078
|
} |
6079
|
6079
|
} else { |
6080
|
6080
|
print 1; |
|
@@ -6105,9 +6105,9 @@ discard block |
|
|
block discarded – undo |
6105
|
6105
|
// phpcs:enable |
6106
|
6106
|
global $conf, $langs; |
6107
|
6107
|
if ($htmlname != "none") { |
6108
|
|
- print '<form method="post" action="' . $page . '">'; |
|
6108
|
+ print '<form method="post" action="'.$page.'">'; |
6109
|
6109
|
print '<input type="hidden" name="action" value="setabsolutediscount">'; |
6110
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6110
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
6111
|
6111
|
print '<div class="inline-block">'; |
6112
|
6112
|
if (!empty($discount_type)) { |
6113
|
6113
|
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
|
@@ -6145,24 +6145,24 @@ discard block |
|
|
block discarded – undo |
6145
|
6145
|
print '</div>'; |
6146
|
6146
|
if (empty($hidelist)) { |
6147
|
6147
|
print '<div class="inline-block" style="padding-right: 10px">'; |
6148
|
|
- $newfilter = 'discount_type=' . intval($discount_type); |
|
6148
|
+ $newfilter = 'discount_type='.intval($discount_type); |
6149
|
6149
|
if (!empty($discount_type)) { |
6150
|
6150
|
$newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
6151
|
6151
|
} else { |
6152
|
6152
|
$newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
6153
|
6153
|
} |
6154
|
6154
|
if ($filter) { |
6155
|
|
- $newfilter .= ' AND (' . $filter . ')'; |
|
6155
|
+ $newfilter .= ' AND ('.$filter.')'; |
6156
|
6156
|
} |
6157
|
6157
|
// output the combo of discounts |
6158
|
6158
|
$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
6159
|
6159
|
if ($nbqualifiedlines > 0) { |
6160
|
|
- print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
6160
|
+ print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
6161
|
6161
|
if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
6162
|
|
- print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6162
|
+ print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
6163
|
6163
|
} |
6164
|
6164
|
if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
6165
|
|
- print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
6165
|
+ print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
6166
|
6166
|
} |
6167
|
6167
|
|
6168
|
6168
|
print '>'; |
|
@@ -6202,23 +6202,23 @@ discard block |
|
|
block discarded – undo |
6202
|
6202
|
global $langs, $conf; |
6203
|
6203
|
|
6204
|
6204
|
if ($htmlname != "none") { |
6205
|
|
- print '<form method="post" action="' . $page . '">'; |
|
6205
|
+ print '<form method="post" action="'.$page.'">'; |
6206
|
6206
|
print '<input type="hidden" name="action" value="set_contact">'; |
6207
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6207
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
6208
|
6208
|
print '<table class="nobordernopadding">'; |
6209
|
6209
|
print '<tr><td>'; |
6210
|
6210
|
print $this->selectcontacts($societe->id, $selected, $htmlname); |
6211
|
6211
|
$num = $this->num; |
6212
|
6212
|
if ($num == 0) { |
6213
|
6213
|
$addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
6214
|
|
- print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
6214
|
+ print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
6215
|
6215
|
} |
6216
|
6216
|
print '</td>'; |
6217
|
|
- print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
6217
|
+ print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
6218
|
6218
|
print '</tr></table></form>'; |
6219
|
6219
|
} else { |
6220
|
6220
|
if ($selected) { |
6221
|
|
- require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
6221
|
+ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
6222
|
6222
|
$contact = new Contact($this->db); |
6223
|
6223
|
$contact->fetch($selected); |
6224
|
6224
|
print $contact->getFullName($langs); |
|
@@ -6253,20 +6253,20 @@ discard block |
|
|
block discarded – undo |
6253
|
6253
|
|
6254
|
6254
|
$out = ''; |
6255
|
6255
|
if ($htmlname != "none") { |
6256
|
|
- $out .= '<form method="post" action="' . $page . '">'; |
|
6256
|
+ $out .= '<form method="post" action="'.$page.'">'; |
6257
|
6257
|
$out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
6258
|
|
- $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
6258
|
+ $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
6259
|
6259
|
$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
6260
|
|
- $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
6260
|
+ $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
6261
|
6261
|
$out .= '</form>'; |
6262
|
6262
|
} else { |
6263
|
6263
|
if ($selected) { |
6264
|
|
- require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
6264
|
+ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
6265
|
6265
|
$soc = new Societe($this->db); |
6266
|
6266
|
$soc->fetch($selected); |
6267
|
6267
|
$out .= $soc->getNomUrl(0, ''); |
6268
|
6268
|
} else { |
6269
|
|
- $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
6269
|
+ $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
6270
|
6270
|
} |
6271
|
6271
|
} |
6272
|
6272
|
|
|
@@ -6316,22 +6316,22 @@ discard block |
|
|
block discarded – undo |
6316
|
6316
|
$selected = 'EUR'; // Pour compatibilite |
6317
|
6317
|
} |
6318
|
6318
|
|
6319
|
|
- $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6319
|
+ $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
6320
|
6320
|
if ($useempty) { |
6321
|
6321
|
$out .= '<option value="-1" selected></option>'; |
6322
|
6322
|
} |
6323
|
6323
|
foreach ($langs->cache_currencies as $code_iso => $currency) { |
6324
|
6324
|
$labeltoshow = $currency['label']; |
6325
|
6325
|
if ($mode == 1) { |
6326
|
|
- $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
6326
|
+ $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
6327
|
6327
|
} else { |
6328
|
|
- $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
6328
|
+ $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
6329
|
6329
|
} |
6330
|
6330
|
|
6331
|
6331
|
if ($selected && $selected == $code_iso) { |
6332
|
|
- $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6332
|
+ $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
6333
|
6333
|
} else { |
6334
|
|
- $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
6334
|
+ $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
6335
|
6335
|
} |
6336
|
6336
|
$out .= $labeltoshow; |
6337
|
6337
|
$out .= '</option>'; |
|
@@ -6342,7 +6342,7 @@ discard block |
|
|
block discarded – undo |
6342
|
6342
|
} |
6343
|
6343
|
|
6344
|
6344
|
// Make select dynamic |
6345
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6345
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
6346
|
6346
|
$out .= ajax_combobox($htmlname); |
6347
|
6347
|
|
6348
|
6348
|
return $out; |
|
@@ -6368,10 +6368,10 @@ discard block |
|
|
block discarded – undo |
6368
|
6368
|
|
6369
|
6369
|
$TCurrency = array(); |
6370
|
6370
|
|
6371
|
|
- $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
6372
|
|
- $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
6371
|
+ $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
6372
|
+ $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
6373
|
6373
|
if ($filter) { |
6374
|
|
- $sql .= " AND " . $filter; |
|
6374
|
+ $sql .= " AND ".$filter; |
6375
|
6375
|
} |
6376
|
6376
|
$resql = $this->db->query($sql); |
6377
|
6377
|
if ($resql) { |
|
@@ -6381,7 +6381,7 @@ discard block |
|
|
block discarded – undo |
6381
|
6381
|
} |
6382
|
6382
|
|
6383
|
6383
|
$out = ''; |
6384
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
6384
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
6385
|
6385
|
if ($useempty) { |
6386
|
6386
|
$out .= '<option value=""> </option>'; |
6387
|
6387
|
} |
|
@@ -6393,13 +6393,13 @@ discard block |
|
|
block discarded – undo |
6393
|
6393
|
foreach ($langs->cache_currencies as $code_iso => $currency) { |
6394
|
6394
|
if (isset($TCurrency[$code_iso])) { |
6395
|
6395
|
if (!empty($selected) && $selected == $code_iso) { |
6396
|
|
- $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
6396
|
+ $out .= '<option value="'.$code_iso.'" selected="selected">'; |
6397
|
6397
|
} else { |
6398
|
|
- $out .= '<option value="' . $code_iso . '">'; |
|
6398
|
+ $out .= '<option value="'.$code_iso.'">'; |
6399
|
6399
|
} |
6400
|
6400
|
|
6401
|
6401
|
$out .= $currency['label']; |
6402
|
|
- $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
6402
|
+ $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
6403
|
6403
|
$out .= '</option>'; |
6404
|
6404
|
} |
6405
|
6405
|
} |
|
@@ -6408,7 +6408,7 @@ discard block |
|
|
block discarded – undo |
6408
|
6408
|
$out .= '</select>'; |
6409
|
6409
|
|
6410
|
6410
|
// Make select dynamic |
6411
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
6411
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
6412
|
6412
|
$out .= ajax_combobox($htmlname); |
6413
|
6413
|
|
6414
|
6414
|
return $out; |
|
@@ -6439,7 +6439,7 @@ discard block |
|
|
block discarded – undo |
6439
|
6439
|
$sql .= " WHERE t.fk_pays = c.rowid"; |
6440
|
6440
|
$sql .= " AND t.active > 0"; |
6441
|
6441
|
$sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
6442
|
|
- $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
6442
|
+ $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
6443
|
6443
|
$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
6444
|
6444
|
|
6445
|
6445
|
$resql = $this->db->query($sql); |
|
@@ -6451,30 +6451,30 @@ discard block |
|
|
block discarded – undo |
6451
|
6451
|
|
6452
|
6452
|
$tmparray = array(); |
6453
|
6453
|
$tmparray['rowid'] = $obj->rowid; |
6454
|
|
- $tmparray['type_vat'] = $obj->type_vat; |
6455
|
|
- $tmparray['code'] = $obj->code; |
|
6454
|
+ $tmparray['type_vat'] = $obj->type_vat; |
|
6455
|
+ $tmparray['code'] = $obj->code; |
6456
|
6456
|
$tmparray['txtva'] = $obj->taux; |
6457
|
|
- $tmparray['nprtva'] = $obj->recuperableonly; |
|
6457
|
+ $tmparray['nprtva'] = $obj->recuperableonly; |
6458
|
6458
|
$tmparray['localtax1'] = $obj->localtax1; |
6459
|
6459
|
$tmparray['localtax1_type'] = $obj->localtax1_type; |
6460
|
6460
|
$tmparray['localtax2'] = $obj->localtax2; |
6461
|
6461
|
$tmparray['localtax2_type'] = $obj->localtax1_type; |
6462
|
|
- $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
6463
|
|
- $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 |
|
6462
|
+ $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
6463
|
+ $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 |
6464
|
6464
|
$positiverates = ''; |
6465
|
6465
|
if ($obj->taux) { |
6466
|
|
- $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
6466
|
+ $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
6467
|
6467
|
} |
6468
|
6468
|
if ($obj->localtax1) { |
6469
|
|
- $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
6469
|
+ $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
6470
|
6470
|
} |
6471
|
6471
|
if ($obj->localtax2) { |
6472
|
|
- $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
6472
|
+ $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
6473
|
6473
|
} |
6474
|
6474
|
if (empty($positiverates)) { |
6475
|
6475
|
$positiverates = '0'; |
6476
|
6476
|
} |
6477
|
|
- $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
6477
|
+ $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
6478
|
6478
|
|
6479
|
6479
|
$this->cache_vatrates[$obj->rowid] = $tmparray; |
6480
|
6480
|
} |
|
@@ -6494,7 +6494,7 @@ discard block |
|
|
block discarded – undo |
6494
|
6494
|
return -1; |
6495
|
6495
|
} |
6496
|
6496
|
} else { |
6497
|
|
- $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
6497
|
+ $this->error = '<span class="error">'.$this->db->error().'</span>'; |
6498
|
6498
|
return -2; |
6499
|
6499
|
} |
6500
|
6500
|
} |
|
@@ -6547,9 +6547,9 @@ discard block |
|
|
block discarded – undo |
6547
|
6547
|
// Check parameters |
6548
|
6548
|
if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
6549
|
6549
|
if ($societe_vendeuse->id == $mysoc->id) { |
6550
|
|
- $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
6550
|
+ $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
6551
|
6551
|
} else { |
6552
|
|
- $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
6552
|
+ $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
6553
|
6553
|
} |
6554
|
6554
|
return $return; |
6555
|
6555
|
} |
|
@@ -6561,12 +6561,12 @@ discard block |
|
|
block discarded – undo |
6561
|
6561
|
// Define list of countries to use to search VAT rates to show |
6562
|
6562
|
// First we defined code_country to use to find list |
6563
|
6563
|
if (is_object($societe_vendeuse)) { |
6564
|
|
- $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
6564
|
+ $code_country = "'".$societe_vendeuse->country_code."'"; |
6565
|
6565
|
} else { |
6566
|
|
- $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
6566
|
+ $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
6567
|
6567
|
} |
6568
|
6568
|
if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
6569
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
6569
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
6570
|
6570
|
// If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
6571
|
6571
|
// If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
6572
|
6572
|
$selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
|
@@ -6576,27 +6576,27 @@ discard block |
|
|
block discarded – undo |
6576
|
6576
|
if ($type == 1) { // We know product is a service |
6577
|
6577
|
switch ($selectVatComboMode) { |
6578
|
6578
|
case '1': |
6579
|
|
- $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6579
|
+ $code_country .= ",'".$societe_acheteuse->country_code."'"; |
6580
|
6580
|
break; |
6581
|
6581
|
case '2': |
6582
|
|
- $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
6582
|
+ $code_country = "'".$societe_acheteuse->country_code."'"; |
6583
|
6583
|
break; |
6584
|
6584
|
} |
6585
|
6585
|
} |
6586
|
6586
|
} elseif (!$idprod) { // We don't know type of product |
6587
|
6587
|
switch ($selectVatComboMode) { |
6588
|
6588
|
case '1': |
6589
|
|
- $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6589
|
+ $code_country .= ",'".$societe_acheteuse->country_code."'"; |
6590
|
6590
|
break; |
6591
|
6591
|
case '2': |
6592
|
|
- $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
6592
|
+ $code_country = "'".$societe_acheteuse->country_code."'"; |
6593
|
6593
|
break; |
6594
|
6594
|
} |
6595
|
6595
|
} else { |
6596
|
6596
|
$prodstatic = new Product($this->db); |
6597
|
6597
|
$prodstatic->fetch($idprod); |
6598
|
6598
|
if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
6599
|
|
- $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
6599
|
+ $code_country .= ",'".$societe_acheteuse->country_code."'"; |
6600
|
6600
|
} |
6601
|
6601
|
} |
6602
|
6602
|
} |
|
@@ -6658,13 +6658,13 @@ discard block |
|
|
block discarded – undo |
6658
|
6658
|
// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
6659
|
6659
|
// of using supplier invoices (this is a very bad idea !) |
6660
|
6660
|
if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
6661
|
|
- $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
6661
|
+ $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
6662
|
6662
|
$disabled = true; |
6663
|
6663
|
} |
6664
|
6664
|
} |
6665
|
6665
|
|
6666
|
6666
|
if (!$options_only) { |
6667
|
|
- $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
6667
|
+ $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
6668
|
6668
|
} |
6669
|
6669
|
|
6670
|
6670
|
$selectedfound = false; |
|
@@ -6678,13 +6678,13 @@ discard block |
|
|
block discarded – undo |
6678
|
6678
|
$key = $rate['txtva']; |
6679
|
6679
|
$key .= $rate['nprtva'] ? '*' : ''; |
6680
|
6680
|
if ($mode > 0 && $rate['code']) { |
6681
|
|
- $key .= ' (' . $rate['code'] . ')'; |
|
6681
|
+ $key .= ' ('.$rate['code'].')'; |
6682
|
6682
|
} |
6683
|
6683
|
if ($mode < 0) { |
6684
|
6684
|
$key = $rate['rowid']; |
6685
|
6685
|
} |
6686
|
6686
|
|
6687
|
|
- $return .= '<option value="' . $key . '"'; |
|
6687
|
+ $return .= '<option value="'.$key.'"'; |
6688
|
6688
|
if (!$selectedfound) { |
6689
|
6689
|
if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
6690
|
6690
|
if ($defaultcode == $rate['code']) { |
|
@@ -6755,7 +6755,7 @@ discard block |
|
|
block discarded – undo |
6755
|
6755
|
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 = '') |
6756
|
6756
|
{ |
6757
|
6757
|
// phpcs:enable |
6758
|
|
- dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
6758
|
+ dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
6759
|
6759
|
$retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
6760
|
6760
|
if (!empty($nooutput)) { |
6761
|
6761
|
return $retstring; |
|
@@ -6784,11 +6784,11 @@ discard block |
|
|
block discarded – undo |
6784
|
6784
|
{ |
6785
|
6785
|
global $langs; |
6786
|
6786
|
|
6787
|
|
- $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
6787
|
+ $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
6788
|
6788
|
if ($forcenewline) { |
6789
|
6789
|
$ret .= '<br>'; |
6790
|
6790
|
} |
6791
|
|
- $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
6791
|
+ $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
6792
|
6792
|
return $ret; |
6793
|
6793
|
} |
6794
|
6794
|
|
|
@@ -6854,7 +6854,7 @@ discard block |
|
|
block discarded – undo |
6854
|
6854
|
$orig_set_time = $set_time; |
6855
|
6855
|
|
6856
|
6856
|
if ($set_time === '' && $emptydate == 0) { |
6857
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
6857
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
6858
|
6858
|
if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
6859
|
6859
|
$set_time = dol_now($gm); |
6860
|
6860
|
} else { |
|
@@ -6926,38 +6926,38 @@ discard block |
|
|
block discarded – undo |
6926
|
6926
|
// Calendrier popup version eldy |
6927
|
6927
|
if ($usecalendar == "eldy") { |
6928
|
6928
|
// Input area to enter date manually |
6929
|
|
- $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
6929
|
+ $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
6930
|
6930
|
$retstring .= ($disabled ? ' disabled' : ''); |
6931
|
|
- $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6931
|
+ $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
6932
|
6932
|
$retstring .= ' autocomplete="off">'; |
6933
|
6933
|
|
6934
|
6934
|
// Icon calendar |
6935
|
6935
|
$retstringbuttom = ''; |
6936
|
6936
|
if (!$disabled) { |
6937
|
|
- $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
6938
|
|
- $base = DOL_URL_ROOT . '/core/'; |
6939
|
|
- $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
6940
|
|
- $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6937
|
+ $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
6938
|
+ $base = DOL_URL_ROOT.'/core/'; |
|
6939
|
+ $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
6940
|
+ $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
6941
|
6941
|
} else { |
6942
|
|
- $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
6942
|
+ $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
6943
|
6943
|
} |
6944
|
|
- $retstring = $retstringbuttom . $retstring; |
|
6944
|
+ $retstring = $retstringbuttom.$retstring; |
6945
|
6945
|
|
6946
|
|
- $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
6947
|
|
- $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
6948
|
|
- $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
6946
|
+ $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
6947
|
+ $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
6948
|
+ $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
6949
|
6949
|
} elseif ($usecalendar == 'jquery' || $usecalendar == 'html') { |
6950
|
6950
|
if (!$disabled && $usecalendar != 'html') { |
6951
|
6951
|
// Output javascript for datepicker |
6952
|
6952
|
$minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (idate('Y') - 100)); |
6953
|
6953
|
$maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (idate('Y') + 100)); |
6954
|
6954
|
|
6955
|
|
- $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
6956
|
|
- $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
6957
|
|
- dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
6955
|
+ $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
6956
|
+ $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
6957
|
+ dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
6958
|
6958
|
autoclose: true, |
6959
|
6959
|
todayHighlight: true, |
6960
|
|
- yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
6960
|
+ yearRange: '" . $minYear.":".$maxYear."',"; |
6961
|
6961
|
if (!empty($conf->dol_use_jmobile)) { |
6962
|
6962
|
$retstring .= " |
6963
|
6963
|
beforeShow: function (input, datePicker) { |
|
@@ -6972,7 +6972,7 @@ discard block |
|
|
block discarded – undo |
6972
|
6972
|
if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
6973
|
6973
|
$retstring .= " |
6974
|
6974
|
showOn: 'button', /* both has problem with autocompletion */ |
6975
|
|
- buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
6975
|
+ buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
6976
|
6976
|
buttonImageOnly: true"; |
6977
|
6977
|
} |
6978
|
6978
|
$retstring .= " |
|
@@ -6984,46 +6984,46 @@ discard block |
|
|
block discarded – undo |
6984
|
6984
|
$retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
6985
|
6985
|
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
6986
|
6986
|
$retstring .= ($disabled ? ' disabled' : ''); |
6987
|
|
- $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
6988
|
|
- $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
6987
|
+ $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
6988
|
+ $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
6989
|
6989
|
$retstring .= ' autocomplete="off">'; |
6990
|
6990
|
|
6991
|
6991
|
// Icone calendrier |
6992
|
6992
|
if ($disabled) { |
6993
|
|
- $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
6994
|
|
- $retstring = $retstringbutton . $retstring; |
|
6993
|
+ $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
6994
|
+ $retstring = $retstringbutton.$retstring; |
6995
|
6995
|
} |
6996
|
6996
|
|
6997
|
6997
|
$retstring .= '</div>'; |
6998
|
|
- $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
6999
|
|
- $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
7000
|
|
- $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
6998
|
+ $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
6999
|
+ $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
7000
|
+ $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
7001
|
7001
|
} else { |
7002
|
7002
|
$retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
7003
|
7003
|
} |
7004
|
7004
|
} else { |
7005
|
7005
|
// Show date with combo selects |
7006
|
7006
|
// Day |
7007
|
|
- $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
7007
|
+ $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
7008
|
7008
|
|
7009
|
7009
|
if ($emptydate || $set_time == -1) { |
7010
|
7010
|
$retstring .= '<option value="0" selected> </option>'; |
7011
|
7011
|
} |
7012
|
7012
|
|
7013
|
7013
|
for ($day = 1; $day <= 31; $day++) { |
7014
|
|
- $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
7014
|
+ $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
7015
|
7015
|
} |
7016
|
7016
|
|
7017
|
7017
|
$retstring .= "</select>"; |
7018
|
7018
|
|
7019
|
|
- $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
7019
|
+ $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
7020
|
7020
|
if ($emptydate || $set_time == -1) { |
7021
|
7021
|
$retstring .= '<option value="0" selected> </option>'; |
7022
|
7022
|
} |
7023
|
7023
|
|
7024
|
7024
|
// Month |
7025
|
7025
|
for ($month = 1; $month <= 12; $month++) { |
7026
|
|
- $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
7026
|
+ $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
7027
|
7027
|
$retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
7028
|
7028
|
$retstring .= "</option>"; |
7029
|
7029
|
} |
|
@@ -7031,13 +7031,13 @@ discard block |
|
|
block discarded – undo |
7031
|
7031
|
|
7032
|
7032
|
// Year |
7033
|
7033
|
if ($emptydate || $set_time == -1) { |
7034
|
|
- $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 . '">'; |
|
7034
|
+ $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.'">'; |
7035
|
7035
|
} else { |
7036
|
|
- $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
7036
|
+ $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
7037
|
7037
|
|
7038
|
7038
|
$syear = (int) $syear; |
7039
|
7039
|
for ($year = $syear - 10; $year < (int) $syear + 10; $year++) { |
7040
|
|
- $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
7040
|
+ $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
7041
|
7041
|
} |
7042
|
7042
|
$retstring .= "</select>\n"; |
7043
|
7043
|
} |
|
@@ -7061,15 +7061,15 @@ discard block |
|
|
block discarded – undo |
7061
|
7061
|
} |
7062
|
7062
|
} |
7063
|
7063
|
// Show hour |
7064
|
|
- $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
7064
|
+ $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
7065
|
7065
|
if ($emptyhours) { |
7066
|
7066
|
$retstring .= '<option value="-1"> </option>'; |
7067
|
7067
|
} |
7068
|
7068
|
for ($hour = $hourstart; $hour < $hourend; $hour++) { |
7069
|
7069
|
if (strlen($hour) < 2) { |
7070
|
|
- $hour = "0" . $hour; |
|
7070
|
+ $hour = "0".$hour; |
7071
|
7071
|
} |
7072
|
|
- $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
7072
|
+ $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
7073
|
7073
|
//$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
7074
|
7074
|
$retstring .= '</option>'; |
7075
|
7075
|
} |
|
@@ -7082,17 +7082,17 @@ discard block |
|
|
block discarded – undo |
7082
|
7082
|
|
7083
|
7083
|
if ($m) { |
7084
|
7084
|
// Show minutes |
7085
|
|
- $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
7085
|
+ $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
7086
|
7086
|
if ($emptyhours) { |
7087
|
7087
|
$retstring .= '<option value="-1"> </option>'; |
7088
|
7088
|
} |
7089
|
7089
|
for ($min = 0; $min < 60; $min += $stepminutes) { |
7090
|
7090
|
$min_str = sprintf("%02d", $min); |
7091
|
|
- $retstring .= '<option value="' . $min_str . '"' . (($min_str == $smin) ? ' selected' : '') . '>' . $min_str . '</option>'; |
|
7091
|
+ $retstring .= '<option value="'.$min_str.'"'.(($min_str == $smin) ? ' selected' : '').'>'.$min_str.'</option>'; |
7092
|
7092
|
} |
7093
|
7093
|
$retstring .= '</select>'; |
7094
|
7094
|
|
7095
|
|
- $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
7095
|
+ $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
7096
|
7096
|
} |
7097
|
7097
|
|
7098
|
7098
|
if ($d && $h) { |
|
@@ -7115,10 +7115,10 @@ discard block |
|
|
block discarded – undo |
7115
|
7115
|
|
7116
|
7116
|
// Generate the date part, depending on the use or not of the javascript calendar |
7117
|
7117
|
if ($addnowlink == 1) { // server time expressed in user time setup |
7118
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
7119
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
7120
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
7121
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7118
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7119
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7120
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7121
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
7122
|
7122
|
} elseif ($addnowlink == 2) { |
7123
|
7123
|
/* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
7124
|
7124
|
* This break application for foreign languages. |
|
@@ -7127,10 +7127,10 @@ discard block |
|
|
block discarded – undo |
7127
|
7127
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
7128
|
7128
|
$reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
7129
|
7129
|
*/ |
7130
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
7131
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
7132
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
7133
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7130
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
7131
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7132
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7133
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
7134
|
7134
|
} |
7135
|
7135
|
/*if ($usecalendar == "eldy") |
7136
|
7136
|
{ |
|
@@ -7150,11 +7150,11 @@ discard block |
|
|
block discarded – undo |
7150
|
7150
|
} |
7151
|
7151
|
//$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
7152
|
7152
|
if ($addnowlink == 1) { |
7153
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
7154
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7153
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
7154
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
7155
|
7155
|
} elseif ($addnowlink == 2) { |
7156
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
7157
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
7156
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
7157
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
7158
|
7158
|
} |
7159
|
7159
|
|
7160
|
7160
|
if ($fullday) { |
|
@@ -7168,11 +7168,11 @@ discard block |
|
|
block discarded – undo |
7168
|
7168
|
} |
7169
|
7169
|
//$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
7170
|
7170
|
if ($addnowlink == 1) { |
7171
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
7172
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7171
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
7172
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
7173
|
7173
|
} elseif ($addnowlink == 2) { |
7174
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
7175
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
7174
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
7175
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
7176
|
7176
|
} |
7177
|
7177
|
if ($fullday) { |
7178
|
7178
|
$reset_scripts .= ' } '; |
|
@@ -7180,7 +7180,7 @@ discard block |
|
|
block discarded – undo |
7180
|
7180
|
} |
7181
|
7181
|
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7182
|
7182
|
if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
7183
|
|
- $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
7183
|
+ $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
7184
|
7184
|
$retstring .= $langs->trans("Now"); |
7185
|
7185
|
$retstring .= '</button> '; |
7186
|
7186
|
} |
|
@@ -7192,16 +7192,16 @@ discard block |
|
|
block discarded – undo |
7192
|
7192
|
$reset_scripts = ""; |
7193
|
7193
|
|
7194
|
7194
|
// Generate the date part, depending on the use or not of the javascript calendar |
7195
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
7196
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
7197
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
7198
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
7195
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
7196
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
7197
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
7198
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
7199
|
7199
|
// Update the hour part |
7200
|
7200
|
if ($h) { |
7201
|
7201
|
if ($fullday) { |
7202
|
7202
|
$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7203
|
7203
|
} |
7204
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
7204
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
7205
|
7205
|
if ($fullday) { |
7206
|
7206
|
$reset_scripts .= ' } '; |
7207
|
7207
|
} |
|
@@ -7211,14 +7211,14 @@ discard block |
|
|
block discarded – undo |
7211
|
7211
|
if ($fullday) { |
7212
|
7212
|
$reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
7213
|
7213
|
} |
7214
|
|
- $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
7214
|
+ $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
7215
|
7215
|
if ($fullday) { |
7216
|
7216
|
$reset_scripts .= ' } '; |
7217
|
7217
|
} |
7218
|
7218
|
} |
7219
|
7219
|
// If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
7220
|
7220
|
if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
7221
|
|
- $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
7221
|
+ $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
7222
|
7222
|
$retstring .= $langs->trans("DateStartPlusOne"); |
7223
|
7223
|
$retstring .= '</button> '; |
7224
|
7224
|
} |
|
@@ -7276,17 +7276,17 @@ discard block |
|
|
block discarded – undo |
7276
|
7276
|
unset($TDurationTypes[$value]); |
7277
|
7277
|
} |
7278
|
7278
|
|
7279
|
|
- $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
7279
|
+ $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
7280
|
7280
|
foreach ($TDurationTypes as $key => $typeduration) { |
7281
|
|
- $retstring .= '<option value="' . $key . '"'; |
|
7281
|
+ $retstring .= '<option value="'.$key.'"'; |
7282
|
7282
|
if ($key == $selected) { |
7283
|
7283
|
$retstring .= " selected"; |
7284
|
7284
|
} |
7285
|
|
- $retstring .= ">" . $typeduration . "</option>"; |
|
7285
|
+ $retstring .= ">".$typeduration."</option>"; |
7286
|
7286
|
} |
7287
|
7287
|
$retstring .= "</select>"; |
7288
|
7288
|
|
7289
|
|
- $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
7289
|
+ $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
7290
|
7290
|
|
7291
|
7291
|
return $retstring; |
7292
|
7292
|
} |
|
@@ -7318,30 +7318,30 @@ discard block |
|
|
block discarded – undo |
7318
|
7318
|
|
7319
|
7319
|
// Hours |
7320
|
7320
|
if ($iSecond != '') { |
7321
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
7321
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
7322
|
7322
|
|
7323
|
7323
|
$hourSelected = convertSecondToTime($iSecond, 'allhour'); |
7324
|
7324
|
$minSelected = convertSecondToTime($iSecond, 'min'); |
7325
|
7325
|
} |
7326
|
7326
|
|
7327
|
7327
|
if ($typehour == 'select') { |
7328
|
|
- $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
7328
|
+ $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
7329
|
7329
|
for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
7330
|
|
- $retstring .= '<option value="' . $hour . '"'; |
|
7330
|
+ $retstring .= '<option value="'.$hour.'"'; |
7331
|
7331
|
if (is_numeric($hourSelected) && $hourSelected == $hour) { |
7332
|
7332
|
$retstring .= " selected"; |
7333
|
7333
|
} |
7334
|
|
- $retstring .= ">" . $hour . "</option>"; |
|
7334
|
+ $retstring .= ">".$hour."</option>"; |
7335
|
7335
|
} |
7336
|
7336
|
$retstring .= "</select>"; |
7337
|
7337
|
} elseif ($typehour == 'text' || $typehour == 'textselect') { |
7338
|
|
- $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
7338
|
+ $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
7339
|
7339
|
} else { |
7340
|
7340
|
return 'BadValueForParameterTypeHour'; |
7341
|
7341
|
} |
7342
|
7342
|
|
7343
|
7343
|
if ($typehour != 'text') { |
7344
|
|
- $retstring .= ' ' . $langs->trans('HourShort'); |
|
7344
|
+ $retstring .= ' '.$langs->trans('HourShort'); |
7345
|
7345
|
} else { |
7346
|
7346
|
$retstring .= '<span class="">:</span>'; |
7347
|
7347
|
} |
|
@@ -7356,21 +7356,21 @@ discard block |
|
|
block discarded – undo |
7356
|
7356
|
} |
7357
|
7357
|
|
7358
|
7358
|
if ($typehour == 'select' || $typehour == 'textselect') { |
7359
|
|
- $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
7359
|
+ $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
7360
|
7360
|
for ($min = 0; $min <= 55; $min += 5) { |
7361
|
|
- $retstring .= '<option value="' . $min . '"'; |
|
7361
|
+ $retstring .= '<option value="'.$min.'"'; |
7362
|
7362
|
if (is_numeric($minSelected) && $minSelected == $min) { |
7363
|
7363
|
$retstring .= ' selected'; |
7364
|
7364
|
} |
7365
|
|
- $retstring .= '>' . $min . '</option>'; |
|
7365
|
+ $retstring .= '>'.$min.'</option>'; |
7366
|
7366
|
} |
7367
|
7367
|
$retstring .= "</select>"; |
7368
|
7368
|
} elseif ($typehour == 'text') { |
7369
|
|
- $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
7369
|
+ $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
7370
|
7370
|
} |
7371
|
7371
|
|
7372
|
7372
|
if ($typehour != 'text') { |
7373
|
|
- $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
7373
|
+ $retstring .= ' '.$langs->trans('MinuteShort'); |
7374
|
7374
|
} |
7375
|
7375
|
|
7376
|
7376
|
$retstring .= "</span>"; |
|
@@ -7418,7 +7418,7 @@ discard block |
|
|
block discarded – undo |
7418
|
7418
|
$placeholder = ''; |
7419
|
7419
|
|
7420
|
7420
|
if ($selected && empty($selected_input_value)) { |
7421
|
|
- require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
7421
|
+ require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
7422
|
7422
|
$tickettmpselect = new Ticket($this->db); |
7423
|
7423
|
$tickettmpselect->fetch($selected); |
7424
|
7424
|
$selected_input_value = $tickettmpselect->ref; |
|
@@ -7426,17 +7426,17 @@ discard block |
|
|
block discarded – undo |
7426
|
7426
|
} |
7427
|
7427
|
|
7428
|
7428
|
$urloption = ''; |
7429
|
|
- $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7429
|
+ $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
7430
|
7430
|
|
7431
|
7431
|
if (empty($hidelabel)) { |
7432
|
|
- $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7432
|
+ $out .= $langs->trans("RefOrLabel").' : '; |
7433
|
7433
|
} elseif ($hidelabel > 1) { |
7434
|
|
- $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7434
|
+ $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
7435
|
7435
|
if ($hidelabel == 2) { |
7436
|
7436
|
$out .= img_picto($langs->trans("Search"), 'search'); |
7437
|
7437
|
} |
7438
|
7438
|
} |
7439
|
|
- $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
7439
|
+ $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
7440
|
7440
|
if ($hidelabel == 3) { |
7441
|
7441
|
$out .= img_picto($langs->trans("Search"), 'search'); |
7442
|
7442
|
} |
|
@@ -7480,8 +7480,8 @@ discard block |
|
|
block discarded – undo |
7480
|
7480
|
|
7481
|
7481
|
$sql = "SELECT "; |
7482
|
7482
|
$sql .= $selectFields; |
7483
|
|
- $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
7484
|
|
- $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
7483
|
+ $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
7484
|
+ $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
7485
|
7485
|
|
7486
|
7486
|
// Add criteria on ref/label |
7487
|
7487
|
if ($filterkey != '') { |
|
@@ -7497,7 +7497,7 @@ discard block |
|
|
block discarded – undo |
7497
|
7497
|
if ($i > 0) { |
7498
|
7498
|
$sql .= " AND "; |
7499
|
7499
|
} |
7500
|
|
- $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7500
|
+ $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
7501
|
7501
|
$sql .= ")"; |
7502
|
7502
|
$i++; |
7503
|
7503
|
} |
|
@@ -7510,22 +7510,22 @@ discard block |
|
|
block discarded – undo |
7510
|
7510
|
$sql .= $this->db->plimit($limit, 0); |
7511
|
7511
|
|
7512
|
7512
|
// Build output string |
7513
|
|
- dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
7513
|
+ dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
7514
|
7514
|
$result = $this->db->query($sql); |
7515
|
7515
|
if ($result) { |
7516
|
|
- require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
7517
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
7516
|
+ require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
7517
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
7518
|
7518
|
|
7519
|
7519
|
$num = $this->db->num_rows($result); |
7520
|
7520
|
|
7521
|
7521
|
$events = array(); |
7522
|
7522
|
|
7523
|
7523
|
if (!$forcecombo) { |
7524
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7524
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7525
|
7525
|
$out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
7526
|
7526
|
} |
7527
|
7527
|
|
7528
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7528
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
7529
|
7529
|
|
7530
|
7530
|
$textifempty = ''; |
7531
|
7531
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
|
@@ -7542,7 +7542,7 @@ discard block |
|
|
block discarded – undo |
7542
|
7542
|
} |
7543
|
7543
|
} |
7544
|
7544
|
if ($showempty) { |
7545
|
|
- $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7545
|
+ $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
7546
|
7546
|
} |
7547
|
7547
|
|
7548
|
7548
|
$i = 0; |
|
@@ -7597,13 +7597,13 @@ discard block |
|
|
block discarded – undo |
7597
|
7597
|
$outref = $objp->ref; |
7598
|
7598
|
$outtype = $objp->fk_product_type; |
7599
|
7599
|
|
7600
|
|
- $opt = '<option value="' . $objp->rowid . '"'; |
|
7600
|
+ $opt = '<option value="'.$objp->rowid.'"'; |
7601
|
7601
|
$opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7602
|
7602
|
$opt .= '>'; |
7603
|
7603
|
$opt .= $objp->ref; |
7604
|
7604
|
$objRef = $objp->ref; |
7605
|
7605
|
if (!empty($filterkey) && $filterkey != '') { |
7606
|
|
- $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7606
|
+ $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
7607
|
7607
|
} |
7608
|
7608
|
|
7609
|
7609
|
$opt .= "</option>\n"; |
|
@@ -7644,7 +7644,7 @@ discard block |
|
|
block discarded – undo |
7644
|
7644
|
$placeholder = ''; |
7645
|
7645
|
|
7646
|
7646
|
if ($selected && empty($selected_input_value)) { |
7647
|
|
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
7647
|
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
7648
|
7648
|
$projecttmpselect = new Project($this->db); |
7649
|
7649
|
$projecttmpselect->fetch($selected); |
7650
|
7650
|
$selected_input_value = $projecttmpselect->ref; |
|
@@ -7652,17 +7652,17 @@ discard block |
|
|
block discarded – undo |
7652
|
7652
|
} |
7653
|
7653
|
|
7654
|
7654
|
$urloption = ''; |
7655
|
|
- $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7655
|
+ $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
7656
|
7656
|
|
7657
|
7657
|
if (empty($hidelabel)) { |
7658
|
|
- $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7658
|
+ $out .= $langs->trans("RefOrLabel").' : '; |
7659
|
7659
|
} elseif ($hidelabel > 1) { |
7660
|
|
- $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7660
|
+ $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
7661
|
7661
|
if ($hidelabel == 2) { |
7662
|
7662
|
$out .= img_picto($langs->trans("Search"), 'search'); |
7663
|
7663
|
} |
7664
|
7664
|
} |
7665
|
|
- $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
7665
|
+ $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
7666
|
7666
|
if ($hidelabel == 3) { |
7667
|
7667
|
$out .= img_picto($langs->trans("Search"), 'search'); |
7668
|
7668
|
} |
|
@@ -7705,8 +7705,8 @@ discard block |
|
|
block discarded – undo |
7705
|
7705
|
|
7706
|
7706
|
$sql = "SELECT "; |
7707
|
7707
|
$sql .= $selectFields; |
7708
|
|
- $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
7709
|
|
- $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
7708
|
+ $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
7709
|
+ $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
7710
|
7710
|
|
7711
|
7711
|
// Add criteria on ref/label |
7712
|
7712
|
if ($filterkey != '') { |
|
@@ -7722,7 +7722,7 @@ discard block |
|
|
block discarded – undo |
7722
|
7722
|
if ($i > 0) { |
7723
|
7723
|
$sql .= " AND "; |
7724
|
7724
|
} |
7725
|
|
- $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
7725
|
+ $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
7726
|
7726
|
$sql .= ""; |
7727
|
7727
|
$i++; |
7728
|
7728
|
} |
|
@@ -7735,22 +7735,22 @@ discard block |
|
|
block discarded – undo |
7735
|
7735
|
$sql .= $this->db->plimit($limit, 0); |
7736
|
7736
|
|
7737
|
7737
|
// Build output string |
7738
|
|
- dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
7738
|
+ dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
7739
|
7739
|
$result = $this->db->query($sql); |
7740
|
7740
|
if ($result) { |
7741
|
|
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
7742
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
7741
|
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
7742
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
7743
|
7743
|
|
7744
|
7744
|
$num = $this->db->num_rows($result); |
7745
|
7745
|
|
7746
|
7746
|
$events = array(); |
7747
|
7747
|
|
7748
|
7748
|
if (!$forcecombo) { |
7749
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7749
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7750
|
7750
|
$out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
7751
|
7751
|
} |
7752
|
7752
|
|
7753
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7753
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
7754
|
7754
|
|
7755
|
7755
|
$textifempty = ''; |
7756
|
7756
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
|
@@ -7767,7 +7767,7 @@ discard block |
|
|
block discarded – undo |
7767
|
7767
|
} |
7768
|
7768
|
} |
7769
|
7769
|
if ($showempty) { |
7770
|
|
- $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
7770
|
+ $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
7771
|
7771
|
} |
7772
|
7772
|
|
7773
|
7773
|
$i = 0; |
|
@@ -7825,13 +7825,13 @@ discard block |
|
|
block discarded – undo |
7825
|
7825
|
$outlabel = $objp->label; |
7826
|
7826
|
$outtype = $objp->fk_product_type; |
7827
|
7827
|
|
7828
|
|
- $opt = '<option value="' . $objp->rowid . '"'; |
|
7828
|
+ $opt = '<option value="'.$objp->rowid.'"'; |
7829
|
7829
|
$opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
7830
|
7830
|
$opt .= '>'; |
7831
|
7831
|
$opt .= $objp->ref; |
7832
|
7832
|
$objRef = $objp->ref; |
7833
|
7833
|
if (!empty($filterkey) && $filterkey != '') { |
7834
|
|
- $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
7834
|
+ $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
7835
|
7835
|
} |
7836
|
7836
|
|
7837
|
7837
|
$opt .= "</option>\n"; |
|
@@ -7873,7 +7873,7 @@ discard block |
|
|
block discarded – undo |
7873
|
7873
|
$placeholder = ''; |
7874
|
7874
|
|
7875
|
7875
|
if ($selected && empty($selected_input_value)) { |
7876
|
|
- require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
7876
|
+ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
7877
|
7877
|
$adherenttmpselect = new Adherent($this->db); |
7878
|
7878
|
$adherenttmpselect->fetch($selected); |
7879
|
7879
|
$selected_input_value = $adherenttmpselect->ref; |
|
@@ -7882,17 +7882,17 @@ discard block |
|
|
block discarded – undo |
7882
|
7882
|
|
7883
|
7883
|
$urloption = ''; |
7884
|
7884
|
|
7885
|
|
- $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
7885
|
+ $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
7886
|
7886
|
|
7887
|
7887
|
if (empty($hidelabel)) { |
7888
|
|
- $out .= $langs->trans("RefOrLabel") . ' : '; |
|
7888
|
+ $out .= $langs->trans("RefOrLabel").' : '; |
7889
|
7889
|
} elseif ($hidelabel > 1) { |
7890
|
|
- $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
7890
|
+ $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
7891
|
7891
|
if ($hidelabel == 2) { |
7892
|
7892
|
$out .= img_picto($langs->trans("Search"), 'search'); |
7893
|
7893
|
} |
7894
|
7894
|
} |
7895
|
|
- $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
7895
|
+ $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
7896
|
7896
|
if ($hidelabel == 3) { |
7897
|
7897
|
$out .= img_picto($langs->trans("Search"), 'search'); |
7898
|
7898
|
} |
|
@@ -7937,8 +7937,8 @@ discard block |
|
|
block discarded – undo |
7937
|
7937
|
|
7938
|
7938
|
$sql = "SELECT "; |
7939
|
7939
|
$sql .= $selectFields; |
7940
|
|
- $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
7941
|
|
- $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
7940
|
+ $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
7941
|
+ $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
7942
|
7942
|
|
7943
|
7943
|
// Add criteria on ref/label |
7944
|
7944
|
if ($filterkey != '') { |
|
@@ -7954,8 +7954,8 @@ discard block |
|
|
block discarded – undo |
7954
|
7954
|
if ($i > 0) { |
7955
|
7955
|
$sql .= " AND "; |
7956
|
7956
|
} |
7957
|
|
- $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
7958
|
|
- $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
7957
|
+ $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
7958
|
+ $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
7959
|
7959
|
$i++; |
7960
|
7960
|
} |
7961
|
7961
|
if (count($search_crit) > 1) { |
|
@@ -7964,27 +7964,27 @@ discard block |
|
|
block discarded – undo |
7964
|
7964
|
$sql .= ')'; |
7965
|
7965
|
} |
7966
|
7966
|
if ($status != -1) { |
7967
|
|
- $sql .= ' AND statut = ' . ((int) $status); |
|
7967
|
+ $sql .= ' AND statut = '.((int) $status); |
7968
|
7968
|
} |
7969
|
7969
|
$sql .= $this->db->plimit($limit, 0); |
7970
|
7970
|
|
7971
|
7971
|
// Build output string |
7972
|
|
- dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
7972
|
+ dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
7973
|
7973
|
$result = $this->db->query($sql); |
7974
|
7974
|
if ($result) { |
7975
|
|
- require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
7976
|
|
- require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
7975
|
+ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
7976
|
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
7977
|
7977
|
|
7978
|
7978
|
$num = $this->db->num_rows($result); |
7979
|
7979
|
|
7980
|
7980
|
$events = array(); |
7981
|
7981
|
|
7982
|
7982
|
if (!$forcecombo) { |
7983
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
7983
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
7984
|
7984
|
$out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
7985
|
7985
|
} |
7986
|
7986
|
|
7987
|
|
- $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
7987
|
+ $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
7988
|
7988
|
|
7989
|
7989
|
$textifempty = ''; |
7990
|
7990
|
// Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
|
@@ -8001,7 +8001,7 @@ discard block |
|
|
block discarded – undo |
8001
|
8001
|
} |
8002
|
8002
|
} |
8003
|
8003
|
if ($showempty) { |
8004
|
|
- $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
8004
|
+ $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
8005
|
8005
|
} |
8006
|
8006
|
|
8007
|
8007
|
$i = 0; |
|
@@ -8057,11 +8057,11 @@ discard block |
|
|
block discarded – undo |
8057
|
8057
|
$outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
8058
|
8058
|
$outtype = $objp->fk_adherent_type; |
8059
|
8059
|
|
8060
|
|
- $opt = '<option value="' . $objp->rowid . '"'; |
|
8060
|
+ $opt = '<option value="'.$objp->rowid.'"'; |
8061
|
8061
|
$opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
8062
|
8062
|
$opt .= '>'; |
8063
|
8063
|
if (!empty($filterkey) && $filterkey != '') { |
8064
|
|
- $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
8064
|
+ $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
8065
|
8065
|
} |
8066
|
8066
|
$opt .= $outlabel; |
8067
|
8067
|
$opt .= "</option>\n"; |
|
@@ -8096,8 +8096,8 @@ discard block |
|
|
block discarded – undo |
8096
|
8096
|
$objectdescorig = $objectdesc; |
8097
|
8097
|
$objecttmp = null; |
8098
|
8098
|
$InfoFieldList = array(); |
8099
|
|
- $filter = ''; // Ensure filter has value (for static analysis) |
8100
|
|
- $sortfield = ''; // Ensure filter has value (for static analysis) |
|
8099
|
+ $filter = ''; // Ensure filter has value (for static analysis) |
|
8100
|
+ $sortfield = ''; // Ensure filter has value (for static analysis) |
8101
|
8101
|
|
8102
|
8102
|
if ($objectfield) { // We must retrieve the objectdesc from the field or extrafield |
8103
|
8103
|
// Example: $objectfield = 'product:options_package' |
|
@@ -8138,9 +8138,9 @@ discard block |
|
|
block discarded – undo |
8138
|
8138
|
$vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
8139
|
8139
|
$reg = array(); |
8140
|
8140
|
if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
8141
|
|
- $InfoFieldList[4] = $reg[1]; // take the sort field |
|
8141
|
+ $InfoFieldList[4] = $reg[1]; // take the sort field |
8142
|
8142
|
} |
8143
|
|
- $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
8143
|
+ $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
8144
|
8144
|
|
8145
|
8145
|
$classname = $InfoFieldList[0]; |
8146
|
8146
|
$classpath = $InfoFieldList[1]; |
|
@@ -8171,8 +8171,8 @@ discard block |
|
|
block discarded – undo |
8171
|
8171
|
); |
8172
|
8172
|
|
8173
|
8173
|
if (!is_object($objecttmp)) { |
8174
|
|
- dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
8175
|
|
- return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield; |
|
8174
|
+ dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
8175
|
+ return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield; |
8176
|
8176
|
} |
8177
|
8177
|
'@phan-var-force CommonObject $objecttmp'; |
8178
|
8178
|
|
|
@@ -8184,9 +8184,9 @@ discard block |
|
|
block discarded – undo |
8184
|
8184
|
if ($prefixforautocompletemode == 'product') { |
8185
|
8185
|
$prefixforautocompletemode = 'produit'; |
8186
|
8186
|
} |
8187
|
|
- $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8187
|
+ $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
8188
|
8188
|
|
8189
|
|
- dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
8189
|
+ dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
8190
|
8190
|
|
8191
|
8191
|
// Generate the combo HTML component |
8192
|
8192
|
$out = ''; |
|
@@ -8215,13 +8215,13 @@ discard block |
|
|
block discarded – undo |
8215
|
8215
|
} |
8216
|
8216
|
|
8217
|
8217
|
// Set url and param to call to get json of the search results |
8218
|
|
- $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
8219
|
|
- $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
8218
|
+ $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
8219
|
+ $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
8220
|
8220
|
|
8221
|
8221
|
// Activate the auto complete using ajax call. |
8222
|
8222
|
$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0); |
8223
|
8223
|
$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
8224
|
|
- $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) . '"' : '') . ' />'; |
|
8224
|
+ $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).'"' : '').' />'; |
8225
|
8225
|
} else { |
8226
|
8226
|
// Immediate load of table record. |
8227
|
8227
|
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
|
@@ -8261,16 +8261,16 @@ discard block |
|
|
block discarded – undo |
8261
|
8261
|
if ($prefixforautocompletemode == 'societe') { |
8262
|
8262
|
$prefixforautocompletemode = 'company'; |
8263
|
8263
|
} |
8264
|
|
- $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
8264
|
+ $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
8265
|
8265
|
|
8266
|
8266
|
if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
8267
|
8267
|
$tmpfieldstoshow = ''; |
8268
|
8268
|
foreach ($objecttmp->fields as $key => $val) { |
8269
|
|
- if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { |
|
8269
|
+ if (!(int) dol_eval($val['enabled'], 1, 1, '1')) { |
8270
|
8270
|
continue; |
8271
|
8271
|
} |
8272
|
8272
|
if (!empty($val['showoncombobox'])) { |
8273
|
|
- $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
8273
|
+ $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
8274
|
8274
|
} |
8275
|
8275
|
} |
8276
|
8276
|
if ($tmpfieldstoshow) { |
|
@@ -8298,18 +8298,18 @@ discard block |
|
|
block discarded – undo |
8298
|
8298
|
$num = 0; |
8299
|
8299
|
|
8300
|
8300
|
// Search data |
8301
|
|
- $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
8301
|
+ $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
8302
|
8302
|
if (!empty($objecttmp->isextrafieldmanaged)) { |
8303
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
8303
|
+ $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
8304
|
8304
|
} |
8305
|
8305
|
if (isset($objecttmp->ismultientitymanaged)) { |
8306
|
8306
|
if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8307
|
8307
|
$tmparray = explode('@', $objecttmp->ismultientitymanaged); |
8308
|
|
- $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
8308
|
+ $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
8309
|
8309
|
} |
8310
|
8310
|
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8311
|
8311
|
if (!$user->hasRight('societe', 'client', 'voir')) { |
8312
|
|
- $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
8312
|
+ $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
8313
|
8313
|
} |
8314
|
8314
|
} |
8315
|
8315
|
} |
|
@@ -8329,21 +8329,21 @@ discard block |
|
|
block discarded – undo |
8329
|
8329
|
$sql .= " WHERE 1=1"; |
8330
|
8330
|
if (isset($objecttmp->ismultientitymanaged)) { |
8331
|
8331
|
if ($objecttmp->ismultientitymanaged == 1) { |
8332
|
|
- $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
8332
|
+ $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
8333
|
8333
|
} |
8334
|
8334
|
if (!is_numeric($objecttmp->ismultientitymanaged)) { |
8335
|
|
- $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
8335
|
+ $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
8336
|
8336
|
} |
8337
|
8337
|
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
8338
|
8338
|
if ($objecttmp->element == 'societe') { |
8339
|
|
- $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
8339
|
+ $sql .= " AND t.rowid = ".((int) $user->socid); |
8340
|
8340
|
} else { |
8341
|
|
- $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
8341
|
+ $sql .= " AND t.fk_soc = ".((int) $user->socid); |
8342
|
8342
|
} |
8343
|
8343
|
} |
8344
|
8344
|
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
8345
|
8345
|
if (!$user->hasRight('societe', 'client', 'voir')) { |
8346
|
|
- $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
8346
|
+ $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
8347
|
8347
|
} |
8348
|
8348
|
} |
8349
|
8349
|
} |
|
@@ -8355,7 +8355,7 @@ discard block |
|
|
block discarded – undo |
8355
|
8355
|
$errormessage = ''; |
8356
|
8356
|
$sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
8357
|
8357
|
if ($errormessage) { |
8358
|
|
- return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
8358
|
+ return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
8359
|
8359
|
} |
8360
|
8360
|
} |
8361
|
8361
|
} |
|
@@ -8367,7 +8367,7 @@ discard block |
|
|
block discarded – undo |
8367
|
8367
|
$resql = $this->db->query($sql); |
8368
|
8368
|
if ($resql) { |
8369
|
8369
|
// Construct $out and $outarray |
8370
|
|
- $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
8370
|
+ $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
8371
|
8371
|
|
8372
|
8372
|
// Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
8373
|
8373
|
$textifempty = ' '; |
|
@@ -8381,7 +8381,7 @@ discard block |
|
|
block discarded – undo |
8381
|
8381
|
} |
8382
|
8382
|
} |
8383
|
8383
|
if ($showempty) { |
8384
|
|
- $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
8384
|
+ $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
8385
|
8385
|
} |
8386
|
8386
|
|
8387
|
8387
|
$num = $this->db->num_rows($resql); |
|
@@ -8404,9 +8404,9 @@ discard block |
|
|
block discarded – undo |
8404
|
8404
|
} |
8405
|
8405
|
if (empty($outputmode)) { |
8406
|
8406
|
if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
8407
|
|
- $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>'; |
|
8407
|
+ $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>'; |
8408
|
8408
|
} else { |
8409
|
|
- $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
8409
|
+ $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
8410
|
8410
|
} |
8411
|
8411
|
} else { |
8412
|
8412
|
array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
|
@@ -8419,10 +8419,10 @@ discard block |
|
|
block discarded – undo |
8419
|
8419
|
} |
8420
|
8420
|
} |
8421
|
8421
|
|
8422
|
|
- $out .= '</select>' . "\n"; |
|
8422
|
+ $out .= '</select>'."\n"; |
8423
|
8423
|
|
8424
|
8424
|
if (!$forcecombo) { |
8425
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8425
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
8426
|
8426
|
$out .= ajax_combobox($htmlname, array(), getDolGlobalInt($confkeyforautocompletemode, 0)); |
8427
|
8427
|
} |
8428
|
8428
|
} else { |
|
@@ -8486,8 +8486,8 @@ discard block |
|
|
block discarded – undo |
8486
|
8486
|
} |
8487
|
8487
|
} |
8488
|
8488
|
$idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
8489
|
|
- $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
8490
|
|
- $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
8489
|
+ $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
8490
|
+ $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
8491
|
8491
|
$out .= '>'."\n"; |
8492
|
8492
|
|
8493
|
8493
|
if ($show_empty) { |
|
@@ -8498,7 +8498,7 @@ discard block |
|
|
block discarded – undo |
8498
|
8498
|
if (!is_numeric($show_empty)) { |
8499
|
8499
|
$textforempty = $show_empty; |
8500
|
8500
|
} |
8501
|
|
- $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
8501
|
+ $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
8502
|
8502
|
} |
8503
|
8503
|
if (is_array($array)) { |
8504
|
8504
|
// Translate |
|
@@ -8523,7 +8523,7 @@ discard block |
|
|
block discarded – undo |
8523
|
8523
|
$value = $tmpvalue['label']; |
8524
|
8524
|
//$valuehtml = empty($tmpvalue['data-html']) ? $value : $tmpvalue['data-html']; |
8525
|
8525
|
$disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
8526
|
|
- $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
8526
|
+ $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
8527
|
8527
|
} else { |
8528
|
8528
|
$value = $tmpvalue; |
8529
|
8529
|
//$valuehtml = $tmpvalue; |
|
@@ -8539,9 +8539,9 @@ discard block |
|
|
block discarded – undo |
8539
|
8539
|
} |
8540
|
8540
|
if ($key_in_label) { |
8541
|
8541
|
if (empty($nohtmlescape)) { |
8542
|
|
- $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
8542
|
+ $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
8543
|
8543
|
} else { |
8544
|
|
- $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
8544
|
+ $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
8545
|
8545
|
} |
8546
|
8546
|
} else { |
8547
|
8547
|
if (empty($nohtmlescape)) { |
|
@@ -8553,8 +8553,8 @@ discard block |
|
|
block discarded – undo |
8553
|
8553
|
$selectOptionValue = ' '; |
8554
|
8554
|
} |
8555
|
8555
|
} |
8556
|
|
- $out .= '<option value="' . $key . '"'; |
8557
|
|
- $out .= $style . $disabled; |
|
8556
|
+ $out .= '<option value="'.$key.'"'; |
|
8557
|
+ $out .= $style.$disabled; |
8558
|
8558
|
if (is_array($id)) { |
8559
|
8559
|
if (in_array($key, $id) && !$disabled) { |
8560
|
8560
|
$out .= ' selected'; // To preselect a value |
|
@@ -8566,7 +8566,7 @@ discard block |
|
|
block discarded – undo |
8566
|
8566
|
} |
8567
|
8567
|
} |
8568
|
8568
|
if (!empty($nohtmlescape)) { // deprecated. Use instead the key 'data-html' into input $array, managed at next step to use HTML content. |
8569
|
|
- $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
8569
|
+ $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
8570
|
8570
|
} |
8571
|
8571
|
|
8572
|
8572
|
if (is_array($tmpvalue)) { |
|
@@ -8585,7 +8585,7 @@ discard block |
|
|
block discarded – undo |
8585
|
8585
|
// Add code for jquery to use multiselect |
8586
|
8586
|
if ($addjscombo && $jsbeautify) { |
8587
|
8587
|
// Enhance with select2 |
8588
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
8588
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
8589
|
8589
|
$out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
8590
|
8590
|
} |
8591
|
8591
|
|
|
@@ -8613,28 +8613,28 @@ discard block |
|
|
block discarded – undo |
8613
|
8613
|
public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
8614
|
8614
|
{ |
8615
|
8615
|
global $conf, $langs; |
8616
|
|
- global $delayedhtmlcontent; // Will be used later outside of this function |
|
8616
|
+ global $delayedhtmlcontent; // Will be used later outside of this function |
8617
|
8617
|
|
8618
|
8618
|
// TODO Use an internal dolibarr component instead of select2 |
8619
|
8619
|
if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8620
|
8620
|
return ''; |
8621
|
8621
|
} |
8622
|
8622
|
|
8623
|
|
- $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
8623
|
+ $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
8624
|
8624
|
|
8625
|
8625
|
$outdelayed = ''; |
8626
|
8626
|
if (!empty($conf->use_javascript_ajax)) { |
8627
|
8627
|
$tmpplugin = 'select2'; |
8628
|
|
- $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
8629
|
|
- <script nonce="' . getNonce() . '"> |
|
8628
|
+ $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8629
|
+ <script nonce="' . getNonce().'"> |
8630
|
8630
|
$(document).ready(function () { |
8631
|
8631
|
|
8632
|
|
- ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
8632
|
+ ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
8633
|
8633
|
|
8634
|
|
- $(".' . $htmlname . '").select2({ |
|
8634
|
+ $(".' . $htmlname.'").select2({ |
8635
|
8635
|
ajax: { |
8636
|
8636
|
dir: "ltr", |
8637
|
|
- url: "' . $url . '", |
|
8637
|
+ url: "' . $url.'", |
8638
|
8638
|
dataType: \'json\', |
8639
|
8639
|
delay: 250, |
8640
|
8640
|
data: function (params) { |
|
@@ -8661,9 +8661,9 @@ discard block |
|
|
block discarded – undo |
8661
|
8661
|
}, |
8662
|
8662
|
language: select2arrayoflanguage, |
8663
|
8663
|
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8664
|
|
- placeholder: "' . dol_escape_js($placeholder) . '", |
|
8664
|
+ placeholder: "' . dol_escape_js($placeholder).'", |
8665
|
8665
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8666
|
|
- minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
8666
|
+ minimumInputLength: ' . ((int) $minimumInputLength).', |
8667
|
8667
|
formatResult: function (result, container, query, escapeMarkup) { |
8668
|
8668
|
return escapeMarkup(result.text); |
8669
|
8669
|
}, |
|
@@ -8671,10 +8671,10 @@ discard block |
|
|
block discarded – undo |
8671
|
8671
|
|
8672
|
8672
|
' . ($callurlonselect ? ' |
8673
|
8673
|
/* Code to execute a GET when we select a value */ |
8674
|
|
- $(".' . $htmlname . '").change(function() { |
8675
|
|
- var selected = $(".' . $htmlname . '").val(); |
|
8674
|
+ $(".' . $htmlname.'").change(function() { |
|
8675
|
+ var selected = $(".' . $htmlname.'").val(); |
8676
|
8676
|
console.log("We select in selectArrayAjax the entry "+selected) |
8677
|
|
- $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8677
|
+ $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
8678
|
8678
|
$.each( saveRemoteData, function( key, value ) { |
8679
|
8679
|
if (key == selected) |
8680
|
8680
|
{ |
|
@@ -8682,7 +8682,7 @@ discard block |
|
|
block discarded – undo |
8682
|
8682
|
location.assign(value.url); |
8683
|
8683
|
} |
8684
|
8684
|
}); |
8685
|
|
- });' : '') . ' |
|
8685
|
+ });' : '').' |
8686
|
8686
|
|
8687
|
8687
|
}); |
8688
|
8688
|
</script>'; |
|
@@ -8718,14 +8718,14 @@ discard block |
|
|
block discarded – undo |
8718
|
8718
|
public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
8719
|
8719
|
{ |
8720
|
8720
|
global $conf, $langs; |
8721
|
|
- global $delayedhtmlcontent; // Will be used later outside of this function |
|
8721
|
+ global $delayedhtmlcontent; // Will be used later outside of this function |
8722
|
8722
|
|
8723
|
8723
|
// TODO Use an internal dolibarr component instead of select2 |
8724
|
8724
|
if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
8725
|
8725
|
return ''; |
8726
|
8726
|
} |
8727
|
8727
|
|
8728
|
|
- $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
8728
|
+ $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
8729
|
8729
|
|
8730
|
8730
|
$formattedarrayresult = array(); |
8731
|
8731
|
|
|
@@ -8740,20 +8740,20 @@ discard block |
|
|
block discarded – undo |
8740
|
8740
|
$outdelayed = ''; |
8741
|
8741
|
if (!empty($conf->use_javascript_ajax)) { |
8742
|
8742
|
$tmpplugin = 'select2'; |
8743
|
|
- $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
8744
|
|
- <script nonce="' . getNonce() . '"> |
|
8743
|
+ $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
8744
|
+ <script nonce="' . getNonce().'"> |
8745
|
8745
|
$(document).ready(function () { |
8746
|
|
- var data = ' . json_encode($formattedarrayresult) . '; |
|
8746
|
+ var data = ' . json_encode($formattedarrayresult).'; |
8747
|
8747
|
|
8748
|
|
- ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
8748
|
+ ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
8749
|
8749
|
|
8750
|
|
- $(".' . $htmlname . '").select2({ |
|
8750
|
+ $(".' . $htmlname.'").select2({ |
8751
|
8751
|
data: data, |
8752
|
8752
|
language: select2arrayoflanguage, |
8753
|
8753
|
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
8754
|
|
- placeholder: "' . dol_escape_js($placeholder) . '", |
|
8754
|
+ placeholder: "' . dol_escape_js($placeholder).'", |
8755
|
8755
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
8756
|
|
- minimumInputLength: ' . $minimumInputLength . ', |
|
8756
|
+ minimumInputLength: ' . $minimumInputLength.', |
8757
|
8757
|
formatResult: function (result, container, query, escapeMarkup) { |
8758
|
8758
|
return escapeMarkup(result.text); |
8759
|
8759
|
}, |
|
@@ -8792,11 +8792,11 @@ discard block |
|
|
block discarded – undo |
8792
|
8792
|
|
8793
|
8793
|
' . ($callurlonselect ? ' |
8794
|
8794
|
/* Code to execute a GET when we select a value */ |
8795
|
|
- $(".' . $htmlname . '").change(function() { |
8796
|
|
- var selected = $(".' . $htmlname . '").val(); |
|
8795
|
+ $(".' . $htmlname.'").change(function() { |
|
8796
|
+ var selected = $(".' . $htmlname.'").val(); |
8797
|
8797
|
console.log("We select "+selected) |
8798
|
8798
|
|
8799
|
|
- $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
8799
|
+ $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
8800
|
8800
|
$.each( saveRemoteData, function( key, value ) { |
8801
|
8801
|
if (key == selected) |
8802
|
8802
|
{ |
|
@@ -8804,7 +8804,7 @@ discard block |
|
|
block discarded – undo |
8804
|
8804
|
location.assign(value.url); |
8805
|
8805
|
} |
8806
|
8806
|
}); |
8807
|
|
- });' : '') . ' |
|
8807
|
+ });' : '').' |
8808
|
8808
|
|
8809
|
8809
|
}); |
8810
|
8810
|
</script>'; |
|
@@ -8853,7 +8853,7 @@ discard block |
|
|
block discarded – undo |
8853
|
8853
|
$useenhancedmultiselect = 0; |
8854
|
8854
|
if (!empty($conf->use_javascript_ajax) && !defined('MAIN_DO_NOT_USE_JQUERY_MULTISELECT') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
8855
|
8855
|
if ($addjscombo) { |
8856
|
|
- $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
8856
|
+ $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
8857
|
8857
|
} |
8858
|
8858
|
} |
8859
|
8859
|
|
|
@@ -8862,7 +8862,7 @@ discard block |
|
|
block discarded – undo |
8862
|
8862
|
// submitted to nothing. |
8863
|
8863
|
$out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
8864
|
8864
|
// Output select component |
8865
|
|
- $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"; |
|
8865
|
+ $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"; |
8866
|
8866
|
if (is_array($array) && !empty($array)) { |
8867
|
8867
|
if ($value_as_key) { |
8868
|
8868
|
$array = array_combine($array, $array); |
|
@@ -8883,33 +8883,33 @@ discard block |
|
|
block discarded – undo |
8883
|
8883
|
$tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml']; |
8884
|
8884
|
} |
8885
|
8885
|
$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
8886
|
|
- $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
8886
|
+ $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
8887
|
8887
|
|
8888
|
|
- $out .= '<option value="' . $tmpkey . '"'; |
|
8888
|
+ $out .= '<option value="'.$tmpkey.'"'; |
8889
|
8889
|
if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
8890
|
8890
|
$out .= ' selected'; |
8891
|
8891
|
} |
8892
|
8892
|
if (!empty($tmplabelhtml)) { |
8893
|
|
- $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
8893
|
+ $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
8894
|
8894
|
} else { |
8895
|
|
- $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
8896
|
|
- $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
8895
|
+ $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
8896
|
+ $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
8897
|
8897
|
} |
8898
|
8898
|
$out .= '>'; |
8899
|
8899
|
$out .= dol_htmlentitiesbr($newval); |
8900
|
|
- $out .= '</option>' . "\n"; |
|
8900
|
+ $out .= '</option>'."\n"; |
8901
|
8901
|
} |
8902
|
8902
|
} |
8903
|
8903
|
} |
8904
|
|
- $out .= '</select>' . "\n"; |
|
8904
|
+ $out .= '</select>'."\n"; |
8905
|
8905
|
|
8906
|
8906
|
// Add code for jquery to use multiselect |
8907
|
8907
|
if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
8908
|
|
- $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
8909
|
|
- $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
8908
|
+ $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
8909
|
+ $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
8910
|
8910
|
if ($addjscombo == 1) { |
8911
|
8911
|
$tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
8912
|
|
- $out .= 'function formatResult(record, container) {' . "\n"; |
|
8912
|
+ $out .= 'function formatResult(record, container) {'."\n"; |
8913
|
8913
|
// If property data-html set, we decode html entities and use this. |
8914
|
8914
|
// Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
8915
|
8915
|
$out .= ' if ($(record.element).attr("data-html") != undefined && typeof htmlEntityDecodeJs === "function") {'; |
|
@@ -8917,26 +8917,26 @@ discard block |
|
|
block discarded – undo |
8917
|
8917
|
$out .= ' return htmlEntityDecodeJs($(record.element).attr("data-html"));'; |
8918
|
8918
|
$out .= ' }'."\n"; |
8919
|
8919
|
$out .= ' return record.text;'; |
8920
|
|
- $out .= '}' . "\n"; |
8921
|
|
- $out .= 'function formatSelection(record) {' . "\n"; |
|
8920
|
+ $out .= '}'."\n"; |
|
8921
|
+ $out .= 'function formatSelection(record) {'."\n"; |
8922
|
8922
|
if ($elemtype == 'category') { |
8923
|
|
- $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
8923
|
+ $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
8924
|
8924
|
} else { |
8925
|
8925
|
$out .= 'return record.text;'; |
8926
|
8926
|
} |
8927
|
|
- $out .= '}' . "\n"; |
|
8927
|
+ $out .= '}'."\n"; |
8928
|
8928
|
$out .= '$(document).ready(function () { |
8929
|
|
- $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
8929
|
+ $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
8930
|
8930
|
if ($placeholder) { |
8931
|
8931
|
$out .= ' |
8932
|
8932
|
placeholder: { |
8933
|
8933
|
id: \'-1\', |
8934
|
|
- text: \'' . dol_escape_js($placeholder) . '\' |
|
8934
|
+ text: \'' . dol_escape_js($placeholder).'\' |
8935
|
8935
|
},'; |
8936
|
8936
|
} |
8937
|
8937
|
$out .= ' dir: \'ltr\', |
8938
|
8938
|
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
8939
|
|
- dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
|
8939
|
+ dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect). Need full version of select2. */ |
8940
|
8940
|
// Specify format function for dropdown item |
8941
|
8941
|
formatResult: formatResult, |
8942
|
8942
|
templateResult: formatResult, /* For 4.0 */ |
|
@@ -8948,21 +8948,21 @@ discard block |
|
|
block discarded – undo |
8948
|
8948
|
|
8949
|
8949
|
/* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
8950
|
8950
|
the size only if component is not hidden by default on load */ |
8951
|
|
- $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
8951
|
+ $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
8952
|
8952
|
});' . "\n"; |
8953
|
8953
|
} elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
8954
|
8954
|
// Add other js lib |
8955
|
8955
|
// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
8956
|
8956
|
// ... |
8957
|
|
- $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
8957
|
+ $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
8958
|
8958
|
$out .= '$(document).ready(function () { |
8959
|
|
- $(\'#' . $htmlname . '\').multiSelect({ |
|
8959
|
+ $(\'#' . $htmlname.'\').multiSelect({ |
8960
|
8960
|
containerHTML: \'<div class="multi-select-container">\', |
8961
|
8961
|
menuHTML: \'<div class="multi-select-menu">\', |
8962
|
|
- buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
8962
|
+ buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
8963
|
8963
|
menuItemHTML: \'<label class="multi-select-menuitem">\', |
8964
|
8964
|
activeClass: \'multi-select-container--open\', |
8965
|
|
- noneText: \'' . $placeholder . '\' |
|
8965
|
+ noneText: \'' . $placeholder.'\' |
8966
|
8966
|
}); |
8967
|
8967
|
})'; |
8968
|
8968
|
} |
|
@@ -8994,7 +8994,7 @@ discard block |
|
|
block discarded – undo |
8994
|
8994
|
return ''; |
8995
|
8995
|
} |
8996
|
8996
|
|
8997
|
|
- $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
8997
|
+ $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
8998
|
8998
|
|
8999
|
8999
|
if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
9000
|
9000
|
$tmparray = explode(',', $user->conf->$tmpvar); |
|
@@ -9037,19 +9037,19 @@ discard block |
|
|
block discarded – undo |
9037
|
9037
|
} |
9038
|
9038
|
|
9039
|
9039
|
// Note: $val['checked'] <> 0 means we must show the field into the combo list @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset |
9040
|
|
- $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>'; |
9041
|
|
- $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
9040
|
+ $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>'; |
|
9041
|
+ $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
9042
|
9042
|
} |
9043
|
9043
|
} |
9044
|
9044
|
|
9045
|
|
- $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
9045
|
+ $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
9046
|
9046
|
|
9047
|
9047
|
<dl class="dropdown"> |
9048
|
9048
|
<dt> |
9049
|
|
- <a href="#' . $htmlname . '"> |
9050
|
|
- ' . img_picto('', 'list') . ' |
|
9049
|
+ <a href="#' . $htmlname.'"> |
|
9050
|
+ ' . img_picto('', 'list').' |
9051
|
9051
|
</a> |
9052
|
|
- <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
9052
|
+ <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
9053
|
9053
|
</dt> |
9054
|
9054
|
<dd class="dropdowndd"> |
9055
|
9055
|
<div class="multiselectcheckbox'.$htmlname.'"> |
|
@@ -9061,19 +9061,19 @@ discard block |
|
|
block discarded – undo |
9061
|
9061
|
</dd> |
9062
|
9062
|
</dl> |
9063
|
9063
|
|
9064
|
|
- <script nonce="' . getNonce() . '" type="text/javascript"> |
|
9064
|
+ <script nonce="' . getNonce().'" type="text/javascript"> |
9065
|
9065
|
jQuery(document).ready(function () { |
9066
|
|
- $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
9066
|
+ $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
9067
|
9067
|
console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
9068
|
9068
|
|
9069
|
9069
|
$("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
9070
|
9070
|
|
9071
|
9071
|
var title = $(this).val() + ","; |
9072
|
9072
|
if ($(this).is(\':checked\')) { |
9073
|
|
- $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
9073
|
+ $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
9074
|
9074
|
} |
9075
|
9075
|
else { |
9076
|
|
- $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
9076
|
+ $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
9077
|
9077
|
} |
9078
|
9078
|
// Now, we submit page |
9079
|
9079
|
//$(this).parents(\'form:first\').submit(); |
|
@@ -9104,7 +9104,7 @@ discard block |
|
|
block discarded – undo |
9104
|
9104
|
*/ |
9105
|
9105
|
public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
9106
|
9106
|
{ |
9107
|
|
- include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
9107
|
+ include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
9108
|
9108
|
|
9109
|
9109
|
$cat = new Categorie($this->db); |
9110
|
9110
|
$categories = $cat->containing($id, $type); |
|
@@ -9114,10 +9114,10 @@ discard block |
|
|
block discarded – undo |
9114
|
9114
|
foreach ($categories as $c) { |
9115
|
9115
|
$ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
9116
|
9116
|
foreach ($ways as $way) { |
9117
|
|
- $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
9117
|
+ $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
9118
|
9118
|
} |
9119
|
9119
|
} |
9120
|
|
- return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
9120
|
+ return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
9121
|
9121
|
} |
9122
|
9122
|
|
9123
|
9123
|
if ($rendermode == 0) { |
|
@@ -9165,15 +9165,15 @@ discard block |
|
|
block discarded – undo |
9165
|
9165
|
|
9166
|
9166
|
|
9167
|
9167
|
print '<div class="div-table-responsive-no-min">'; |
9168
|
|
- print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
9168
|
+ print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
9169
|
9169
|
|
9170
|
9170
|
print '<tr class="liste_titre">'; |
9171
|
|
- print '<td>' . $langs->trans("Type") . '</td>'; |
9172
|
|
- print '<td>' . $langs->trans("Ref") . '</td>'; |
|
9171
|
+ print '<td>'.$langs->trans("Type").'</td>'; |
|
9172
|
+ print '<td>'.$langs->trans("Ref").'</td>'; |
9173
|
9173
|
print '<td class="center"></td>'; |
9174
|
|
- print '<td class="center">' . $langs->trans("Date") . '</td>'; |
9175
|
|
- print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
9176
|
|
- print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
9174
|
+ print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
9175
|
+ print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9176
|
+ print '<td class="right">'.$langs->trans("Status").'</td>'; |
9177
|
9177
|
print '<td></td>'; |
9178
|
9178
|
print '</tr>'; |
9179
|
9179
|
|
|
@@ -9192,13 +9192,13 @@ discard block |
|
|
block discarded – undo |
9192
|
9192
|
if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
9193
|
9193
|
$element = $regs[1]; |
9194
|
9194
|
$subelement = $regs[2]; |
9195
|
|
- $tplpath = $element . '/' . $subelement; |
|
9195
|
+ $tplpath = $element.'/'.$subelement; |
9196
|
9196
|
} |
9197
|
9197
|
$tplname = 'linkedobjectblock'; |
9198
|
9198
|
|
9199
|
9199
|
// To work with non standard path |
9200
|
9200
|
if ($objecttype == 'facture') { |
9201
|
|
- $tplpath = 'compta/' . $element; |
|
9201
|
+ $tplpath = 'compta/'.$element; |
9202
|
9202
|
if (!isModEnabled('invoice')) { |
9203
|
9203
|
continue; // Do not show if module disabled |
9204
|
9204
|
} |
|
@@ -9209,7 +9209,7 @@ discard block |
|
|
block discarded – undo |
9209
|
9209
|
continue; // Do not show if module disabled |
9210
|
9210
|
} |
9211
|
9211
|
} elseif ($objecttype == 'propal') { |
9212
|
|
- $tplpath = 'comm/' . $element; |
|
9212
|
+ $tplpath = 'comm/'.$element; |
9213
|
9213
|
if (!isModEnabled('propal')) { |
9214
|
9214
|
continue; // Do not show if module disabled |
9215
|
9215
|
} |
|
@@ -9260,7 +9260,7 @@ discard block |
|
|
block discarded – undo |
9260
|
9260
|
$linkedObjectBlock = $objects; |
9261
|
9261
|
|
9262
|
9262
|
// Output template part (modules that overwrite templates must declare this into descriptor) |
9263
|
|
- $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
9263
|
+ $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
9264
|
9264
|
foreach ($dirtpls as $reldir) { |
9265
|
9265
|
$reldir = rtrim($reldir, '/'); |
9266
|
9266
|
if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
|
@@ -9268,7 +9268,7 @@ discard block |
|
|
block discarded – undo |
9268
|
9268
|
$noMoreLinkedObjectBlockAfter = 1; |
9269
|
9269
|
} |
9270
|
9270
|
|
9271
|
|
- $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
9271
|
+ $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
9272
|
9272
|
if ($res) { |
9273
|
9273
|
$nboftypesoutput++; |
9274
|
9274
|
break; |
|
@@ -9277,7 +9277,7 @@ discard block |
|
|
block discarded – undo |
9277
|
9277
|
} |
9278
|
9278
|
|
9279
|
9279
|
if (!$nboftypesoutput) { |
9280
|
|
- print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
9280
|
+ print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
9281
|
9281
|
} |
9282
|
9282
|
|
9283
|
9283
|
print '</table>'; |
|
@@ -9317,14 +9317,14 @@ discard block |
|
|
block discarded – undo |
9317
|
9317
|
if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
9318
|
9318
|
$listofidcompanytoscan = $object->thirdparty->id; |
9319
|
9319
|
if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
9320
|
|
- $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
9320
|
+ $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
9321
|
9321
|
} |
9322
|
9322
|
if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
9323
|
|
- include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
9323
|
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
9324
|
9324
|
$tmpproject = new Project($this->db); |
9325
|
9325
|
$tmpproject->fetch($object->fk_project); |
9326
|
9326
|
if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
9327
|
|
- $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
9327
|
+ $listofidcompanytoscan .= ','.$tmpproject->socid; |
9328
|
9328
|
} |
9329
|
9329
|
unset($tmpproject); |
9330
|
9330
|
} |
|
@@ -9334,63 +9334,63 @@ discard block |
|
|
block discarded – undo |
9334
|
9334
|
'enabled' => isModEnabled('propal'), |
9335
|
9335
|
'perms' => 1, |
9336
|
9336
|
'label' => 'LinkToProposal', |
9337
|
|
- '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') . ')'), |
|
9337
|
+ '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').')'), |
9338
|
9338
|
'shipping' => array( |
9339
|
9339
|
'enabled' => isModEnabled('shipping'), |
9340
|
9340
|
'perms' => 1, |
9341
|
9341
|
'label' => 'LinkToExpedition', |
9342
|
|
- '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') . ')'), |
|
9342
|
+ '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').')'), |
9343
|
9343
|
'order' => array( |
9344
|
9344
|
'enabled' => isModEnabled('order'), |
9345
|
9345
|
'perms' => 1, |
9346
|
9346
|
'label' => 'LinkToOrder', |
9347
|
|
- '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') . ')'), |
|
9347
|
+ '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').')'), |
9348
|
9348
|
'invoice' => array( |
9349
|
9349
|
'enabled' => isModEnabled('invoice'), |
9350
|
9350
|
'perms' => 1, |
9351
|
9351
|
'label' => 'LinkToInvoice', |
9352
|
|
- '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') . ')'), |
|
9352
|
+ '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').')'), |
9353
|
9353
|
'invoice_template' => array( |
9354
|
9354
|
'enabled' => isModEnabled('invoice'), |
9355
|
9355
|
'perms' => 1, |
9356
|
9356
|
'label' => 'LinkToTemplateInvoice', |
9357
|
|
- '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') . ')'), |
|
9357
|
+ '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').')'), |
9358
|
9358
|
'contrat' => array( |
9359
|
9359
|
'enabled' => isModEnabled('contract'), |
9360
|
9360
|
'perms' => 1, |
9361
|
9361
|
'label' => 'LinkToContract', |
9362
|
9362
|
'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 |
9363
|
|
- 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' |
|
9363
|
+ 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' |
9364
|
9364
|
), |
9365
|
9365
|
'fichinter' => array( |
9366
|
9366
|
'enabled' => isModEnabled('intervention'), |
9367
|
9367
|
'perms' => 1, |
9368
|
9368
|
'label' => 'LinkToIntervention', |
9369
|
|
- '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') . ')'), |
|
9369
|
+ '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').')'), |
9370
|
9370
|
'supplier_proposal' => array( |
9371
|
9371
|
'enabled' => isModEnabled('supplier_proposal'), |
9372
|
9372
|
'perms' => 1, |
9373
|
9373
|
'label' => 'LinkToSupplierProposal', |
9374
|
|
- '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') . ')'), |
|
9374
|
+ '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').')'), |
9375
|
9375
|
'order_supplier' => array( |
9376
|
9376
|
'enabled' => isModEnabled("supplier_order"), |
9377
|
9377
|
'perms' => 1, |
9378
|
9378
|
'label' => 'LinkToSupplierOrder', |
9379
|
|
- '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') . ')'), |
|
9379
|
+ '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').')'), |
9380
|
9380
|
'invoice_supplier' => array( |
9381
|
9381
|
'enabled' => isModEnabled("supplier_invoice"), |
9382
|
9382
|
'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
9383
|
|
- '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') . ')'), |
|
9383
|
+ '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').')'), |
9384
|
9384
|
'ticket' => array( |
9385
|
9385
|
'enabled' => isModEnabled('ticket'), |
9386
|
9386
|
'perms' => 1, |
9387
|
9387
|
'label' => 'LinkToTicket', |
9388
|
|
- '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') . ')'), |
|
9388
|
+ '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').')'), |
9389
|
9389
|
'mo' => array( |
9390
|
9390
|
'enabled' => isModEnabled('mrp'), |
9391
|
9391
|
'perms' => 1, |
9392
|
9392
|
'label' => 'LinkToMo', |
9393
|
|
- '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') . ')') |
|
9393
|
+ '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').')') |
9394
|
9394
|
); |
9395
|
9395
|
} |
9396
|
9396
|
|
|
@@ -9426,22 +9426,22 @@ discard block |
|
|
block discarded – undo |
9426
|
9426
|
} |
9427
|
9427
|
|
9428
|
9428
|
if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
9429
|
|
- print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
9429
|
+ print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
9430
|
9430
|
|
9431
|
9431
|
if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
9432
|
9432
|
print '<br>'."\n"; |
9433
|
9433
|
print '<!-- form to add a link from anywhere -->'."\n"; |
9434
|
|
- print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
9435
|
|
- print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
9434
|
+ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
9435
|
+ print '<input type="hidden" name="id" value="'.$object->id.'">'; |
9436
|
9436
|
print '<input type="hidden" name="action" value="addlinkbyref">'; |
9437
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
9438
|
|
- print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9437
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9438
|
+ print '<input type="hidden" name="addlink" value="'.$key.'">'; |
9439
|
9439
|
print '<table class="noborder">'; |
9440
|
9440
|
print '<tr>'; |
9441
|
9441
|
//print '<td>' . $langs->trans("Ref") . '</td>'; |
9442
|
|
- print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
9443
|
|
- print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
9444
|
|
- print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
9442
|
+ print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
9443
|
+ print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
9444
|
+ print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
9445
|
9445
|
print '</tr>'; |
9446
|
9446
|
print '</table>'; |
9447
|
9447
|
print '</form>'; |
|
@@ -9456,48 +9456,48 @@ discard block |
|
|
block discarded – undo |
9456
|
9456
|
|
9457
|
9457
|
print '<br>'; |
9458
|
9458
|
print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
9459
|
|
- print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
9459
|
+ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
9460
|
9460
|
print '<input type="hidden" name="action" value="addlink">'; |
9461
|
|
- print '<input type="hidden" name="token" value="' . newToken() . '">'; |
9462
|
|
- print '<input type="hidden" name="id" value="' . $object->id . '">'; |
9463
|
|
- print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
9461
|
+ print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
9462
|
+ print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
9463
|
+ print '<input type="hidden" name="addlink" value="'.$key.'">'; |
9464
|
9464
|
print '<table class="noborder">'; |
9465
|
9465
|
print '<tr class="liste_titre">'; |
9466
|
9466
|
print '<td class="nowrap"></td>'; |
9467
|
|
- print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
9468
|
|
- print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
9469
|
|
- print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
9470
|
|
- print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
9467
|
+ print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
9468
|
+ print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
9469
|
+ print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
9470
|
+ print '<td class="left">'.$langs->trans("Company").'</td>'; |
9471
|
9471
|
print '</tr>'; |
9472
|
9472
|
while ($i < $num) { |
9473
|
9473
|
$objp = $this->db->fetch_object($resqllist); |
9474
|
9474
|
|
9475
|
9475
|
print '<tr class="oddeven">'; |
9476
|
9476
|
print '<td class="left">'; |
9477
|
|
- print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
9477
|
+ print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
9478
|
9478
|
print '</td>'; |
9479
|
|
- print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
9480
|
|
- print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
9479
|
+ print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
9480
|
+ print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
9481
|
9481
|
print '<td class="right">'; |
9482
|
9482
|
if ($possiblelink['label'] == 'LinkToContract') { |
9483
|
9483
|
$form = new Form($this->db); |
9484
|
|
- print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
9484
|
+ print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
9485
|
9485
|
} |
9486
|
|
- print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
9486
|
+ print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
9487
|
9487
|
print '</td>'; |
9488
|
|
- print '<td>' . $objp->name . '</td>'; |
|
9488
|
+ print '<td>'.$objp->name.'</td>'; |
9489
|
9489
|
print '</tr>'; |
9490
|
9490
|
$i++; |
9491
|
9491
|
} |
9492
|
9492
|
print '</table>'; |
9493
|
9493
|
print '<div class="center">'; |
9494
|
9494
|
if ($num) { |
9495
|
|
- print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
9495
|
+ print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
9496
|
9496
|
} |
9497
|
9497
|
if (empty($conf->use_javascript_ajax)) { |
9498
|
|
- print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9498
|
+ print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
9499
|
9499
|
} else { |
9500
|
|
- print '<input type="submit" onclick="jQuery(\'#' . $key . 'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
9500
|
+ print '<input type="submit" onclick="jQuery(\'#'.$key.'list\').toggle(); return false;" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
9501
|
9501
|
} |
9502
|
9502
|
print '</form>'; |
9503
|
9503
|
$this->db->free($resqllist); |
|
@@ -9508,10 +9508,10 @@ discard block |
|
|
block discarded – undo |
9508
|
9508
|
|
9509
|
9509
|
//$linktoelem.=($linktoelem?' ':''); |
9510
|
9510
|
if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
9511
|
|
- $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
9511
|
+ $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
9512
|
9512
|
// } else $linktoelem.=$langs->trans($possiblelink['label']); |
9513
|
9513
|
} else { |
9514
|
|
- $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
9514
|
+ $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
9515
|
9515
|
} |
9516
|
9516
|
} |
9517
|
9517
|
} |
|
@@ -9521,22 +9521,22 @@ discard block |
|
|
block discarded – undo |
9521
|
9521
|
<dl class="dropdown" id="linktoobjectname"> |
9522
|
9522
|
'; |
9523
|
9523
|
if (!empty($conf->use_javascript_ajax)) { |
9524
|
|
- $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
9524
|
+ $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
9525
|
9525
|
} |
9526
|
9526
|
$linktoelem .= '<dd> |
9527
|
9527
|
<div class="multiselectlinkto"> |
9528
|
|
- <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
9528
|
+ <ul class="ulselectedfields">' . $linktoelemlist.' |
9529
|
9529
|
</ul> |
9530
|
9530
|
</div> |
9531
|
9531
|
</dd> |
9532
|
9532
|
</dl>'; |
9533
|
9533
|
} else { |
9534
|
|
- $linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
|
9534
|
+ $linktoelem = ''; // @phan-suppress-current-line PhanPluginRedundantAssignment |
9535
|
9535
|
} |
9536
|
9536
|
|
9537
|
9537
|
if (!empty($conf->use_javascript_ajax)) { |
9538
|
9538
|
print '<!-- Add js to show linkto box --> |
9539
|
|
- <script nonce="' . getNonce() . '"> |
|
9539
|
+ <script nonce="' . getNonce().'"> |
9540
|
9540
|
jQuery(document).ready(function() { |
9541
|
9541
|
jQuery(".linkto").click(function() { |
9542
|
9542
|
console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
|
@@ -9577,19 +9577,19 @@ discard block |
|
|
block discarded – undo |
9577
|
9577
|
|
9578
|
9578
|
$disabled = ($disabled ? ' disabled' : ''); |
9579
|
9579
|
|
9580
|
|
- $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
9580
|
+ $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
9581
|
9581
|
if ($useempty) { |
9582
|
|
- $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
9582
|
+ $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
9583
|
9583
|
} |
9584
|
9584
|
if (("$value" == 'yes') || ($value == 1)) { |
9585
|
|
- $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
9586
|
|
- $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9585
|
+ $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
9586
|
+ $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
9587
|
9587
|
} else { |
9588
|
9588
|
$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
9589
|
|
- $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
9590
|
|
- $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
9589
|
+ $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
9590
|
+ $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
9591
|
9591
|
} |
9592
|
|
- $resultyesno .= '</select>' . "\n"; |
|
9592
|
+ $resultyesno .= '</select>'."\n"; |
9593
|
9593
|
|
9594
|
9594
|
if ($addjscombo) { |
9595
|
9595
|
$resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
|
@@ -9613,12 +9613,12 @@ discard block |
|
|
block discarded – undo |
9613
|
9613
|
{ |
9614
|
9614
|
// phpcs:enable |
9615
|
9615
|
$sql = "SELECT rowid, label"; |
9616
|
|
- $sql .= " FROM " . $this->db->prefix() . "export_model"; |
9617
|
|
- $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
9616
|
+ $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
9617
|
+ $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
9618
|
9618
|
$sql .= " ORDER BY rowid"; |
9619
|
9619
|
$result = $this->db->query($sql); |
9620
|
9620
|
if ($result) { |
9621
|
|
- print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
9621
|
+ print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
9622
|
9622
|
if ($useempty) { |
9623
|
9623
|
print '<option value="-1"> </option>'; |
9624
|
9624
|
} |
|
@@ -9628,9 +9628,9 @@ discard block |
|
|
block discarded – undo |
9628
|
9628
|
while ($i < $num) { |
9629
|
9629
|
$obj = $this->db->fetch_object($result); |
9630
|
9630
|
if ($selected == $obj->rowid) { |
9631
|
|
- print '<option value="' . $obj->rowid . '" selected>'; |
|
9631
|
+ print '<option value="'.$obj->rowid.'" selected>'; |
9632
|
9632
|
} else { |
9633
|
|
- print '<option value="' . $obj->rowid . '">'; |
|
9633
|
+ print '<option value="'.$obj->rowid.'">'; |
9634
|
9634
|
} |
9635
|
9635
|
print $obj->label; |
9636
|
9636
|
print '</option>'; |
|
@@ -9721,8 +9721,8 @@ discard block |
|
|
block discarded – undo |
9721
|
9721
|
$stringforfirstkey .= ' CTL +'; |
9722
|
9722
|
} |
9723
|
9723
|
|
9724
|
|
- $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>'; |
9725
|
|
- $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>'; |
|
9724
|
+ $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>'; |
|
9725
|
+ $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>'; |
9726
|
9726
|
} |
9727
|
9727
|
|
9728
|
9728
|
//print "xx".$previous_ref."x".$next_ref; |
|
@@ -9730,18 +9730,18 @@ discard block |
|
|
block discarded – undo |
9730
|
9730
|
|
9731
|
9731
|
// Right part of banner |
9732
|
9732
|
if ($morehtmlright) { |
9733
|
|
- $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
9733
|
+ $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
9734
|
9734
|
} |
9735
|
9735
|
|
9736
|
9736
|
if ($previous_ref || $next_ref || $morehtml) { |
9737
|
9737
|
$ret .= '<div class="pagination paginationref"><ul class="right">'; |
9738
|
9738
|
} |
9739
|
9739
|
if ($morehtml && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { |
9740
|
|
- $ret .= '<!-- morehtml --><li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
9740
|
+ $ret .= '<!-- morehtml --><li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
9741
|
9741
|
} |
9742
|
9742
|
if ($shownav && ($previous_ref || $next_ref)) { |
9743
|
|
- $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
9744
|
|
- $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
9743
|
+ $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
9744
|
+ $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
9745
|
9745
|
} |
9746
|
9746
|
if ($previous_ref || $next_ref || $morehtml) { |
9747
|
9747
|
$ret .= '</ul></div>'; |
|
@@ -9756,7 +9756,7 @@ discard block |
|
|
block discarded – undo |
9756
|
9756
|
$morehtmlstatus = $hookmanager->resPrint; |
9757
|
9757
|
} |
9758
|
9758
|
if ($morehtmlstatus) { |
9759
|
|
- $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
9759
|
+ $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
9760
|
9760
|
} |
9761
|
9761
|
|
9762
|
9762
|
$parameters = array(); |
|
@@ -9770,14 +9770,14 @@ discard block |
|
|
block discarded – undo |
9770
|
9770
|
// Left part of banner |
9771
|
9771
|
if ($morehtmlleft) { |
9772
|
9772
|
if ($conf->browser->layout == 'phone') { |
9773
|
|
- $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
9773
|
+ $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
9774
|
9774
|
} else { |
9775
|
|
- $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
9775
|
+ $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
9776
|
9776
|
} |
9777
|
9777
|
} |
9778
|
9778
|
|
9779
|
9779
|
//if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
9780
|
|
- $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
9780
|
+ $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
9781
|
9781
|
|
9782
|
9782
|
// For thirdparty, contact, user, member, the ref is the id, so we show something else |
9783
|
9783
|
if ($object->element == 'societe') { |
|
@@ -9791,7 +9791,7 @@ discard block |
|
|
block discarded – undo |
9791
|
9791
|
|
9792
|
9792
|
if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
9793
|
9793
|
if (!is_object($extralanguages)) { |
9794
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
9794
|
+ include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
9795
|
9795
|
$extralanguages = new ExtraLanguages($this->db); |
9796
|
9796
|
} |
9797
|
9797
|
$extralanguages->fetch_name_extralanguages('societe'); |
|
@@ -9806,29 +9806,29 @@ discard block |
|
|
block discarded – undo |
9806
|
9806
|
if ($object->array_languages['name'][$extralangcode]) { |
9807
|
9807
|
$htmltext .= $object->array_languages['name'][$extralangcode]; |
9808
|
9808
|
} else { |
9809
|
|
- $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
9809
|
+ $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
9810
|
9810
|
} |
9811
|
9811
|
} |
9812
|
|
- $ret .= '<!-- Show translations of name -->' . "\n"; |
|
9812
|
+ $ret .= '<!-- Show translations of name -->'."\n"; |
9813
|
9813
|
$ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
9814
|
9814
|
} |
9815
|
9815
|
} |
9816
|
9816
|
} elseif ($object->element == 'member') { |
9817
|
9817
|
'@phan-var-force Adherent $object'; |
9818
|
|
- $ret .= $object->ref . '<br>'; |
|
9818
|
+ $ret .= $object->ref.'<br>'; |
9819
|
9819
|
$fullname = $object->getFullName($langs); |
9820
|
9820
|
if ($object->morphy == 'mor' && $object->societe) { |
9821
|
|
- $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
9821
|
+ $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
9822
|
9822
|
} else { |
9823
|
|
- $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
9823
|
+ $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
9824
|
9824
|
} |
9825
|
9825
|
} elseif (in_array($object->element, array('contact', 'user'))) { |
9826
|
|
- $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
9826
|
+ $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
9827
|
9827
|
} elseif ($object->element == 'usergroup') { |
9828
|
9828
|
$ret .= dol_htmlentities($object->name); |
9829
|
9829
|
} elseif (in_array($object->element, array('action', 'agenda'))) { |
9830
|
9830
|
'@phan-var-force ActionComm $object'; |
9831
|
|
- $ret .= $object->ref . '<br>' . $object->label; |
|
9831
|
+ $ret .= $object->ref.'<br>'.$object->label; |
9832
|
9832
|
} elseif (in_array($object->element, array('adherent_type'))) { |
9833
|
9833
|
$ret .= $object->label; |
9834
|
9834
|
} elseif ($object->element == 'ecm_directories') { |
|
@@ -9881,9 +9881,9 @@ discard block |
|
|
block discarded – undo |
9881
|
9881
|
} |
9882
|
9882
|
|
9883
|
9883
|
// Barcode image @phan-suppress-next-line PhanUndeclaredProperty |
9884
|
|
- $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
9885
|
|
- $out = '<!-- url barcode = ' . $url . ' -->'; |
9886
|
|
- $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
9884
|
+ $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
9885
|
+ $out = '<!-- url barcode = '.$url.' -->'; |
|
9886
|
+ $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
9887
|
9887
|
|
9888
|
9888
|
return $out; |
9889
|
9889
|
} |
|
@@ -9910,7 +9910,7 @@ discard block |
|
|
block discarded – undo |
9910
|
9910
|
global $conf, $langs; |
9911
|
9911
|
|
9912
|
9912
|
$entity = (empty($object->entity) ? $conf->entity : $object->entity); |
9913
|
|
- $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
|
9913
|
+ $id = (empty($object->id) ? $object->rowid : $object->id); // @phan-suppress-current-line PhanUndeclaredProperty (->rowid) |
9914
|
9914
|
|
9915
|
9915
|
$dir = ''; |
9916
|
9916
|
$file = ''; |
|
@@ -9923,28 +9923,28 @@ discard block |
|
|
block discarded – undo |
9923
|
9923
|
if (!empty($object->logo)) { |
9924
|
9924
|
if (dolIsAllowedForPreview($object->logo)) { |
9925
|
9925
|
if ((string) $imagesize == 'mini') { |
9926
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
9926
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
9927
|
9927
|
} elseif ((string) $imagesize == 'small') { |
9928
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
9928
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
9929
|
9929
|
} else { |
9930
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
9930
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
9931
|
9931
|
} |
9932
|
|
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
9932
|
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
9933
|
9933
|
} |
9934
|
9934
|
} |
9935
|
9935
|
$email = $object->email; |
9936
|
9936
|
} elseif ($modulepart == 'contact') { |
9937
|
|
- $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
9937
|
+ $dir = $conf->societe->multidir_output[$entity].'/contact'; |
9938
|
9938
|
if (!empty($object->photo)) { |
9939
|
9939
|
if (dolIsAllowedForPreview($object->photo)) { |
9940
|
9940
|
if ((string) $imagesize == 'mini') { |
9941
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9941
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
9942
|
9942
|
} elseif ((string) $imagesize == 'small') { |
9943
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9943
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
9944
|
9944
|
} else { |
9945
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
9945
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
9946
|
9946
|
} |
9947
|
|
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
9947
|
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
9948
|
9948
|
} |
9949
|
9949
|
} |
9950
|
9950
|
$email = $object->email; |
|
@@ -9954,17 +9954,17 @@ discard block |
|
|
block discarded – undo |
9954
|
9954
|
if (!empty($object->photo)) { |
9955
|
9955
|
if (dolIsAllowedForPreview($object->photo)) { |
9956
|
9956
|
if ((string) $imagesize == 'mini') { |
9957
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9957
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
9958
|
9958
|
} elseif ((string) $imagesize == 'small') { |
9959
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9959
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
9960
|
9960
|
} else { |
9961
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
9961
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
9962
|
9962
|
} |
9963
|
|
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
9963
|
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
9964
|
9964
|
} |
9965
|
9965
|
} |
9966
|
9966
|
if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
9967
|
|
- $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9967
|
+ $altfile = $object->id.".jpg"; // For backward compatibility |
9968
|
9968
|
} |
9969
|
9969
|
$email = $object->email; |
9970
|
9970
|
$capture = 'user'; |
|
@@ -9973,17 +9973,17 @@ discard block |
|
|
block discarded – undo |
9973
|
9973
|
if (!empty($object->photo)) { |
9974
|
9974
|
if (dolIsAllowedForPreview($object->photo)) { |
9975
|
9975
|
if ((string) $imagesize == 'mini') { |
9976
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
9976
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
9977
|
9977
|
} elseif ((string) $imagesize == 'small') { |
9978
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
9978
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
9979
|
9979
|
} else { |
9980
|
|
- $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
9980
|
+ $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
9981
|
9981
|
} |
9982
|
|
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
9982
|
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
9983
|
9983
|
} |
9984
|
9984
|
} |
9985
|
9985
|
if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
9986
|
|
- $altfile = $object->id . ".jpg"; // For backward compatibility |
|
9986
|
+ $altfile = $object->id.".jpg"; // For backward compatibility |
9987
|
9987
|
} |
9988
|
9988
|
$email = $object->email; |
9989
|
9989
|
$capture = 'user'; |
|
@@ -10009,35 +10009,35 @@ discard block |
|
|
block discarded – undo |
10009
|
10009
|
$ret = ''; |
10010
|
10010
|
|
10011
|
10011
|
if ($dir) { |
10012
|
|
- if ($file && file_exists($dir . "/" . $file)) { |
|
10012
|
+ if ($file && file_exists($dir."/".$file)) { |
10013
|
10013
|
if ($addlinktofullsize) { |
10014
|
|
- $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
10014
|
+ $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
10015
|
10015
|
if ($urladvanced) { |
10016
|
|
- $ret .= '<a href="' . $urladvanced . '">'; |
|
10016
|
+ $ret .= '<a href="'.$urladvanced.'">'; |
10017
|
10017
|
} else { |
10018
|
|
- $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
10018
|
+ $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
10019
|
10019
|
} |
10020
|
10020
|
} |
10021
|
|
- $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 . '">'; |
|
10021
|
+ $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.'">'; |
10022
|
10022
|
if ($addlinktofullsize) { |
10023
|
10023
|
$ret .= '</a>'; |
10024
|
10024
|
} |
10025
|
|
- } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
10025
|
+ } elseif ($altfile && file_exists($dir."/".$altfile)) { |
10026
|
10026
|
if ($addlinktofullsize) { |
10027
|
|
- $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
10027
|
+ $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
10028
|
10028
|
if ($urladvanced) { |
10029
|
|
- $ret .= '<a href="' . $urladvanced . '">'; |
|
10029
|
+ $ret .= '<a href="'.$urladvanced.'">'; |
10030
|
10030
|
} else { |
10031
|
|
- $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
10031
|
+ $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
10032
|
10032
|
} |
10033
|
10033
|
} |
10034
|
|
- $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 . '">'; |
|
10034
|
+ $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.'">'; |
10035
|
10035
|
if ($addlinktofullsize) { |
10036
|
10036
|
$ret .= '</a>'; |
10037
|
10037
|
} |
10038
|
10038
|
} else { |
10039
|
10039
|
$nophoto = '/public/theme/common/nophoto.png'; |
10040
|
|
- $defaultimg = 'identicon'; // For gravatar |
|
10040
|
+ $defaultimg = 'identicon'; // For gravatar |
10041
|
10041
|
if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
10042
|
10042
|
if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor') !== false)) { |
10043
|
10043
|
$nophoto = 'company'; |
|
@@ -10055,13 +10055,13 @@ discard block |
|
|
block discarded – undo |
10055
|
10055
|
if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
10056
|
10056
|
// see https://gravatar.com/site/implement/images/php/ |
10057
|
10057
|
$ret .= '<!-- Put link to gravatar -->'; |
10058
|
|
- $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 |
|
10058
|
+ $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 |
10059
|
10059
|
} else { |
10060
|
10060
|
if ($nophoto == 'company') { |
10061
|
|
- $ret .= '<div class="divforspanimg valignmiddle center photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
10061
|
+ $ret .= '<div class="divforspanimg valignmiddle center photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
10062
|
10062
|
//$ret .= '<div class="difforspanimgright"></div>'; |
10063
|
10063
|
} else { |
10064
|
|
- $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
10064
|
+ $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
10065
|
10065
|
} |
10066
|
10066
|
} |
10067
|
10067
|
} |
|
@@ -10072,15 +10072,15 @@ discard block |
|
|
block discarded – undo |
10072
|
10072
|
} |
10073
|
10073
|
$ret .= '<table class="nobordernopadding centpercent">'; |
10074
|
10074
|
if ($object->photo) { |
10075
|
|
- $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
10075
|
+ $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
10076
|
10076
|
} |
10077
|
10077
|
$ret .= '<tr><td class="tdoverflow">'; |
10078
|
10078
|
$maxfilesizearray = getMaxFileSizeArray(); |
10079
|
10079
|
$maxmin = $maxfilesizearray['maxmin']; |
10080
|
10080
|
if ($maxmin > 0) { |
10081
|
|
- $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
10081
|
+ $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
10082
|
10082
|
} |
10083
|
|
- $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
10083
|
+ $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
10084
|
10084
|
$ret .= '</td></tr>'; |
10085
|
10085
|
$ret .= '</table>'; |
10086
|
10086
|
} |
|
@@ -10134,38 +10134,38 @@ discard block |
|
|
block discarded – undo |
10134
|
10134
|
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
10135
|
10135
|
$sql .= ", e.label"; |
10136
|
10136
|
} |
10137
|
|
- $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
10137
|
+ $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
10138
|
10138
|
if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
10139
|
|
- $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
10139
|
+ $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
10140
|
10140
|
if ($force_entity) { |
10141
|
|
- $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
10141
|
+ $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
10142
|
10142
|
} else { |
10143
|
10143
|
$sql .= " WHERE ug.entity IS NOT NULL"; |
10144
|
10144
|
} |
10145
|
10145
|
} else { |
10146
|
|
- $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
10146
|
+ $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
10147
|
10147
|
} |
10148
|
10148
|
if (is_array($exclude) && $excludeGroups) { |
10149
|
|
- $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
10149
|
+ $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
10150
|
10150
|
} |
10151
|
10151
|
if (is_array($include) && $includeGroups) { |
10152
|
|
- $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
10152
|
+ $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
10153
|
10153
|
} |
10154
|
10154
|
$sql .= " ORDER BY ug.nom ASC"; |
10155
|
10155
|
|
10156
|
|
- dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
10156
|
+ dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
10157
|
10157
|
$resql = $this->db->query($sql); |
10158
|
10158
|
if ($resql) { |
10159
|
10159
|
// Enhance with select2 |
10160
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10160
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
10161
|
10161
|
|
10162
|
|
- $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
10162
|
+ $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
10163
|
10163
|
|
10164
|
10164
|
$num = $this->db->num_rows($resql); |
10165
|
10165
|
$i = 0; |
10166
|
10166
|
if ($num) { |
10167
|
10167
|
if ($show_empty && !$multiple) { |
10168
|
|
- $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
10168
|
+ $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
10169
|
10169
|
} |
10170
|
10170
|
|
10171
|
10171
|
while ($i < $num) { |
|
@@ -10178,11 +10178,11 @@ discard block |
|
|
block discarded – undo |
10178
|
10178
|
$label = $obj->name; |
10179
|
10179
|
$labelhtml = $obj->name; |
10180
|
10180
|
if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
10181
|
|
- $label .= " (" . $obj->label . ")"; |
10182
|
|
- $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
10181
|
+ $label .= " (".$obj->label.")"; |
|
10182
|
+ $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
10183
|
10183
|
} |
10184
|
10184
|
|
10185
|
|
- $out .= '<option value="' . $obj->rowid . '"'; |
|
10185
|
+ $out .= '<option value="'.$obj->rowid.'"'; |
10186
|
10186
|
if ($disableline) { |
10187
|
10187
|
$out .= ' disabled'; |
10188
|
10188
|
} |
|
@@ -10198,9 +10198,9 @@ discard block |
|
|
block discarded – undo |
10198
|
10198
|
} |
10199
|
10199
|
} else { |
10200
|
10200
|
if ($show_empty) { |
10201
|
|
- $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
10201
|
+ $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
10202
|
10202
|
} |
10203
|
|
- $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
10203
|
+ $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
10204
|
10204
|
} |
10205
|
10205
|
$out .= '</select>'; |
10206
|
10206
|
|
|
@@ -10244,25 +10244,25 @@ discard block |
|
|
block discarded – undo |
10244
|
10244
|
$out = ''; |
10245
|
10245
|
|
10246
|
10246
|
if (!empty($conf->use_javascript_ajax)) { |
10247
|
|
- $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
10247
|
+ $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
10248
|
10248
|
} |
10249
|
|
- $out .= '<script nonce="' . getNonce() . '"> |
|
10249
|
+ $out .= '<script nonce="'.getNonce().'"> |
10250
|
10250
|
$(document).ready(function() { |
10251
|
|
- $("#' . $cssclass . 's").click(function() { |
|
10251
|
+ $("#' . $cssclass.'s").click(function() { |
10252
|
10252
|
if($(this).is(\':checked\')){ |
10253
|
|
- console.log("We check all ' . $cssclass . ' and trigger the change method"); |
10254
|
|
- $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
10253
|
+ console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
10254
|
+ $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
10255
|
10255
|
} |
10256
|
10256
|
else |
10257
|
10257
|
{ |
10258
|
10258
|
console.log("We uncheck all"); |
10259
|
|
- $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
10259
|
+ $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
10260
|
10260
|
}' . "\n"; |
10261
|
10261
|
if ($calljsfunction) { |
10262
|
|
- $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
10262
|
+ $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
10263
|
10263
|
} |
10264
|
10264
|
$out .= ' }); |
10265
|
|
- $(".' . $cssclass . '").change(function() { |
|
10265
|
+ $(".' . $cssclass.'").change(function() { |
10266
|
10266
|
$(this).closest("tr").toggleClass("highlight", this.checked); |
10267
|
10267
|
}); |
10268
|
10268
|
}); |
|
@@ -10307,67 +10307,67 @@ discard block |
|
|
block discarded – undo |
10307
|
10307
|
global $langs, $user; |
10308
|
10308
|
|
10309
|
10309
|
$out = ''; |
10310
|
|
- $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
10311
|
|
- $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
10310
|
+ $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
10311
|
+ $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
10312
|
10312
|
if (!empty($excludeid)) { |
10313
|
|
- $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
10313
|
+ $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
10314
|
10314
|
} |
10315
|
10315
|
$sql .= " ORDER BY label"; |
10316
|
10316
|
|
10317
|
10317
|
$resql = $this->db->query($sql); |
10318
|
10318
|
if ($resql) { |
10319
|
|
- $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
10319
|
+ $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
10320
|
10320
|
if ($useempty) { |
10321
|
10321
|
$out .= '<option value="0"> </option>'; |
10322
|
10322
|
} |
10323
|
10323
|
|
10324
|
10324
|
while ($obj = $this->db->fetch_object($resql)) { |
10325
|
|
- $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
10325
|
+ $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
10326
|
10326
|
} |
10327
|
10327
|
$out .= '</select>'; |
10328
|
|
- $out .= ajax_combobox('select_' . $htmlname); |
|
10328
|
+ $out .= ajax_combobox('select_'.$htmlname); |
10329
|
10329
|
|
10330
|
10330
|
if (!empty($htmlname) && $user->admin && $info_admin) { |
10331
|
|
- $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
10331
|
+ $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
10332
|
10332
|
} |
10333
|
10333
|
|
10334
|
10334
|
if (!empty($target)) { |
10335
|
|
- $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
10335
|
+ $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
10336
|
10336
|
$resql = $this->db->query($sql); |
10337
|
10337
|
if ($resql) { |
10338
|
10338
|
if ($this->db->num_rows($resql) > 0) { |
10339
|
10339
|
$obj = $this->db->fetch_object($resql); |
10340
|
|
- $out .= '<script nonce="' . getNonce() . '"> |
|
10340
|
+ $out .= '<script nonce="'.getNonce().'"> |
10341
|
10341
|
$(function() { |
10342
|
|
- $("select[name=' . $target . ']").on("change", function() { |
|
10342
|
+ $("select[name=' . $target.']").on("change", function() { |
10343
|
10343
|
var current_val = $(this).val(); |
10344
|
|
- if (current_val == ' . $obj->id . ') {'; |
|
10344
|
+ if (current_val == ' . $obj->id.') {'; |
10345
|
10345
|
if (!empty($default_selected) || !empty($selected)) { |
10346
|
|
- $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
10346
|
+ $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
10347
|
10347
|
} |
10348
|
10348
|
|
10349
|
10349
|
$out .= ' |
10350
|
|
- $("select[name=' . $htmlname . ']").change(); |
|
10350
|
+ $("select[name=' . $htmlname.']").change(); |
10351
|
10351
|
} |
10352
|
10352
|
}); |
10353
|
10353
|
|
10354
|
|
- $("select[name=' . $htmlname . ']").change(function() { |
|
10354
|
+ $("select[name=' . $htmlname.']").change(function() { |
10355
|
10355
|
|
10356
|
|
- if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
10356
|
+ if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
10357
|
10357
|
// get price of kilometer to fill the unit price |
10358
|
10358
|
$.ajax({ |
10359
|
10359
|
method: "POST", |
10360
|
10360
|
dataType: "json", |
10361
|
|
- data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
10362
|
|
- url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
10361
|
+ data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
10362
|
+ url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
10363
|
10363
|
}).done(function( data, textStatus, jqXHR ) { |
10364
|
10364
|
console.log(data); |
10365
|
10365
|
if (typeof data.up != "undefined") { |
10366
|
10366
|
$("input[name=value_unit]").val(data.up); |
10367
|
|
- $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
10367
|
+ $("select[name=' . $htmlname.']").attr("title", data.title); |
10368
|
10368
|
} else { |
10369
|
10369
|
$("input[name=value_unit]").val(""); |
10370
|
|
- $("select[name=' . $htmlname . ']").attr("title", ""); |
|
10370
|
+ $("select[name=' . $htmlname.']").attr("title", ""); |
10371
|
10371
|
} |
10372
|
10372
|
}); |
10373
|
10373
|
} |
|
@@ -10397,18 +10397,18 @@ discard block |
|
|
block discarded – undo |
10397
|
10397
|
global $conf, $langs; |
10398
|
10398
|
|
10399
|
10399
|
$out = ''; |
10400
|
|
- $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
10401
|
|
- $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
10400
|
+ $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
10401
|
+ $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
10402
|
10402
|
|
10403
|
10403
|
$resql = $this->db->query($sql); |
10404
|
10404
|
if ($resql) { |
10405
|
|
- $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10405
|
+ $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
10406
|
10406
|
if ($useempty) { |
10407
|
10407
|
$out .= '<option value="0"></option>'; |
10408
|
10408
|
} |
10409
|
10409
|
|
10410
|
10410
|
while ($obj = $this->db->fetch_object($resql)) { |
10411
|
|
- $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
10411
|
+ $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
10412
|
10412
|
} |
10413
|
10413
|
$out .= '</select>'; |
10414
|
10414
|
} else { |
|
@@ -10439,12 +10439,12 @@ discard block |
|
|
block discarded – undo |
10439
|
10439
|
|
10440
|
10440
|
$resql = $this->db->query($sql); |
10441
|
10441
|
if ($resql) { |
10442
|
|
- $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
10442
|
+ $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
10443
|
10443
|
if ($useempty) { |
10444
|
10444
|
$out .= '<option value="0"></option>'; |
10445
|
10445
|
} |
10446
|
10446
|
if ($allchoice) { |
10447
|
|
- $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
10447
|
+ $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
10448
|
10448
|
} |
10449
|
10449
|
|
10450
|
10450
|
$field = 'code'; |
|
@@ -10454,7 +10454,7 @@ discard block |
|
|
block discarded – undo |
10454
|
10454
|
|
10455
|
10455
|
while ($obj = $this->db->fetch_object($resql)) { |
10456
|
10456
|
$key = $langs->trans($obj->code); |
10457
|
|
- $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
10457
|
+ $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
10458
|
10458
|
} |
10459
|
10459
|
$out .= '</select>'; |
10460
|
10460
|
|
|
@@ -10488,7 +10488,7 @@ discard block |
|
|
block discarded – undo |
10488
|
10488
|
{ |
10489
|
10489
|
global $user, $conf, $langs; |
10490
|
10490
|
|
10491
|
|
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
10491
|
+ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
10492
|
10492
|
|
10493
|
10493
|
if (is_null($usertofilter)) { |
10494
|
10494
|
$usertofilter = $user; |
|
@@ -10512,10 +10512,10 @@ discard block |
|
|
block discarded – undo |
10512
|
10512
|
$sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
10513
|
10513
|
p.title, p.fk_soc, p.fk_statut, p.public,"; |
10514
|
10514
|
$sql .= ' s.nom as name'; |
10515
|
|
- $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
10516
|
|
- $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
10517
|
|
- $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
10518
|
|
- $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
10515
|
+ $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
10516
|
+ $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
10517
|
+ $sql .= ' '.$this->db->prefix().'facture as f'; |
|
10518
|
+ $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
10519
|
10519
|
$sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
10520
|
10520
|
//if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
10521
|
10521
|
//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
|
@@ -10526,14 +10526,14 @@ discard block |
|
|
block discarded – undo |
10526
|
10526
|
if ($resql) { |
10527
|
10527
|
// Use select2 selector |
10528
|
10528
|
if (!empty($conf->use_javascript_ajax)) { |
10529
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10529
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
10530
|
10530
|
$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
10531
|
10531
|
$out .= $comboenhancement; |
10532
|
10532
|
$morecss = 'minwidth200imp maxwidth500'; |
10533
|
10533
|
} |
10534
|
10534
|
|
10535
|
10535
|
if (empty($option_only)) { |
10536
|
|
- $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10536
|
+ $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
10537
|
10537
|
} |
10538
|
10538
|
if (!empty($show_empty)) { |
10539
|
10539
|
$out .= '<option value="0" class="optiongrey">'; |
|
@@ -10563,33 +10563,33 @@ discard block |
|
|
block discarded – undo |
10563
|
10563
|
if ($showproject == 'all') { |
10564
|
10564
|
$labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
10565
|
10565
|
if ($obj->name) { |
10566
|
|
- $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
10566
|
+ $labeltoshow .= ' - '.$obj->name; // Soc name |
10567
|
10567
|
} |
10568
|
10568
|
|
10569
|
10569
|
$disabled = 0; |
10570
|
10570
|
if ($obj->fk_statut == Project::STATUS_DRAFT) { |
10571
|
10571
|
$disabled = 1; |
10572
|
|
- $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
10572
|
+ $labeltoshow .= ' - '.$langs->trans("Draft"); |
10573
|
10573
|
} elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
10574
|
10574
|
if ($discard_closed == 2) { |
10575
|
10575
|
$disabled = 1; |
10576
|
10576
|
} |
10577
|
|
- $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10577
|
+ $labeltoshow .= ' - '.$langs->trans("Closed"); |
10578
|
10578
|
} elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
10579
|
10579
|
$disabled = 1; |
10580
|
|
- $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
10580
|
+ $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
10581
|
10581
|
} |
10582
|
10582
|
} |
10583
|
10583
|
|
10584
|
10584
|
if (!empty($selected) && $selected == $obj->rowid) { |
10585
|
|
- $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10585
|
+ $out .= '<option value="'.$obj->rowid.'" selected'; |
10586
|
10586
|
//if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10587
|
|
- $out .= '>' . $labeltoshow . '</option>'; |
|
10587
|
+ $out .= '>'.$labeltoshow.'</option>'; |
10588
|
10588
|
} else { |
10589
|
10589
|
if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
10590
|
10590
|
$resultat = ''; |
10591
|
10591
|
} else { |
10592
|
|
- $resultat = '<option value="' . $obj->rowid . '"'; |
|
10592
|
+ $resultat = '<option value="'.$obj->rowid.'"'; |
10593
|
10593
|
if ($disabled) { |
10594
|
10594
|
$resultat .= ' disabled'; |
10595
|
10595
|
} |
|
@@ -10641,22 +10641,22 @@ discard block |
|
|
block discarded – undo |
10641
|
10641
|
|
10642
|
10642
|
$sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
10643
|
10643
|
//$sql.= ', el.fk_source'; |
10644
|
|
- $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
10645
|
|
- $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
10644
|
+ $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
10645
|
+ $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
10646
|
10646
|
$sql .= " ORDER BY f.titre ASC"; |
10647
|
10647
|
|
10648
|
10648
|
$resql = $this->db->query($sql); |
10649
|
10649
|
if ($resql) { |
10650
|
10650
|
// Use select2 selector |
10651
|
10651
|
if (!empty($conf->use_javascript_ajax)) { |
10652
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
10652
|
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
10653
|
10653
|
$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus); |
10654
|
10654
|
$out .= $comboenhancement; |
10655
|
10655
|
$morecss = 'minwidth200imp maxwidth500'; |
10656
|
10656
|
} |
10657
|
10657
|
|
10658
|
10658
|
if (empty($option_only)) { |
10659
|
|
- $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
10659
|
+ $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
10660
|
10660
|
} |
10661
|
10661
|
if (!empty($show_empty)) { |
10662
|
10662
|
$out .= '<option value="0" class="optiongrey">'; |
|
@@ -10675,19 +10675,19 @@ discard block |
|
|
block discarded – undo |
10675
|
10675
|
$disabled = 0; |
10676
|
10676
|
if (!empty($obj->suspended)) { |
10677
|
10677
|
$disabled = 1; |
10678
|
|
- $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
10678
|
+ $labeltoshow .= ' - '.$langs->trans("Closed"); |
10679
|
10679
|
} |
10680
|
10680
|
|
10681
|
10681
|
|
10682
|
10682
|
if (!empty($selected) && $selected == $obj->rowid) { |
10683
|
|
- $out .= '<option value="' . $obj->rowid . '" selected'; |
|
10683
|
+ $out .= '<option value="'.$obj->rowid.'" selected'; |
10684
|
10684
|
//if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
10685
|
|
- $out .= '>' . $labeltoshow . '</option>'; |
|
10685
|
+ $out .= '>'.$labeltoshow.'</option>'; |
10686
|
10686
|
} else { |
10687
|
10687
|
if ($disabled && ($selected != $obj->rowid)) { |
10688
|
10688
|
$resultat = ''; |
10689
|
10689
|
} else { |
10690
|
|
- $resultat = '<option value="' . $obj->rowid . '"'; |
|
10690
|
+ $resultat = '<option value="'.$obj->rowid.'"'; |
10691
|
10691
|
if ($disabled) { |
10692
|
10692
|
$resultat .= ' disabled'; |
10693
|
10693
|
} |
|
@@ -10727,14 +10727,14 @@ discard block |
|
|
block discarded – undo |
10727
|
10727
|
global $langs; |
10728
|
10728
|
|
10729
|
10729
|
if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
10730
|
|
- $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
10730
|
+ $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
10731
|
10731
|
} |
10732
|
10732
|
|
10733
|
10733
|
$ret = ''; |
10734
|
10734
|
|
10735
|
10735
|
$ret .= '<div class="divadvancedsearchfieldcomp centpercent inline-block">'; |
10736
|
10736
|
$ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
10737
|
|
- $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
10737
|
+ $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth hideonsmartphone" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
10738
|
10738
|
$ret .= '</a>'; |
10739
|
10739
|
|
10740
|
10740
|
$ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
|
@@ -10778,29 +10778,29 @@ discard block |
|
|
block discarded – undo |
10778
|
10778
|
$ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
10779
|
10779
|
} |
10780
|
10780
|
$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%')) -->"; |
10781
|
|
- $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
10781
|
+ $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
10782
|
10782
|
// $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
10783
|
10783
|
|
10784
|
10784
|
// For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
10785
|
10785
|
foreach ($arrayofcriterias as $criteria) { |
10786
|
10786
|
foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
10787
|
|
- if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
10787
|
+ if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
10788
|
10788
|
continue; |
10789
|
10789
|
} |
10790
|
10790
|
if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
10791
|
10791
|
continue; |
10792
|
10792
|
} |
10793
|
10793
|
if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
10794
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
10795
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
10796
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
10797
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
10798
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
10799
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
10800
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
10801
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
10794
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
10795
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
10796
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
10797
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
10798
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
10799
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
10800
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
10801
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
10802
|
10802
|
} else { |
10803
|
|
- $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
10803
|
+ $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
10804
|
10804
|
} |
10805
|
10805
|
} |
10806
|
10806
|
} |
|
@@ -10808,7 +10808,7 @@ discard block |
|
|
block discarded – undo |
10808
|
10808
|
$ret .= '</div>'; |
10809
|
10809
|
|
10810
|
10810
|
$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"; |
10811
|
|
- $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
10811
|
+ $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
10812
|
10812
|
|
10813
|
10813
|
$ret .= '</div>'; |
10814
|
10814
|
$ret .= '</div>'; |
|
@@ -10882,7 +10882,7 @@ discard block |
|
|
block discarded – undo |
10882
|
10882
|
|
10883
|
10883
|
$TModels = array(); |
10884
|
10884
|
|
10885
|
|
- include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
10885
|
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
10886
|
10886
|
$formmail = new FormMail($this->db); |
10887
|
10887
|
$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
10888
|
10888
|
|
|
@@ -10895,17 +10895,17 @@ discard block |
|
|
block discarded – undo |
10895
|
10895
|
} |
10896
|
10896
|
} |
10897
|
10897
|
|
10898
|
|
- $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
10898
|
+ $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
10899
|
10899
|
|
10900
|
10900
|
foreach ($TModels as $id_model => $label_model) { |
10901
|
|
- $retstring .= '<option value="' . $id_model . '"'; |
10902
|
|
- $retstring .= ">" . $label_model . "</option>"; |
|
10901
|
+ $retstring .= '<option value="'.$id_model.'"'; |
|
10902
|
+ $retstring .= ">".$label_model."</option>"; |
10903
|
10903
|
} |
10904
|
10904
|
|
10905
|
10905
|
$retstring .= "</select>"; |
10906
|
10906
|
|
10907
|
10907
|
if ($addjscombo) { |
10908
|
|
- $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
10908
|
+ $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
10909
|
10909
|
} |
10910
|
10910
|
|
10911
|
10911
|
return $retstring; |
|
@@ -10956,16 +10956,16 @@ discard block |
|
|
block discarded – undo |
10956
|
10956
|
|
10957
|
10957
|
foreach ($buttons as $button) { |
10958
|
10958
|
$addclass = empty($button['addclass']) ? '' : $button['addclass']; |
10959
|
|
- $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
10959
|
+ $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
10960
|
10960
|
} |
10961
|
10961
|
$retstring .= $withoutdiv ? '' : '</div>'; |
10962
|
10962
|
|
10963
|
10963
|
if ($dol_openinpopup) { |
10964
|
|
- $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
10965
|
|
- $retstring .= '<script nonce="' . getNonce() . '">'; |
|
10964
|
+ $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
10965
|
+ $retstring .= '<script nonce="'.getNonce().'">'; |
10966
|
10966
|
$retstring .= 'jQuery(".button-cancel").click(function(e) { |
10967
|
|
- e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
10968
|
|
- window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
10967
|
+ e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
10968
|
+ window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
10969
|
10969
|
});'; |
10970
|
10970
|
$retstring .= '</script>'; |
10971
|
10971
|
} |
|
@@ -10994,7 +10994,7 @@ discard block |
|
|
block discarded – undo |
10994
|
10994
|
dol_syslog(__METHOD__, LOG_DEBUG); |
10995
|
10995
|
|
10996
|
10996
|
$sql = "SELECT rowid, code, label as label"; |
10997
|
|
- $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
10997
|
+ $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
10998
|
10998
|
$sql .= " WHERE active = 1"; |
10999
|
10999
|
|
11000
|
11000
|
$resql = $this->db->query($sql); |
|
@@ -11005,7 +11005,7 @@ discard block |
|
|
block discarded – undo |
11005
|
11005
|
$obj = $this->db->fetch_object($resql); |
11006
|
11006
|
|
11007
|
11007
|
// If translation exists, we use it, otherwise we take the default wording |
11008
|
|
- $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
11008
|
+ $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
11009
|
11009
|
$this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
11010
|
11010
|
$this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
11011
|
11011
|
$this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
|
@@ -11037,18 +11037,18 @@ discard block |
|
|
block discarded – undo |
11037
|
11037
|
global $langs, $user; |
11038
|
11038
|
|
11039
|
11039
|
$out = ''; |
11040
|
|
- dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
11040
|
+ dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
11041
|
11041
|
|
11042
|
11042
|
$this->load_cache_invoice_subtype(); |
11043
|
11043
|
|
11044
|
|
- $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
11044
|
+ $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
11045
|
11045
|
if ($addempty) { |
11046
|
11046
|
$out .= '<option value="0"> </option>'; |
11047
|
11047
|
} |
11048
|
11048
|
|
11049
|
11049
|
foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
11050
|
11050
|
$label = $subtype['label']; |
11051
|
|
- $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
11051
|
+ $out .= '<option value="'.$subtype['rowid'].'"'; |
11052
|
11052
|
if ($selected == $subtype['rowid']) { |
11053
|
11053
|
$out .= ' selected="selected"'; |
11054
|
11054
|
} |