@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
| 104 | 104 | */ |
| 105 | - public $fields=array( |
|
| 105 | + public $fields = array( |
|
| 106 | 106 | 'id_sondage' => array('type'=>'varchar(16)', 'label'=>'Idsondage', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>-1,), |
| 107 | 107 | 'commentaires' => array('type'=>'mediumtext', 'label'=>'Comments', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>-1,), |
| 108 | 108 | 'mail_admin' => array('type'=>'varchar(128)', 'label'=>'Mailadmin', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>-1,), |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | $result .= $linkend; |
| 566 | 566 | |
| 567 | 567 | global $action; |
| 568 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 568 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 569 | 569 | $parameters = array('id'=>$this->id, 'getnomurl' => &$result); |
| 570 | 570 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 571 | 571 | if ($reshook > 0) { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $search_batch = trim(GETPOST("search_batch")); |
| 87 | 87 | $search_qty = trim(GETPOST("search_qty")); |
| 88 | 88 | $search_type_mouvement = GETPOST('search_type_mouvement', 'int'); |
| 89 | -$search_fk_project=GETPOST("search_fk_project", 'int'); |
|
| 89 | +$search_fk_project = GETPOST("search_fk_project", 'int'); |
|
| 90 | 90 | |
| 91 | 91 | $type = GETPOST("type", "int"); |
| 92 | 92 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $object = new MouvementStock($db); |
| 117 | 117 | $extrafields = new ExtraFields($db); |
| 118 | 118 | $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; |
| 119 | -$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
| 119 | +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes |
|
| 120 | 120 | |
| 121 | 121 | $formfile = new FormFile($db); |
| 122 | 122 | |
@@ -696,10 +696,10 @@ discard block |
||
| 696 | 696 | $sql .= " AND e.rowid = ".((int) $id); |
| 697 | 697 | } |
| 698 | 698 | if (!empty($search_date_start)) { |
| 699 | - $sql .= " AND m.datem >= '" . $db->idate($search_date_start) . "'"; |
|
| 699 | + $sql .= " AND m.datem >= '".$db->idate($search_date_start)."'"; |
|
| 700 | 700 | } |
| 701 | 701 | if (!empty($search_date_end)) { |
| 702 | - $sql .= " AND m.datem <= '" . $db->idate($search_date_end) . "'"; |
|
| 702 | + $sql .= " AND m.datem <= '".$db->idate($search_date_end)."'"; |
|
| 703 | 703 | } |
| 704 | 704 | if ($idproduct > 0) { |
| 705 | 705 | $sql .= " AND p.rowid = ".((int) $idproduct); |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | if (!empty($arrayfields['m.rowid']['checked'])) { |
| 1495 | 1495 | print '<td class="nowraponall">'; |
| 1496 | 1496 | //print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"'); |
| 1497 | - print $object->getNomUrl(1);; |
|
| 1497 | + print $object->getNomUrl(1); ; |
|
| 1498 | 1498 | print '</td>'; // This is primary not movement id |
| 1499 | 1499 | } |
| 1500 | 1500 | if (!empty($arrayfields['m.datem']['checked'])) { |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | 'skip_batch' => &$skip_batch, |
| 217 | 217 | 'id_product_batch' => &$id_product_batch |
| 218 | 218 | ); |
| 219 | - $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
| 219 | + $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
|
| 220 | 220 | |
| 221 | 221 | if ($reshook < 0) { |
| 222 | 222 | if (!empty($hookmanager->resPrint)) { |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | // Update stock quantity |
| 557 | 557 | if (!$error) { |
| 558 | 558 | if ($alreadyarecord > 0) { |
| 559 | - $sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = " . ((float) $oldqtywarehouse + (float) $qty); |
|
| 559 | + $sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = ".((float) $oldqtywarehouse + (float) $qty); |
|
| 560 | 560 | $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); |
| 561 | 561 | } else { |
| 562 | 562 | $sql = "INSERT INTO ".$this->db->prefix()."product_stock"; |
@@ -705,8 +705,8 @@ discard block |
||
| 705 | 705 | $this->price = $obj->price; |
| 706 | 706 | $this->fk_user_author = $obj->fk_user_author; |
| 707 | 707 | $this->label = $obj->label; |
| 708 | - $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
| 709 | - $this->origintype = $obj->origin_type; // For backward compatibility |
|
| 708 | + $this->fk_origin = $obj->origin_id; // For backward compatibility |
|
| 709 | + $this->origintype = $obj->origin_type; // For backward compatibility |
|
| 710 | 710 | $this->origin_id = $obj->origin_id; |
| 711 | 711 | $this->origin_type = $obj->origin_type; |
| 712 | 712 | $this->inventorycode = $obj->inventorycode; |
@@ -941,8 +941,8 @@ discard block |
||
| 941 | 941 | } else { // product_batch record not found |
| 942 | 942 | $pdluo->fk_product_stock = $vfk_product_stock; |
| 943 | 943 | $pdluo->qty = $qty; |
| 944 | - $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
| 945 | - $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
| 944 | + $pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table. |
|
| 945 | + $pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table. |
|
| 946 | 946 | $pdluo->batch = $vbatchnumber; |
| 947 | 947 | |
| 948 | 948 | $result = $pdluo->create($user, 1); |
@@ -1139,8 +1139,8 @@ discard block |
||
| 1139 | 1139 | $label .= '<div width="100%">'; |
| 1140 | 1140 | $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->id; |
| 1141 | 1141 | $label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label; |
| 1142 | - $qtylabel = (($this->qty > 0) ? '<span class="stockmovemententry">+' : '<span class="stockmovementexit">') . $this->qty . '</span>'; |
|
| 1143 | - $label .= '<br><b>'.$langs->trans('Qty').':</b> ' . $qtylabel; |
|
| 1142 | + $qtylabel = (($this->qty > 0) ? '<span class="stockmovemententry">+' : '<span class="stockmovementexit">').$this->qty.'</span>'; |
|
| 1143 | + $label .= '<br><b>'.$langs->trans('Qty').':</b> '.$qtylabel; |
|
| 1144 | 1144 | if ($this->batch) { |
| 1145 | 1145 | $label .= '<br><b>'.$langs->trans('Batch').':</b> '.$this->batch; |
| 1146 | 1146 | } |
@@ -1268,8 +1268,8 @@ discard block |
||
| 1268 | 1268 | $sql = "SELECT sum(pb.qty) as cpt"; |
| 1269 | 1269 | $sql .= " FROM ".$this->db->prefix()."product_batch as pb"; |
| 1270 | 1270 | $sql .= " INNER JOIN ".$this->db->prefix()."product_stock as ps ON ps.rowid = pb.fk_product_stock"; |
| 1271 | - $sql .= " WHERE ps.fk_product = " . ((int) $fk_product); |
|
| 1272 | - $sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'"; |
|
| 1271 | + $sql .= " WHERE ps.fk_product = ".((int) $fk_product); |
|
| 1272 | + $sql .= " AND pb.batch = '".$this->db->escape($batch)."'"; |
|
| 1273 | 1273 | |
| 1274 | 1274 | $result = $this->db->query($sql); |
| 1275 | 1275 | if ($result) { |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | */ |
| 1294 | 1294 | public function reverseMouvement() |
| 1295 | 1295 | { |
| 1296 | - $formattedDate = "REVERTMV" .dol_print_date($this->datem, '%Y%m%d%His'); |
|
| 1296 | + $formattedDate = "REVERTMV".dol_print_date($this->datem, '%Y%m%d%His'); |
|
| 1297 | 1297 | if ($this->label == 'Annulation movement ID'.$this->id) { |
| 1298 | 1298 | return -1; |
| 1299 | 1299 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { |
| 120 | 120 | if (!empty($perm)) { |
| 121 | 121 | $tmp = explode(':', $typeofdata); |
| 122 | - $ret .= '<div class="editkey_' . $tmp[0] . (!empty($tmp[1]) ? ' ' . $tmp[1] : '') . '" id="' . $htmlname . '">'; |
|
| 122 | + $ret .= '<div class="editkey_'.$tmp[0].(!empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">'; |
|
| 123 | 123 | if ($fieldrequired) { |
| 124 | 124 | $ret .= '<span class="fieldrequired">'; |
| 125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | if ($fieldrequired) { |
| 132 | 132 | $ret .= '</span>'; |
| 133 | 133 | } |
| 134 | - $ret .= '</div>' . "\n"; |
|
| 134 | + $ret .= '</div>'."\n"; |
|
| 135 | 135 | } else { |
| 136 | 136 | if ($fieldrequired) { |
| 137 | 137 | $ret .= '<span class="fieldrequired">'; |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | if (empty($notabletag) && $perm) { |
| 170 | 170 | $ret .= '<td class="right">'; |
| 171 | 171 | } |
| 172 | - if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { |
|
| 173 | - $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>'; |
|
| 172 | + if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { |
|
| 173 | + $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>'; |
|
| 174 | 174 | } |
| 175 | 175 | if (!empty($notabletag) && $notabletag == 1) { |
| 176 | 176 | if ($text) { |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } elseif ($reg[1] == 'int') { |
| 238 | 238 | $typeofdata = 'numeric'; |
| 239 | 239 | } else { |
| 240 | - return 'ErrorBadParameter ' . $typeofdata; |
|
| 240 | + return 'ErrorBadParameter '.$typeofdata; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | if ($editaction == '') { |
| 249 | 249 | $editaction = GETPOST('action', 'aZ09'); |
| 250 | 250 | } |
| 251 | - $editmode = ($editaction == 'edit' . $htmlname); |
|
| 251 | + $editmode = ($editaction == 'edit'.$htmlname); |
|
| 252 | 252 | if ($editmode) { // edit mode |
| 253 | 253 | $ret .= "\n"; |
| 254 | - $ret .= '<form method="post" action="' . $_SERVER["PHP_SELF"] . ($moreparam ? '?' . $moreparam : '') . '">'; |
|
| 255 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 256 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 257 | - $ret .= '<input type="hidden" name="' . $paramid . '" value="' . $object->id . '">'; |
|
| 254 | + $ret .= '<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam ? '?'.$moreparam : '').'">'; |
|
| 255 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 256 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 257 | + $ret .= '<input type="hidden" name="'.$paramid.'" value="'.$object->id.'">'; |
|
| 258 | 258 | if (empty($notabletag)) { |
| 259 | 259 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 260 | 260 | } |
@@ -263,28 +263,28 @@ discard block |
||
| 263 | 263 | } |
| 264 | 264 | if (preg_match('/^(string|safehtmlstring|email|phone|url)/', $typeofdata)) { |
| 265 | 265 | $tmp = explode(':', $typeofdata); |
| 266 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($editvalue ? $editvalue : $value) . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 266 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 267 | 267 | } elseif (preg_match('/^(integer)/', $typeofdata)) { |
| 268 | 268 | $tmp = explode(':', $typeofdata); |
| 269 | 269 | $valuetoshow = price2num($editvalue ? $editvalue : $value, 0); |
| 270 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . $valuetoshow . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 270 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.$valuetoshow.'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 271 | 271 | } elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { |
| 272 | 272 | $tmp = explode(':', $typeofdata); |
| 273 | 273 | $valuetoshow = price2num($editvalue ? $editvalue : $value); |
| 274 | - $ret .= '<input type="text" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($valuetoshow != '' ? price($valuetoshow) : '') . '"' . (empty($tmp[1]) ? '' : ' size="' . $tmp[1] . '"') . ' autofocus>'; |
|
| 274 | + $ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ? price($valuetoshow) : '').'"'.(empty($tmp[1]) ? '' : ' size="'.$tmp[1].'"').' autofocus>'; |
|
| 275 | 275 | } elseif (preg_match('/^(checkbox)/', $typeofdata)) { |
| 276 | 276 | $tmp = explode(':', $typeofdata); |
| 277 | - $ret .= '<input type="checkbox" id="' . $htmlname . '" name="' . $htmlname . '" value="' . ($value ? $value : 'on') . '"' . ($value ? ' checked' : '') . (empty($tmp[1]) ? '' : $tmp[1]) . '/>'; |
|
| 277 | + $ret .= '<input type="checkbox" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($value ? $value : 'on').'"'.($value ? ' checked' : '').(empty($tmp[1]) ? '' : $tmp[1]).'/>'; |
|
| 278 | 278 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { // if wysiwyg is enabled $typeofdata = 'ckeditor' |
| 279 | 279 | $tmp = explode(':', $typeofdata); |
| 280 | 280 | $cols = (empty($tmp[2]) ? '' : $tmp[2]); |
| 281 | 281 | $morealt = ''; |
| 282 | 282 | if (preg_match('/%/', $cols)) { |
| 283 | - $morealt = ' style="width: ' . $cols . '"'; |
|
| 283 | + $morealt = ' style="width: '.$cols.'"'; |
|
| 284 | 284 | $cols = ''; |
| 285 | 285 | } |
| 286 | 286 | $valuetoshow = ($editvalue ? $editvalue : $value); |
| 287 | - $ret .= '<textarea id="' . $htmlname . '" name="' . $htmlname . '" wrap="soft" rows="' . (empty($tmp[1]) ? '20' : $tmp[1]) . '"' . ($cols ? ' cols="' . $cols . '"' : 'class="quatrevingtpercent"') . $morealt . '" autofocus>'; |
|
| 287 | + $ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.(empty($tmp[1]) ? '20' : $tmp[1]).'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>'; |
|
| 288 | 288 | // textarea convert automatically entities chars into simple chars. |
| 289 | 289 | // 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. |
| 290 | 290 | $valuetoshow = str_replace('&', '&', $valuetoshow); |
@@ -294,12 +294,12 @@ discard block |
||
| 294 | 294 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 295 | 295 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 296 | 296 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 297 | - $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 297 | + $ret .= $this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 298 | 298 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 299 | 299 | $addnowlink = empty($moreoptions['addnowlink']) ? 0 : $moreoptions['addnowlink']; |
| 300 | 300 | $adddateof = empty($moreoptions['adddateof']) ? '' : $moreoptions['adddateof']; |
| 301 | 301 | $labeladddateof = empty($moreoptions['labeladddateof']) ? '' : $moreoptions['labeladddateof']; |
| 302 | - $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form' . $htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 302 | + $ret .= $this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, $addnowlink, 0, '', '', $adddateof, '', 1, $labeladddateof, '', $gm); |
|
| 303 | 303 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 304 | 304 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 305 | 305 | $arraylist = array(); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | // TODO Not yet implemented. See code for extrafields |
| 314 | 314 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
| 315 | 315 | $tmp = explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols:uselocalbrowser |
| 316 | - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
| 316 | + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
| 317 | 317 | $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])); |
| 318 | 318 | $ret .= $doleditor->Create(1); |
| 319 | 319 | } elseif ($typeofdata == 'asis') { |
@@ -328,19 +328,19 @@ discard block |
||
| 328 | 328 | $ret .= '<td>'; |
| 329 | 329 | } |
| 330 | 330 | //else $ret.='<div class="clearboth"></div>'; |
| 331 | - $ret .= '<input type="submit" class="smallpaddingimp button' . (empty($notabletag) ? '' : ' ') . '" name="modify" value="' . $langs->trans("Modify") . '">'; |
|
| 331 | + $ret .= '<input type="submit" class="smallpaddingimp button'.(empty($notabletag) ? '' : ' ').'" name="modify" value="'.$langs->trans("Modify").'">'; |
|
| 332 | 332 | if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) { |
| 333 | - $ret .= '<br>' . "\n"; |
|
| 333 | + $ret .= '<br>'."\n"; |
|
| 334 | 334 | } |
| 335 | - $ret .= '<input type="submit" class="smallpaddingimp button button-cancel' . (empty($notabletag) ? '' : ' ') . '" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 335 | + $ret .= '<input type="submit" class="smallpaddingimp button button-cancel'.(empty($notabletag) ? '' : ' ').'" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 336 | 336 | if (empty($notabletag)) { |
| 337 | 337 | $ret .= '</td>'; |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if (empty($notabletag)) { |
| 341 | - $ret .= '</tr></table>' . "\n"; |
|
| 341 | + $ret .= '</tr></table>'."\n"; |
|
| 342 | 342 | } |
| 343 | - $ret .= '</form>' . "\n"; |
|
| 343 | + $ret .= '</form>'."\n"; |
|
| 344 | 344 | } else { // view mode |
| 345 | 345 | if (preg_match('/^email/', $typeofdata)) { |
| 346 | 346 | $ret .= dol_print_email($value, 0, 0, 0, 0, 1); |
@@ -352,15 +352,15 @@ discard block |
||
| 352 | 352 | $ret .= ($value != '' ? price($value, '', $langs, 0, -1, -1, $conf->currency) : ''); |
| 353 | 353 | } elseif (preg_match('/^checkbox/', $typeofdata)) { |
| 354 | 354 | $tmp = explode(':', $typeofdata); |
| 355 | - $ret .= '<input type="checkbox" disabled id="' . $htmlname . '" name="' . $htmlname . '" value="' . $value . '"' . ($value ? ' checked' : '') . ($tmp[1] ? $tmp[1] : '') . '/>'; |
|
| 355 | + $ret .= '<input type="checkbox" disabled id="'.$htmlname.'" name="'.$htmlname.'" value="'.$value.'"'.($value ? ' checked' : '').($tmp[1] ? $tmp[1] : '').'/>'; |
|
| 356 | 356 | } elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { |
| 357 | 357 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($value), 1, 1, 1)); |
| 358 | 358 | } elseif (preg_match('/^(safehtmlstring|restricthtml)/', $typeofdata)) { // 'restricthtml' is not an allowed type for editfieldval. Value is 'safehtmlstring' |
| 359 | 359 | $ret .= dol_htmlwithnojs(dol_string_onlythesehtmltags($value)); |
| 360 | 360 | } elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { |
| 361 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'day', $gm) . '</span>'; |
|
| 361 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'day', $gm).'</span>'; |
|
| 362 | 362 | } elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { |
| 363 | - $ret .= '<span class="valuedate">' . dol_print_date($value, 'dayhour', $gm) . '</span>'; |
|
| 363 | + $ret .= '<span class="valuedate">'.dol_print_date($value, 'dayhour', $gm).'</span>'; |
|
| 364 | 364 | } elseif (preg_match('/^select;/', $typeofdata)) { |
| 365 | 365 | $arraydata = explode(',', preg_replace('/^select;/', '', $typeofdata)); |
| 366 | 366 | $arraylist = array(); |
@@ -371,9 +371,9 @@ discard block |
||
| 371 | 371 | $ret .= $arraylist[$value]; |
| 372 | 372 | if ($htmlname == 'fk_product_type') { |
| 373 | 373 | if ($value == 0) { |
| 374 | - $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 374 | + $ret = img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 375 | 375 | } else { |
| 376 | - $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"') . $ret; |
|
| 376 | + $ret = img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"').$ret; |
|
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | } elseif (preg_match('/^ckeditor/', $typeofdata)) { |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { |
| 382 | 382 | $firstline = preg_replace('/<br>.*/', '', $tmpcontent); |
| 383 | 383 | $firstline = preg_replace('/[\n\r].*/', '', $firstline); |
| 384 | - $tmpcontent = $firstline . ((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 384 | + $tmpcontent = $firstline.((strlen($firstline) != strlen($tmpcontent)) ? '...' : ''); |
|
| 385 | 385 | } |
| 386 | 386 | // We don't use dol_escape_htmltag to get the html formatting active, but this need we must also |
| 387 | 387 | // clean data from some dangerous html |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | if (empty($moreoptions['valuealreadyhtmlescaped'])) { |
| 391 | 391 | $ret .= dol_escape_htmltag($value); |
| 392 | 392 | } else { |
| 393 | - $ret .= $value; // $value must be already html escaped. |
|
| 393 | + $ret .= $value; // $value must be already html escaped. |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | |
| 429 | 429 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 430 | 430 | if (!is_object($extralanguages)) { |
| 431 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 431 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 432 | 432 | $extralanguages = new ExtraLanguages($this->db); |
| 433 | 433 | } |
| 434 | 434 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -437,17 +437,17 @@ discard block |
||
| 437 | 437 | return ''; // No extralang field to show |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - $result .= '<!-- Widget for translation -->' . "\n"; |
|
| 441 | - $result .= '<div class="inline-block paddingleft image-' . $object->element . '-' . $fieldname . '">'; |
|
| 440 | + $result .= '<!-- Widget for translation -->'."\n"; |
|
| 441 | + $result .= '<div class="inline-block paddingleft image-'.$object->element.'-'.$fieldname.'">'; |
|
| 442 | 442 | $s = img_picto($langs->trans("ShowOtherLanguages"), 'language', '', false, 0, 0, '', 'fa-15 editfieldlang'); |
| 443 | 443 | $result .= $s; |
| 444 | 444 | $result .= '</div>'; |
| 445 | 445 | |
| 446 | - $result .= '<div class="inline-block hidden field-' . $object->element . '-' . $fieldname . '">'; |
|
| 446 | + $result .= '<div class="inline-block hidden field-'.$object->element.'-'.$fieldname.'">'; |
|
| 447 | 447 | |
| 448 | 448 | $resultforextrlang = ''; |
| 449 | 449 | foreach ($arrayoflangcode as $langcode) { |
| 450 | - $valuetoshow = GETPOSTISSET('field-' . $object->element . "-" . $fieldname . "-" . $langcode) ? GETPOST('field-' . $object->element . '-' . $fieldname . "-" . $langcode, $check) : ''; |
|
| 450 | + $valuetoshow = GETPOSTISSET('field-'.$object->element."-".$fieldname."-".$langcode) ? GETPOST('field-'.$object->element.'-'.$fieldname."-".$langcode, $check) : ''; |
|
| 451 | 451 | if (empty($valuetoshow)) { |
| 452 | 452 | $object->fetchValuesForExtraLanguages(); |
| 453 | 453 | //var_dump($object->array_languages); |
@@ -459,17 +459,17 @@ discard block |
||
| 459 | 459 | |
| 460 | 460 | // TODO Use the showInputField() method of ExtraLanguages object |
| 461 | 461 | if ($typeofdata == 'textarea') { |
| 462 | - $resultforextrlang .= '<textarea name="field-' . $object->element . "-" . $fieldname . "-" . $langcode . '" id="' . $fieldname . "-" . $langcode . '" class="' . $morecss . '" rows="' . ROWS_2 . '" wrap="soft">'; |
|
| 462 | + $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; |
|
| 463 | 463 | $resultforextrlang .= $valuetoshow; |
| 464 | 464 | $resultforextrlang .= '</textarea>'; |
| 465 | 465 | } else { |
| 466 | - $resultforextrlang .= '<input type="text" class="inputfieldforlang ' . ($morecss ? ' ' . $morecss : '') . '" name="field-' . $object->element . '-' . $fieldname . '-' . $langcode . '" value="' . $valuetoshow . '">'; |
|
| 466 | + $resultforextrlang .= '<input type="text" class="inputfieldforlang '.($morecss ? ' '.$morecss : '').'" name="field-'.$object->element.'-'.$fieldname.'-'.$langcode.'" value="'.$valuetoshow.'">'; |
|
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | $result .= $resultforextrlang; |
| 470 | 470 | |
| 471 | 471 | $result .= '</div>'; |
| 472 | - $result .= '<script nonce="' . getNonce() . '">$(".image-' . $object->element . '-' . $fieldname . '").click(function() { console.log("Toggle lang widget"); jQuery(".field-' . $object->element . '-' . $fieldname . '").toggle(); });</script>'; |
|
| 472 | + $result .= '<script nonce="'.getNonce().'">$(".image-'.$object->element.'-'.$fieldname.'").click(function() { console.log("Toggle lang widget"); jQuery(".field-'.$object->element.'-'.$fieldname.'").toggle(); });</script>'; |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | return $result; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | if (!empty($tmp[2])) { |
| 535 | 535 | $savemethod = $tmp[2]; |
| 536 | 536 | } |
| 537 | - $out .= '<input id="width_' . $htmlname . '" value="' . $inputOption . '" type="hidden"/>' . "\n"; |
|
| 537 | + $out .= '<input id="width_'.$htmlname.'" value="'.$inputOption.'" type="hidden"/>'."\n"; |
|
| 538 | 538 | } elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { |
| 539 | 539 | $tmp = explode(':', $inputType); |
| 540 | 540 | $inputType = $tmp[0]; |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | $savemethod = $tmp[2]; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | - $out .= '<input id="timestamp" type="hidden"/>' . "\n"; // Use for timestamp format |
|
| 548 | + $out .= '<input id="timestamp" type="hidden"/>'."\n"; // Use for timestamp format |
|
| 549 | 549 | } elseif (preg_match('/^(select|autocomplete)/', $inputType)) { |
| 550 | 550 | $tmp = explode(':', $inputType); |
| 551 | 551 | $inputType = $tmp[0]; |
@@ -576,40 +576,40 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | if (isModEnabled('fckeditor')) { |
| 579 | - $out .= '<input id="ckeditor_toolbar" value="' . $toolbar . '" type="hidden"/>' . "\n"; |
|
| 579 | + $out .= '<input id="ckeditor_toolbar" value="'.$toolbar.'" type="hidden"/>'."\n"; |
|
| 580 | 580 | } else { |
| 581 | 581 | $inputType = 'textarea'; |
| 582 | 582 | } |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | - $out .= '<input id="element_' . $htmlname . '" value="' . $element . '" type="hidden"/>' . "\n"; |
|
| 586 | - $out .= '<input id="table_element_' . $htmlname . '" value="' . $table_element . '" type="hidden"/>' . "\n"; |
|
| 587 | - $out .= '<input id="fk_element_' . $htmlname . '" value="' . $fk_element . '" type="hidden"/>' . "\n"; |
|
| 588 | - $out .= '<input id="loadmethod_' . $htmlname . '" value="' . $loadmethod . '" type="hidden"/>' . "\n"; |
|
| 585 | + $out .= '<input id="element_'.$htmlname.'" value="'.$element.'" type="hidden"/>'."\n"; |
|
| 586 | + $out .= '<input id="table_element_'.$htmlname.'" value="'.$table_element.'" type="hidden"/>'."\n"; |
|
| 587 | + $out .= '<input id="fk_element_'.$htmlname.'" value="'.$fk_element.'" type="hidden"/>'."\n"; |
|
| 588 | + $out .= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; |
|
| 589 | 589 | if (!empty($savemethod)) { |
| 590 | - $out .= '<input id="savemethod_' . $htmlname . '" value="' . $savemethod . '" type="hidden"/>' . "\n"; |
|
| 590 | + $out .= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; |
|
| 591 | 591 | } |
| 592 | 592 | if (!empty($ext_element)) { |
| 593 | - $out .= '<input id="ext_element_' . $htmlname . '" value="' . $ext_element . '" type="hidden"/>' . "\n"; |
|
| 593 | + $out .= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; |
|
| 594 | 594 | } |
| 595 | 595 | if (!empty($custommsg)) { |
| 596 | 596 | if (is_array($custommsg)) { |
| 597 | 597 | if (!empty($custommsg['success'])) { |
| 598 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg['success'] . '" type="hidden"/>' . "\n"; |
|
| 598 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n"; |
|
| 599 | 599 | } |
| 600 | 600 | if (!empty($custommsg['error'])) { |
| 601 | - $out .= '<input id="errormsg_' . $htmlname . '" value="' . $custommsg['error'] . '" type="hidden"/>' . "\n"; |
|
| 601 | + $out .= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n"; |
|
| 602 | 602 | } |
| 603 | 603 | } else { |
| 604 | - $out .= '<input id="successmsg_' . $htmlname . '" value="' . $custommsg . '" type="hidden"/>' . "\n"; |
|
| 604 | + $out .= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n"; |
|
| 605 | 605 | } |
| 606 | 606 | } |
| 607 | 607 | if ($inputType == 'textarea') { |
| 608 | - $out .= '<input id="textarea_' . $htmlname . '_rows" value="' . $rows . '" type="hidden"/>' . "\n"; |
|
| 609 | - $out .= '<input id="textarea_' . $htmlname . '_cols" value="' . $cols . '" type="hidden"/>' . "\n"; |
|
| 608 | + $out .= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; |
|
| 609 | + $out .= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; |
|
| 610 | 610 | } |
| 611 | - $out .= '<span id="viewval_' . $htmlname . '" class="viewval_' . $inputType . ($button_only ? ' inactive' : ' active') . '">' . $value . '</span>' . "\n"; |
|
| 612 | - $out .= '<span id="editval_' . $htmlname . '" class="editval_' . $inputType . ($button_only ? ' inactive' : ' active') . ' hideobject">' . (!empty($editvalue) ? $editvalue : $value) . '</span>' . "\n"; |
|
| 611 | + $out .= '<span id="viewval_'.$htmlname.'" class="viewval_'.$inputType.($button_only ? ' inactive' : ' active').'">'.$value.'</span>'."\n"; |
|
| 612 | + $out .= '<span id="editval_'.$htmlname.'" class="editval_'.$inputType.($button_only ? ' inactive' : ' active').' hideobject">'.(!empty($editvalue) ? $editvalue : $value).'</span>'."\n"; |
|
| 613 | 613 | } else { |
| 614 | 614 | $out = $value; |
| 615 | 615 | } |
@@ -638,12 +638,12 @@ discard block |
||
| 638 | 638 | public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) |
| 639 | 639 | { |
| 640 | 640 | if ($incbefore) { |
| 641 | - $text = $incbefore . $text; |
|
| 641 | + $text = $incbefore.$text; |
|
| 642 | 642 | } |
| 643 | 643 | if (!$htmltext) { |
| 644 | 644 | return $text; |
| 645 | 645 | } |
| 646 | - $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 646 | + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 |
|
| 647 | 647 | |
| 648 | 648 | $tag = 'td'; |
| 649 | 649 | if ($notabs == 2) { |
@@ -657,11 +657,11 @@ discard block |
||
| 657 | 657 | |
| 658 | 658 | $extrastyle = ''; |
| 659 | 659 | if ($direction < 0) { |
| 660 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 660 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 661 | 661 | $extrastyle = 'padding: 0px; padding-left: 3px;'; |
| 662 | 662 | } |
| 663 | 663 | if ($direction > 0) { |
| 664 | - $extracss = ($extracss ? $extracss . ' ' : '') . ($notabs != 3 ? 'inline-block' : ''); |
|
| 664 | + $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); |
|
| 665 | 665 | $extrastyle = 'padding: 0px; padding-right: 3px;'; |
| 666 | 666 | } |
| 667 | 667 | |
@@ -674,53 +674,53 @@ discard block |
||
| 674 | 674 | $htmltext = str_replace('"', '"', $htmltext); |
| 675 | 675 | } else { |
| 676 | 676 | $classfortooltip = 'classfortooltiponclick'; |
| 677 | - $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_' . $tooltiptrigger . '" class="classfortooltiponclicktext">' . $htmltext . '</div>'; |
|
| 677 | + $textfordialog .= '<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>'; |
|
| 678 | 678 | } |
| 679 | 679 | if ($tooltipon == 2 || $tooltipon == 3) { |
| 680 | - $paramfortooltipimg = ' class="' . $classfortooltip . ($notabs != 3 ? ' inline-block' : '') . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '"'; |
|
| 680 | + $paramfortooltipimg = ' class="'.$classfortooltip.($notabs != 3 ? ' inline-block' : '').($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'"'; |
|
| 681 | 681 | if ($tooltiptrigger == '') { |
| 682 | - $paramfortooltipimg .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on img tag to store tooltip |
|
| 682 | + $paramfortooltipimg .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on img tag to store tooltip |
|
| 683 | 683 | } else { |
| 684 | - $paramfortooltipimg .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 684 | + $paramfortooltipimg .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 685 | 685 | } |
| 686 | 686 | } else { |
| 687 | - $paramfortooltipimg = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 687 | + $paramfortooltipimg = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 688 | 688 | } |
| 689 | 689 | if ($tooltipon == 1 || $tooltipon == 3) { |
| 690 | - $paramfortooltiptd = ' class="' . ($tooltipon == 3 ? 'cursorpointer ' : '') . $classfortooltip . ' inline-block' . ($extracss ? ' ' . $extracss : '') . '" style="padding: 0px;' . ($extrastyle ? ' ' . $extrastyle : '') . '" '; |
|
| 690 | + $paramfortooltiptd = ' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss ? ' '.$extracss : '').'" style="padding: 0px;'.($extrastyle ? ' '.$extrastyle : '').'" '; |
|
| 691 | 691 | if ($tooltiptrigger == '') { |
| 692 | - $paramfortooltiptd .= ' title="' . ($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)) . '"'; // Attribute to put on td tag to store tooltip |
|
| 692 | + $paramfortooltiptd .= ' title="'.($noencodehtmltext ? $htmltext : dol_escape_htmltag($htmltext, 1)).'"'; // Attribute to put on td tag to store tooltip |
|
| 693 | 693 | } else { |
| 694 | - $paramfortooltiptd .= ' dolid="' . $tooltiptrigger . '"'; |
|
| 694 | + $paramfortooltiptd .= ' dolid="'.$tooltiptrigger.'"'; |
|
| 695 | 695 | } |
| 696 | 696 | } else { |
| 697 | - $paramfortooltiptd = ($extracss ? ' class="' . $extracss . '"' : '') . ($extrastyle ? ' style="' . $extrastyle . '"' : ''); // Attribute to put on td text tag |
|
| 697 | + $paramfortooltiptd = ($extracss ? ' class="'.$extracss.'"' : '').($extrastyle ? ' style="'.$extrastyle.'"' : ''); // Attribute to put on td text tag |
|
| 698 | 698 | } |
| 699 | 699 | if (empty($notabs)) { |
| 700 | 700 | $s .= '<table class="nobordernopadding"><tr style="height: auto;">'; |
| 701 | 701 | } elseif ($notabs == 2) { |
| 702 | - $s .= '<div class="inline-block' . ($forcenowrap ? ' nowrap' : '') . '">'; |
|
| 702 | + $s .= '<div class="inline-block'.($forcenowrap ? ' nowrap' : '').'">'; |
|
| 703 | 703 | } |
| 704 | 704 | // Define value if value is before |
| 705 | 705 | if ($direction < 0) { |
| 706 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 706 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 707 | 707 | if ($tag == 'td') { |
| 708 | 708 | $s .= ' class="valigntop" width="14"'; |
| 709 | 709 | } |
| 710 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 710 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 711 | 711 | } |
| 712 | 712 | // Use another method to help avoid having a space in value in order to use this value with jquery |
| 713 | 713 | // Define label |
| 714 | 714 | if ((string) $text != '') { |
| 715 | - $s .= '<' . $tag . $paramfortooltiptd . '>' . $text . '</' . $tag . '>'; |
|
| 715 | + $s .= '<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; |
|
| 716 | 716 | } |
| 717 | 717 | // Define value if value is after |
| 718 | 718 | if ($direction > 0) { |
| 719 | - $s .= '<' . $tag . $paramfortooltipimg; |
|
| 719 | + $s .= '<'.$tag.$paramfortooltipimg; |
|
| 720 | 720 | if ($tag == 'td') { |
| 721 | 721 | $s .= ' class="valignmiddle" width="14"'; |
| 722 | 722 | } |
| 723 | - $s .= '>' . $textfordialog . $img . '</' . $tag . '>'; |
|
| 723 | + $s .= '>'.$textfordialog.$img.'</'.$tag.'>'; |
|
| 724 | 724 | } |
| 725 | 725 | if (empty($notabs)) { |
| 726 | 726 | $s .= '</tr></table>'; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | $disabled = 0; |
| 826 | 826 | $ret = '<div class="centpercent center">'; |
| 827 | - $ret .= '<select class="flat' . (empty($conf->use_javascript_ajax) ? '' : ' hideobject') . ' ' . $name . ' ' . $name . 'select valignmiddle alignstart" id="' . $name . '" name="' . $name . '"' . ($disabled ? ' disabled="disabled"' : '') . '>'; |
|
| 827 | + $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'select valignmiddle alignstart" id="'.$name.'" name="'.$name.'"'.($disabled ? ' disabled="disabled"' : '').'>'; |
|
| 828 | 828 | |
| 829 | 829 | // 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. |
| 830 | 830 | $parameters = array(); |
@@ -834,9 +834,9 @@ discard block |
||
| 834 | 834 | return; |
| 835 | 835 | } |
| 836 | 836 | if (empty($reshook)) { |
| 837 | - $ret .= '<option value="0"' . ($disabled ? ' disabled="disabled"' : '') . '>-- ' . $langs->trans("SelectAction") . ' --</option>'; |
|
| 837 | + $ret .= '<option value="0"'.($disabled ? ' disabled="disabled"' : '').'>-- '.$langs->trans("SelectAction").' --</option>'; |
|
| 838 | 838 | foreach ($arrayofaction as $code => $label) { |
| 839 | - $ret .= '<option value="' . $code . '"' . ($disabled ? ' disabled="disabled"' : '') . ' data-html="' . dol_escape_htmltag($label) . '">' . $label . '</option>'; |
|
| 839 | + $ret .= '<option value="'.$code.'"'.($disabled ? ' disabled="disabled"' : '').' data-html="'.dol_escape_htmltag($label).'">'.$label.'</option>'; |
|
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | $ret .= $hookmanager->resPrint; |
@@ -844,17 +844,17 @@ discard block |
||
| 844 | 844 | $ret .= '</select>'; |
| 845 | 845 | |
| 846 | 846 | if (empty($conf->dol_optimize_smallscreen)) { |
| 847 | - $ret .= ajax_combobox('.' . $name . 'select'); |
|
| 847 | + $ret .= ajax_combobox('.'.$name.'select'); |
|
| 848 | 848 | } |
| 849 | 849 | |
| 850 | 850 | // 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 |
| 851 | 851 | $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. |
| 852 | - $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")) . '">'; |
|
| 852 | + $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")).'">'; |
|
| 853 | 853 | $ret .= '</div>'; |
| 854 | 854 | |
| 855 | 855 | if (!empty($conf->use_javascript_ajax)) { |
| 856 | 856 | $ret .= '<!-- JS CODE TO ENABLE mass action select --> |
| 857 | - <script nonce="' . getNonce() . '"> |
|
| 857 | + <script nonce="' . getNonce().'"> |
|
| 858 | 858 | 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 */ |
| 859 | 859 | { |
| 860 | 860 | atleastoneselected=0; |
@@ -865,11 +865,11 @@ discard block |
||
| 865 | 865 | |
| 866 | 866 | console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); |
| 867 | 867 | |
| 868 | - if (atleastoneselected || ' . $alwaysvisible . ') |
|
| 868 | + if (atleastoneselected || ' . $alwaysvisible.') |
|
| 869 | 869 | { |
| 870 | 870 | jQuery("."+name).show(); |
| 871 | - ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' |
|
| 872 | - ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '') . ' |
|
| 871 | + ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').' |
|
| 872 | + ' . ($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').' |
|
| 873 | 873 | } |
| 874 | 874 | else |
| 875 | 875 | { |
@@ -879,11 +879,11 @@ discard block |
||
| 879 | 879 | } |
| 880 | 880 | |
| 881 | 881 | jQuery(document).ready(function () { |
| 882 | - initCheckForSelect(0, "' . $name . '", "' . $cssclass . '"); |
|
| 883 | - jQuery(".' . $cssclass . '").click(function() { |
|
| 884 | - initCheckForSelect(1, "' . $name . '", "' . $cssclass . '"); |
|
| 882 | + initCheckForSelect(0, "' . $name.'", "'.$cssclass.'"); |
|
| 883 | + jQuery(".' . $cssclass.'").click(function() { |
|
| 884 | + initCheckForSelect(1, "' . $name.'", "'.$cssclass.'"); |
|
| 885 | 885 | }); |
| 886 | - jQuery(".' . $name . 'select").change(function() { |
|
| 886 | + jQuery(".' . $name.'select").change(function() { |
|
| 887 | 887 | var massaction = $( this ).val(); |
| 888 | 888 | var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); |
| 889 | 889 | if (massaction == "builddoc") |
@@ -891,18 +891,18 @@ discard block |
||
| 891 | 891 | urlform = urlform + "#show_files"; |
| 892 | 892 | } |
| 893 | 893 | $( this ).closest("form").attr("action", urlform); |
| 894 | - console.log("we select a mass action name=' . $name . ' massaction="+massaction+" - "+urlform); |
|
| 894 | + console.log("we select a mass action name=' . $name.' massaction="+massaction+" - "+urlform); |
|
| 895 | 895 | /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ |
| 896 | 896 | if ($(this).val() != \'0\') |
| 897 | 897 | { |
| 898 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', false); |
|
| 899 | - jQuery(".' . $name . 'other").hide(); /* To disable if another div was open */ |
|
| 900 | - jQuery(".' . $name . '"+massaction).show(); |
|
| 898 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', false); |
|
| 899 | + jQuery(".' . $name.'other").hide(); /* To disable if another div was open */ |
|
| 900 | + jQuery(".' . $name.'"+massaction).show(); |
|
| 901 | 901 | } |
| 902 | 902 | else |
| 903 | 903 | { |
| 904 | - jQuery(".' . $name . 'confirmed").prop(\'disabled\', true); |
|
| 905 | - jQuery(".' . $name . 'other").hide(); /* To disable any div open */ |
|
| 904 | + jQuery(".' . $name.'confirmed").prop(\'disabled\', true); |
|
| 905 | + jQuery(".' . $name.'other").hide(); /* To disable any div open */ |
|
| 906 | 906 | } |
| 907 | 907 | }); |
| 908 | 908 | }); |
@@ -945,14 +945,14 @@ discard block |
||
| 945 | 945 | $atleastonefavorite = 0; |
| 946 | 946 | |
| 947 | 947 | $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite, eec"; |
| 948 | - $sql .= " FROM " . $this->db->prefix() . "c_country"; |
|
| 948 | + $sql .= " FROM ".$this->db->prefix()."c_country"; |
|
| 949 | 949 | $sql .= " WHERE active > 0"; |
| 950 | 950 | //$sql.= " ORDER BY code ASC"; |
| 951 | 951 | |
| 952 | - dol_syslog(get_class($this) . "::select_country", LOG_DEBUG); |
|
| 952 | + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); |
|
| 953 | 953 | $resql = $this->db->query($sql); |
| 954 | 954 | if ($resql) { |
| 955 | - $out .= '<select id="select' . $htmlname . '" class="flat maxwidth200onsmartphone selectcountry' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 955 | + $out .= '<select id="select'.$htmlname.'" class="flat maxwidth200onsmartphone selectcountry'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 956 | 956 | $num = $this->db->num_rows($resql); |
| 957 | 957 | $i = 0; |
| 958 | 958 | if ($num) { |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | $countryArray[$i]['rowid'] = $obj->rowid; |
| 963 | 963 | $countryArray[$i]['code_iso'] = $obj->code_iso; |
| 964 | 964 | $countryArray[$i]['code_iso3'] = $obj->code_iso3; |
| 965 | - $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 : '')); |
|
| 965 | + $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 : '')); |
|
| 966 | 966 | $countryArray[$i]['favorite'] = $obj->favorite; |
| 967 | 967 | $countryArray[$i]['eec'] = $obj->eec; |
| 968 | 968 | $favorite[$i] = $obj->favorite; |
@@ -980,20 +980,20 @@ discard block |
||
| 980 | 980 | |
| 981 | 981 | if ($showempty) { |
| 982 | 982 | if (is_numeric($showempty)) { |
| 983 | - $out .= '<option value=""> </option>' . "\n"; |
|
| 983 | + $out .= '<option value=""> </option>'."\n"; |
|
| 984 | 984 | } else { |
| 985 | - $out .= '<option value="-1">' . $langs->trans($showempty) . '</option>' . "\n"; |
|
| 985 | + $out .= '<option value="-1">'.$langs->trans($showempty).'</option>'."\n"; |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | if ($addspecialentries) { // Add dedicated entries for groups of countries |
| 990 | 990 | //if ($showempty) $out.= '<option value="" disabled class="selectoptiondisabledwhite">--------------</option>'; |
| 991 | - $out .= '<option value="special_allnotme"' . ($selected == 'special_allnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 992 | - $out .= '<option value="special_eec"' . ($selected == 'special_eec' ? ' selected' : '') . '>' . $langs->trans("CountriesInEEC") . '</option>'; |
|
| 991 | + $out .= '<option value="special_allnotme"'.($selected == 'special_allnotme' ? ' selected' : '').'>'.$langs->trans("CountriesExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 992 | + $out .= '<option value="special_eec"'.($selected == 'special_eec' ? ' selected' : '').'>'.$langs->trans("CountriesInEEC").'</option>'; |
|
| 993 | 993 | if ($mysoc->isInEEC()) { |
| 994 | - $out .= '<option value="special_eecnotme"' . ($selected == 'special_eecnotme' ? ' selected' : '') . '>' . $langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country" . $mysoc->country_code)) . '</option>'; |
|
| 994 | + $out .= '<option value="special_eecnotme"'.($selected == 'special_eecnotme' ? ' selected' : '').'>'.$langs->trans("CountriesInEECExceptMe", $langs->transnoentitiesnoconv("Country".$mysoc->country_code)).'</option>'; |
|
| 995 | 995 | } |
| 996 | - $out .= '<option value="special_noteec"' . ($selected == 'special_noteec' ? ' selected' : '') . '>' . $langs->trans("CountriesNotInEEC") . '</option>'; |
|
| 996 | + $out .= '<option value="special_noteec"'.($selected == 'special_noteec' ? ' selected' : '').'>'.$langs->trans("CountriesNotInEEC").'</option>'; |
|
| 997 | 997 | $out .= '<option value="" disabled class="selectoptiondisabledwhite">------------</option>'; |
| 998 | 998 | } |
| 999 | 999 | |
@@ -1021,20 +1021,20 @@ discard block |
||
| 1021 | 1021 | $labeltoshow .= ' '; |
| 1022 | 1022 | } |
| 1023 | 1023 | if ($row['code_iso']) { |
| 1024 | - $labeltoshow .= ' <span class="opacitymedium">(' . $row['code_iso'] . ')</span>'; |
|
| 1024 | + $labeltoshow .= ' <span class="opacitymedium">('.$row['code_iso'].')</span>'; |
|
| 1025 | 1025 | if (empty($hideflags)) { |
| 1026 | 1026 | $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); |
| 1027 | - $labeltoshow = $tmpflag . ' ' . $labeltoshow; |
|
| 1027 | + $labeltoshow = $tmpflag.' '.$labeltoshow; |
|
| 1028 | 1028 | } |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label'])) { |
| 1032 | - $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']) . '">'; |
|
| 1032 | + $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']).'">'; |
|
| 1033 | 1033 | } else { |
| 1034 | - $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']) . '">'; |
|
| 1034 | + $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']).'">'; |
|
| 1035 | 1035 | } |
| 1036 | 1036 | $out .= $labeltoshow; |
| 1037 | - $out .= '</option>' . "\n"; |
|
| 1037 | + $out .= '</option>'."\n"; |
|
| 1038 | 1038 | } |
| 1039 | 1039 | } |
| 1040 | 1040 | $out .= '</select>'; |
@@ -1043,8 +1043,8 @@ discard block |
||
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | 1045 | // Make select dynamic |
| 1046 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1047 | - $out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve'); |
|
| 1046 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1047 | + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); |
|
| 1048 | 1048 | |
| 1049 | 1049 | return $out; |
| 1050 | 1050 | } |
@@ -1076,25 +1076,25 @@ discard block |
||
| 1076 | 1076 | $incotermArray = array(); |
| 1077 | 1077 | |
| 1078 | 1078 | $sql = "SELECT rowid, code"; |
| 1079 | - $sql .= " FROM " . $this->db->prefix() . "c_incoterms"; |
|
| 1079 | + $sql .= " FROM ".$this->db->prefix()."c_incoterms"; |
|
| 1080 | 1080 | $sql .= " WHERE active > 0"; |
| 1081 | 1081 | $sql .= " ORDER BY code ASC"; |
| 1082 | 1082 | |
| 1083 | - dol_syslog(get_class($this) . "::select_incoterm", LOG_DEBUG); |
|
| 1083 | + dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG); |
|
| 1084 | 1084 | $resql = $this->db->query($sql); |
| 1085 | 1085 | if ($resql) { |
| 1086 | 1086 | if ($conf->use_javascript_ajax && !$forcecombo) { |
| 1087 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1087 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1088 | 1088 | $out .= ajax_combobox($htmlname, $events); |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | if (!empty($page)) { |
| 1092 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 1092 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 1093 | 1093 | $out .= '<input type="hidden" name="action" value="set_incoterms">'; |
| 1094 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 1094 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | - $out .= '<select id="' . $htmlname . '" class="flat selectincoterm width75" name="' . $htmlname . '" ' . $htmloption . '>'; |
|
| 1097 | + $out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>'; |
|
| 1098 | 1098 | $out .= '<option value="0"> </option>'; |
| 1099 | 1099 | $num = $this->db->num_rows($resql); |
| 1100 | 1100 | $i = 0; |
@@ -1108,9 +1108,9 @@ discard block |
||
| 1108 | 1108 | |
| 1109 | 1109 | foreach ($incotermArray as $row) { |
| 1110 | 1110 | if ($selected && ($selected == $row['rowid'] || $selected == $row['code'])) { |
| 1111 | - $out .= '<option value="' . $row['rowid'] . '" selected>'; |
|
| 1111 | + $out .= '<option value="'.$row['rowid'].'" selected>'; |
|
| 1112 | 1112 | } else { |
| 1113 | - $out .= '<option value="' . $row['rowid'] . '">'; |
|
| 1113 | + $out .= '<option value="'.$row['rowid'].'">'; |
|
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | if ($row['code']) { |
@@ -1123,13 +1123,13 @@ discard block |
||
| 1123 | 1123 | $out .= '</select>'; |
| 1124 | 1124 | |
| 1125 | 1125 | if ($conf->use_javascript_ajax && empty($disableautocomplete)) { |
| 1126 | - $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; |
|
| 1126 | + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT.'/core/ajax/locationincoterms.php')."\n"; |
|
| 1127 | 1127 | $moreattrib .= ' autocomplete="off"'; |
| 1128 | 1128 | } |
| 1129 | - $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n"; |
|
| 1129 | + $out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="'.$location_incoterms.'">'."\n"; |
|
| 1130 | 1130 | |
| 1131 | 1131 | if (!empty($page)) { |
| 1132 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="' . $langs->trans("Modify") . '"></form>'; |
|
| 1132 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp nomargintop nomarginbottom" value="'.$langs->trans("Modify").'"></form>'; |
|
| 1133 | 1133 | } |
| 1134 | 1134 | } else { |
| 1135 | 1135 | dol_print_error($this->db); |
@@ -1160,9 +1160,9 @@ discard block |
||
| 1160 | 1160 | if ($forceall == 1 || (empty($forceall) && isModEnabled("product") && isModEnabled("service")) |
| 1161 | 1161 | || (empty($forceall) && !isModEnabled('product') && !isModEnabled('service'))) { |
| 1162 | 1162 | if (empty($hidetext)) { |
| 1163 | - print $langs->trans("Type") . ': '; |
|
| 1163 | + print $langs->trans("Type").': '; |
|
| 1164 | 1164 | } |
| 1165 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 1165 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 1166 | 1166 | if ($showempty) { |
| 1167 | 1167 | print '<option value="-1"'; |
| 1168 | 1168 | if ($selected == -1) { |
@@ -1175,28 +1175,28 @@ discard block |
||
| 1175 | 1175 | if (0 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'product')) { |
| 1176 | 1176 | print ' selected'; |
| 1177 | 1177 | } |
| 1178 | - print '>' . $langs->trans("Product"); |
|
| 1178 | + print '>'.$langs->trans("Product"); |
|
| 1179 | 1179 | |
| 1180 | 1180 | print '<option value="1"'; |
| 1181 | 1181 | if (1 == $selected || ($selected == -1 && getDolGlobalString('MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT') == 'service')) { |
| 1182 | 1182 | print ' selected'; |
| 1183 | 1183 | } |
| 1184 | - print '>' . $langs->trans("Service"); |
|
| 1184 | + print '>'.$langs->trans("Service"); |
|
| 1185 | 1185 | |
| 1186 | 1186 | print '</select>'; |
| 1187 | - print ajax_combobox('select_' . $htmlname); |
|
| 1187 | + print ajax_combobox('select_'.$htmlname); |
|
| 1188 | 1188 | //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); |
| 1189 | 1189 | } |
| 1190 | 1190 | if ((empty($forceall) && !isModEnabled('product') && isModEnabled("service")) || $forceall == 3) { |
| 1191 | 1191 | print $langs->trans("Service"); |
| 1192 | - print '<input type="hidden" name="' . $htmlname . '" value="1">'; |
|
| 1192 | + print '<input type="hidden" name="'.$htmlname.'" value="1">'; |
|
| 1193 | 1193 | } |
| 1194 | 1194 | if ((empty($forceall) && isModEnabled("product") && !isModEnabled('service')) || $forceall == 2) { |
| 1195 | 1195 | print $langs->trans("Product"); |
| 1196 | - print '<input type="hidden" name="' . $htmlname . '" value="0">'; |
|
| 1196 | + print '<input type="hidden" name="'.$htmlname.'" value="0">'; |
|
| 1197 | 1197 | } |
| 1198 | 1198 | if ($forceall < 0) { // This should happened only for contracts when both predefined product and service are disabled. |
| 1199 | - 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 |
|
| 1199 | + 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 |
|
| 1200 | 1200 | } |
| 1201 | 1201 | } |
| 1202 | 1202 | |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | $langs->load("trips"); |
| 1223 | 1223 | |
| 1224 | 1224 | $sql = "SELECT c.code, c.label"; |
| 1225 | - $sql .= " FROM " . $this->db->prefix() . "c_type_fees as c"; |
|
| 1225 | + $sql .= " FROM ".$this->db->prefix()."c_type_fees as c"; |
|
| 1226 | 1226 | $sql .= " WHERE active > 0"; |
| 1227 | 1227 | |
| 1228 | 1228 | $resql = $this->db->query($sql); |
@@ -1263,11 +1263,11 @@ discard block |
||
| 1263 | 1263 | // phpcs:enable |
| 1264 | 1264 | global $user, $langs; |
| 1265 | 1265 | |
| 1266 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 1266 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 1267 | 1267 | |
| 1268 | 1268 | $this->load_cache_types_fees(); |
| 1269 | 1269 | |
| 1270 | - print '<select id="select_' . $htmlname . '" class="flat" name="' . $htmlname . '">'; |
|
| 1270 | + print '<select id="select_'.$htmlname.'" class="flat" name="'.$htmlname.'">'; |
|
| 1271 | 1271 | if ($showempty) { |
| 1272 | 1272 | print '<option value="-1"'; |
| 1273 | 1273 | if ($selected == -1) { |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | foreach ($this->cache_types_fees as $key => $value) { |
| 1280 | - print '<option value="' . $key . '"'; |
|
| 1280 | + print '<option value="'.$key.'"'; |
|
| 1281 | 1281 | if ($key == $selected) { |
| 1282 | 1282 | print ' selected'; |
| 1283 | 1283 | } |
@@ -1328,12 +1328,12 @@ discard block |
||
| 1328 | 1328 | $ajaxoptions = array(); |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1331 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1332 | 1332 | |
| 1333 | 1333 | // No immediate load of all database |
| 1334 | 1334 | $placeholder = ''; |
| 1335 | 1335 | if ($selected && empty($selected_input_value)) { |
| 1336 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 1336 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 1337 | 1337 | $societetmp = new Societe($this->db); |
| 1338 | 1338 | $societetmp->fetch($selected); |
| 1339 | 1339 | $selected_input_value = $societetmp->name; |
@@ -1341,25 +1341,25 @@ discard block |
||
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | // mode 1 |
| 1344 | - $urloption = 'htmlname=' . urlencode(str_replace('.', '_', $htmlname)) . '&outjson=1&filter=' . urlencode($filter) . (empty($excludeids) ? '' : '&excludeids=' . implode(',', $excludeids)) . ($showtype ? '&showtype=' . urlencode($showtype) : '') . ($showcode ? '&showcode=' . urlencode($showcode) : ''); |
|
| 1344 | + $urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.implode(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '').($showcode ? '&showcode='.urlencode($showcode) : ''); |
|
| 1345 | 1345 | |
| 1346 | 1346 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 1347 | 1347 | if (empty($hidelabel)) { |
| 1348 | - print $langs->trans("RefOrLabel") . ' : '; |
|
| 1348 | + print $langs->trans("RefOrLabel").' : '; |
|
| 1349 | 1349 | } elseif ($hidelabel > 1) { |
| 1350 | 1350 | $placeholder = $langs->trans("RefOrLabel"); |
| 1351 | 1351 | if ($hidelabel == 2) { |
| 1352 | 1352 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1353 | 1353 | } |
| 1354 | 1354 | } |
| 1355 | - $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' : '') . ' />'; |
|
| 1355 | + $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' : '').' />'; |
|
| 1356 | 1356 | if ($hidelabel == 3) { |
| 1357 | 1357 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 1358 | 1358 | } |
| 1359 | 1359 | |
| 1360 | 1360 | $out .= ajax_event($htmlname, $events); |
| 1361 | 1361 | |
| 1362 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1362 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 1363 | 1363 | } else { |
| 1364 | 1364 | // Immediate load of all database |
| 1365 | 1365 | $out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids, $showcode); |
@@ -1443,30 +1443,30 @@ discard block |
||
| 1443 | 1443 | $sql .= ", s.address, s.zip, s.town"; |
| 1444 | 1444 | $sql .= ", dictp.code as country_code"; |
| 1445 | 1445 | } |
| 1446 | - $sql .= " FROM " . $this->db->prefix() . "societe as s"; |
|
| 1446 | + $sql .= " FROM ".$this->db->prefix()."societe as s"; |
|
| 1447 | 1447 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1448 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1448 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as dictp ON dictp.rowid = s.fk_pays"; |
|
| 1449 | 1449 | } |
| 1450 | 1450 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1451 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 1451 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 1452 | 1452 | } |
| 1453 | - $sql .= " WHERE s.entity IN (" . getEntity('societe') . ")"; |
|
| 1453 | + $sql .= " WHERE s.entity IN (".getEntity('societe').")"; |
|
| 1454 | 1454 | if (!empty($user->socid)) { |
| 1455 | - $sql .= " AND s.rowid = " . ((int) $user->socid); |
|
| 1455 | + $sql .= " AND s.rowid = ".((int) $user->socid); |
|
| 1456 | 1456 | } |
| 1457 | 1457 | if ($filter) { |
| 1458 | 1458 | // $filter is safe because, if it contains '(' or ')', it has been sanitized by testSqlAndScriptInject() and forgeSQLFromUniversalSearchCriteria() |
| 1459 | 1459 | // if not, by testSqlAndScriptInject() only. |
| 1460 | - $sql .= " AND (" . $filter . ")"; |
|
| 1460 | + $sql .= " AND (".$filter.")"; |
|
| 1461 | 1461 | } |
| 1462 | 1462 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 1463 | - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 1463 | + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | if (getDolGlobalString('COMPANY_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1466 | 1466 | $sql .= " AND s.status <> 0"; |
| 1467 | 1467 | } |
| 1468 | 1468 | if (!empty($excludeids)) { |
| 1469 | - $sql .= " AND s.rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeids)) . ")"; |
|
| 1469 | + $sql .= " AND s.rowid NOT IN (".$this->db->sanitize(implode(',', $excludeids)).")"; |
|
| 1470 | 1470 | } |
| 1471 | 1471 | // Add where from hooks |
| 1472 | 1472 | $parameters = array(); |
@@ -1486,17 +1486,17 @@ discard block |
||
| 1486 | 1486 | if ($i > 0) { |
| 1487 | 1487 | $sql .= " AND "; |
| 1488 | 1488 | } |
| 1489 | - $sql .= "(s.nom LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 1489 | + $sql .= "(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 1490 | 1490 | $i++; |
| 1491 | 1491 | } |
| 1492 | 1492 | if (count($search_crit) > 1) { |
| 1493 | 1493 | $sql .= ")"; |
| 1494 | 1494 | } |
| 1495 | 1495 | if (isModEnabled('barcode')) { |
| 1496 | - $sql .= " OR s.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1496 | + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1497 | 1497 | } |
| 1498 | - $sql .= " OR s.code_client LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.code_fournisseur LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1499 | - $sql .= " OR s.name_alias LIKE '" . $this->db->escape($prefix . $filterkey) . "%' OR s.tva_intra LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 1498 | + $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1499 | + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 1500 | 1500 | $sql .= ")"; |
| 1501 | 1501 | } |
| 1502 | 1502 | $sql .= $this->db->order("nom", "ASC"); |
@@ -1507,12 +1507,12 @@ discard block |
||
| 1507 | 1507 | $resql = $this->db->query($sql); |
| 1508 | 1508 | if ($resql) { |
| 1509 | 1509 | if (!$forcecombo) { |
| 1510 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1510 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1511 | 1511 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString("COMPANY_USE_SEARCH_TO_SELECT")); |
| 1512 | 1512 | } |
| 1513 | 1513 | |
| 1514 | 1514 | // Construct $out and $outarray |
| 1515 | - $out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($moreparam ? ' ' . $moreparam : '') . ' name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . '>' . "\n"; |
|
| 1515 | + $out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').'>'."\n"; |
|
| 1516 | 1516 | |
| 1517 | 1517 | $textifempty = (($showempty && !is_numeric($showempty)) ? $langs->trans($showempty) : ''); |
| 1518 | 1518 | if (getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) { |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | } |
| 1526 | 1526 | } |
| 1527 | 1527 | if ($showempty) { |
| 1528 | - $out .= '<option value="-1" data-html="' . dol_escape_htmltag('<span class="opacitymedium">' . ($textifempty ? $textifempty : ' ') . '</span>') . '">' . $textifempty . '</option>' . "\n"; |
|
| 1528 | + $out .= '<option value="-1" data-html="'.dol_escape_htmltag('<span class="opacitymedium">'.($textifempty ? $textifempty : ' ').'</span>').'">'.$textifempty.'</option>'."\n"; |
|
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | $companytemp = new Societe($this->db); |
@@ -1538,18 +1538,18 @@ discard block |
||
| 1538 | 1538 | $label = ''; |
| 1539 | 1539 | if ($showcode || getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) { |
| 1540 | 1540 | if (($obj->client) && (!empty($obj->code_client))) { |
| 1541 | - $label = $obj->code_client . ' - '; |
|
| 1541 | + $label = $obj->code_client.' - '; |
|
| 1542 | 1542 | } |
| 1543 | 1543 | if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) { |
| 1544 | - $label .= $obj->code_fournisseur . ' - '; |
|
| 1544 | + $label .= $obj->code_fournisseur.' - '; |
|
| 1545 | 1545 | } |
| 1546 | - $label .= ' ' . $obj->name; |
|
| 1546 | + $label .= ' '.$obj->name; |
|
| 1547 | 1547 | } else { |
| 1548 | 1548 | $label = $obj->name; |
| 1549 | 1549 | } |
| 1550 | 1550 | |
| 1551 | 1551 | if (!empty($obj->name_alias)) { |
| 1552 | - $label .= ' (' . $obj->name_alias . ')'; |
|
| 1552 | + $label .= ' ('.$obj->name_alias.')'; |
|
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | if (getDolGlobalString('SOCIETE_SHOW_VAT_IN_LIST') && !empty($obj->tva_intra)) { |
@@ -1564,7 +1564,7 @@ discard block |
||
| 1564 | 1564 | $companytemp->fournisseur = $obj->fournisseur; |
| 1565 | 1565 | $tmptype = $companytemp->getTypeUrl(1, '', 0, 'span'); |
| 1566 | 1566 | if ($tmptype) { |
| 1567 | - $labelhtml .= ' ' . $tmptype; |
|
| 1567 | + $labelhtml .= ' '.$tmptype; |
|
| 1568 | 1568 | } |
| 1569 | 1569 | |
| 1570 | 1570 | if ($obj->client || $obj->fournisseur) { |
@@ -1574,10 +1574,10 @@ discard block |
||
| 1574 | 1574 | $label .= $langs->trans("Customer"); |
| 1575 | 1575 | } |
| 1576 | 1576 | if ($obj->client == 2 || $obj->client == 3) { |
| 1577 | - $label .= ($obj->client == 3 ? ', ' : '') . $langs->trans("Prospect"); |
|
| 1577 | + $label .= ($obj->client == 3 ? ', ' : '').$langs->trans("Prospect"); |
|
| 1578 | 1578 | } |
| 1579 | 1579 | if ($obj->fournisseur) { |
| 1580 | - $label .= ($obj->client ? ', ' : '') . $langs->trans("Supplier"); |
|
| 1580 | + $label .= ($obj->client ? ', ' : '').$langs->trans("Supplier"); |
|
| 1581 | 1581 | } |
| 1582 | 1582 | if ($obj->client || $obj->fournisseur) { |
| 1583 | 1583 | $label .= ')'; |
@@ -1585,9 +1585,9 @@ discard block |
||
| 1585 | 1585 | } |
| 1586 | 1586 | |
| 1587 | 1587 | if (getDolGlobalString('COMPANY_SHOW_ADDRESS_SELECTLIST')) { |
| 1588 | - $s = ($obj->address ? ' - ' . $obj->address : '') . ($obj->zip ? ' - ' . $obj->zip : '') . ($obj->town ? ' ' . $obj->town : ''); |
|
| 1588 | + $s = ($obj->address ? ' - '.$obj->address : '').($obj->zip ? ' - '.$obj->zip : '').($obj->town ? ' '.$obj->town : ''); |
|
| 1589 | 1589 | if (!empty($obj->country_code)) { |
| 1590 | - $s .= ', ' . $langs->trans('Country' . $obj->country_code); |
|
| 1590 | + $s .= ', '.$langs->trans('Country'.$obj->country_code); |
|
| 1591 | 1591 | } |
| 1592 | 1592 | $label .= $s; |
| 1593 | 1593 | $labelhtml .= $s; |
@@ -1595,9 +1595,9 @@ discard block |
||
| 1595 | 1595 | |
| 1596 | 1596 | if (empty($outputmode)) { |
| 1597 | 1597 | if (in_array($obj->rowid, $selected)) { |
| 1598 | - $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>'; |
|
| 1598 | + $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>'; |
|
| 1599 | 1599 | } else { |
| 1600 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 1600 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | } else { |
| 1603 | 1603 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label, 'labelhtml' => $labelhtml)); |
@@ -1609,7 +1609,7 @@ discard block |
||
| 1609 | 1609 | } |
| 1610 | 1610 | } |
| 1611 | 1611 | } |
| 1612 | - $out .= '</select>' . "\n"; |
|
| 1612 | + $out .= '</select>'."\n"; |
|
| 1613 | 1613 | } else { |
| 1614 | 1614 | dol_print_error($this->db); |
| 1615 | 1615 | } |
@@ -1643,18 +1643,18 @@ discard block |
||
| 1643 | 1643 | // On recherche les remises |
| 1644 | 1644 | $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; |
| 1645 | 1645 | $sql .= " re.description, re.fk_facture_source"; |
| 1646 | - $sql .= " FROM " . $this->db->prefix() . "societe_remise_except as re"; |
|
| 1647 | - $sql .= " WHERE re.fk_soc = " . (int) $socid; |
|
| 1648 | - $sql .= " AND re.entity = " . $conf->entity; |
|
| 1646 | + $sql .= " FROM ".$this->db->prefix()."societe_remise_except as re"; |
|
| 1647 | + $sql .= " WHERE re.fk_soc = ".(int) $socid; |
|
| 1648 | + $sql .= " AND re.entity = ".$conf->entity; |
|
| 1649 | 1649 | if ($filter) { |
| 1650 | - $sql .= " AND " . $filter; |
|
| 1650 | + $sql .= " AND ".$filter; |
|
| 1651 | 1651 | } |
| 1652 | 1652 | $sql .= " ORDER BY re.description ASC"; |
| 1653 | 1653 | |
| 1654 | - dol_syslog(get_class($this) . "::select_remises", LOG_DEBUG); |
|
| 1654 | + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); |
|
| 1655 | 1655 | $resql = $this->db->query($sql); |
| 1656 | 1656 | if ($resql) { |
| 1657 | - print '<select id="select_' . $htmlname . '" class="flat maxwidthonsmartphone" name="' . $htmlname . '">'; |
|
| 1657 | + print '<select id="select_'.$htmlname.'" class="flat maxwidthonsmartphone" name="'.$htmlname.'">'; |
|
| 1658 | 1658 | $num = $this->db->num_rows($resql); |
| 1659 | 1659 | |
| 1660 | 1660 | $qualifiedlines = $num; |
@@ -1692,16 +1692,16 @@ discard block |
||
| 1692 | 1692 | if (getDolGlobalString('MAIN_SHOW_FACNUMBER_IN_DISCOUNT_LIST') && !empty($obj->fk_facture_source)) { |
| 1693 | 1693 | $tmpfac = new Facture($this->db); |
| 1694 | 1694 | if ($tmpfac->fetch($obj->fk_facture_source) > 0) { |
| 1695 | - $desc = $desc . ' - ' . $tmpfac->ref; |
|
| 1695 | + $desc = $desc.' - '.$tmpfac->ref; |
|
| 1696 | 1696 | } |
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | - print '<option value="' . $obj->rowid . '"' . $selectstring . $disabled . '>' . $desc . ' (' . price($obj->amount_ht) . ' ' . $langs->trans("HT") . ' - ' . price($obj->amount_ttc) . ' ' . $langs->trans("TTC") . ')</option>'; |
|
| 1699 | + print '<option value="'.$obj->rowid.'"'.$selectstring.$disabled.'>'.$desc.' ('.price($obj->amount_ht).' '.$langs->trans("HT").' - '.price($obj->amount_ttc).' '.$langs->trans("TTC").')</option>'; |
|
| 1700 | 1700 | $i++; |
| 1701 | 1701 | } |
| 1702 | 1702 | } |
| 1703 | 1703 | print '</select>'; |
| 1704 | - print ajax_combobox('select_' . $htmlname); |
|
| 1704 | + print ajax_combobox('select_'.$htmlname); |
|
| 1705 | 1705 | |
| 1706 | 1706 | return $qualifiedlines; |
| 1707 | 1707 | } else { |
@@ -1782,7 +1782,7 @@ discard block |
||
| 1782 | 1782 | $out = ''; |
| 1783 | 1783 | |
| 1784 | 1784 | if (!is_object($hookmanager)) { |
| 1785 | - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; |
|
| 1785 | + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; |
|
| 1786 | 1786 | $hookmanager = new HookManager($this->db); |
| 1787 | 1787 | } |
| 1788 | 1788 | |
@@ -1791,13 +1791,13 @@ discard block |
||
| 1791 | 1791 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1792 | 1792 | $sql .= ", s.nom as company, s.town AS company_town"; |
| 1793 | 1793 | } |
| 1794 | - $sql .= " FROM " . $this->db->prefix() . "socpeople as sp"; |
|
| 1794 | + $sql .= " FROM ".$this->db->prefix()."socpeople as sp"; |
|
| 1795 | 1795 | if ($showsoc > 0 || getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { |
| 1796 | - $sql .= " LEFT OUTER JOIN " . $this->db->prefix() . "societe as s ON s.rowid=sp.fk_soc"; |
|
| 1796 | + $sql .= " LEFT OUTER JOIN ".$this->db->prefix()."societe as s ON s.rowid=sp.fk_soc"; |
|
| 1797 | 1797 | } |
| 1798 | - $sql .= " WHERE sp.entity IN (" . getEntity('contact') . ")"; |
|
| 1798 | + $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
|
| 1799 | 1799 | if ($socid > 0 || $socid == -1) { |
| 1800 | - $sql .= " AND sp.fk_soc = " . ((int) $socid); |
|
| 1800 | + $sql .= " AND sp.fk_soc = ".((int) $socid); |
|
| 1801 | 1801 | } |
| 1802 | 1802 | if (getDolGlobalString('CONTACT_HIDE_INACTIVE_IN_COMBOBOX')) { |
| 1803 | 1803 | $sql .= " AND sp.statut <> 0"; |
@@ -1808,30 +1808,30 @@ discard block |
||
| 1808 | 1808 | $sql .= $hookmanager->resPrint; |
| 1809 | 1809 | $sql .= " ORDER BY sp.lastname ASC"; |
| 1810 | 1810 | |
| 1811 | - dol_syslog(get_class($this) . "::selectcontacts", LOG_DEBUG); |
|
| 1811 | + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); |
|
| 1812 | 1812 | $resql = $this->db->query($sql); |
| 1813 | 1813 | if ($resql) { |
| 1814 | 1814 | $num = $this->db->num_rows($resql); |
| 1815 | 1815 | |
| 1816 | 1816 | if ($htmlname != 'none' && !$options_only) { |
| 1817 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlid . '" name="' . $htmlname . (($num || empty($disableifempty)) ? '' : ' disabled') . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . (!empty($moreparam) ? $moreparam : '') . '>'; |
|
| 1817 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlid.'" name="'.$htmlname.(($num || empty($disableifempty)) ? '' : ' disabled').($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>'; |
|
| 1818 | 1818 | } |
| 1819 | 1819 | |
| 1820 | 1820 | if ($showempty && !is_numeric($showempty)) { |
| 1821 | 1821 | $textforempty = $showempty; |
| 1822 | - $out .= '<option class="optiongrey" value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '>' . $textforempty . '</option>'; |
|
| 1822 | + $out .= '<option class="optiongrey" value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'>'.$textforempty.'</option>'; |
|
| 1823 | 1823 | } else { |
| 1824 | 1824 | if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) { |
| 1825 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '> </option>'; |
|
| 1825 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'> </option>'; |
|
| 1826 | 1826 | } |
| 1827 | 1827 | if ($showempty == 2) { |
| 1828 | - $out .= '<option value="0"' . (in_array(0, $selected) ? ' selected' : '') . '>-- ' . $langs->trans("Internal") . ' --</option>'; |
|
| 1828 | + $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>'; |
|
| 1829 | 1829 | } |
| 1830 | 1830 | } |
| 1831 | 1831 | |
| 1832 | 1832 | $i = 0; |
| 1833 | 1833 | if ($num) { |
| 1834 | - include_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 1834 | + include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 1835 | 1835 | $contactstatic = new Contact($this->db); |
| 1836 | 1836 | |
| 1837 | 1837 | while ($i < $num) { |
@@ -1867,7 +1867,7 @@ discard block |
||
| 1867 | 1867 | } |
| 1868 | 1868 | $extendedInfos = implode(' - ', $extendedInfos); |
| 1869 | 1869 | if (!empty($extendedInfos)) { |
| 1870 | - $extendedInfos = ' - ' . $extendedInfos; |
|
| 1870 | + $extendedInfos = ' - '.$extendedInfos; |
|
| 1871 | 1871 | } |
| 1872 | 1872 | } |
| 1873 | 1873 | |
@@ -1884,42 +1884,42 @@ discard block |
||
| 1884 | 1884 | $disabled = 1; |
| 1885 | 1885 | } |
| 1886 | 1886 | if (!empty($selected) && in_array($obj->rowid, $selected)) { |
| 1887 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1887 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1888 | 1888 | if ($disabled) { |
| 1889 | 1889 | $out .= ' disabled'; |
| 1890 | 1890 | } |
| 1891 | 1891 | $out .= ' selected>'; |
| 1892 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1892 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1893 | 1893 | if ($showfunction && $obj->poste) { |
| 1894 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1894 | + $out .= ' ('.$obj->poste.')'; |
|
| 1895 | 1895 | } |
| 1896 | 1896 | if (($showsoc > 0) && $obj->company) { |
| 1897 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1897 | + $out .= ' - ('.$obj->company.')'; |
|
| 1898 | 1898 | } |
| 1899 | 1899 | $out .= '</option>'; |
| 1900 | 1900 | } else { |
| 1901 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 1901 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 1902 | 1902 | if ($disabled) { |
| 1903 | 1903 | $out .= ' disabled'; |
| 1904 | 1904 | } |
| 1905 | 1905 | $out .= '>'; |
| 1906 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1906 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1907 | 1907 | if ($showfunction && $obj->poste) { |
| 1908 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1908 | + $out .= ' ('.$obj->poste.')'; |
|
| 1909 | 1909 | } |
| 1910 | 1910 | if (($showsoc > 0) && $obj->company) { |
| 1911 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1911 | + $out .= ' - ('.$obj->company.')'; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | $out .= '</option>'; |
| 1914 | 1914 | } |
| 1915 | 1915 | } else { |
| 1916 | 1916 | if (in_array($obj->rowid, $selected)) { |
| 1917 | - $out .= $contactstatic->getFullName($langs) . $extendedInfos; |
|
| 1917 | + $out .= $contactstatic->getFullName($langs).$extendedInfos; |
|
| 1918 | 1918 | if ($showfunction && $obj->poste) { |
| 1919 | - $out .= ' (' . $obj->poste . ')'; |
|
| 1919 | + $out .= ' ('.$obj->poste.')'; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | if (($showsoc > 0) && $obj->company) { |
| 1922 | - $out .= ' - (' . $obj->company . ')'; |
|
| 1922 | + $out .= ' - ('.$obj->company.')'; |
|
| 1923 | 1923 | } |
| 1924 | 1924 | } |
| 1925 | 1925 | } |
@@ -1928,7 +1928,7 @@ discard block |
||
| 1928 | 1928 | } |
| 1929 | 1929 | } else { |
| 1930 | 1930 | $labeltoshow = ($socid != -1) ? ($langs->trans($socid ? "NoContactDefinedForThirdParty" : "NoContactDefined")) : $langs->trans('SelectAThirdPartyFirst'); |
| 1931 | - $out .= '<option class="disabled" value="-1"' . (($showempty == 2 || $multiple) ? '' : ' selected') . ' disabled="disabled">'; |
|
| 1931 | + $out .= '<option class="disabled" value="-1"'.(($showempty == 2 || $multiple) ? '' : ' selected').' disabled="disabled">'; |
|
| 1932 | 1932 | $out .= $labeltoshow; |
| 1933 | 1933 | $out .= '</option>'; |
| 1934 | 1934 | } |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | } |
| 1950 | 1950 | |
| 1951 | 1951 | if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) { |
| 1952 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 1952 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 1953 | 1953 | $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT")); |
| 1954 | 1954 | } |
| 1955 | 1955 | |
@@ -2054,11 +2054,11 @@ discard block |
||
| 2054 | 2054 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2055 | 2055 | $sql .= ", e.label"; |
| 2056 | 2056 | } |
| 2057 | - $sql .= " FROM " . $this->db->prefix() . "user as u"; |
|
| 2057 | + $sql .= " FROM ".$this->db->prefix()."user as u"; |
|
| 2058 | 2058 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 2059 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity"; |
|
| 2059 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; |
|
| 2060 | 2060 | if (!empty($force_entity)) { |
| 2061 | - $sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")"; |
|
| 2061 | + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; |
|
| 2062 | 2062 | } else { |
| 2063 | 2063 | $sql .= " WHERE u.entity IS NOT NULL"; |
| 2064 | 2064 | } |
@@ -2066,17 +2066,17 @@ discard block |
||
| 2066 | 2066 | if (isModEnabled('multicompany') && getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE')) { |
| 2067 | 2067 | $sql .= " WHERE u.rowid IN (SELECT ug.fk_user FROM ".$this->db->prefix()."usergroup_user as ug WHERE ug.entity IN (".getEntity('usergroup')."))"; |
| 2068 | 2068 | } else { |
| 2069 | - $sql .= " WHERE u.entity IN (" . getEntity('user') . ")"; |
|
| 2069 | + $sql .= " WHERE u.entity IN (".getEntity('user').")"; |
|
| 2070 | 2070 | } |
| 2071 | 2071 | } |
| 2072 | 2072 | if (!empty($user->socid)) { |
| 2073 | - $sql .= " AND u.fk_soc = " . ((int) $user->socid); |
|
| 2073 | + $sql .= " AND u.fk_soc = ".((int) $user->socid); |
|
| 2074 | 2074 | } |
| 2075 | 2075 | if (is_array($exclude) && $excludeUsers) { |
| 2076 | - $sql .= " AND u.rowid NOT IN (" . $this->db->sanitize($excludeUsers) . ")"; |
|
| 2076 | + $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; |
|
| 2077 | 2077 | } |
| 2078 | 2078 | if ($includeUsers) { |
| 2079 | - $sql .= " AND u.rowid IN (" . $this->db->sanitize($includeUsers) . ")"; |
|
| 2079 | + $sql .= " AND u.rowid IN (".$this->db->sanitize($includeUsers).")"; |
|
| 2080 | 2080 | } |
| 2081 | 2081 | if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX') || $notdisabled) { |
| 2082 | 2082 | $sql .= " AND u.statut <> 0"; |
@@ -2088,7 +2088,7 @@ discard block |
||
| 2088 | 2088 | $sql .= " AND u.fk_soc IS NULL"; |
| 2089 | 2089 | } |
| 2090 | 2090 | if (!empty($morefilter)) { |
| 2091 | - $sql .= " " . $morefilter; |
|
| 2091 | + $sql .= " ".$morefilter; |
|
| 2092 | 2092 | } |
| 2093 | 2093 | |
| 2094 | 2094 | //Add hook to filter on user (for example on usergroup define in custom modules) |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | $sql .= " ORDER BY u.statut DESC, u.lastname ASC, u.firstname ASC"; |
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | - dol_syslog(get_class($this) . "::select_dolusers", LOG_DEBUG); |
|
| 2106 | + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); |
|
| 2107 | 2107 | |
| 2108 | 2108 | $resql = $this->db->query($sql); |
| 2109 | 2109 | if ($resql) { |
@@ -2111,7 +2111,7 @@ discard block |
||
| 2111 | 2111 | $i = 0; |
| 2112 | 2112 | if ($num) { |
| 2113 | 2113 | // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined |
| 2114 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : ' minwidth200') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 2114 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 2115 | 2115 | if ($show_empty && !$multiple) { |
| 2116 | 2116 | $textforempty = ' '; |
| 2117 | 2117 | if (!empty($conf->use_javascript_ajax)) { |
@@ -2120,10 +2120,10 @@ discard block |
||
| 2120 | 2120 | if (!is_numeric($show_empty)) { |
| 2121 | 2121 | $textforempty = $show_empty; |
| 2122 | 2122 | } |
| 2123 | - $out .= '<option class="optiongrey" value="' . ($show_empty < 0 ? $show_empty : -1) . '"' . ((empty($selected) || in_array(-1, $selected)) ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 2123 | + $out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 2124 | 2124 | } |
| 2125 | 2125 | if ($show_every) { |
| 2126 | - $out .= '<option value="-2"' . ((in_array(-2, $selected)) ? ' selected' : '') . '>-- ' . $langs->trans("Everybody") . ' --</option>' . "\n"; |
|
| 2126 | + $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; |
|
| 2127 | 2127 | } |
| 2128 | 2128 | |
| 2129 | 2129 | $userstatic = new User($this->db); |
@@ -2170,22 +2170,22 @@ discard block |
||
| 2170 | 2170 | } |
| 2171 | 2171 | if ($showstatus >= 0) { |
| 2172 | 2172 | if ($obj->status == 1 && $showstatus == 1) { |
| 2173 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Enabled'); |
|
| 2174 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Enabled'); |
|
| 2173 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Enabled'); |
|
| 2174 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Enabled'); |
|
| 2175 | 2175 | } |
| 2176 | 2176 | if ($obj->status == 0 && $showstatus == 1) { |
| 2177 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans('Disabled'); |
|
| 2178 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans('Disabled'); |
|
| 2177 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); |
|
| 2178 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans('Disabled'); |
|
| 2179 | 2179 | } |
| 2180 | 2180 | } |
| 2181 | 2181 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1 && !empty($user->admin) && empty($user->entity)) { |
| 2182 | 2182 | if (empty($obj->entity)) { |
| 2183 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . $langs->trans("AllEntities"); |
|
| 2184 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . $langs->trans("AllEntities"); |
|
| 2183 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); |
|
| 2184 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').$langs->trans("AllEntities"); |
|
| 2185 | 2185 | } else { |
| 2186 | 2186 | if ($obj->entity != $conf->entity) { |
| 2187 | - $moreinfo .= ($moreinfo ? ' - ' : ' (') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2188 | - $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(') . ($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2187 | + $moreinfo .= ($moreinfo ? ' - ' : ' (').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2188 | + $moreinfohtml .= ($moreinfohtml ? ' - ' : ' <span class="opacitymedium">(').($obj->label ? $obj->label : $langs->trans("EntityNameNotDefined")); |
|
| 2189 | 2189 | } |
| 2190 | 2190 | } |
| 2191 | 2191 | } |
@@ -2193,13 +2193,13 @@ discard block |
||
| 2193 | 2193 | $moreinfohtml .= (!empty($moreinfohtml) ? ')</span>' : ''); |
| 2194 | 2194 | if (!empty($disableline) && $disableline != '1') { |
| 2195 | 2195 | // Add text from $enableonlytext parameter |
| 2196 | - $moreinfo .= ' - ' . $disableline; |
|
| 2197 | - $moreinfohtml .= ' - ' . $disableline; |
|
| 2196 | + $moreinfo .= ' - '.$disableline; |
|
| 2197 | + $moreinfohtml .= ' - '.$disableline; |
|
| 2198 | 2198 | } |
| 2199 | 2199 | $labeltoshow .= $moreinfo; |
| 2200 | 2200 | $labeltoshowhtml .= $moreinfohtml; |
| 2201 | 2201 | |
| 2202 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2202 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2203 | 2203 | if (!empty($disableline)) { |
| 2204 | 2204 | $out .= ' disabled'; |
| 2205 | 2205 | } |
@@ -2207,7 +2207,7 @@ discard block |
||
| 2207 | 2207 | $out .= ' selected'; |
| 2208 | 2208 | } |
| 2209 | 2209 | $out .= ' data-html="'; |
| 2210 | - $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1) . ' '; |
|
| 2210 | + $outhtml = $userstatic->getNomUrl(-3, '', 0, 1, 24, 1, 'login', '', 1).' '; |
|
| 2211 | 2211 | if ($showstatus >= 0 && $obj->status == 0) { |
| 2212 | 2212 | $outhtml .= '<strike class="opacitymediumxxx">'; |
| 2213 | 2213 | } |
@@ -2220,7 +2220,7 @@ discard block |
||
| 2220 | 2220 | $out .= $labeltoshow; |
| 2221 | 2221 | $out .= '</option>'; |
| 2222 | 2222 | |
| 2223 | - $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength) . $moreinfo; |
|
| 2223 | + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength).$moreinfo; |
|
| 2224 | 2224 | $outarray2[$userstatic->id] = array( |
| 2225 | 2225 | 'id'=>$userstatic->id, |
| 2226 | 2226 | 'label'=>$labeltoshow, |
@@ -2232,14 +2232,14 @@ discard block |
||
| 2232 | 2232 | $i++; |
| 2233 | 2233 | } |
| 2234 | 2234 | } else { |
| 2235 | - $out .= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '" disabled>'; |
|
| 2236 | - $out .= '<option value="">' . $langs->trans("None") . '</option>'; |
|
| 2235 | + $out .= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'" disabled>'; |
|
| 2236 | + $out .= '<option value="">'.$langs->trans("None").'</option>'; |
|
| 2237 | 2237 | } |
| 2238 | 2238 | $out .= '</select>'; |
| 2239 | 2239 | |
| 2240 | 2240 | if ($num && !$forcecombo) { |
| 2241 | 2241 | // Enhance with select2 |
| 2242 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2242 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2243 | 2243 | $out .= ajax_combobox($htmlname); |
| 2244 | 2244 | } |
| 2245 | 2245 | } else { |
@@ -2309,16 +2309,16 @@ discard block |
||
| 2309 | 2309 | $out .= $userstatic->getNomUrl(-1); |
| 2310 | 2310 | if ($i == 0) { |
| 2311 | 2311 | $ownerid = $value['id']; |
| 2312 | - $out .= ' (' . $langs->trans("Owner") . ')'; |
|
| 2312 | + $out .= ' ('.$langs->trans("Owner").')'; |
|
| 2313 | 2313 | } |
| 2314 | 2314 | if ($nbassignetouser > 1 && $action != 'view') { |
| 2315 | - $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 . '">'; |
|
| 2315 | + $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.'">'; |
|
| 2316 | 2316 | } |
| 2317 | 2317 | // Show my availability |
| 2318 | 2318 | if ($showproperties) { |
| 2319 | 2319 | if ($ownerid == $value['id'] && is_array($listofuserid) && count($listofuserid) && in_array($ownerid, array_keys($listofuserid))) { |
| 2320 | 2320 | $out .= '<div class="myavailability inline-block">'; |
| 2321 | - $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>'; |
|
| 2321 | + $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>'; |
|
| 2322 | 2322 | $out .= '</div>'; |
| 2323 | 2323 | } |
| 2324 | 2324 | } |
@@ -2335,15 +2335,15 @@ discard block |
||
| 2335 | 2335 | // Method with no ajax |
| 2336 | 2336 | if ($action != 'view') { |
| 2337 | 2337 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">'; |
| 2338 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2338 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2339 | 2339 | $out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });'; |
| 2340 | 2340 | $out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());'; |
| 2341 | - $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#' . $action . 'assignedtouser").attr("disabled", false); }'; |
|
| 2342 | - $out .= ' else { jQuery("#' . $action . 'assignedtouser").attr("disabled", true); }'; |
|
| 2341 | + $out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }'; |
|
| 2342 | + $out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }'; |
|
| 2343 | 2343 | $out .= '});'; |
| 2344 | 2344 | $out .= '})</script>'; |
| 2345 | 2345 | $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2346 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtouser" name="' . $action . 'assignedtouser" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2346 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2347 | 2347 | $out .= '<br>'; |
| 2348 | 2348 | } |
| 2349 | 2349 | |
@@ -2398,13 +2398,13 @@ discard block |
||
| 2398 | 2398 | $resourcestatic->fetch($value['id']); |
| 2399 | 2399 | $out .= $resourcestatic->getNomUrl(-1); |
| 2400 | 2400 | if ($nbassignetoresource > 1 && $action != 'view') { |
| 2401 | - $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 . '">'; |
|
| 2401 | + $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.'">'; |
|
| 2402 | 2402 | } |
| 2403 | 2403 | // Show my availability |
| 2404 | 2404 | if ($showproperties) { |
| 2405 | 2405 | if (is_array($listofresourceid) && count($listofresourceid)) { |
| 2406 | 2406 | $out .= '<div class="myavailability inline-block">'; |
| 2407 | - $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>'; |
|
| 2407 | + $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>'; |
|
| 2408 | 2408 | $out .= '</div>'; |
| 2409 | 2409 | } |
| 2410 | 2410 | } |
@@ -2421,11 +2421,11 @@ discard block |
||
| 2421 | 2421 | // Method with no ajax |
| 2422 | 2422 | if ($action != 'view') { |
| 2423 | 2423 | $out .= '<input type="hidden" class="removedassignedhidden" name="removedassignedresource" value="">'; |
| 2424 | - $out .= '<script nonce="' . getNonce() . '" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2424 | + $out .= '<script nonce="'.getNonce().'" type="text/javascript">jQuery(document).ready(function () {'; |
|
| 2425 | 2425 | $out .= 'jQuery(".removedassignedresource").click(function() { jQuery(".removedassignedresourcehidden").val(jQuery(this).val()); });'; |
| 2426 | 2426 | $out .= 'jQuery(".assignedtoresource").change(function() { console.log(jQuery(".assignedtoresource option:selected").val());'; |
| 2427 | - $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#' . $action . 'assignedtoresource").attr("disabled", false); }'; |
|
| 2428 | - $out .= ' else { jQuery("#' . $action . 'assignedtoresource").attr("disabled", true); }'; |
|
| 2427 | + $out .= ' if (jQuery(".assignedtoresource option:selected").val() > 0) { jQuery("#'.$action.'assignedtoresource").attr("disabled", false); }'; |
|
| 2428 | + $out .= ' else { jQuery("#'.$action.'assignedtoresource").attr("disabled", true); }'; |
|
| 2429 | 2429 | $out .= '});'; |
| 2430 | 2430 | $out .= '})</script>'; |
| 2431 | 2431 | |
@@ -2433,7 +2433,7 @@ discard block |
||
| 2433 | 2433 | $out .= img_picto('', 'resource', 'class="pictofixedwidth"'); |
| 2434 | 2434 | $out .= $formresources->select_resource_list(0, $htmlname, [], 1, 1, 0, $events, '', 2, 0); |
| 2435 | 2435 | //$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); |
| 2436 | - $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="' . $action . 'assignedtoresource" name="' . $action . 'assignedtoresource" value="' . dol_escape_htmltag($langs->trans("Add")) . '">'; |
|
| 2436 | + $out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtoresource" name="'.$action.'assignedtoresource" value="'.dol_escape_htmltag($langs->trans("Add")).'">'; |
|
| 2437 | 2437 | $out .= '<br>'; |
| 2438 | 2438 | } |
| 2439 | 2439 | |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | $placeholder = ''; |
| 2495 | 2495 | |
| 2496 | 2496 | if ($selected && empty($selected_input_value)) { |
| 2497 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2497 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2498 | 2498 | $producttmpselect = new Product($this->db); |
| 2499 | 2499 | $producttmpselect->fetch($selected); |
| 2500 | 2500 | $selected_input_value = $producttmpselect->ref; |
@@ -2509,17 +2509,17 @@ discard block |
||
| 2509 | 2509 | } |
| 2510 | 2510 | } |
| 2511 | 2511 | // mode=1 means customers products |
| 2512 | - $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; |
|
| 2513 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2512 | + $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; |
|
| 2513 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 2514 | 2514 | |
| 2515 | 2515 | if (isModEnabled('variants') && is_array($selected_combinations)) { |
| 2516 | 2516 | // Code to automatically insert with javascript the select of attributes under the select of product |
| 2517 | 2517 | // when a parent of variant has been selected. |
| 2518 | 2518 | $out .= ' |
| 2519 | 2519 | <!-- script to auto show attributes select tags if a variant was selected --> |
| 2520 | - <script nonce="' . getNonce() . '"> |
|
| 2520 | + <script nonce="' . getNonce().'"> |
|
| 2521 | 2521 | // auto show attributes fields |
| 2522 | - selected = ' . json_encode($selected_combinations) . '; |
|
| 2522 | + selected = ' . json_encode($selected_combinations).'; |
|
| 2523 | 2523 | combvalues = {}; |
| 2524 | 2524 | |
| 2525 | 2525 | jQuery(document).ready(function () { |
@@ -2530,7 +2530,7 @@ discard block |
||
| 2530 | 2530 | } |
| 2531 | 2531 | }); |
| 2532 | 2532 | |
| 2533 | - jQuery("input#' . $htmlname . '").change(function () { |
|
| 2533 | + jQuery("input#' . $htmlname.'").change(function () { |
|
| 2534 | 2534 | |
| 2535 | 2535 | if (!jQuery(this).val()) { |
| 2536 | 2536 | jQuery(\'div#attributes_box\').empty(); |
@@ -2539,7 +2539,7 @@ discard block |
||
| 2539 | 2539 | |
| 2540 | 2540 | console.log("A change has started. We get variants fields to inject html select"); |
| 2541 | 2541 | |
| 2542 | - jQuery.getJSON("' . DOL_URL_ROOT . '/variants/ajax/getCombinations.php", { |
|
| 2542 | + jQuery.getJSON("' . DOL_URL_ROOT.'/variants/ajax/getCombinations.php", { |
|
| 2543 | 2543 | id: jQuery(this).val() |
| 2544 | 2544 | }, function (data) { |
| 2545 | 2545 | jQuery(\'div#attributes_box\').empty(); |
@@ -2582,21 +2582,21 @@ discard block |
||
| 2582 | 2582 | }) |
| 2583 | 2583 | }); |
| 2584 | 2584 | |
| 2585 | - ' . ($selected ? 'jQuery("input#' . $htmlname . '").change();' : '') . ' |
|
| 2585 | + ' . ($selected ? 'jQuery("input#'.$htmlname.'").change();' : '').' |
|
| 2586 | 2586 | }); |
| 2587 | 2587 | </script> |
| 2588 | 2588 | '; |
| 2589 | 2589 | } |
| 2590 | 2590 | |
| 2591 | 2591 | if (empty($hidelabel)) { |
| 2592 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 2592 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 2593 | 2593 | } elseif ($hidelabel > 1) { |
| 2594 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 2594 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 2595 | 2595 | if ($hidelabel == 2) { |
| 2596 | 2596 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2597 | 2597 | } |
| 2598 | 2598 | } |
| 2599 | - $out .= '<input type="text" class="minwidth100' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 2599 | + $out .= '<input type="text" class="minwidth100'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 2600 | 2600 | if ($hidelabel == 3) { |
| 2601 | 2601 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 2602 | 2602 | } |
@@ -2633,33 +2633,33 @@ discard block |
||
| 2633 | 2633 | // phpcs:enable |
| 2634 | 2634 | global $conf, $user, $langs, $db; |
| 2635 | 2635 | |
| 2636 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2636 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2637 | 2637 | |
| 2638 | 2638 | $error = 0; |
| 2639 | 2639 | $out = ''; |
| 2640 | 2640 | |
| 2641 | 2641 | if (!$forcecombo) { |
| 2642 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2642 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2643 | 2643 | $events = array(); |
| 2644 | 2644 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2645 | 2645 | } |
| 2646 | 2646 | |
| 2647 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2647 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2648 | 2648 | |
| 2649 | 2649 | $sql = 'SELECT b.rowid, b.ref, b.label, b.fk_product'; |
| 2650 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bom_bom as b'; |
|
| 2651 | - $sql .= ' WHERE b.entity IN (' . getEntity('bom') . ')'; |
|
| 2650 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'bom_bom as b'; |
|
| 2651 | + $sql .= ' WHERE b.entity IN ('.getEntity('bom').')'; |
|
| 2652 | 2652 | if (!empty($status)) { |
| 2653 | - $sql .= ' AND status = ' . (int) $status; |
|
| 2653 | + $sql .= ' AND status = '.(int) $status; |
|
| 2654 | 2654 | } |
| 2655 | 2655 | if (!empty($type)) { |
| 2656 | - $sql .= ' AND bomtype = ' . (int) $type; |
|
| 2656 | + $sql .= ' AND bomtype = '.(int) $type; |
|
| 2657 | 2657 | } |
| 2658 | 2658 | if (!empty($TProducts)) { |
| 2659 | - $sql .= ' AND fk_product IN (' . $this->db->sanitize(implode(',', $TProducts)) . ')'; |
|
| 2659 | + $sql .= ' AND fk_product IN ('.$this->db->sanitize(implode(',', $TProducts)).')'; |
|
| 2660 | 2660 | } |
| 2661 | 2661 | if (!empty($limit)) { |
| 2662 | - $sql .= ' LIMIT ' . (int) $limit; |
|
| 2662 | + $sql .= ' LIMIT '.(int) $limit; |
|
| 2663 | 2663 | } |
| 2664 | 2664 | $resql = $db->query($sql); |
| 2665 | 2665 | if ($resql) { |
@@ -2673,11 +2673,11 @@ discard block |
||
| 2673 | 2673 | while ($obj = $db->fetch_object($resql)) { |
| 2674 | 2674 | $product = new Product($db); |
| 2675 | 2675 | $res = $product->fetch($obj->fk_product); |
| 2676 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 2676 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 2677 | 2677 | if ($obj->rowid == $selected) { |
| 2678 | 2678 | $out .= 'selected'; |
| 2679 | 2679 | } |
| 2680 | - $out .= '>' . $obj->ref . ' - ' . $product->label . ' - ' . $obj->label . '</option>'; |
|
| 2680 | + $out .= '>'.$obj->ref.' - '.$product->label.' - '.$obj->label.'</option>'; |
|
| 2681 | 2681 | } |
| 2682 | 2682 | } else { |
| 2683 | 2683 | $error++; |
@@ -2734,7 +2734,7 @@ discard block |
||
| 2734 | 2734 | |
| 2735 | 2735 | $warehouseStatusArray = array(); |
| 2736 | 2736 | if (!empty($warehouseStatus)) { |
| 2737 | - require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; |
|
| 2737 | + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; |
|
| 2738 | 2738 | if (preg_match('/warehouseclosed/', $warehouseStatus)) { |
| 2739 | 2739 | $warehouseStatusArray[] = Entrepot::STATUS_CLOSED; |
| 2740 | 2740 | } |
@@ -2748,9 +2748,9 @@ discard block |
||
| 2748 | 2748 | |
| 2749 | 2749 | $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"; |
| 2750 | 2750 | if (count($warehouseStatusArray)) { |
| 2751 | - $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 |
|
| 2751 | + $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 |
|
| 2752 | 2752 | } else { |
| 2753 | - $selectFieldsGrouped = ", " . $this->db->ifsql("p.stock IS NULL", 0, "p.stock") . " AS stock"; |
|
| 2753 | + $selectFieldsGrouped = ", ".$this->db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; |
|
| 2754 | 2754 | } |
| 2755 | 2755 | |
| 2756 | 2756 | $sql = "SELECT "; |
@@ -2766,9 +2766,9 @@ discard block |
||
| 2766 | 2766 | |
| 2767 | 2767 | if (getDolGlobalString('PRODUCT_SORT_BY_CATEGORY')) { |
| 2768 | 2768 | //Product category |
| 2769 | - $sql .= ", (SELECT " . $this->db->prefix() . "categorie_product.fk_categorie |
|
| 2770 | - FROM " . $this->db->prefix() . "categorie_product |
|
| 2771 | - WHERE " . $this->db->prefix() . "categorie_product.fk_product=p.rowid |
|
| 2769 | + $sql .= ", (SELECT ".$this->db->prefix()."categorie_product.fk_categorie |
|
| 2770 | + FROM " . $this->db->prefix()."categorie_product |
|
| 2771 | + WHERE " . $this->db->prefix()."categorie_product.fk_product=p.rowid |
|
| 2772 | 2772 | LIMIT 1 |
| 2773 | 2773 | ) AS categorie_product_id "; |
| 2774 | 2774 | } |
@@ -2794,15 +2794,15 @@ discard block |
||
| 2794 | 2794 | } |
| 2795 | 2795 | // Price by quantity |
| 2796 | 2796 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2797 | - $sql .= ", (SELECT pp.rowid FROM " . $this->db->prefix() . "product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2797 | + $sql .= ", (SELECT pp.rowid FROM ".$this->db->prefix()."product_price as pp WHERE pp.fk_product = p.rowid"; |
|
| 2798 | 2798 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2799 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2799 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2800 | 2800 | } |
| 2801 | 2801 | $sql .= " ORDER BY date_price"; |
| 2802 | 2802 | $sql .= " DESC LIMIT 1) as price_rowid"; |
| 2803 | - $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 |
|
| 2803 | + $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 |
|
| 2804 | 2804 | if ($price_level >= 1 && getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { |
| 2805 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 2805 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 2806 | 2806 | } |
| 2807 | 2807 | $sql .= " ORDER BY date_price"; |
| 2808 | 2808 | $sql .= " DESC LIMIT 1) as price_by_qty"; |
@@ -2816,53 +2816,53 @@ discard block |
||
| 2816 | 2816 | $sql .= $hookmanager->resPrint; |
| 2817 | 2817 | |
| 2818 | 2818 | if (count($warehouseStatusArray)) { |
| 2819 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2820 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (" . getEntity('stock') . ")"; |
|
| 2821 | - $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. |
|
| 2819 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as ps on ps.fk_product = p.rowid"; |
|
| 2820 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")"; |
|
| 2821 | + $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. |
|
| 2822 | 2822 | } |
| 2823 | 2823 | |
| 2824 | 2824 | // include search in supplier ref |
| 2825 | 2825 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 2826 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2826 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 2827 | 2827 | } |
| 2828 | 2828 | |
| 2829 | 2829 | //Price by customer |
| 2830 | 2830 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 2831 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_customer_price as pcp ON pcp.fk_soc=" . ((int) $socid) . " AND pcp.fk_product=p.rowid"; |
|
| 2831 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid"; |
|
| 2832 | 2832 | } |
| 2833 | 2833 | // Units |
| 2834 | 2834 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 2835 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 2835 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 2836 | 2836 | } |
| 2837 | 2837 | // Multilang : we add translation |
| 2838 | 2838 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2839 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2839 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_lang as pl ON pl.fk_product = p.rowid "; |
|
| 2840 | 2840 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE') && !empty($socid)) { |
| 2841 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 2841 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 2842 | 2842 | $soc = new Societe($this->db); |
| 2843 | 2843 | $result = $soc->fetch($socid); |
| 2844 | 2844 | if ($result > 0 && !empty($soc->default_lang)) { |
| 2845 | - $sql .= " AND pl.lang = '" . $this->db->escape($soc->default_lang) . "'"; |
|
| 2845 | + $sql .= " AND pl.lang = '".$this->db->escape($soc->default_lang)."'"; |
|
| 2846 | 2846 | } else { |
| 2847 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2847 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2848 | 2848 | } |
| 2849 | 2849 | } else { |
| 2850 | - $sql .= " AND pl.lang = '" . $this->db->escape($langs->getDefaultLang()) . "'"; |
|
| 2850 | + $sql .= " AND pl.lang = '".$this->db->escape($langs->getDefaultLang())."'"; |
|
| 2851 | 2851 | } |
| 2852 | 2852 | } |
| 2853 | 2853 | |
| 2854 | 2854 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 2855 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2855 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_attribute_combination pac ON pac.fk_product_child = p.rowid"; |
|
| 2856 | 2856 | } |
| 2857 | 2857 | |
| 2858 | - $sql .= ' WHERE p.entity IN (' . getEntity('product') . ')'; |
|
| 2858 | + $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; |
|
| 2859 | 2859 | |
| 2860 | 2860 | if (getDolGlobalString('PRODUIT_ATTRIBUTES_HIDECHILD')) { |
| 2861 | 2861 | $sql .= " AND pac.rowid IS NULL"; |
| 2862 | 2862 | } |
| 2863 | 2863 | |
| 2864 | 2864 | if ($finished == 0) { |
| 2865 | - $sql .= " AND p.finished = " . ((int) $finished); |
|
| 2865 | + $sql .= " AND p.finished = ".((int) $finished); |
|
| 2866 | 2866 | } elseif ($finished == 1) { |
| 2867 | 2867 | $sql .= " AND p.finished = ".((int) $finished); |
| 2868 | 2868 | } |
@@ -2870,11 +2870,11 @@ discard block |
||
| 2870 | 2870 | $sql .= " AND p.tosell = ".((int) $status); |
| 2871 | 2871 | } |
| 2872 | 2872 | if ($status_purchase >= 0) { |
| 2873 | - $sql .= " AND p.tobuy = " . ((int) $status_purchase); |
|
| 2873 | + $sql .= " AND p.tobuy = ".((int) $status_purchase); |
|
| 2874 | 2874 | } |
| 2875 | 2875 | // Filter by product type |
| 2876 | 2876 | if (strval($filtertype) != '') { |
| 2877 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 2877 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 2878 | 2878 | } elseif (!isModEnabled('product')) { // when product module is disabled, show services only |
| 2879 | 2879 | $sql .= " AND p.fk_product_type = 1"; |
| 2880 | 2880 | } elseif (!isModEnabled('service')) { // when service module is disabled, show products only |
@@ -2898,21 +2898,21 @@ discard block |
||
| 2898 | 2898 | if ($i > 0) { |
| 2899 | 2899 | $sql .= " AND "; |
| 2900 | 2900 | } |
| 2901 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2901 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2902 | 2902 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2903 | - $sql .= " OR pl.label LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2903 | + $sql .= " OR pl.label LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2904 | 2904 | } |
| 2905 | 2905 | if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') && !empty($socid)) { |
| 2906 | - $sql .= " OR pcp.ref_customer LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2906 | + $sql .= " OR pcp.ref_customer LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2907 | 2907 | } |
| 2908 | 2908 | if (getDolGlobalString('PRODUCT_AJAX_SEARCH_ON_DESCRIPTION')) { |
| 2909 | - $sql .= " OR p.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2909 | + $sql .= " OR p.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2910 | 2910 | if (getDolGlobalInt('MAIN_MULTILANGS')) { |
| 2911 | - $sql .= " OR pl.description LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2911 | + $sql .= " OR pl.description LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2912 | 2912 | } |
| 2913 | 2913 | } |
| 2914 | 2914 | if (getDolGlobalString('MAIN_SEARCH_PRODUCT_BY_FOURN_REF')) { |
| 2915 | - $sql .= " OR pfp.ref_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 2915 | + $sql .= " OR pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 2916 | 2916 | } |
| 2917 | 2917 | $sql .= ")"; |
| 2918 | 2918 | $i++; |
@@ -2921,12 +2921,12 @@ discard block |
||
| 2921 | 2921 | $sql .= ")"; |
| 2922 | 2922 | } |
| 2923 | 2923 | if (isModEnabled('barcode')) { |
| 2924 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 2924 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 2925 | 2925 | } |
| 2926 | 2926 | $sql .= ')'; |
| 2927 | 2927 | } |
| 2928 | 2928 | if (count($warehouseStatusArray)) { |
| 2929 | - $sql .= " GROUP BY " . $selectFields; |
|
| 2929 | + $sql .= " GROUP BY ".$selectFields; |
|
| 2930 | 2930 | } |
| 2931 | 2931 | |
| 2932 | 2932 | //Sort by category |
@@ -2941,23 +2941,23 @@ discard block |
||
| 2941 | 2941 | $sql .= $this->db->plimit($limit, 0); |
| 2942 | 2942 | |
| 2943 | 2943 | // Build output string |
| 2944 | - dol_syslog(get_class($this) . "::select_produits_list search products", LOG_DEBUG); |
|
| 2944 | + dol_syslog(get_class($this)."::select_produits_list search products", LOG_DEBUG); |
|
| 2945 | 2945 | $result = $this->db->query($sql); |
| 2946 | 2946 | if ($result) { |
| 2947 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 2948 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 2949 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 2947 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 2948 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 2949 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 2950 | 2950 | |
| 2951 | 2951 | $num = $this->db->num_rows($result); |
| 2952 | 2952 | |
| 2953 | 2953 | $events = null; |
| 2954 | 2954 | |
| 2955 | 2955 | if (!$forcecombo) { |
| 2956 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 2956 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 2957 | 2957 | $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); |
| 2958 | 2958 | } |
| 2959 | 2959 | |
| 2960 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 2960 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 2961 | 2961 | |
| 2962 | 2962 | $textifempty = ''; |
| 2963 | 2963 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -2974,7 +2974,7 @@ discard block |
||
| 2974 | 2974 | } |
| 2975 | 2975 | } |
| 2976 | 2976 | if ($showempty) { |
| 2977 | - $out .= '<option value="-1" selected>' . ($textifempty ? $textifempty : ' ') . '</option>'; |
|
| 2977 | + $out .= '<option value="-1" selected>'.($textifempty ? $textifempty : ' ').'</option>'; |
|
| 2978 | 2978 | } |
| 2979 | 2979 | |
| 2980 | 2980 | $i = 0; |
@@ -2985,11 +2985,11 @@ discard block |
||
| 2985 | 2985 | |
| 2986 | 2986 | 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 |
| 2987 | 2987 | $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise, price_base_type"; |
| 2988 | - $sql .= " FROM " . $this->db->prefix() . "product_price_by_qty"; |
|
| 2989 | - $sql .= " WHERE fk_product_price = " . ((int) $objp->price_rowid); |
|
| 2988 | + $sql .= " FROM ".$this->db->prefix()."product_price_by_qty"; |
|
| 2989 | + $sql .= " WHERE fk_product_price = ".((int) $objp->price_rowid); |
|
| 2990 | 2990 | $sql .= " ORDER BY quantity ASC"; |
| 2991 | 2991 | |
| 2992 | - dol_syslog(get_class($this) . "::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2992 | + dol_syslog(get_class($this)."::select_produits_list search prices by qty", LOG_DEBUG); |
|
| 2993 | 2993 | $result2 = $this->db->query($sql); |
| 2994 | 2994 | if ($result2) { |
| 2995 | 2995 | $nb_prices = $this->db->num_rows($result2); |
@@ -3027,7 +3027,7 @@ discard block |
||
| 3027 | 3027 | $price_product = new Product($this->db); |
| 3028 | 3028 | $price_product->fetch($objp->rowid, '', '', 1); |
| 3029 | 3029 | |
| 3030 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3030 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3031 | 3031 | $priceparser = new PriceParser($this->db); |
| 3032 | 3032 | $price_result = $priceparser->parseProduct($price_product); |
| 3033 | 3033 | if ($price_result >= 0) { |
@@ -3111,7 +3111,7 @@ discard block |
||
| 3111 | 3111 | $label = $objp->label_translated; |
| 3112 | 3112 | } |
| 3113 | 3113 | if (!empty($filterkey) && $filterkey != '') { |
| 3114 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3114 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | $outkey = $objp->rowid; |
@@ -3132,32 +3132,32 @@ discard block |
||
| 3132 | 3132 | $outdurationunit = $outtype == Product::TYPE_SERVICE ? substr($objp->duration, -1) : ''; |
| 3133 | 3133 | |
| 3134 | 3134 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3135 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 3135 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 3136 | 3136 | } |
| 3137 | 3137 | |
| 3138 | 3138 | // Units |
| 3139 | 3139 | $outvalUnits = ''; |
| 3140 | 3140 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3141 | 3141 | if (!empty($objp->unit_short)) { |
| 3142 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3142 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3143 | 3143 | } |
| 3144 | 3144 | } |
| 3145 | 3145 | if (getDolGlobalString('PRODUCT_SHOW_DIMENSIONS_IN_COMBO')) { |
| 3146 | 3146 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3147 | 3147 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3148 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3148 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3149 | 3149 | } |
| 3150 | 3150 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3151 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3152 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3151 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3152 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3153 | 3153 | } |
| 3154 | 3154 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3155 | 3155 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3156 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3156 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3157 | 3157 | } |
| 3158 | 3158 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3159 | 3159 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3160 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3160 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3161 | 3161 | } |
| 3162 | 3162 | } |
| 3163 | 3163 | if ($outdurationvalue && $outdurationunit) { |
@@ -3169,14 +3169,14 @@ discard block |
||
| 3169 | 3169 | 'y' => $langs->trans('Year') |
| 3170 | 3170 | ); |
| 3171 | 3171 | if (isset($da[$outdurationunit])) { |
| 3172 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3172 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3173 | 3173 | } |
| 3174 | 3174 | } |
| 3175 | 3175 | |
| 3176 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 3176 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 3177 | 3177 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 3178 | 3178 | if (!empty($objp->price_by_qty_rowid) && $objp->price_by_qty_rowid > 0) { |
| 3179 | - $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 . '"'; |
|
| 3179 | + $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.'"'; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3182 | 3182 | if ($user->hasRight('stock', 'lire')) { |
@@ -3188,36 +3188,36 @@ discard block |
||
| 3188 | 3188 | } |
| 3189 | 3189 | } |
| 3190 | 3190 | if (getDolGlobalString('PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE')) { |
| 3191 | - $opt .= ' data-labeltrans="' . $outlabel_translated . '"'; |
|
| 3192 | - $opt .= ' data-desctrans="' . dol_escape_htmltag($outdesc_translated) . '"'; |
|
| 3191 | + $opt .= ' data-labeltrans="'.$outlabel_translated.'"'; |
|
| 3192 | + $opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"'; |
|
| 3193 | 3193 | } |
| 3194 | 3194 | $opt .= '>'; |
| 3195 | 3195 | $opt .= $objp->ref; |
| 3196 | 3196 | if (!empty($objp->custref)) { |
| 3197 | - $opt .= ' (' . $objp->custref . ')'; |
|
| 3197 | + $opt .= ' ('.$objp->custref.')'; |
|
| 3198 | 3198 | } |
| 3199 | 3199 | if ($outbarcode) { |
| 3200 | - $opt .= ' (' . $outbarcode . ')'; |
|
| 3200 | + $opt .= ' ('.$outbarcode.')'; |
|
| 3201 | 3201 | } |
| 3202 | - $opt .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3202 | + $opt .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3203 | 3203 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3204 | - $opt .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3204 | + $opt .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3205 | 3205 | } |
| 3206 | 3206 | |
| 3207 | 3207 | $objRef = $objp->ref; |
| 3208 | 3208 | if (!empty($objp->custref)) { |
| 3209 | - $objRef .= ' (' . $objp->custref . ')'; |
|
| 3209 | + $objRef .= ' ('.$objp->custref.')'; |
|
| 3210 | 3210 | } |
| 3211 | 3211 | if (!empty($filterkey) && $filterkey != '') { |
| 3212 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3212 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3213 | 3213 | } |
| 3214 | 3214 | $outval .= $objRef; |
| 3215 | 3215 | if ($outbarcode) { |
| 3216 | - $outval .= ' (' . $outbarcode . ')'; |
|
| 3216 | + $outval .= ' ('.$outbarcode.')'; |
|
| 3217 | 3217 | } |
| 3218 | - $outval .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3218 | + $outval .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3219 | 3219 | if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) { |
| 3220 | - $outval .= ' (' . getCountry($outorigin, 1) . ')'; |
|
| 3220 | + $outval .= ' ('.getCountry($outorigin, 1).')'; |
|
| 3221 | 3221 | } |
| 3222 | 3222 | |
| 3223 | 3223 | // Units |
@@ -3230,35 +3230,35 @@ discard block |
||
| 3230 | 3230 | // If we need a particular price level (from 1 to n) |
| 3231 | 3231 | if (empty($hidepriceinlabel) && $price_level >= 1 && (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES'))) { |
| 3232 | 3232 | $sql = "SELECT price, price_ttc, price_base_type, tva_tx, default_vat_code"; |
| 3233 | - $sql .= " FROM " . $this->db->prefix() . "product_price"; |
|
| 3234 | - $sql .= " WHERE fk_product = " . ((int) $objp->rowid); |
|
| 3235 | - $sql .= " AND entity IN (" . getEntity('productprice') . ")"; |
|
| 3236 | - $sql .= " AND price_level = " . ((int) $price_level); |
|
| 3233 | + $sql .= " FROM ".$this->db->prefix()."product_price"; |
|
| 3234 | + $sql .= " WHERE fk_product = ".((int) $objp->rowid); |
|
| 3235 | + $sql .= " AND entity IN (".getEntity('productprice').")"; |
|
| 3236 | + $sql .= " AND price_level = ".((int) $price_level); |
|
| 3237 | 3237 | $sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid. |
| 3238 | 3238 | $sql .= " LIMIT 1"; |
| 3239 | 3239 | |
| 3240 | - dol_syslog(get_class($this) . '::constructProductListOption search price for product ' . $objp->rowid . ' AND level ' . $price_level, LOG_DEBUG); |
|
| 3240 | + dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level, LOG_DEBUG); |
|
| 3241 | 3241 | $result2 = $this->db->query($sql); |
| 3242 | 3242 | if ($result2) { |
| 3243 | 3243 | $objp2 = $this->db->fetch_object($result2); |
| 3244 | 3244 | if ($objp2) { |
| 3245 | 3245 | $found = 1; |
| 3246 | 3246 | if ($objp2->price_base_type == 'HT') { |
| 3247 | - $opt .= ' - ' . price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3248 | - $outval .= ' - ' . price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3247 | + $opt .= ' - '.price($objp2->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3248 | + $outval .= ' - '.price($objp2->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3249 | 3249 | } else { |
| 3250 | - $opt .= ' - ' . price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3251 | - $outval .= ' - ' . price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3250 | + $opt .= ' - '.price($objp2->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3251 | + $outval .= ' - '.price($objp2->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3252 | 3252 | } |
| 3253 | 3253 | $outprice_ht = price($objp2->price); |
| 3254 | 3254 | $outprice_ttc = price($objp2->price_ttc); |
| 3255 | 3255 | $outpricebasetype = $objp2->price_base_type; |
| 3256 | 3256 | if (getDolGlobalString('PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL')) { // using this option is a bug. kept for backward compatibility |
| 3257 | - $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3258 | - $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3257 | + $outtva_tx = $objp2->tva_tx; // We use the vat rate on line of multiprice |
|
| 3258 | + $outdefault_vat_code = $objp2->default_vat_code; // We use the vat code on line of multiprice |
|
| 3259 | 3259 | } else { |
| 3260 | - $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3261 | - $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3260 | + $outtva_tx = $objp->tva_tx; // We use the vat rate of product, not the one on line of multiprice |
|
| 3261 | + $outdefault_vat_code = $objp->default_vat_code; // We use the vat code or product, not the one on line of multiprice |
|
| 3262 | 3262 | } |
| 3263 | 3263 | } |
| 3264 | 3264 | } else { |
@@ -3272,13 +3272,13 @@ discard block |
||
| 3272 | 3272 | $outqty = $objp->quantity; |
| 3273 | 3273 | $outdiscount = $objp->remise_percent; |
| 3274 | 3274 | if ($objp->quantity == 1) { |
| 3275 | - $opt .= ' - ' . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3276 | - $outval .= ' - ' . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3275 | + $opt .= ' - '.price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3276 | + $outval .= ' - '.price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3277 | 3277 | $opt .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3278 | 3278 | $outval .= $langs->transnoentities("Unit"); |
| 3279 | 3279 | } else { |
| 3280 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3281 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3280 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3281 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3282 | 3282 | $opt .= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
| 3283 | 3283 | $outval .= $langs->transnoentities("Units"); |
| 3284 | 3284 | } |
@@ -3286,16 +3286,16 @@ discard block |
||
| 3286 | 3286 | $outprice_ht = price($objp->unitprice); |
| 3287 | 3287 | $outprice_ttc = price($objp->unitprice * (1 + ($objp->tva_tx / 100))); |
| 3288 | 3288 | $outpricebasetype = $objp->price_base_type; |
| 3289 | - $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 |
|
| 3290 | - $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 |
|
| 3289 | + $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 |
|
| 3290 | + $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 |
|
| 3291 | 3291 | } |
| 3292 | 3292 | if (empty($hidepriceinlabel) && !empty($objp->quantity) && $objp->quantity >= 1) { |
| 3293 | - $opt .= " (" . price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->trans("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3294 | - $outval .= " (" . price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency) . "/" . $langs->transnoentities("Unit") . ")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3293 | + $opt .= " (".price($objp->unitprice, 1, $langs, 0, 0, -1, $conf->currency)."/".$langs->trans("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3294 | + $outval .= " (".price($objp->unitprice, 0, $langs, 0, 0, -1, $conf->currency)."/".$langs->transnoentities("Unit").")"; // Do not use strtolower because it breaks utf8 encoding |
|
| 3295 | 3295 | } |
| 3296 | 3296 | if (empty($hidepriceinlabel) && !empty($objp->remise_percent) && $objp->remise_percent >= 1) { |
| 3297 | - $opt .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3298 | - $outval .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3297 | + $opt .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3298 | + $outval .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3299 | 3299 | } |
| 3300 | 3300 | |
| 3301 | 3301 | // Price by customer |
@@ -3304,11 +3304,11 @@ discard block |
||
| 3304 | 3304 | $found = 1; |
| 3305 | 3305 | |
| 3306 | 3306 | if ($objp->custprice_base_type == 'HT') { |
| 3307 | - $opt .= ' - ' . price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3308 | - $outval .= ' - ' . price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3307 | + $opt .= ' - '.price($objp->custprice, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3308 | + $outval .= ' - '.price($objp->custprice, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3309 | 3309 | } else { |
| 3310 | - $opt .= ' - ' . price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3311 | - $outval .= ' - ' . price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3310 | + $opt .= ' - '.price($objp->custprice_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3311 | + $outval .= ' - '.price($objp->custprice_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3312 | 3312 | } |
| 3313 | 3313 | |
| 3314 | 3314 | $outprice_ht = price($objp->custprice); |
@@ -3322,11 +3322,11 @@ discard block |
||
| 3322 | 3322 | // If level no defined or multiprice not found, we used the default price |
| 3323 | 3323 | if (empty($hidepriceinlabel) && !$found) { |
| 3324 | 3324 | if ($objp->price_base_type == 'HT') { |
| 3325 | - $opt .= ' - ' . price($objp->price, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("HT"); |
|
| 3326 | - $outval .= ' - ' . price($objp->price, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("HT"); |
|
| 3325 | + $opt .= ' - '.price($objp->price, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("HT"); |
|
| 3326 | + $outval .= ' - '.price($objp->price, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("HT"); |
|
| 3327 | 3327 | } else { |
| 3328 | - $opt .= ' - ' . price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->trans("TTC"); |
|
| 3329 | - $outval .= ' - ' . price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency) . ' ' . $langs->transnoentities("TTC"); |
|
| 3328 | + $opt .= ' - '.price($objp->price_ttc, 1, $langs, 0, 0, -1, $conf->currency).' '.$langs->trans("TTC"); |
|
| 3329 | + $outval .= ' - '.price($objp->price_ttc, 0, $langs, 0, 0, -1, $conf->currency).' '.$langs->transnoentities("TTC"); |
|
| 3330 | 3330 | } |
| 3331 | 3331 | $outprice_ht = price($objp->price); |
| 3332 | 3332 | $outprice_ttc = price($objp->price_ttc); |
@@ -3337,14 +3337,14 @@ discard block |
||
| 3337 | 3337 | |
| 3338 | 3338 | if (isModEnabled('stock') && isset($objp->stock) && ($objp->fk_product_type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { |
| 3339 | 3339 | if ($user->hasRight('stock', 'lire')) { |
| 3340 | - $opt .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3340 | + $opt .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3341 | 3341 | |
| 3342 | 3342 | if ($objp->stock > 0) { |
| 3343 | 3343 | $outval .= ' - <span class="product_line_stock_ok">'; |
| 3344 | 3344 | } elseif ($objp->stock <= 0) { |
| 3345 | 3345 | $outval .= ' - <span class="product_line_stock_too_low">'; |
| 3346 | 3346 | } |
| 3347 | - $outval .= $langs->transnoentities("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3347 | + $outval .= $langs->transnoentities("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3348 | 3348 | $outval .= '</span>'; |
| 3349 | 3349 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3350 | 3350 | $langs->load("stocks"); |
@@ -3354,9 +3354,9 @@ discard block |
||
| 3354 | 3354 | $tmpproduct->load_virtual_stock(); |
| 3355 | 3355 | $virtualstock = $tmpproduct->stock_theorique; |
| 3356 | 3356 | |
| 3357 | - $opt .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3357 | + $opt .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3358 | 3358 | |
| 3359 | - $outval .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3359 | + $outval .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3360 | 3360 | if ($virtualstock > 0) { |
| 3361 | 3361 | $outval .= '<span class="product_line_stock_ok">'; |
| 3362 | 3362 | } elseif ($virtualstock <= 0) { |
@@ -3434,7 +3434,7 @@ discard block |
||
| 3434 | 3434 | $selected_input_value = ''; |
| 3435 | 3435 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) { |
| 3436 | 3436 | if ($selected > 0) { |
| 3437 | - require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
| 3437 | + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
| 3438 | 3438 | $producttmpselect = new Product($this->db); |
| 3439 | 3439 | $producttmpselect->fetch($selected); |
| 3440 | 3440 | $selected_input_value = $producttmpselect->ref; |
@@ -3442,10 +3442,10 @@ discard block |
||
| 3442 | 3442 | } |
| 3443 | 3443 | |
| 3444 | 3444 | // mode=2 means suppliers products |
| 3445 | - $urloption = ($socid > 0 ? 'socid=' . $socid . '&' : '') . 'htmlname=' . $htmlname . '&outjson=1&price_level=' . $price_level . '&type=' . $filtertype . '&mode=2&status=' . $status . '&finished=' . $finished . '&alsoproductwithnosupplierprice=' . $alsoproductwithnosupplierprice; |
|
| 3446 | - print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3445 | + $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; |
|
| 3446 | + print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); |
|
| 3447 | 3447 | |
| 3448 | - print($hidelabel ? '' : $langs->trans("RefOrLabel") . ' : ') . '<input type="text" class="minwidth300" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . $placeholder . '"' : '') . '>'; |
|
| 3448 | + print($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>'; |
|
| 3449 | 3449 | } else { |
| 3450 | 3450 | print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); |
| 3451 | 3451 | } |
@@ -3508,25 +3508,25 @@ discard block |
||
| 3508 | 3508 | if (isModEnabled('barcode')) { |
| 3509 | 3509 | $sql .= ", pfp.barcode"; |
| 3510 | 3510 | } |
| 3511 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3512 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (" . getEntity('product') . ") )"; |
|
| 3511 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3512 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; |
|
| 3513 | 3513 | if ($socid > 0) { |
| 3514 | - $sql .= " AND pfp.fk_soc = " . ((int) $socid); |
|
| 3514 | + $sql .= " AND pfp.fk_soc = ".((int) $socid); |
|
| 3515 | 3515 | } |
| 3516 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3516 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3517 | 3517 | // Units |
| 3518 | 3518 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3519 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "c_units u ON u.rowid = p.fk_unit"; |
|
| 3519 | + $sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit"; |
|
| 3520 | 3520 | } |
| 3521 | - $sql .= " WHERE p.entity IN (" . getEntity('product') . ")"; |
|
| 3521 | + $sql .= " WHERE p.entity IN (".getEntity('product').")"; |
|
| 3522 | 3522 | if ($statut != -1) { |
| 3523 | - $sql .= " AND p.tobuy = " . ((int) $statut); |
|
| 3523 | + $sql .= " AND p.tobuy = ".((int) $statut); |
|
| 3524 | 3524 | } |
| 3525 | 3525 | if (strval($filtertype) != '') { |
| 3526 | - $sql .= " AND p.fk_product_type = " . ((int) $filtertype); |
|
| 3526 | + $sql .= " AND p.fk_product_type = ".((int) $filtertype); |
|
| 3527 | 3527 | } |
| 3528 | 3528 | if (!empty($filtre)) { |
| 3529 | - $sql .= " " . $filtre; |
|
| 3529 | + $sql .= " ".$filtre; |
|
| 3530 | 3530 | } |
| 3531 | 3531 | // Add where from hooks |
| 3532 | 3532 | $parameters = array(); |
@@ -3546,9 +3546,9 @@ discard block |
||
| 3546 | 3546 | if ($i > 0) { |
| 3547 | 3547 | $sql .= " AND "; |
| 3548 | 3548 | } |
| 3549 | - $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) . "%'"; |
|
| 3549 | + $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)."%'"; |
|
| 3550 | 3550 | if (getDolGlobalString('PRODUIT_FOURN_TEXTS')) { |
| 3551 | - $sql .= " OR pfp.desc_fourn LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 3551 | + $sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 3552 | 3552 | } |
| 3553 | 3553 | $sql .= ")"; |
| 3554 | 3554 | $i++; |
@@ -3557,8 +3557,8 @@ discard block |
||
| 3557 | 3557 | $sql .= ")"; |
| 3558 | 3558 | } |
| 3559 | 3559 | if (isModEnabled('barcode')) { |
| 3560 | - $sql .= " OR p.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3561 | - $sql .= " OR pfp.barcode LIKE '" . $this->db->escape($prefix . $filterkey) . "%'"; |
|
| 3560 | + $sql .= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3561 | + $sql .= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; |
|
| 3562 | 3562 | } |
| 3563 | 3563 | $sql .= ')'; |
| 3564 | 3564 | } |
@@ -3567,20 +3567,20 @@ discard block |
||
| 3567 | 3567 | |
| 3568 | 3568 | // Build output string |
| 3569 | 3569 | |
| 3570 | - dol_syslog(get_class($this) . "::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3570 | + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); |
|
| 3571 | 3571 | $result = $this->db->query($sql); |
| 3572 | 3572 | if ($result) { |
| 3573 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3574 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php'; |
|
| 3573 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3574 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; |
|
| 3575 | 3575 | |
| 3576 | 3576 | $num = $this->db->num_rows($result); |
| 3577 | 3577 | |
| 3578 | 3578 | //$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax |
| 3579 | - $out .= '<select class="flat ' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3579 | + $out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3580 | 3580 | if (!$selected) { |
| 3581 | - $out .= '<option value="-1" selected>' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3581 | + $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3582 | 3582 | } else { |
| 3583 | - $out .= '<option value="-1">' . ($placeholder ? $placeholder : ' ') . '</option>'; |
|
| 3583 | + $out .= '<option value="-1">'.($placeholder ? $placeholder : ' ').'</option>'; |
|
| 3584 | 3584 | } |
| 3585 | 3585 | |
| 3586 | 3586 | $i = 0; |
@@ -3595,7 +3595,7 @@ discard block |
||
| 3595 | 3595 | |
| 3596 | 3596 | $outkey = $objp->idprodfournprice; // id in table of price |
| 3597 | 3597 | if (!$outkey && $alsoproductwithnosupplierprice) { |
| 3598 | - $outkey = 'idprod_' . $objp->rowid; // id of product |
|
| 3598 | + $outkey = 'idprod_'.$objp->rowid; // id of product |
|
| 3599 | 3599 | } |
| 3600 | 3600 | |
| 3601 | 3601 | $outref = $objp->ref; |
@@ -3610,23 +3610,23 @@ discard block |
||
| 3610 | 3610 | $outvalUnits = ''; |
| 3611 | 3611 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 3612 | 3612 | if (!empty($objp->unit_short)) { |
| 3613 | - $outvalUnits .= ' - ' . $objp->unit_short; |
|
| 3613 | + $outvalUnits .= ' - '.$objp->unit_short; |
|
| 3614 | 3614 | } |
| 3615 | 3615 | if (!empty($objp->weight) && $objp->weight_units !== null) { |
| 3616 | 3616 | $unitToShow = showDimensionInBestUnit($objp->weight, $objp->weight_units, 'weight', $langs); |
| 3617 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3617 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3618 | 3618 | } |
| 3619 | 3619 | if ((!empty($objp->length) || !empty($objp->width) || !empty($objp->height)) && $objp->length_units !== null) { |
| 3620 | - $unitToShow = $objp->length . ' x ' . $objp->width . ' x ' . $objp->height . ' ' . measuringUnitString(0, 'size', $objp->length_units); |
|
| 3621 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3620 | + $unitToShow = $objp->length.' x '.$objp->width.' x '.$objp->height.' '.measuringUnitString(0, 'size', $objp->length_units); |
|
| 3621 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3622 | 3622 | } |
| 3623 | 3623 | if (!empty($objp->surface) && $objp->surface_units !== null) { |
| 3624 | 3624 | $unitToShow = showDimensionInBestUnit($objp->surface, $objp->surface_units, 'surface', $langs); |
| 3625 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3625 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3626 | 3626 | } |
| 3627 | 3627 | if (!empty($objp->volume) && $objp->volume_units !== null) { |
| 3628 | 3628 | $unitToShow = showDimensionInBestUnit($objp->volume, $objp->volume_units, 'volume', $langs); |
| 3629 | - $outvalUnits .= ' - ' . $unitToShow; |
|
| 3629 | + $outvalUnits .= ' - '.$unitToShow; |
|
| 3630 | 3630 | } |
| 3631 | 3631 | if ($outdurationvalue && $outdurationunit) { |
| 3632 | 3632 | $da = array( |
@@ -3637,22 +3637,22 @@ discard block |
||
| 3637 | 3637 | 'y' => $langs->trans('Year') |
| 3638 | 3638 | ); |
| 3639 | 3639 | if (isset($da[$outdurationunit])) { |
| 3640 | - $outvalUnits .= ' - ' . $outdurationvalue . ' ' . $langs->transnoentities($da[$outdurationunit] . ($outdurationvalue > 1 ? 's' : '')); |
|
| 3640 | + $outvalUnits .= ' - '.$outdurationvalue.' '.$langs->transnoentities($da[$outdurationunit].($outdurationvalue > 1 ? 's' : '')); |
|
| 3641 | 3641 | } |
| 3642 | 3642 | } |
| 3643 | 3643 | } |
| 3644 | 3644 | |
| 3645 | 3645 | $objRef = $objp->ref; |
| 3646 | 3646 | if ($filterkey && $filterkey != '') { |
| 3647 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3647 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 3648 | 3648 | } |
| 3649 | 3649 | $objRefFourn = $objp->ref_fourn; |
| 3650 | 3650 | if ($filterkey && $filterkey != '') { |
| 3651 | - $objRefFourn = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3651 | + $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1); |
|
| 3652 | 3652 | } |
| 3653 | 3653 | $label = $objp->label; |
| 3654 | 3654 | if ($filterkey && $filterkey != '') { |
| 3655 | - $label = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $label, 1); |
|
| 3655 | + $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1); |
|
| 3656 | 3656 | } |
| 3657 | 3657 | |
| 3658 | 3658 | switch ($objp->fk_product_type) { |
@@ -3675,21 +3675,21 @@ discard block |
||
| 3675 | 3675 | |
| 3676 | 3676 | $optlabel .= $objp->ref; |
| 3677 | 3677 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3678 | - $optlabel .= ' <span class="opacitymedium">(' . $objp->ref_fourn . ')</span>'; |
|
| 3678 | + $optlabel .= ' <span class="opacitymedium">('.$objp->ref_fourn.')</span>'; |
|
| 3679 | 3679 | } |
| 3680 | 3680 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3681 | - $optlabel .= ' (' . $outbarcode . ')'; |
|
| 3681 | + $optlabel .= ' ('.$outbarcode.')'; |
|
| 3682 | 3682 | } |
| 3683 | - $optlabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3683 | + $optlabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3684 | 3684 | |
| 3685 | 3685 | $outvallabel = $objRef; |
| 3686 | 3686 | if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) { |
| 3687 | - $outvallabel .= ' (' . $objRefFourn . ')'; |
|
| 3687 | + $outvallabel .= ' ('.$objRefFourn.')'; |
|
| 3688 | 3688 | } |
| 3689 | 3689 | if (isModEnabled('barcode') && !empty($objp->barcode)) { |
| 3690 | - $outvallabel .= ' (' . $outbarcode . ')'; |
|
| 3690 | + $outvallabel .= ' ('.$outbarcode.')'; |
|
| 3691 | 3691 | } |
| 3692 | - $outvallabel .= ' - ' . dol_trunc($label, $maxlengtharticle); |
|
| 3692 | + $outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle); |
|
| 3693 | 3693 | |
| 3694 | 3694 | // Units |
| 3695 | 3695 | $optlabel .= $outvalUnits; |
@@ -3706,7 +3706,7 @@ discard block |
||
| 3706 | 3706 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3707 | 3707 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3708 | 3708 | |
| 3709 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3709 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3710 | 3710 | $priceparser = new PriceParser($this->db); |
| 3711 | 3711 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3712 | 3712 | if ($price_result >= 0) { |
@@ -3717,47 +3717,47 @@ discard block |
||
| 3717 | 3717 | } |
| 3718 | 3718 | } |
| 3719 | 3719 | if ($objp->quantity == 1) { |
| 3720 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3721 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3720 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3721 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3722 | 3722 | $optlabel .= $langs->trans("Unit"); // Do not use strtolower because it breaks utf8 encoding |
| 3723 | 3723 | $outvallabel .= $langs->transnoentities("Unit"); |
| 3724 | 3724 | } else { |
| 3725 | - $optlabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3726 | - $outvallabel .= ' - ' . price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency) . "/" . $objp->quantity; |
|
| 3727 | - $optlabel .= ' ' . $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3728 | - $outvallabel .= ' ' . $langs->transnoentities("Units"); |
|
| 3725 | + $optlabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3726 | + $outvallabel .= ' - '.price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 0, $langs, 0, 0, -1, $conf->currency)."/".$objp->quantity; |
|
| 3727 | + $optlabel .= ' '.$langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding |
|
| 3728 | + $outvallabel .= ' '.$langs->transnoentities("Units"); |
|
| 3729 | 3729 | } |
| 3730 | 3730 | |
| 3731 | 3731 | if ($objp->quantity > 1) { |
| 3732 | - $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 |
|
| 3733 | - $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 |
|
| 3732 | + $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 |
|
| 3733 | + $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 |
|
| 3734 | 3734 | } |
| 3735 | 3735 | if ($objp->remise_percent >= 1) { |
| 3736 | - $optlabel .= " - " . $langs->trans("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3737 | - $outvallabel .= " - " . $langs->transnoentities("Discount") . " : " . vatrate($objp->remise_percent) . ' %'; |
|
| 3736 | + $optlabel .= " - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3737 | + $outvallabel .= " - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %'; |
|
| 3738 | 3738 | } |
| 3739 | 3739 | if ($objp->duration) { |
| 3740 | - $optlabel .= " - " . $objp->duration; |
|
| 3741 | - $outvallabel .= " - " . $objp->duration; |
|
| 3740 | + $optlabel .= " - ".$objp->duration; |
|
| 3741 | + $outvallabel .= " - ".$objp->duration; |
|
| 3742 | 3742 | } |
| 3743 | 3743 | if (!$socid) { |
| 3744 | - $optlabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3745 | - $outvallabel .= " - " . dol_trunc($objp->name, 8); |
|
| 3744 | + $optlabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3745 | + $outvallabel .= " - ".dol_trunc($objp->name, 8); |
|
| 3746 | 3746 | } |
| 3747 | 3747 | if ($objp->supplier_reputation) { |
| 3748 | 3748 | //TODO dictionary |
| 3749 | 3749 | $reputations = array('' => $langs->trans('Standard'), 'FAVORITE' => $langs->trans('Favorite'), 'NOTTHGOOD' => $langs->trans('NotTheGoodQualitySupplier'), 'DONOTORDER' => $langs->trans('DoNotOrderThisProductToThisSupplier')); |
| 3750 | 3750 | |
| 3751 | - $optlabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3752 | - $outvallabel .= " - " . $reputations[$objp->supplier_reputation]; |
|
| 3751 | + $optlabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3752 | + $outvallabel .= " - ".$reputations[$objp->supplier_reputation]; |
|
| 3753 | 3753 | } |
| 3754 | 3754 | } else { |
| 3755 | 3755 | if (empty($alsoproductwithnosupplierprice)) { // No supplier price defined for couple product/supplier |
| 3756 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3757 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3756 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3757 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3758 | 3758 | } else { // No supplier price defined for product, even on other suppliers |
| 3759 | - $optlabel .= " - <span class='opacitymedium'>" . $langs->trans("NoPriceDefinedForThisSupplier") . '</span>'; |
|
| 3760 | - $outvallabel .= ' - ' . $langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3759 | + $optlabel .= " - <span class='opacitymedium'>".$langs->trans("NoPriceDefinedForThisSupplier").'</span>'; |
|
| 3760 | + $outvallabel .= ' - '.$langs->transnoentities("NoPriceDefinedForThisSupplier"); |
|
| 3761 | 3761 | } |
| 3762 | 3762 | } |
| 3763 | 3763 | |
@@ -3765,14 +3765,14 @@ discard block |
||
| 3765 | 3765 | $novirtualstock = ($showstockinlist == 2); |
| 3766 | 3766 | |
| 3767 | 3767 | if ($user->hasRight('stock', 'lire')) { |
| 3768 | - $outvallabel .= ' - ' . $langs->trans("Stock") . ': ' . price(price2num($objp->stock, 'MS')); |
|
| 3768 | + $outvallabel .= ' - '.$langs->trans("Stock").': '.price(price2num($objp->stock, 'MS')); |
|
| 3769 | 3769 | |
| 3770 | 3770 | if ($objp->stock > 0) { |
| 3771 | 3771 | $optlabel .= ' - <span class="product_line_stock_ok">'; |
| 3772 | 3772 | } elseif ($objp->stock <= 0) { |
| 3773 | 3773 | $optlabel .= ' - <span class="product_line_stock_too_low">'; |
| 3774 | 3774 | } |
| 3775 | - $optlabel .= $langs->transnoentities("Stock") . ':' . price(price2num($objp->stock, 'MS')); |
|
| 3775 | + $optlabel .= $langs->transnoentities("Stock").':'.price(price2num($objp->stock, 'MS')); |
|
| 3776 | 3776 | $optlabel .= '</span>'; |
| 3777 | 3777 | if (empty($novirtualstock) && getDolGlobalString('STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO')) { // Warning, this option may slow down combo list generation |
| 3778 | 3778 | $langs->load("stocks"); |
@@ -3782,9 +3782,9 @@ discard block |
||
| 3782 | 3782 | $tmpproduct->load_virtual_stock(); |
| 3783 | 3783 | $virtualstock = $tmpproduct->stock_theorique; |
| 3784 | 3784 | |
| 3785 | - $outvallabel .= ' - ' . $langs->trans("VirtualStock") . ':' . $virtualstock; |
|
| 3785 | + $outvallabel .= ' - '.$langs->trans("VirtualStock").':'.$virtualstock; |
|
| 3786 | 3786 | |
| 3787 | - $optlabel .= ' - ' . $langs->transnoentities("VirtualStock") . ':'; |
|
| 3787 | + $optlabel .= ' - '.$langs->transnoentities("VirtualStock").':'; |
|
| 3788 | 3788 | if ($virtualstock > 0) { |
| 3789 | 3789 | $optlabel .= '<span class="product_line_stock_ok">'; |
| 3790 | 3790 | } elseif ($virtualstock <= 0) { |
@@ -3798,7 +3798,7 @@ discard block |
||
| 3798 | 3798 | } |
| 3799 | 3799 | } |
| 3800 | 3800 | |
| 3801 | - $optstart = '<option value="' . $outkey . '"'; |
|
| 3801 | + $optstart = '<option value="'.$outkey.'"'; |
|
| 3802 | 3802 | if ($selected && $selected == $objp->idprodfournprice) { |
| 3803 | 3803 | $optstart .= ' selected'; |
| 3804 | 3804 | } |
@@ -3807,31 +3807,31 @@ discard block |
||
| 3807 | 3807 | } |
| 3808 | 3808 | |
| 3809 | 3809 | if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { |
| 3810 | - $optstart .= ' data-product-id="' . dol_escape_htmltag($objp->rowid) . '"'; |
|
| 3811 | - $optstart .= ' data-price-id="' . dol_escape_htmltag($objp->idprodfournprice) . '"'; |
|
| 3812 | - $optstart .= ' data-qty="' . dol_escape_htmltag($objp->quantity) . '"'; |
|
| 3813 | - $optstart .= ' data-up="' . dol_escape_htmltag(price2num($objp->unitprice)) . '"'; |
|
| 3814 | - $optstart .= ' data-up-locale="' . dol_escape_htmltag(price($objp->unitprice)) . '"'; |
|
| 3815 | - $optstart .= ' data-discount="' . dol_escape_htmltag($outdiscount) . '"'; |
|
| 3816 | - $optstart .= ' data-tvatx="' . dol_escape_htmltag(price2num($objp->tva_tx)) . '"'; |
|
| 3817 | - $optstart .= ' data-tvatx-formated="' . dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)) . '"'; |
|
| 3818 | - $optstart .= ' data-default-vat-code="' . dol_escape_htmltag($objp->default_vat_code) . '"'; |
|
| 3819 | - $optstart .= ' data-supplier-ref="' . dol_escape_htmltag($objp->ref_fourn) . '"'; |
|
| 3810 | + $optstart .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; |
|
| 3811 | + $optstart .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; |
|
| 3812 | + $optstart .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; |
|
| 3813 | + $optstart .= ' data-up="'.dol_escape_htmltag(price2num($objp->unitprice)).'"'; |
|
| 3814 | + $optstart .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; |
|
| 3815 | + $optstart .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; |
|
| 3816 | + $optstart .= ' data-tvatx="'.dol_escape_htmltag(price2num($objp->tva_tx)).'"'; |
|
| 3817 | + $optstart .= ' data-tvatx-formated="'.dol_escape_htmltag(price($objp->tva_tx, 0, $langs, 1, -1, 2)).'"'; |
|
| 3818 | + $optstart .= ' data-default-vat-code="'.dol_escape_htmltag($objp->default_vat_code).'"'; |
|
| 3819 | + $optstart .= ' data-supplier-ref="'.dol_escape_htmltag($objp->ref_fourn).'"'; |
|
| 3820 | 3820 | if (isModEnabled('multicurrency')) { |
| 3821 | - $optstart .= ' data-multicurrency-code="' . dol_escape_htmltag($objp->multicurrency_code) . '"'; |
|
| 3822 | - $optstart .= ' data-multicurrency-up="' . dol_escape_htmltag($objp->multicurrency_unitprice) . '"'; |
|
| 3821 | + $optstart .= ' data-multicurrency-code="'.dol_escape_htmltag($objp->multicurrency_code).'"'; |
|
| 3822 | + $optstart .= ' data-multicurrency-up="'.dol_escape_htmltag($objp->multicurrency_unitprice).'"'; |
|
| 3823 | 3823 | } |
| 3824 | 3824 | } |
| 3825 | - $optstart .= ' data-description="' . dol_escape_htmltag($objp->description, 0, 1) . '"'; |
|
| 3825 | + $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; |
|
| 3826 | 3826 | |
| 3827 | 3827 | $outarrayentry = array( |
| 3828 | 3828 | 'key' => $outkey, |
| 3829 | 3829 | 'value' => $outref, |
| 3830 | 3830 | 'label' => $outvallabel, |
| 3831 | 3831 | 'qty' => $outqty, |
| 3832 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3833 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3834 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3832 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3833 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3834 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3835 | 3835 | 'tva_tx_formated' => price($objp->tva_tx, 0, $langs, 1, -1, 2), |
| 3836 | 3836 | 'tva_tx' => price2num($objp->tva_tx), |
| 3837 | 3837 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3860,17 +3860,17 @@ discard block |
||
| 3860 | 3860 | // Add new entry |
| 3861 | 3861 | // "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 |
| 3862 | 3862 | // "label" value of json key array is used by jQuery automatically as text for combo box |
| 3863 | - $out .= $optstart . ' data-html="' . dol_escape_htmltag($optlabel) . '">' . $optlabel . "</option>\n"; |
|
| 3863 | + $out .= $optstart.' data-html="'.dol_escape_htmltag($optlabel).'">'.$optlabel."</option>\n"; |
|
| 3864 | 3864 | $outarraypush = array( |
| 3865 | 3865 | 'key' => $outkey, |
| 3866 | 3866 | 'value' => $outref, |
| 3867 | 3867 | 'label' => $outvallabel, |
| 3868 | 3868 | 'qty' => $outqty, |
| 3869 | - 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3869 | + 'price_qty_ht' => price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty |
|
| 3870 | 3870 | 'price_qty_ht_locale' => price($objp->fprice), |
| 3871 | - 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3871 | + 'price_unit_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price |
|
| 3872 | 3872 | 'price_unit_ht_locale' => price($objp->unitprice), |
| 3873 | - 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3873 | + 'price_ht' => price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) |
|
| 3874 | 3874 | 'tva_tx_formated' => price($objp->tva_tx), |
| 3875 | 3875 | 'tva_tx' => price2num($objp->tva_tx), |
| 3876 | 3876 | 'default_vat_code' => $objp->default_vat_code, |
@@ -3902,7 +3902,7 @@ discard block |
||
| 3902 | 3902 | |
| 3903 | 3903 | $this->db->free($result); |
| 3904 | 3904 | |
| 3905 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 3905 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 3906 | 3906 | $out .= ajax_combobox($htmlname); |
| 3907 | 3907 | } else { |
| 3908 | 3908 | dol_print_error($this->db); |
@@ -3934,43 +3934,43 @@ discard block |
||
| 3934 | 3934 | $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,"; |
| 3935 | 3935 | $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; |
| 3936 | 3936 | $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; |
| 3937 | - $sql .= " FROM " . $this->db->prefix() . "product as p"; |
|
| 3938 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3939 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3940 | - $sql .= " WHERE pfp.entity IN (" . getEntity('productsupplierprice') . ")"; |
|
| 3937 | + $sql .= " FROM ".$this->db->prefix()."product as p"; |
|
| 3938 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; |
|
| 3939 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid"; |
|
| 3940 | + $sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; |
|
| 3941 | 3941 | $sql .= " AND p.tobuy = 1"; |
| 3942 | 3942 | $sql .= " AND s.fournisseur = 1"; |
| 3943 | - $sql .= " AND p.rowid = " . ((int) $productid); |
|
| 3943 | + $sql .= " AND p.rowid = ".((int) $productid); |
|
| 3944 | 3944 | if (!getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED')) { |
| 3945 | 3945 | $sql .= " ORDER BY s.nom, pfp.ref_fourn DESC"; |
| 3946 | 3946 | } else { |
| 3947 | 3947 | $sql .= " ORDER BY pfp.unitprice ASC"; |
| 3948 | 3948 | } |
| 3949 | 3949 | |
| 3950 | - dol_syslog(get_class($this) . "::select_product_fourn_price", LOG_DEBUG); |
|
| 3950 | + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); |
|
| 3951 | 3951 | $result = $this->db->query($sql); |
| 3952 | 3952 | |
| 3953 | 3953 | if ($result) { |
| 3954 | 3954 | $num = $this->db->num_rows($result); |
| 3955 | 3955 | |
| 3956 | - $form = '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 3956 | + $form = '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 3957 | 3957 | |
| 3958 | 3958 | if (!$num) { |
| 3959 | - $form .= '<option value="0">-- ' . $langs->trans("NoSupplierPriceDefinedForThisProduct") . ' --</option>'; |
|
| 3959 | + $form .= '<option value="0">-- '.$langs->trans("NoSupplierPriceDefinedForThisProduct").' --</option>'; |
|
| 3960 | 3960 | } else { |
| 3961 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3961 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3962 | 3962 | $form .= '<option value="0"> </option>'; |
| 3963 | 3963 | |
| 3964 | 3964 | $i = 0; |
| 3965 | 3965 | while ($i < $num) { |
| 3966 | 3966 | $objp = $this->db->fetch_object($result); |
| 3967 | 3967 | |
| 3968 | - $opt = '<option value="' . $objp->idprodfournprice . '"'; |
|
| 3968 | + $opt = '<option value="'.$objp->idprodfournprice.'"'; |
|
| 3969 | 3969 | //if there is only one supplier, preselect it |
| 3970 | 3970 | if ($num == 1 || ($selected_supplier > 0 && $objp->fk_soc == $selected_supplier) || ($i == 0 && getDolGlobalString('PRODUCT_BEST_SUPPLIER_PRICE_PRESELECTED'))) { |
| 3971 | 3971 | $opt .= ' selected'; |
| 3972 | 3972 | } |
| 3973 | - $opt .= '>' . $objp->name . ' - ' . $objp->ref_fourn . ' - '; |
|
| 3973 | + $opt .= '>'.$objp->name.' - '.$objp->ref_fourn.' - '; |
|
| 3974 | 3974 | |
| 3975 | 3975 | if (isModEnabled('dynamicprices') && !empty($objp->fk_supplier_price_expression)) { |
| 3976 | 3976 | $prod_supplier = new ProductFournisseur($this->db); |
@@ -3980,7 +3980,7 @@ discard block |
||
| 3980 | 3980 | $prod_supplier->fourn_tva_tx = $objp->tva_tx; |
| 3981 | 3981 | $prod_supplier->fk_supplier_price_expression = $objp->fk_supplier_price_expression; |
| 3982 | 3982 | |
| 3983 | - require_once DOL_DOCUMENT_ROOT . '/product/dynamic_price/class/price_parser.class.php'; |
|
| 3983 | + require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; |
|
| 3984 | 3984 | $priceparser = new PriceParser($this->db); |
| 3985 | 3985 | $price_result = $priceparser->parseProductSupplier($prod_supplier); |
| 3986 | 3986 | if ($price_result >= 0) { |
@@ -3991,10 +3991,10 @@ discard block |
||
| 3991 | 3991 | } |
| 3992 | 3992 | } |
| 3993 | 3993 | if ($objp->quantity == 1) { |
| 3994 | - $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency) . "/"; |
|
| 3994 | + $opt .= price($objp->fprice * (getDolGlobalString('DISPLAY_DISCOUNTED_SUPPLIER_PRICE') ? (1 - $objp->remise_percent / 100) : 1), 1, $langs, 0, 0, -1, $conf->currency)."/"; |
|
| 3995 | 3995 | } |
| 3996 | 3996 | |
| 3997 | - $opt .= $objp->quantity . ' '; |
|
| 3997 | + $opt .= $objp->quantity.' '; |
|
| 3998 | 3998 | |
| 3999 | 3999 | if ($objp->quantity == 1) { |
| 4000 | 4000 | $opt .= $langs->trans("Unit"); |
@@ -4003,10 +4003,10 @@ discard block |
||
| 4003 | 4003 | } |
| 4004 | 4004 | if ($objp->quantity > 1) { |
| 4005 | 4005 | $opt .= " - "; |
| 4006 | - $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"); |
|
| 4006 | + $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"); |
|
| 4007 | 4007 | } |
| 4008 | 4008 | if ($objp->duration) { |
| 4009 | - $opt .= " - " . $objp->duration; |
|
| 4009 | + $opt .= " - ".$objp->duration; |
|
| 4010 | 4010 | } |
| 4011 | 4011 | $opt .= "</option>\n"; |
| 4012 | 4012 | |
@@ -4044,8 +4044,8 @@ discard block |
||
| 4044 | 4044 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 4045 | 4045 | |
| 4046 | 4046 | $sql = "SELECT rowid, code, libelle as label, deposit_percent"; |
| 4047 | - $sql .= " FROM " . $this->db->prefix() . 'c_payment_term'; |
|
| 4048 | - $sql .= " WHERE entity IN (" . getEntity('c_payment_term') . ")"; |
|
| 4047 | + $sql .= " FROM ".$this->db->prefix().'c_payment_term'; |
|
| 4048 | + $sql .= " WHERE entity IN (".getEntity('c_payment_term').")"; |
|
| 4049 | 4049 | $sql .= " AND active > 0"; |
| 4050 | 4050 | $sql .= " ORDER BY sortorder"; |
| 4051 | 4051 | |
@@ -4057,7 +4057,7 @@ discard block |
||
| 4057 | 4057 | $obj = $this->db->fetch_object($resql); |
| 4058 | 4058 | |
| 4059 | 4059 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4060 | - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4060 | + $label = ($langs->trans("PaymentConditionShort".$obj->code) != "PaymentConditionShort".$obj->code ? $langs->trans("PaymentConditionShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4061 | 4061 | $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; |
| 4062 | 4062 | $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; |
| 4063 | 4063 | $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; |
@@ -4085,7 +4085,7 @@ discard block |
||
| 4085 | 4085 | // phpcs:enable |
| 4086 | 4086 | global $langs; |
| 4087 | 4087 | |
| 4088 | - $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4088 | + $num = count($this->cache_availability); // TODO Use $conf->cache['availability'] instead of $this->cache_availability |
|
| 4089 | 4089 | if ($num > 0) { |
| 4090 | 4090 | return 0; // Cache already loaded |
| 4091 | 4091 | } |
@@ -4095,7 +4095,7 @@ discard block |
||
| 4095 | 4095 | $langs->load('propal'); |
| 4096 | 4096 | |
| 4097 | 4097 | $sql = "SELECT rowid, code, label, position"; |
| 4098 | - $sql .= " FROM " . $this->db->prefix() . 'c_availability'; |
|
| 4098 | + $sql .= " FROM ".$this->db->prefix().'c_availability'; |
|
| 4099 | 4099 | $sql .= " WHERE active > 0"; |
| 4100 | 4100 | |
| 4101 | 4101 | $resql = $this->db->query($sql); |
@@ -4106,7 +4106,7 @@ discard block |
||
| 4106 | 4106 | $obj = $this->db->fetch_object($resql); |
| 4107 | 4107 | |
| 4108 | 4108 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4109 | - $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4109 | + $label = ($langs->trans("AvailabilityType".$obj->code) != "AvailabilityType".$obj->code ? $langs->trans("AvailabilityType".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4110 | 4110 | $this->cache_availability[$obj->rowid]['code'] = $obj->code; |
| 4111 | 4111 | $this->cache_availability[$obj->rowid]['label'] = $label; |
| 4112 | 4112 | $this->cache_availability[$obj->rowid]['position'] = $obj->position; |
@@ -4138,17 +4138,17 @@ discard block |
||
| 4138 | 4138 | |
| 4139 | 4139 | $this->load_cache_availability(); |
| 4140 | 4140 | |
| 4141 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4141 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4142 | 4142 | |
| 4143 | - print '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4143 | + print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4144 | 4144 | if ($addempty) { |
| 4145 | 4145 | print '<option value="0"> </option>'; |
| 4146 | 4146 | } |
| 4147 | 4147 | foreach ($this->cache_availability as $id => $arrayavailability) { |
| 4148 | 4148 | if ($selected == $id) { |
| 4149 | - print '<option value="' . $id . '" selected>'; |
|
| 4149 | + print '<option value="'.$id.'" selected>'; |
|
| 4150 | 4150 | } else { |
| 4151 | - print '<option value="' . $id . '">'; |
|
| 4151 | + print '<option value="'.$id.'">'; |
|
| 4152 | 4152 | } |
| 4153 | 4153 | print dol_escape_htmltag($arrayavailability['label']); |
| 4154 | 4154 | print '</option>'; |
@@ -4169,13 +4169,13 @@ discard block |
||
| 4169 | 4169 | { |
| 4170 | 4170 | global $langs; |
| 4171 | 4171 | |
| 4172 | - $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4172 | + $num = count($this->cache_demand_reason); // TODO Use $conf->cache['input_reason'] instead of $this->cache_demand_reason |
|
| 4173 | 4173 | if ($num > 0) { |
| 4174 | 4174 | return 0; // Cache already loaded |
| 4175 | 4175 | } |
| 4176 | 4176 | |
| 4177 | 4177 | $sql = "SELECT rowid, code, label"; |
| 4178 | - $sql .= " FROM " . $this->db->prefix() . 'c_input_reason'; |
|
| 4178 | + $sql .= " FROM ".$this->db->prefix().'c_input_reason'; |
|
| 4179 | 4179 | $sql .= " WHERE active > 0"; |
| 4180 | 4180 | |
| 4181 | 4181 | $resql = $this->db->query($sql); |
@@ -4188,8 +4188,8 @@ discard block |
||
| 4188 | 4188 | |
| 4189 | 4189 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4190 | 4190 | $label = ($obj->label != '-' ? $obj->label : ''); |
| 4191 | - if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { |
|
| 4192 | - $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4191 | + if ($langs->trans("DemandReasonType".$obj->code) != "DemandReasonType".$obj->code) { |
|
| 4192 | + $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work |
|
| 4193 | 4193 | } |
| 4194 | 4194 | if ($langs->trans($obj->code) != $obj->code) { |
| 4195 | 4195 | $label = $langs->trans($obj->code); // So translation key SRC_XXX will work |
@@ -4229,9 +4229,9 @@ discard block |
||
| 4229 | 4229 | |
| 4230 | 4230 | $this->loadCacheInputReason(); |
| 4231 | 4231 | |
| 4232 | - print '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4232 | + print '<select class="flat'.($morecss ? ' '.$morecss : '').'" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4233 | 4233 | if ($addempty) { |
| 4234 | - print '<option value="0"' . (empty($selected) ? ' selected' : '') . '> </option>'; |
|
| 4234 | + print '<option value="0"'.(empty($selected) ? ' selected' : '').'> </option>'; |
|
| 4235 | 4235 | } |
| 4236 | 4236 | foreach ($this->cache_demand_reason as $id => $arraydemandreason) { |
| 4237 | 4237 | if ($arraydemandreason['code'] == $exclude) { |
@@ -4239,9 +4239,9 @@ discard block |
||
| 4239 | 4239 | } |
| 4240 | 4240 | |
| 4241 | 4241 | if ($selected && ($selected == $arraydemandreason['id'] || $selected == $arraydemandreason['code'])) { |
| 4242 | - print '<option value="' . $arraydemandreason['id'] . '" selected>'; |
|
| 4242 | + print '<option value="'.$arraydemandreason['id'].'" selected>'; |
|
| 4243 | 4243 | } else { |
| 4244 | - print '<option value="' . $arraydemandreason['id'] . '">'; |
|
| 4244 | + print '<option value="'.$arraydemandreason['id'].'">'; |
|
| 4245 | 4245 | } |
| 4246 | 4246 | $label = $arraydemandreason['label']; // Translation of label was already done into the ->loadCacheInputReason |
| 4247 | 4247 | print $langs->trans($label); |
@@ -4251,7 +4251,7 @@ discard block |
||
| 4251 | 4251 | if ($user->admin && empty($notooltip)) { |
| 4252 | 4252 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4253 | 4253 | } |
| 4254 | - print ajax_combobox('select_' . $htmlname); |
|
| 4254 | + print ajax_combobox('select_'.$htmlname); |
|
| 4255 | 4255 | } |
| 4256 | 4256 | |
| 4257 | 4257 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
@@ -4266,7 +4266,7 @@ discard block |
||
| 4266 | 4266 | // phpcs:enable |
| 4267 | 4267 | global $langs; |
| 4268 | 4268 | |
| 4269 | - $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4269 | + $num = count($this->cache_types_paiements); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_types_paiements |
|
| 4270 | 4270 | if ($num > 0) { |
| 4271 | 4271 | return $num; // Cache already loaded |
| 4272 | 4272 | } |
@@ -4276,8 +4276,8 @@ discard block |
||
| 4276 | 4276 | $this->cache_types_paiements = array(); |
| 4277 | 4277 | |
| 4278 | 4278 | $sql = "SELECT id, code, libelle as label, type, active"; |
| 4279 | - $sql .= " FROM " . $this->db->prefix() . "c_paiement"; |
|
| 4280 | - $sql .= " WHERE entity IN (" . getEntity('c_paiement') . ")"; |
|
| 4279 | + $sql .= " FROM ".$this->db->prefix()."c_paiement"; |
|
| 4280 | + $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; |
|
| 4281 | 4281 | |
| 4282 | 4282 | $resql = $this->db->query($sql); |
| 4283 | 4283 | if ($resql) { |
@@ -4287,7 +4287,7 @@ discard block |
||
| 4287 | 4287 | $obj = $this->db->fetch_object($resql); |
| 4288 | 4288 | |
| 4289 | 4289 | // Si traduction existe, on l'utilise, sinon on prend le libelle par default |
| 4290 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4290 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4291 | 4291 | $this->cache_types_paiements[$obj->id]['id'] = $obj->id; |
| 4292 | 4292 | $this->cache_types_paiements[$obj->id]['code'] = $obj->code; |
| 4293 | 4293 | $this->cache_types_paiements[$obj->id]['label'] = $label; |
@@ -4359,17 +4359,17 @@ discard block |
||
| 4359 | 4359 | global $langs, $user, $conf; |
| 4360 | 4360 | |
| 4361 | 4361 | $out = ''; |
| 4362 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 4362 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 4363 | 4363 | |
| 4364 | 4364 | $this->load_cache_conditions_paiements(); |
| 4365 | 4365 | |
| 4366 | 4366 | // Set default value if not already set by caller |
| 4367 | 4367 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID')) { |
| 4368 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4368 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TERM_ID", LOG_NOTICE); |
|
| 4369 | 4369 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID'); |
| 4370 | 4370 | } |
| 4371 | 4371 | |
| 4372 | - $out .= '<select id="' . $htmlname . '" class="flat selectpaymentterms' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4372 | + $out .= '<select id="'.$htmlname.'" class="flat selectpaymentterms'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4373 | 4373 | if ($addempty) { |
| 4374 | 4374 | $out .= '<option value="0"> </option>'; |
| 4375 | 4375 | } |
@@ -4383,9 +4383,9 @@ discard block |
||
| 4383 | 4383 | |
| 4384 | 4384 | if ($selected == $id) { |
| 4385 | 4385 | $selectedDepositPercent = $deposit_percent > 0 ? $deposit_percent : $arrayconditions['deposit_percent']; |
| 4386 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '" selected>'; |
|
| 4386 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'" selected>'; |
|
| 4387 | 4387 | } else { |
| 4388 | - $out .= '<option value="' . $id . '" data-deposit_percent="' . $arrayconditions['deposit_percent'] . '">'; |
|
| 4388 | + $out .= '<option value="'.$id.'" data-deposit_percent="'.$arrayconditions['deposit_percent'].'">'; |
|
| 4389 | 4389 | } |
| 4390 | 4390 | $label = $arrayconditions['label']; |
| 4391 | 4391 | |
@@ -4403,21 +4403,21 @@ discard block |
||
| 4403 | 4403 | $out .= ajax_combobox($htmlname); |
| 4404 | 4404 | |
| 4405 | 4405 | if ($deposit_percent >= 0) { |
| 4406 | - $out .= ' <span id="' . $htmlname . '_deposit_percent_container"' . (empty($selectedDepositPercent) ? ' style="display: none"' : '') . '>'; |
|
| 4407 | - $out .= $langs->trans('DepositPercent') . ' : '; |
|
| 4408 | - $out .= '<input id="' . $htmlname . '_deposit_percent" name="' . $htmlname . '_deposit_percent" class="maxwidth50" value="' . $deposit_percent . '" />'; |
|
| 4406 | + $out .= ' <span id="'.$htmlname.'_deposit_percent_container"'.(empty($selectedDepositPercent) ? ' style="display: none"' : '').'>'; |
|
| 4407 | + $out .= $langs->trans('DepositPercent').' : '; |
|
| 4408 | + $out .= '<input id="'.$htmlname.'_deposit_percent" name="'.$htmlname.'_deposit_percent" class="maxwidth50" value="'.$deposit_percent.'" />'; |
|
| 4409 | 4409 | $out .= '</span>'; |
| 4410 | 4410 | $out .= ' |
| 4411 | - <script nonce="' . getNonce() . '"> |
|
| 4411 | + <script nonce="' . getNonce().'"> |
|
| 4412 | 4412 | $(document).ready(function () { |
| 4413 | - $("#' . $htmlname . '").change(function () { |
|
| 4413 | + $("#' . $htmlname.'").change(function () { |
|
| 4414 | 4414 | let $selected = $(this).find("option:selected"); |
| 4415 | 4415 | let depositPercent = $selected.attr("data-deposit_percent"); |
| 4416 | 4416 | |
| 4417 | 4417 | if (depositPercent.length > 0) { |
| 4418 | - $("#' . $htmlname . '_deposit_percent_container").show().find("#' . $htmlname . '_deposit_percent").val(depositPercent); |
|
| 4418 | + $("#' . $htmlname.'_deposit_percent_container").show().find("#'.$htmlname.'_deposit_percent").val(depositPercent); |
|
| 4419 | 4419 | } else { |
| 4420 | - $("#' . $htmlname . '_deposit_percent_container").hide(); |
|
| 4420 | + $("#' . $htmlname.'_deposit_percent_container").hide(); |
|
| 4421 | 4421 | } |
| 4422 | 4422 | |
| 4423 | 4423 | return true; |
@@ -4455,7 +4455,7 @@ discard block |
||
| 4455 | 4455 | |
| 4456 | 4456 | $out = ''; |
| 4457 | 4457 | |
| 4458 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $filtertype . ", " . $format, LOG_DEBUG); |
|
| 4458 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); |
|
| 4459 | 4459 | |
| 4460 | 4460 | $filterarray = array(); |
| 4461 | 4461 | if ($filtertype == 'CRDT') { |
@@ -4470,11 +4470,11 @@ discard block |
||
| 4470 | 4470 | |
| 4471 | 4471 | // Set default value if not already set by caller |
| 4472 | 4472 | if (empty($selected) && getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID')) { |
| 4473 | - dol_syslog(__METHOD__ . "Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4473 | + dol_syslog(__METHOD__."Using deprecated option MAIN_DEFAULT_PAYMENT_TYPE_ID", LOG_NOTICE); |
|
| 4474 | 4474 | $selected = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID'); |
| 4475 | 4475 | } |
| 4476 | 4476 | |
| 4477 | - $out .= '<select id="select' . $htmlname . '" class="flat selectpaymenttypes' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4477 | + $out .= '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4478 | 4478 | if ($empty) { |
| 4479 | 4479 | $out .= '<option value=""> </option>'; |
| 4480 | 4480 | } |
@@ -4495,13 +4495,13 @@ discard block |
||
| 4495 | 4495 | } |
| 4496 | 4496 | |
| 4497 | 4497 | if ($format == 0) { |
| 4498 | - $out .= '<option value="' . $id . '"'; |
|
| 4498 | + $out .= '<option value="'.$id.'"'; |
|
| 4499 | 4499 | } elseif ($format == 1) { |
| 4500 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4500 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4501 | 4501 | } elseif ($format == 2) { |
| 4502 | - $out .= '<option value="' . $arraytypes['code'] . '"'; |
|
| 4502 | + $out .= '<option value="'.$arraytypes['code'].'"'; |
|
| 4503 | 4503 | } elseif ($format == 3) { |
| 4504 | - $out .= '<option value="' . $id . '"'; |
|
| 4504 | + $out .= '<option value="'.$id.'"'; |
|
| 4505 | 4505 | } |
| 4506 | 4506 | // Print attribute selected or not |
| 4507 | 4507 | if ($format == 1 || $format == 2) { |
@@ -4531,7 +4531,7 @@ discard block |
||
| 4531 | 4531 | if ($user->admin && !$noadmininfo) { |
| 4532 | 4532 | $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4533 | 4533 | } |
| 4534 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4534 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4535 | 4535 | |
| 4536 | 4536 | if (empty($nooutput)) { |
| 4537 | 4537 | print $out; |
@@ -4553,22 +4553,22 @@ discard block |
||
| 4553 | 4553 | { |
| 4554 | 4554 | global $langs; |
| 4555 | 4555 | |
| 4556 | - $return = '<select class="flat maxwidth100" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4556 | + $return = '<select class="flat maxwidth100" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4557 | 4557 | $options = array( |
| 4558 | 4558 | 'HT' => $langs->trans("HT"), |
| 4559 | 4559 | 'TTC' => $langs->trans("TTC") |
| 4560 | 4560 | ); |
| 4561 | 4561 | foreach ($options as $id => $value) { |
| 4562 | 4562 | if ($selected == $id) { |
| 4563 | - $return .= '<option value="' . $id . '" selected>' . $value; |
|
| 4563 | + $return .= '<option value="'.$id.'" selected>'.$value; |
|
| 4564 | 4564 | } else { |
| 4565 | - $return .= '<option value="' . $id . '">' . $value; |
|
| 4565 | + $return .= '<option value="'.$id.'">'.$value; |
|
| 4566 | 4566 | } |
| 4567 | 4567 | $return .= '</option>'; |
| 4568 | 4568 | } |
| 4569 | 4569 | $return .= '</select>'; |
| 4570 | 4570 | if ($addjscombo) { |
| 4571 | - $return .= ajax_combobox('select_' . $htmlname); |
|
| 4571 | + $return .= ajax_combobox('select_'.$htmlname); |
|
| 4572 | 4572 | } |
| 4573 | 4573 | |
| 4574 | 4574 | return $return; |
@@ -4586,7 +4586,7 @@ discard block |
||
| 4586 | 4586 | // phpcs:enable |
| 4587 | 4587 | global $langs; |
| 4588 | 4588 | |
| 4589 | - $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4589 | + $num = count($this->cache_transport_mode); // TODO Use $conf->cache['payment_mode'] instead of $this->cache_transport_mode |
|
| 4590 | 4590 | if ($num > 0) { |
| 4591 | 4591 | return $num; // Cache already loaded |
| 4592 | 4592 | } |
@@ -4596,8 +4596,8 @@ discard block |
||
| 4596 | 4596 | $this->cache_transport_mode = array(); |
| 4597 | 4597 | |
| 4598 | 4598 | $sql = "SELECT rowid, code, label, active"; |
| 4599 | - $sql .= " FROM " . $this->db->prefix() . "c_transport_mode"; |
|
| 4600 | - $sql .= " WHERE entity IN (" . getEntity('c_transport_mode') . ")"; |
|
| 4599 | + $sql .= " FROM ".$this->db->prefix()."c_transport_mode"; |
|
| 4600 | + $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; |
|
| 4601 | 4601 | |
| 4602 | 4602 | $resql = $this->db->query($sql); |
| 4603 | 4603 | if ($resql) { |
@@ -4607,7 +4607,7 @@ discard block |
||
| 4607 | 4607 | $obj = $this->db->fetch_object($resql); |
| 4608 | 4608 | |
| 4609 | 4609 | // If traduction exist, we use it else we take the default label |
| 4610 | - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4610 | + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) != "PaymentTypeShort".$obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); |
|
| 4611 | 4611 | $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; |
| 4612 | 4612 | $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; |
| 4613 | 4613 | $this->cache_transport_mode[$obj->rowid]['label'] = $label; |
@@ -4641,11 +4641,11 @@ discard block |
||
| 4641 | 4641 | { |
| 4642 | 4642 | global $langs, $user; |
| 4643 | 4643 | |
| 4644 | - dol_syslog(__METHOD__ . " " . $selected . ", " . $htmlname . ", " . $format, LOG_DEBUG); |
|
| 4644 | + dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$format, LOG_DEBUG); |
|
| 4645 | 4645 | |
| 4646 | 4646 | $this->load_cache_transport_mode(); |
| 4647 | 4647 | |
| 4648 | - print '<select id="select' . $htmlname . '" class="flat selectmodetransport' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 4648 | + print '<select id="select'.$htmlname.'" class="flat selectmodetransport'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 4649 | 4649 | if ($empty) { |
| 4650 | 4650 | print '<option value=""> </option>'; |
| 4651 | 4651 | } |
@@ -4661,13 +4661,13 @@ discard block |
||
| 4661 | 4661 | } |
| 4662 | 4662 | |
| 4663 | 4663 | if ($format == 0) { |
| 4664 | - print '<option value="' . $id . '"'; |
|
| 4664 | + print '<option value="'.$id.'"'; |
|
| 4665 | 4665 | } elseif ($format == 1) { |
| 4666 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4666 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4667 | 4667 | } elseif ($format == 2) { |
| 4668 | - print '<option value="' . $arraytypes['code'] . '"'; |
|
| 4668 | + print '<option value="'.$arraytypes['code'].'"'; |
|
| 4669 | 4669 | } elseif ($format == 3) { |
| 4670 | - print '<option value="' . $id . '"'; |
|
| 4670 | + print '<option value="'.$id.'"'; |
|
| 4671 | 4671 | } |
| 4672 | 4672 | // If text is selected, we compare with code, else with id |
| 4673 | 4673 | if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { |
@@ -4715,31 +4715,31 @@ discard block |
||
| 4715 | 4715 | $langs->load("deliveries"); |
| 4716 | 4716 | |
| 4717 | 4717 | $sql = "SELECT rowid, code, libelle as label"; |
| 4718 | - $sql .= " FROM " . $this->db->prefix() . "c_shipment_mode"; |
|
| 4718 | + $sql .= " FROM ".$this->db->prefix()."c_shipment_mode"; |
|
| 4719 | 4719 | $sql .= " WHERE active > 0"; |
| 4720 | 4720 | if ($filtre) { |
| 4721 | - $sql .= " AND " . $filtre; |
|
| 4721 | + $sql .= " AND ".$filtre; |
|
| 4722 | 4722 | } |
| 4723 | 4723 | $sql .= " ORDER BY libelle ASC"; |
| 4724 | 4724 | |
| 4725 | - dol_syslog(get_class($this) . "::selectShippingMode", LOG_DEBUG); |
|
| 4725 | + dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG); |
|
| 4726 | 4726 | $result = $this->db->query($sql); |
| 4727 | 4727 | if ($result) { |
| 4728 | 4728 | $num = $this->db->num_rows($result); |
| 4729 | 4729 | $i = 0; |
| 4730 | 4730 | if ($num) { |
| 4731 | - print '<select id="select' . $htmlname . '" class="flat selectshippingmethod' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4731 | + print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4732 | 4732 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4733 | 4733 | print '<option value="-1"> </option>'; |
| 4734 | 4734 | } |
| 4735 | 4735 | while ($i < $num) { |
| 4736 | 4736 | $obj = $this->db->fetch_object($result); |
| 4737 | 4737 | if ($selected == $obj->rowid) { |
| 4738 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 4738 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 4739 | 4739 | } else { |
| 4740 | - print '<option value="' . $obj->rowid . '">'; |
|
| 4740 | + print '<option value="'.$obj->rowid.'">'; |
|
| 4741 | 4741 | } |
| 4742 | - print ($langs->trans("SendingMethod" . strtoupper($obj->code)) != "SendingMethod" . strtoupper($obj->code)) ? $langs->trans("SendingMethod" . strtoupper($obj->code)) : $obj->label; |
|
| 4742 | + print ($langs->trans("SendingMethod".strtoupper($obj->code)) != "SendingMethod".strtoupper($obj->code)) ? $langs->trans("SendingMethod".strtoupper($obj->code)) : $obj->label; |
|
| 4743 | 4743 | print '</option>'; |
| 4744 | 4744 | $i++; |
| 4745 | 4745 | } |
@@ -4748,7 +4748,7 @@ discard block |
||
| 4748 | 4748 | print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
| 4749 | 4749 | } |
| 4750 | 4750 | |
| 4751 | - print ajax_combobox('select' . $htmlname); |
|
| 4751 | + print ajax_combobox('select'.$htmlname); |
|
| 4752 | 4752 | } else { |
| 4753 | 4753 | print $langs->trans("NoShippingMethodDefined"); |
| 4754 | 4754 | } |
@@ -4773,16 +4773,16 @@ discard block |
||
| 4773 | 4773 | $langs->load("deliveries"); |
| 4774 | 4774 | |
| 4775 | 4775 | if ($htmlname != "none") { |
| 4776 | - print '<form method="POST" action="' . $page . '">'; |
|
| 4776 | + print '<form method="POST" action="'.$page.'">'; |
|
| 4777 | 4777 | print '<input type="hidden" name="action" value="setshippingmethod">'; |
| 4778 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 4778 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 4779 | 4779 | $this->selectShippingMethod($selected, $htmlname, '', $addempty); |
| 4780 | - print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 4780 | + print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 4781 | 4781 | print '</form>'; |
| 4782 | 4782 | } else { |
| 4783 | 4783 | if ($selected) { |
| 4784 | 4784 | $code = $langs->getLabelFromKey($this->db, $selected, 'c_shipment_mode', 'rowid', 'code'); |
| 4785 | - print $langs->trans("SendingMethod" . strtoupper($code)); |
|
| 4785 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
| 4786 | 4786 | } else { |
| 4787 | 4787 | print " "; |
| 4788 | 4788 | } |
@@ -4805,10 +4805,10 @@ discard block |
||
| 4805 | 4805 | |
| 4806 | 4806 | $opt = '<option value="" selected></option>'; |
| 4807 | 4807 | $sql = "SELECT rowid, ref, situation_cycle_ref, situation_counter, situation_final, fk_soc"; |
| 4808 | - $sql .= ' FROM ' . $this->db->prefix() . 'facture'; |
|
| 4809 | - $sql .= ' WHERE entity IN (' . getEntity('invoice') . ')'; |
|
| 4808 | + $sql .= ' FROM '.$this->db->prefix().'facture'; |
|
| 4809 | + $sql .= ' WHERE entity IN ('.getEntity('invoice').')'; |
|
| 4810 | 4810 | $sql .= ' AND situation_counter >= 1'; |
| 4811 | - $sql .= ' AND fk_soc = ' . (int) $socid; |
|
| 4811 | + $sql .= ' AND fk_soc = '.(int) $socid; |
|
| 4812 | 4812 | $sql .= ' AND type <> 2'; |
| 4813 | 4813 | $sql .= ' ORDER by situation_cycle_ref, situation_counter desc'; |
| 4814 | 4814 | $resql = $this->db->query($sql); |
@@ -4826,19 +4826,19 @@ discard block |
||
| 4826 | 4826 | //Not prov? |
| 4827 | 4827 | if (substr($obj->ref, 1, 4) != 'PROV') { |
| 4828 | 4828 | if ($selected == $obj->rowid) { |
| 4829 | - $opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->ref . '</option>'; |
|
| 4829 | + $opt .= '<option value="'.$obj->rowid.'" selected>'.$obj->ref.'</option>'; |
|
| 4830 | 4830 | } else { |
| 4831 | - $opt .= '<option value="' . $obj->rowid . '">' . $obj->ref . '</option>'; |
|
| 4831 | + $opt .= '<option value="'.$obj->rowid.'">'.$obj->ref.'</option>'; |
|
| 4832 | 4832 | } |
| 4833 | 4833 | } |
| 4834 | 4834 | } |
| 4835 | 4835 | } |
| 4836 | 4836 | } |
| 4837 | 4837 | } else { |
| 4838 | - dol_syslog("Error sql=" . $sql . ", error=" . $this->error, LOG_ERR); |
|
| 4838 | + dol_syslog("Error sql=".$sql.", error=".$this->error, LOG_ERR); |
|
| 4839 | 4839 | } |
| 4840 | 4840 | if ($opt == '<option value ="" selected></option>') { |
| 4841 | - $opt = '<option value ="0" selected>' . $langs->trans('NoSituations') . '</option>'; |
|
| 4841 | + $opt = '<option value ="0" selected>'.$langs->trans('NoSituations').'</option>'; |
|
| 4842 | 4842 | } |
| 4843 | 4843 | return $opt; |
| 4844 | 4844 | } |
@@ -4858,12 +4858,12 @@ discard block |
||
| 4858 | 4858 | |
| 4859 | 4859 | $langs->load('products'); |
| 4860 | 4860 | |
| 4861 | - $return = '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 4861 | + $return = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 4862 | 4862 | |
| 4863 | - $sql = "SELECT rowid, label, code FROM " . $this->db->prefix() . "c_units"; |
|
| 4863 | + $sql = "SELECT rowid, label, code FROM ".$this->db->prefix()."c_units"; |
|
| 4864 | 4864 | $sql .= ' WHERE active > 0'; |
| 4865 | 4865 | if (!empty($unit_type)) { |
| 4866 | - $sql .= " AND unit_type = '" . $this->db->escape($unit_type) . "'"; |
|
| 4866 | + $sql .= " AND unit_type = '".$this->db->escape($unit_type)."'"; |
|
| 4867 | 4867 | } |
| 4868 | 4868 | $sql .= " ORDER BY sortorder"; |
| 4869 | 4869 | |
@@ -4875,14 +4875,14 @@ discard block |
||
| 4875 | 4875 | |
| 4876 | 4876 | while ($res = $this->db->fetch_object($resql)) { |
| 4877 | 4877 | $unitLabel = $res->label; |
| 4878 | - if (!empty($langs->tab_translate['unit' . $res->code])) { // check if Translation is available before |
|
| 4879 | - $unitLabel = $langs->trans('unit' . $res->code) != $res->label ? $langs->trans('unit' . $res->code) : $res->label; |
|
| 4878 | + if (!empty($langs->tab_translate['unit'.$res->code])) { // check if Translation is available before |
|
| 4879 | + $unitLabel = $langs->trans('unit'.$res->code) != $res->label ? $langs->trans('unit'.$res->code) : $res->label; |
|
| 4880 | 4880 | } |
| 4881 | 4881 | |
| 4882 | 4882 | if ($selected == $res->rowid) { |
| 4883 | - $return .= '<option value="' . $res->rowid . '" selected>' . $unitLabel . '</option>'; |
|
| 4883 | + $return .= '<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>'; |
|
| 4884 | 4884 | } else { |
| 4885 | - $return .= '<option value="' . $res->rowid . '">' . $unitLabel . '</option>'; |
|
| 4885 | + $return .= '<option value="'.$res->rowid.'">'.$unitLabel.'</option>'; |
|
| 4886 | 4886 | } |
| 4887 | 4887 | } |
| 4888 | 4888 | $return .= '</select>'; |
@@ -4917,23 +4917,23 @@ discard block |
||
| 4917 | 4917 | $num = 0; |
| 4918 | 4918 | |
| 4919 | 4919 | $sql = "SELECT rowid, label, bank, clos as status, currency_code"; |
| 4920 | - $sql .= " FROM " . $this->db->prefix() . "bank_account"; |
|
| 4921 | - $sql .= " WHERE entity IN (" . getEntity('bank_account') . ")"; |
|
| 4920 | + $sql .= " FROM ".$this->db->prefix()."bank_account"; |
|
| 4921 | + $sql .= " WHERE entity IN (".getEntity('bank_account').")"; |
|
| 4922 | 4922 | if ($status != 2) { |
| 4923 | - $sql .= " AND clos = " . (int) $status; |
|
| 4923 | + $sql .= " AND clos = ".(int) $status; |
|
| 4924 | 4924 | } |
| 4925 | 4925 | if ($filtre) { |
| 4926 | - $sql .= " AND " . $filtre; |
|
| 4926 | + $sql .= " AND ".$filtre; |
|
| 4927 | 4927 | } |
| 4928 | 4928 | $sql .= " ORDER BY label"; |
| 4929 | 4929 | |
| 4930 | - dol_syslog(get_class($this) . "::select_comptes", LOG_DEBUG); |
|
| 4930 | + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); |
|
| 4931 | 4931 | $result = $this->db->query($sql); |
| 4932 | 4932 | if ($result) { |
| 4933 | 4933 | $num = $this->db->num_rows($result); |
| 4934 | 4934 | $i = 0; |
| 4935 | 4935 | if ($num) { |
| 4936 | - $out .= '<select id="select' . $htmlname . '" class="flat selectbankaccount' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 4936 | + $out .= '<select id="select'.$htmlname.'" class="flat selectbankaccount'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 4937 | 4937 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 4938 | 4938 | $out .= '<option value="-1"> </option>'; |
| 4939 | 4939 | } |
@@ -4941,27 +4941,27 @@ discard block |
||
| 4941 | 4941 | while ($i < $num) { |
| 4942 | 4942 | $obj = $this->db->fetch_object($result); |
| 4943 | 4943 | if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { |
| 4944 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '" selected>'; |
|
| 4944 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>'; |
|
| 4945 | 4945 | } else { |
| 4946 | - $out .= '<option value="' . $obj->rowid . '" data-currency-code="' . $obj->currency_code . '">'; |
|
| 4946 | + $out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">'; |
|
| 4947 | 4947 | } |
| 4948 | 4948 | $out .= trim($obj->label); |
| 4949 | 4949 | if ($showcurrency) { |
| 4950 | - $out .= ' (' . $obj->currency_code . ')'; |
|
| 4950 | + $out .= ' ('.$obj->currency_code.')'; |
|
| 4951 | 4951 | } |
| 4952 | 4952 | if ($status == 2 && $obj->status == 1) { |
| 4953 | - $out .= ' (' . $langs->trans("Closed") . ')'; |
|
| 4953 | + $out .= ' ('.$langs->trans("Closed").')'; |
|
| 4954 | 4954 | } |
| 4955 | 4955 | $out .= '</option>'; |
| 4956 | 4956 | $i++; |
| 4957 | 4957 | } |
| 4958 | 4958 | $out .= "</select>"; |
| 4959 | - $out .= ajax_combobox('select' . $htmlname); |
|
| 4959 | + $out .= ajax_combobox('select'.$htmlname); |
|
| 4960 | 4960 | } else { |
| 4961 | 4961 | if ($status == 0) { |
| 4962 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoActiveBankAccountDefined") . '</span>'; |
|
| 4962 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoActiveBankAccountDefined").'</span>'; |
|
| 4963 | 4963 | } else { |
| 4964 | - $out .= '<span class="opacitymedium">' . $langs->trans("NoBankAccountFound") . '</span>'; |
|
| 4964 | + $out .= '<span class="opacitymedium">'.$langs->trans("NoBankAccountFound").'</span>'; |
|
| 4965 | 4965 | } |
| 4966 | 4966 | } |
| 4967 | 4967 | } else { |
@@ -4997,23 +4997,23 @@ discard block |
||
| 4997 | 4997 | $num = 0; |
| 4998 | 4998 | |
| 4999 | 4999 | $sql = "SELECT rowid, name, fk_country, status, entity"; |
| 5000 | - $sql .= " FROM " . $this->db->prefix() . "establishment"; |
|
| 5000 | + $sql .= " FROM ".$this->db->prefix()."establishment"; |
|
| 5001 | 5001 | $sql .= " WHERE 1=1"; |
| 5002 | 5002 | if ($status != 2) { |
| 5003 | - $sql .= " AND status = " . (int) $status; |
|
| 5003 | + $sql .= " AND status = ".(int) $status; |
|
| 5004 | 5004 | } |
| 5005 | 5005 | if ($filtre) { |
| 5006 | - $sql .= " AND " . $filtre; |
|
| 5006 | + $sql .= " AND ".$filtre; |
|
| 5007 | 5007 | } |
| 5008 | 5008 | $sql .= " ORDER BY name"; |
| 5009 | 5009 | |
| 5010 | - dol_syslog(get_class($this) . "::select_establishment", LOG_DEBUG); |
|
| 5010 | + dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG); |
|
| 5011 | 5011 | $result = $this->db->query($sql); |
| 5012 | 5012 | if ($result) { |
| 5013 | 5013 | $num = $this->db->num_rows($result); |
| 5014 | 5014 | $i = 0; |
| 5015 | 5015 | if ($num) { |
| 5016 | - print '<select id="select' . $htmlname . '" class="flat selectestablishment" name="' . $htmlname . '"' . ($moreattrib ? ' ' . $moreattrib : '') . '>'; |
|
| 5016 | + print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>'; |
|
| 5017 | 5017 | if ($useempty == 1 || ($useempty == 2 && $num > 1)) { |
| 5018 | 5018 | print '<option value="-1"> </option>'; |
| 5019 | 5019 | } |
@@ -5021,13 +5021,13 @@ discard block |
||
| 5021 | 5021 | while ($i < $num) { |
| 5022 | 5022 | $obj = $this->db->fetch_object($result); |
| 5023 | 5023 | if ($selected == $obj->rowid) { |
| 5024 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 5024 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 5025 | 5025 | } else { |
| 5026 | - print '<option value="' . $obj->rowid . '">'; |
|
| 5026 | + print '<option value="'.$obj->rowid.'">'; |
|
| 5027 | 5027 | } |
| 5028 | 5028 | print trim($obj->name); |
| 5029 | 5029 | if ($status == 2 && $obj->status == 1) { |
| 5030 | - print ' (' . $langs->trans("Closed") . ')'; |
|
| 5030 | + print ' ('.$langs->trans("Closed").')'; |
|
| 5031 | 5031 | } |
| 5032 | 5032 | print '</option>'; |
| 5033 | 5033 | $i++; |
@@ -5035,9 +5035,9 @@ discard block |
||
| 5035 | 5035 | print "</select>"; |
| 5036 | 5036 | } else { |
| 5037 | 5037 | if ($status == 0) { |
| 5038 | - print '<span class="opacitymedium">' . $langs->trans("NoActiveEstablishmentDefined") . '</span>'; |
|
| 5038 | + print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>'; |
|
| 5039 | 5039 | } else { |
| 5040 | - print '<span class="opacitymedium">' . $langs->trans("NoEstablishmentFound") . '</span>'; |
|
| 5040 | + print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>'; |
|
| 5041 | 5041 | } |
| 5042 | 5042 | } |
| 5043 | 5043 | |
@@ -5061,20 +5061,20 @@ discard block |
||
| 5061 | 5061 | { |
| 5062 | 5062 | global $langs; |
| 5063 | 5063 | if ($htmlname != "none") { |
| 5064 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5064 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5065 | 5065 | print '<input type="hidden" name="action" value="setbankaccount">'; |
| 5066 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5066 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5067 | 5067 | print img_picto('', 'bank_account', 'class="pictofixedwidth"'); |
| 5068 | 5068 | $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); |
| 5069 | 5069 | if ($nbaccountfound > 0) { |
| 5070 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5070 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5071 | 5071 | } |
| 5072 | 5072 | print '</form>'; |
| 5073 | 5073 | } else { |
| 5074 | 5074 | $langs->load('banks'); |
| 5075 | 5075 | |
| 5076 | 5076 | if ($selected) { |
| 5077 | - require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; |
|
| 5077 | + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; |
|
| 5078 | 5078 | $bankstatic = new Account($this->db); |
| 5079 | 5079 | $result = $bankstatic->fetch($selected); |
| 5080 | 5080 | if ($result) { |
@@ -5112,19 +5112,19 @@ discard block |
||
| 5112 | 5112 | global $conf, $langs; |
| 5113 | 5113 | $langs->load("categories"); |
| 5114 | 5114 | |
| 5115 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5115 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5116 | 5116 | |
| 5117 | 5117 | // For backward compatibility |
| 5118 | 5118 | if (is_numeric($type)) { |
| 5119 | - dol_syslog(__METHOD__ . ': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5119 | + dol_syslog(__METHOD__.': using numeric value for parameter type is deprecated. Use string code instead.', LOG_WARNING); |
|
| 5120 | 5120 | } |
| 5121 | 5121 | |
| 5122 | 5122 | if ($type === Categorie::TYPE_BANK_LINE) { |
| 5123 | 5123 | // TODO Move this into common category feature |
| 5124 | 5124 | $cate_arbo = array(); |
| 5125 | 5125 | $sql = "SELECT c.label, c.rowid"; |
| 5126 | - $sql .= " FROM " . $this->db->prefix() . "bank_categ as c"; |
|
| 5127 | - $sql .= " WHERE entity = " . $conf->entity; |
|
| 5126 | + $sql .= " FROM ".$this->db->prefix()."bank_categ as c"; |
|
| 5127 | + $sql .= " WHERE entity = ".$conf->entity; |
|
| 5128 | 5128 | $sql .= " ORDER BY c.label"; |
| 5129 | 5129 | $result = $this->db->query($sql); |
| 5130 | 5130 | if ($result) { |
@@ -5149,10 +5149,10 @@ discard block |
||
| 5149 | 5149 | $outarray = array(); |
| 5150 | 5150 | $outarrayrichhtml = array(); |
| 5151 | 5151 | |
| 5152 | - $output = '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 5152 | + $output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 5153 | 5153 | if (is_array($cate_arbo)) { |
| 5154 | 5154 | if (!count($cate_arbo)) { |
| 5155 | - $output .= '<option value="-1" disabled>' . $langs->trans("NoCategoriesDefined") . '</option>'; |
|
| 5155 | + $output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>'; |
|
| 5156 | 5156 | } else { |
| 5157 | 5157 | $output .= '<option value="-1"> </option>'; |
| 5158 | 5158 | foreach ($cate_arbo as $key => $value) { |
@@ -5162,15 +5162,15 @@ discard block |
||
| 5162 | 5162 | $add = ''; |
| 5163 | 5163 | } |
| 5164 | 5164 | |
| 5165 | - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); |
|
| 5165 | + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"'); |
|
| 5166 | 5166 | $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5167 | 5167 | |
| 5168 | 5168 | $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; |
| 5169 | 5169 | |
| 5170 | 5170 | $outarrayrichhtml[$cate_arbo[$key]['id']] = $labeltoshow; |
| 5171 | 5171 | |
| 5172 | - $output .= '<option ' . $add . 'value="' . $cate_arbo[$key]['id'] . '"'; |
|
| 5173 | - $output .= ' data-html="' . dol_escape_htmltag($labeltoshow) . '"'; |
|
| 5172 | + $output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"'; |
|
| 5173 | + $output .= ' data-html="'.dol_escape_htmltag($labeltoshow).'"'; |
|
| 5174 | 5174 | $output .= '>'; |
| 5175 | 5175 | $output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); |
| 5176 | 5176 | $output .= '</option>'; |
@@ -5211,7 +5211,7 @@ discard block |
||
| 5211 | 5211 | public function form_confirm($page, $title, $question, $action, $formquestion = array(), $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) |
| 5212 | 5212 | { |
| 5213 | 5213 | // phpcs:enable |
| 5214 | - dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5214 | + dol_syslog(__METHOD__.': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); |
|
| 5215 | 5215 | print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); |
| 5216 | 5216 | } |
| 5217 | 5217 | |
@@ -5246,7 +5246,7 @@ discard block |
||
| 5246 | 5246 | { |
| 5247 | 5247 | global $langs, $conf; |
| 5248 | 5248 | |
| 5249 | - $more = '<!-- formconfirm - before call, page=' . dol_escape_htmltag($page) . ' -->'; |
|
| 5249 | + $more = '<!-- formconfirm - before call, page='.dol_escape_htmltag($page).' -->'; |
|
| 5250 | 5250 | $formconfirm = ''; |
| 5251 | 5251 | $inputok = array(); |
| 5252 | 5252 | $inputko = array(); |
@@ -5270,27 +5270,27 @@ discard block |
||
| 5270 | 5270 | foreach ($formquestion as $key => $input) { |
| 5271 | 5271 | if (is_array($input) && !empty($input)) { |
| 5272 | 5272 | if ($input['type'] == 'hidden') { |
| 5273 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5274 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5273 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5274 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5275 | 5275 | |
| 5276 | - $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"; |
|
| 5276 | + $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"; |
|
| 5277 | 5277 | } |
| 5278 | 5278 | } |
| 5279 | 5279 | } |
| 5280 | 5280 | |
| 5281 | 5281 | // Now add questions |
| 5282 | 5282 | $moreonecolumn = ''; |
| 5283 | - $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">' . "\n"; |
|
| 5283 | + $more .= '<div class="tagtable paddingtopbottomonly centpercent noborderspacing">'."\n"; |
|
| 5284 | 5284 | foreach ($formquestion as $key => $input) { |
| 5285 | 5285 | if (is_array($input) && !empty($input)) { |
| 5286 | - $size = (!empty($input['size']) ? ' size="' . $input['size'] . '"' : ''); // deprecated. Use morecss instead. |
|
| 5287 | - $moreattr = (!empty($input['moreattr']) ? ' ' . $input['moreattr'] : ''); |
|
| 5288 | - $morecss = (!empty($input['morecss']) ? ' ' . $input['morecss'] : ''); |
|
| 5286 | + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. |
|
| 5287 | + $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); |
|
| 5288 | + $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); |
|
| 5289 | 5289 | |
| 5290 | 5290 | if ($input['type'] == 'text') { |
| 5291 | - $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"; |
|
| 5291 | + $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"; |
|
| 5292 | 5292 | } elseif ($input['type'] == 'password') { |
| 5293 | - $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"; |
|
| 5293 | + $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"; |
|
| 5294 | 5294 | } elseif ($input['type'] == 'textarea') { |
| 5295 | 5295 | /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; |
| 5296 | 5296 | $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; |
@@ -5298,8 +5298,8 @@ discard block |
||
| 5298 | 5298 | $more .= '</textarea>'; |
| 5299 | 5299 | $more .= '</div></div>'."\n";*/ |
| 5300 | 5300 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5301 | - $moreonecolumn .= $input['label'] . '<br>'; |
|
| 5302 | - $moreonecolumn .= '<textarea name="' . dol_escape_htmltag($input['name']) . '" id="' . dol_escape_htmltag($input['name']) . '" class="' . $morecss . '"' . $moreattr . '>'; |
|
| 5301 | + $moreonecolumn .= $input['label'].'<br>'; |
|
| 5302 | + $moreonecolumn .= '<textarea name="'.dol_escape_htmltag($input['name']).'" id="'.dol_escape_htmltag($input['name']).'" class="'.$morecss.'"'.$moreattr.'>'; |
|
| 5303 | 5303 | $moreonecolumn .= $input['value']; |
| 5304 | 5304 | $moreonecolumn .= '</textarea>'; |
| 5305 | 5305 | $moreonecolumn .= '</div>'; |
@@ -5316,20 +5316,20 @@ discard block |
||
| 5316 | 5316 | $disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0; |
| 5317 | 5317 | $sort = isset($input['select_sort']) ? $input['select_sort'] : ''; |
| 5318 | 5318 | |
| 5319 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">'; |
|
| 5319 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
|
| 5320 | 5320 | if (!empty($input['label'])) { |
| 5321 | - $more .= $input['label'] . '</div><div class="tagtd left">'; |
|
| 5321 | + $more .= $input['label'].'</div><div class="tagtd left">'; |
|
| 5322 | 5322 | } |
| 5323 | 5323 | if ($input['type'] == 'select') { |
| 5324 | 5324 | $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); |
| 5325 | 5325 | } else { |
| 5326 | 5326 | $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); |
| 5327 | 5327 | } |
| 5328 | - $more .= '</div></div>' . "\n"; |
|
| 5328 | + $more .= '</div></div>'."\n"; |
|
| 5329 | 5329 | } elseif ($input['type'] == 'checkbox') { |
| 5330 | 5330 | $more .= '<div class="tagtr">'; |
| 5331 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '"><label for="' . dol_escape_htmltag($input['name']) . '">' . $input['label'] . '</label></div><div class="tagtd">'; |
|
| 5332 | - $more .= '<input type="checkbox" class="flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . dol_escape_htmltag($input['name']) . '" name="' . dol_escape_htmltag($input['name']) . '"' . $moreattr; |
|
| 5331 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'"><label for="'.dol_escape_htmltag($input['name']).'">'.$input['label'].'</label></div><div class="tagtd">'; |
|
| 5332 | + $more .= '<input type="checkbox" class="flat'.($morecss ? ' '.$morecss : '').'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; |
|
| 5333 | 5333 | if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') { |
| 5334 | 5334 | $more .= ' checked'; |
| 5335 | 5335 | } |
@@ -5340,19 +5340,19 @@ discard block |
||
| 5340 | 5340 | $more .= ' disabled'; |
| 5341 | 5341 | } |
| 5342 | 5342 | $more .= ' /></div>'; |
| 5343 | - $more .= '</div>' . "\n"; |
|
| 5343 | + $more .= '</div>'."\n"; |
|
| 5344 | 5344 | } elseif ($input['type'] == 'radio') { |
| 5345 | 5345 | $i = 0; |
| 5346 | 5346 | foreach ($input['values'] as $selkey => $selval) { |
| 5347 | 5347 | $more .= '<div class="tagtr">'; |
| 5348 | 5348 | if (isset($input['label'])) { |
| 5349 | 5349 | if ($i == 0) { |
| 5350 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? ' tdtop' : (' tdtop ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5350 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5351 | 5351 | } else { |
| 5352 | - $more .= '<div class="tagtd' . (empty($input['tdclass']) ? '' : (' "' . $input['tdclass'])) . '"> </div>'; |
|
| 5352 | + $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'"> </div>'; |
|
| 5353 | 5353 | } |
| 5354 | 5354 | } |
| 5355 | - $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; |
|
| 5355 | + $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; |
|
| 5356 | 5356 | if (!empty($input['disabled'])) { |
| 5357 | 5357 | $more .= ' disabled'; |
| 5358 | 5358 | } |
@@ -5360,12 +5360,12 @@ discard block |
||
| 5360 | 5360 | $more .= ' checked="checked"'; |
| 5361 | 5361 | } |
| 5362 | 5362 | $more .= ' /> '; |
| 5363 | - $more .= '<label for="' . dol_escape_htmltag($input['name'] . $selkey) . '" class="valignmiddle">' . $selval . '</label>'; |
|
| 5364 | - $more .= '</div></div>' . "\n"; |
|
| 5363 | + $more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>'; |
|
| 5364 | + $more .= '</div></div>'."\n"; |
|
| 5365 | 5365 | $i++; |
| 5366 | 5366 | } |
| 5367 | 5367 | } elseif ($input['type'] == 'date' || $input['type'] == 'datetime') { |
| 5368 | - $more .= '<div class="tagtr"><div class="tagtd' . (empty($input['tdclass']) ? '' : (' ' . $input['tdclass'])) . '">' . $input['label'] . '</div>'; |
|
| 5368 | + $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div>'; |
|
| 5369 | 5369 | $more .= '<div class="tagtd">'; |
| 5370 | 5370 | $addnowlink = (empty($input['datenow']) ? 0 : 1); |
| 5371 | 5371 | $h = $m = 0; |
@@ -5383,24 +5383,24 @@ discard block |
||
| 5383 | 5383 | } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not |
| 5384 | 5384 | $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'; |
| 5385 | 5385 | if (!empty($input['label'])) { |
| 5386 | - $more .= $input['label'] . '</div><div class="tagtd">'; |
|
| 5386 | + $more .= $input['label'].'</div><div class="tagtd">'; |
|
| 5387 | 5387 | } |
| 5388 | 5388 | $more .= $input['value']; |
| 5389 | - $more .= '</div></div>' . "\n"; |
|
| 5389 | + $more .= '</div></div>'."\n"; |
|
| 5390 | 5390 | } elseif ($input['type'] == 'onecolumn') { |
| 5391 | 5391 | $moreonecolumn .= '<div class="margintoponly">'; |
| 5392 | 5392 | $moreonecolumn .= $input['value']; |
| 5393 | - $moreonecolumn .= '</div>' . "\n"; |
|
| 5393 | + $moreonecolumn .= '</div>'."\n"; |
|
| 5394 | 5394 | } elseif ($input['type'] == 'hidden') { |
| 5395 | 5395 | // Do nothing more, already added by a previous loop |
| 5396 | 5396 | } elseif ($input['type'] == 'separator') { |
| 5397 | 5397 | $more .= '<br>'; |
| 5398 | 5398 | } else { |
| 5399 | - $more .= 'Error type ' . $input['type'] . ' for the confirm box is not a supported type'; |
|
| 5399 | + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; |
|
| 5400 | 5400 | } |
| 5401 | 5401 | } |
| 5402 | 5402 | } |
| 5403 | - $more .= '</div>' . "\n"; |
|
| 5403 | + $more .= '</div>'."\n"; |
|
| 5404 | 5404 | $more .= $moreonecolumn; |
| 5405 | 5405 | } |
| 5406 | 5406 | |
@@ -5422,10 +5422,10 @@ discard block |
||
| 5422 | 5422 | $button = $useajax; |
| 5423 | 5423 | $useajax = 1; |
| 5424 | 5424 | $autoOpen = false; |
| 5425 | - $dialogconfirm .= '-' . $button; |
|
| 5425 | + $dialogconfirm .= '-'.$button; |
|
| 5426 | 5426 | } |
| 5427 | - $pageyes = $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=yes'; |
|
| 5428 | - $pageno = ($useajax == 2 ? $page . (preg_match('/\?/', $page) ? '&' : '?') . 'action=' . urlencode($action) . '&confirm=no' : ''); |
|
| 5427 | + $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=yes'; |
|
| 5428 | + $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.urlencode($action).'&confirm=no' : ''); |
|
| 5429 | 5429 | |
| 5430 | 5430 | // Add input fields into list of fields to read during submit (inputok and inputko) |
| 5431 | 5431 | if (is_array($formquestion)) { |
@@ -5447,24 +5447,24 @@ discard block |
||
| 5447 | 5447 | } |
| 5448 | 5448 | |
| 5449 | 5449 | // Show JQuery confirm box. |
| 5450 | - $formconfirm .= '<div id="' . $dialogconfirm . '" title="' . dol_escape_htmltag($title) . '" style="display: none;">'; |
|
| 5450 | + $formconfirm .= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; |
|
| 5451 | 5451 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5452 | - $formconfirm .= '<div class="confirmtext">' . $formquestion['text'] . '</div>' . "\n"; |
|
| 5452 | + $formconfirm .= '<div class="confirmtext">'.$formquestion['text'].'</div>'."\n"; |
|
| 5453 | 5453 | } |
| 5454 | 5454 | if (!empty($more)) { |
| 5455 | - $formconfirm .= '<div class="confirmquestions">' . $more . '</div>' . "\n"; |
|
| 5455 | + $formconfirm .= '<div class="confirmquestions">'.$more.'</div>'."\n"; |
|
| 5456 | 5456 | } |
| 5457 | - $formconfirm .= ($question ? '<div class="confirmmessage">' . img_help('', '') . ' ' . $question . '</div>' : ''); |
|
| 5458 | - $formconfirm .= '</div>' . "\n"; |
|
| 5457 | + $formconfirm .= ($question ? '<div class="confirmmessage">'.img_help('', '').' '.$question.'</div>' : ''); |
|
| 5458 | + $formconfirm .= '</div>'."\n"; |
|
| 5459 | 5459 | |
| 5460 | - $formconfirm .= "\n<!-- begin code of popup for formconfirm page=" . $page . " -->\n"; |
|
| 5461 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5460 | + $formconfirm .= "\n<!-- begin code of popup for formconfirm page=".$page." -->\n"; |
|
| 5461 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5462 | 5462 | $formconfirm .= "/* Code for the jQuery('#dialogforpopup').dialog() */\n"; |
| 5463 | 5463 | $formconfirm .= 'jQuery(document).ready(function() { |
| 5464 | 5464 | $(function() { |
| 5465 | - $( "#' . $dialogconfirm . '" ).dialog( |
|
| 5465 | + $( "#' . $dialogconfirm.'" ).dialog( |
|
| 5466 | 5466 | { |
| 5467 | - autoOpen: ' . ($autoOpen ? "true" : "false") . ','; |
|
| 5467 | + autoOpen: ' . ($autoOpen ? "true" : "false").','; |
|
| 5468 | 5468 | if ($newselectedchoice == 'no') { |
| 5469 | 5469 | $formconfirm .= ' |
| 5470 | 5470 | open: function() { |
@@ -5474,24 +5474,24 @@ discard block |
||
| 5474 | 5474 | |
| 5475 | 5475 | $jsforcursor = ''; |
| 5476 | 5476 | if ($useajax == 1) { |
| 5477 | - $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor' . "\n"; |
|
| 5478 | - $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");' . "\n"; |
|
| 5477 | + $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; |
|
| 5478 | + $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; |
|
| 5479 | 5479 | } |
| 5480 | 5480 | |
| 5481 | 5481 | $postconfirmas = 'GET'; |
| 5482 | 5482 | |
| 5483 | 5483 | $formconfirm .= ' |
| 5484 | 5484 | resizable: false, |
| 5485 | - height: "' . $height . '", |
|
| 5486 | - width: "' . $width . '", |
|
| 5485 | + height: "' . $height.'", |
|
| 5486 | + width: "' . $width.'", |
|
| 5487 | 5487 | modal: true, |
| 5488 | 5488 | closeOnEscape: false, |
| 5489 | 5489 | buttons: { |
| 5490 | - "' . dol_escape_js($langs->transnoentities($labelbuttonyes)) . '": function() { |
|
| 5491 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5492 | - var inputok = ' . json_encode($inputok) . '; /* List of fields into form */ |
|
| 5493 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5494 | - var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '') . '"; |
|
| 5490 | + "' . dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() { |
|
| 5491 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5492 | + var inputok = ' . json_encode($inputok).'; /* List of fields into form */ |
|
| 5493 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5494 | + var pageyes = "' . dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; |
|
| 5495 | 5495 | |
| 5496 | 5496 | if (inputok.length > 0) { |
| 5497 | 5497 | $.each(inputok, function(i, inputname) { |
@@ -5525,11 +5525,11 @@ discard block |
||
| 5525 | 5525 | } |
| 5526 | 5526 | $(this).dialog("close"); |
| 5527 | 5527 | }, |
| 5528 | - "' . dol_escape_js($langs->transnoentities($labelbuttonno)) . '": function() { |
|
| 5529 | - var options = "token=' . urlencode(newToken()) . '"; |
|
| 5530 | - var inputko = ' . json_encode($inputko) . '; /* List of fields into form */ |
|
| 5531 | - var page = "' . dol_escape_js(!empty($page) ? $page : '') . '"; |
|
| 5532 | - var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '') . '"; |
|
| 5528 | + "' . dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { |
|
| 5529 | + var options = "token=' . urlencode(newToken()).'"; |
|
| 5530 | + var inputko = ' . json_encode($inputko).'; /* List of fields into form */ |
|
| 5531 | + var page = "' . dol_escape_js(!empty($page) ? $page : '').'"; |
|
| 5532 | + var pageno="' . dol_escape_js(!empty($pageno) ? $pageno : '').'"; |
|
| 5533 | 5533 | if (inputko.length > 0) { |
| 5534 | 5534 | $.each(inputko, function(i, inputname) { |
| 5535 | 5535 | var more = ""; |
@@ -5561,10 +5561,10 @@ discard block |
||
| 5561 | 5561 | } |
| 5562 | 5562 | ); |
| 5563 | 5563 | |
| 5564 | - var button = "' . $button . '"; |
|
| 5564 | + var button = "' . $button.'"; |
|
| 5565 | 5565 | if (button.length > 0) { |
| 5566 | 5566 | $( "#" + button ).click(function() { |
| 5567 | - $("#' . $dialogconfirm . '").dialog("open"); |
|
| 5567 | + $("#' . $dialogconfirm.'").dialog("open"); |
|
| 5568 | 5568 | }); |
| 5569 | 5569 | } |
| 5570 | 5570 | }); |
@@ -5572,44 +5572,44 @@ discard block |
||
| 5572 | 5572 | </script>'; |
| 5573 | 5573 | $formconfirm .= "<!-- end ajax formconfirm -->\n"; |
| 5574 | 5574 | } else { |
| 5575 | - $formconfirm .= "\n<!-- begin formconfirm page=" . dol_escape_htmltag($page) . " -->\n"; |
|
| 5575 | + $formconfirm .= "\n<!-- begin formconfirm page=".dol_escape_htmltag($page)." -->\n"; |
|
| 5576 | 5576 | |
| 5577 | 5577 | if (empty($disableformtag)) { |
| 5578 | - $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright">' . "\n"; |
|
| 5578 | + $formconfirm .= '<form method="POST" action="'.$page.'" class="notoptoleftroright">'."\n"; |
|
| 5579 | 5579 | } |
| 5580 | 5580 | |
| 5581 | - $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">' . "\n"; |
|
| 5582 | - $formconfirm .= '<input type="hidden" name="token" value="' . newToken() . '">' . "\n"; |
|
| 5581 | + $formconfirm .= '<input type="hidden" name="action" value="'.$action.'">'."\n"; |
|
| 5582 | + $formconfirm .= '<input type="hidden" name="token" value="'.newToken().'">'."\n"; |
|
| 5583 | 5583 | |
| 5584 | - $formconfirm .= '<table class="valid centpercent">' . "\n"; |
|
| 5584 | + $formconfirm .= '<table class="valid centpercent">'."\n"; |
|
| 5585 | 5585 | |
| 5586 | 5586 | // Line title |
| 5587 | 5587 | $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">'; |
| 5588 | - $formconfirm .= img_picto('', 'pictoconfirm') . ' ' . $title; |
|
| 5589 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5588 | + $formconfirm .= img_picto('', 'pictoconfirm').' '.$title; |
|
| 5589 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5590 | 5590 | |
| 5591 | 5591 | // Line text |
| 5592 | 5592 | if (is_array($formquestion) && !empty($formquestion['text'])) { |
| 5593 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . $formquestion['text'] . '</td></tr>' . "\n"; |
|
| 5593 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n"; |
|
| 5594 | 5594 | } |
| 5595 | 5595 | |
| 5596 | 5596 | // Line form fields |
| 5597 | 5597 | if ($more) { |
| 5598 | - $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">' . "\n"; |
|
| 5598 | + $formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n"; |
|
| 5599 | 5599 | $formconfirm .= $more; |
| 5600 | - $formconfirm .= '</td></tr>' . "\n"; |
|
| 5600 | + $formconfirm .= '</td></tr>'."\n"; |
|
| 5601 | 5601 | } |
| 5602 | 5602 | |
| 5603 | 5603 | // Line with question |
| 5604 | 5604 | $formconfirm .= '<tr class="valid">'; |
| 5605 | - $formconfirm .= '<td class="valid">' . $question . '</td>'; |
|
| 5605 | + $formconfirm .= '<td class="valid">'.$question.'</td>'; |
|
| 5606 | 5606 | $formconfirm .= '<td class="valid center">'; |
| 5607 | 5607 | $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno); |
| 5608 | - $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="' . $langs->trans("Validate") . '">'; |
|
| 5608 | + $formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">'; |
|
| 5609 | 5609 | $formconfirm .= '</td>'; |
| 5610 | - $formconfirm .= '</tr>' . "\n"; |
|
| 5610 | + $formconfirm .= '</tr>'."\n"; |
|
| 5611 | 5611 | |
| 5612 | - $formconfirm .= '</table>' . "\n"; |
|
| 5612 | + $formconfirm .= '</table>'."\n"; |
|
| 5613 | 5613 | |
| 5614 | 5614 | if (empty($disableformtag)) { |
| 5615 | 5615 | $formconfirm .= "</form>\n"; |
@@ -5618,7 +5618,7 @@ discard block |
||
| 5618 | 5618 | |
| 5619 | 5619 | if (!empty($conf->use_javascript_ajax)) { |
| 5620 | 5620 | $formconfirm .= '<!-- code to disable button to avoid double clic -->'; |
| 5621 | - $formconfirm .= '<script nonce="' . getNonce() . '" type="text/javascript">' . "\n"; |
|
| 5621 | + $formconfirm .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n"; |
|
| 5622 | 5622 | $formconfirm .= ' |
| 5623 | 5623 | $(document).ready(function () { |
| 5624 | 5624 | $(".confirmvalidatebutton").on("click", function() { |
@@ -5630,7 +5630,7 @@ discard block |
||
| 5630 | 5630 | }); |
| 5631 | 5631 | }); |
| 5632 | 5632 | '; |
| 5633 | - $formconfirm .= '</script>' . "\n"; |
|
| 5633 | + $formconfirm .= '</script>'."\n"; |
|
| 5634 | 5634 | } |
| 5635 | 5635 | |
| 5636 | 5636 | $formconfirm .= "<!-- end formconfirm -->\n"; |
@@ -5662,8 +5662,8 @@ discard block |
||
| 5662 | 5662 | // phpcs:enable |
| 5663 | 5663 | global $langs; |
| 5664 | 5664 | |
| 5665 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 5666 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
| 5665 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 5666 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
| 5667 | 5667 | |
| 5668 | 5668 | $out = ''; |
| 5669 | 5669 | |
@@ -5671,11 +5671,11 @@ discard block |
||
| 5671 | 5671 | |
| 5672 | 5672 | $langs->load("project"); |
| 5673 | 5673 | if ($htmlname != "none") { |
| 5674 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 5674 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 5675 | 5675 | $out .= '<input type="hidden" name="action" value="classin">'; |
| 5676 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5676 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5677 | 5677 | $out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1, 0, $morecss); |
| 5678 | - $out .= '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5678 | + $out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5679 | 5679 | $out .= '</form>'; |
| 5680 | 5680 | } else { |
| 5681 | 5681 | $out .= '<span class="project_head_block">'; |
@@ -5684,7 +5684,7 @@ discard block |
||
| 5684 | 5684 | $projet->fetch($selected); |
| 5685 | 5685 | $out .= $projet->getNomUrl(0, '', 1); |
| 5686 | 5686 | } else { |
| 5687 | - $out .= '<span class="opacitymedium">' . $textifnoproject . '</span>'; |
|
| 5687 | + $out .= '<span class="opacitymedium">'.$textifnoproject.'</span>'; |
|
| 5688 | 5688 | } |
| 5689 | 5689 | $out .= '</span>'; |
| 5690 | 5690 | } |
@@ -5721,14 +5721,14 @@ discard block |
||
| 5721 | 5721 | $out = ''; |
| 5722 | 5722 | |
| 5723 | 5723 | if ($htmlname != "none") { |
| 5724 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5724 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5725 | 5725 | $out .= '<input type="hidden" name="action" value="setconditions">'; |
| 5726 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5726 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5727 | 5727 | if ($type) { |
| 5728 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5728 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5729 | 5729 | } |
| 5730 | 5730 | $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); |
| 5731 | - $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5731 | + $out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5732 | 5732 | $out .= '</form>'; |
| 5733 | 5733 | } else { |
| 5734 | 5734 | if ($selected) { |
@@ -5773,12 +5773,12 @@ discard block |
||
| 5773 | 5773 | // phpcs:enable |
| 5774 | 5774 | global $langs; |
| 5775 | 5775 | if ($htmlname != "none") { |
| 5776 | - print '<form method="post" action="' . $page . '">'; |
|
| 5776 | + print '<form method="post" action="'.$page.'">'; |
|
| 5777 | 5777 | print '<input type="hidden" name="action" value="setavailability">'; |
| 5778 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5778 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5779 | 5779 | $this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty); |
| 5780 | - print '<input type="submit" name="modify" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5781 | - print '<input type="submit" name="cancel" class="button smallpaddingimp" value="' . $langs->trans("Cancel") . '">'; |
|
| 5780 | + print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5781 | + print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">'; |
|
| 5782 | 5782 | print '</form>'; |
| 5783 | 5783 | } else { |
| 5784 | 5784 | if ($selected) { |
@@ -5804,11 +5804,11 @@ discard block |
||
| 5804 | 5804 | { |
| 5805 | 5805 | global $langs; |
| 5806 | 5806 | if ($htmlname != "none") { |
| 5807 | - print '<form method="post" action="' . $page . '">'; |
|
| 5807 | + print '<form method="post" action="'.$page.'">'; |
|
| 5808 | 5808 | print '<input type="hidden" name="action" value="setdemandreason">'; |
| 5809 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5809 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5810 | 5810 | $this->selectInputReason($selected, $htmlname, -1, $addempty); |
| 5811 | - print '<input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '">'; |
|
| 5811 | + print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">'; |
|
| 5812 | 5812 | print '</form>'; |
| 5813 | 5813 | } else { |
| 5814 | 5814 | if ($selected) { |
@@ -5848,17 +5848,17 @@ discard block |
||
| 5848 | 5848 | $ret = ''; |
| 5849 | 5849 | |
| 5850 | 5850 | if ($htmlname != "none") { |
| 5851 | - $ret .= '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5852 | - $ret .= '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5853 | - $ret .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5851 | + $ret .= '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5852 | + $ret .= '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5853 | + $ret .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5854 | 5854 | if ($type) { |
| 5855 | - $ret .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5855 | + $ret .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5856 | 5856 | } |
| 5857 | 5857 | $ret .= '<table class="nobordernopadding">'; |
| 5858 | 5858 | $ret .= '<tr><td>'; |
| 5859 | - $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form' . $htmlname, 1, 0); |
|
| 5859 | + $ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0); |
|
| 5860 | 5860 | $ret .= '</td>'; |
| 5861 | - $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 5861 | + $ret .= '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 5862 | 5862 | $ret .= '</tr></table></form>'; |
| 5863 | 5863 | } else { |
| 5864 | 5864 | if ($displayhour) { |
@@ -5893,15 +5893,15 @@ discard block |
||
| 5893 | 5893 | global $langs; |
| 5894 | 5894 | |
| 5895 | 5895 | if ($htmlname != "none") { |
| 5896 | - print '<form method="POST" action="' . $page . '" name="form' . $htmlname . '">'; |
|
| 5897 | - print '<input type="hidden" name="action" value="set' . $htmlname . '">'; |
|
| 5898 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5896 | + print '<form method="POST" action="'.$page.'" name="form'.$htmlname.'">'; |
|
| 5897 | + print '<input type="hidden" name="action" value="set'.$htmlname.'">'; |
|
| 5898 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5899 | 5899 | print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include); |
| 5900 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5900 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5901 | 5901 | print '</form>'; |
| 5902 | 5902 | } else { |
| 5903 | 5903 | if ($selected) { |
| 5904 | - require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; |
|
| 5904 | + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
|
| 5905 | 5905 | $theuser = new User($this->db); |
| 5906 | 5906 | $theuser->fetch($selected); |
| 5907 | 5907 | print $theuser->getNomUrl(1); |
@@ -5934,14 +5934,14 @@ discard block |
||
| 5934 | 5934 | |
| 5935 | 5935 | $out = ''; |
| 5936 | 5936 | if ($htmlname != "none") { |
| 5937 | - $out .= '<form method="POST" action="' . $page . '">'; |
|
| 5937 | + $out .= '<form method="POST" action="'.$page.'">'; |
|
| 5938 | 5938 | $out .= '<input type="hidden" name="action" value="setmode">'; |
| 5939 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5939 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5940 | 5940 | if ($type) { |
| 5941 | - $out .= '<input type="hidden" name="type" value="' . dol_escape_htmltag($type) . '">'; |
|
| 5941 | + $out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">'; |
|
| 5942 | 5942 | } |
| 5943 | 5943 | $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); |
| 5944 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5944 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5945 | 5945 | $out .= '</form>'; |
| 5946 | 5946 | } else { |
| 5947 | 5947 | if ($selected) { |
@@ -5974,11 +5974,11 @@ discard block |
||
| 5974 | 5974 | { |
| 5975 | 5975 | global $langs; |
| 5976 | 5976 | if ($htmlname != "none") { |
| 5977 | - print '<form method="POST" action="' . $page . '">'; |
|
| 5977 | + print '<form method="POST" action="'.$page.'">'; |
|
| 5978 | 5978 | print '<input type="hidden" name="action" value="settransportmode">'; |
| 5979 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 5979 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 5980 | 5980 | $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); |
| 5981 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 5981 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 5982 | 5982 | print '</form>'; |
| 5983 | 5983 | } else { |
| 5984 | 5984 | if ($selected) { |
@@ -6005,11 +6005,11 @@ discard block |
||
| 6005 | 6005 | // phpcs:enable |
| 6006 | 6006 | global $langs; |
| 6007 | 6007 | if ($htmlname != "none") { |
| 6008 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6008 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6009 | 6009 | print '<input type="hidden" name="action" value="setmulticurrencycode">'; |
| 6010 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6010 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6011 | 6011 | print $this->selectMultiCurrency($selected, $htmlname, 0); |
| 6012 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6012 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6013 | 6013 | print '</form>'; |
| 6014 | 6014 | } else { |
| 6015 | 6015 | dol_include_once('/core/lib/company.lib.php'); |
@@ -6034,21 +6034,21 @@ discard block |
||
| 6034 | 6034 | global $langs, $mysoc, $conf; |
| 6035 | 6035 | |
| 6036 | 6036 | if ($htmlname != "none") { |
| 6037 | - print '<form method="POST" action="' . $page . '">'; |
|
| 6037 | + print '<form method="POST" action="'.$page.'">'; |
|
| 6038 | 6038 | print '<input type="hidden" name="action" value="setmulticurrencyrate">'; |
| 6039 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6040 | - print '<input type="text" class="maxwidth100" name="' . $htmlname . '" value="' . (!empty($rate) ? price(price2num($rate, 'CU')) : 1) . '" /> '; |
|
| 6039 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6040 | + print '<input type="text" class="maxwidth100" name="'.$htmlname.'" value="'.(!empty($rate) ? price(price2num($rate, 'CU')) : 1).'" /> '; |
|
| 6041 | 6041 | print '<select name="calculation_mode">'; |
| 6042 | - print '<option value="1">Change ' . $langs->trans("PriceUHT") . ' of lines</option>'; |
|
| 6043 | - print '<option value="2">Change ' . $langs->trans("PriceUHTCurrency") . ' of lines</option>'; |
|
| 6042 | + print '<option value="1">Change '.$langs->trans("PriceUHT").' of lines</option>'; |
|
| 6043 | + print '<option value="2">Change '.$langs->trans("PriceUHTCurrency").' of lines</option>'; |
|
| 6044 | 6044 | print '</select> '; |
| 6045 | - print '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6045 | + print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6046 | 6046 | print '</form>'; |
| 6047 | 6047 | } else { |
| 6048 | 6048 | if (!empty($rate)) { |
| 6049 | 6049 | print price($rate, 1, $langs, 1, 0); |
| 6050 | 6050 | if ($currency && $rate != 1) { |
| 6051 | - print ' (' . price($rate, 1, $langs, 1, 0) . ' ' . $currency . ' = 1 ' . $conf->currency . ')'; |
|
| 6051 | + print ' ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; |
|
| 6052 | 6052 | } |
| 6053 | 6053 | } else { |
| 6054 | 6054 | print 1; |
@@ -6079,9 +6079,9 @@ discard block |
||
| 6079 | 6079 | // phpcs:enable |
| 6080 | 6080 | global $conf, $langs; |
| 6081 | 6081 | if ($htmlname != "none") { |
| 6082 | - print '<form method="post" action="' . $page . '">'; |
|
| 6082 | + print '<form method="post" action="'.$page.'">'; |
|
| 6083 | 6083 | print '<input type="hidden" name="action" value="setabsolutediscount">'; |
| 6084 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6084 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6085 | 6085 | print '<div class="inline-block">'; |
| 6086 | 6086 | if (!empty($discount_type)) { |
| 6087 | 6087 | if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) { |
@@ -6119,24 +6119,24 @@ discard block |
||
| 6119 | 6119 | print '</div>'; |
| 6120 | 6120 | if (empty($hidelist)) { |
| 6121 | 6121 | print '<div class="inline-block" style="padding-right: 10px">'; |
| 6122 | - $newfilter = 'discount_type=' . intval($discount_type); |
|
| 6122 | + $newfilter = 'discount_type='.intval($discount_type); |
|
| 6123 | 6123 | if (!empty($discount_type)) { |
| 6124 | 6124 | $newfilter .= ' AND fk_invoice_supplier IS NULL AND fk_invoice_supplier_line IS NULL'; // Supplier discounts available |
| 6125 | 6125 | } else { |
| 6126 | 6126 | $newfilter .= ' AND fk_facture IS NULL AND fk_facture_line IS NULL'; // Customer discounts available |
| 6127 | 6127 | } |
| 6128 | 6128 | if ($filter) { |
| 6129 | - $newfilter .= ' AND (' . $filter . ')'; |
|
| 6129 | + $newfilter .= ' AND ('.$filter.')'; |
|
| 6130 | 6130 | } |
| 6131 | 6131 | // output the combo of discounts |
| 6132 | 6132 | $nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue); |
| 6133 | 6133 | if ($nbqualifiedlines > 0) { |
| 6134 | - print ' <input type="submit" class="button smallpaddingimp" value="' . dol_escape_htmltag($langs->trans("UseLine")) . '"'; |
|
| 6134 | + print ' <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"'; |
|
| 6135 | 6135 | if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')") { |
| 6136 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6136 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6137 | 6137 | } |
| 6138 | 6138 | if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')") { |
| 6139 | - print ' title="' . $langs->trans("UseCreditNoteInInvoicePayment") . '"'; |
|
| 6139 | + print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"'; |
|
| 6140 | 6140 | } |
| 6141 | 6141 | |
| 6142 | 6142 | print '>'; |
@@ -6176,23 +6176,23 @@ discard block |
||
| 6176 | 6176 | global $langs, $conf; |
| 6177 | 6177 | |
| 6178 | 6178 | if ($htmlname != "none") { |
| 6179 | - print '<form method="post" action="' . $page . '">'; |
|
| 6179 | + print '<form method="post" action="'.$page.'">'; |
|
| 6180 | 6180 | print '<input type="hidden" name="action" value="set_contact">'; |
| 6181 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6181 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6182 | 6182 | print '<table class="nobordernopadding">'; |
| 6183 | 6183 | print '<tr><td>'; |
| 6184 | 6184 | print $this->selectcontacts($societe->id, $selected, $htmlname); |
| 6185 | 6185 | $num = $this->num; |
| 6186 | 6186 | if ($num == 0) { |
| 6187 | 6187 | $addcontact = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); |
| 6188 | - print '<a href="' . DOL_URL_ROOT . '/contact/card.php?socid=' . $societe->id . '&action=create&backtoreferer=1">' . $addcontact . '</a>'; |
|
| 6188 | + print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&action=create&backtoreferer=1">'.$addcontact.'</a>'; |
|
| 6189 | 6189 | } |
| 6190 | 6190 | print '</td>'; |
| 6191 | - print '<td class="left"><input type="submit" class="button smallpaddingimp" value="' . $langs->trans("Modify") . '"></td>'; |
|
| 6191 | + print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>'; |
|
| 6192 | 6192 | print '</tr></table></form>'; |
| 6193 | 6193 | } else { |
| 6194 | 6194 | if ($selected) { |
| 6195 | - require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
| 6195 | + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
| 6196 | 6196 | $contact = new Contact($this->db); |
| 6197 | 6197 | $contact->fetch($selected); |
| 6198 | 6198 | print $contact->getFullName($langs); |
@@ -6227,20 +6227,20 @@ discard block |
||
| 6227 | 6227 | |
| 6228 | 6228 | $out = ''; |
| 6229 | 6229 | if ($htmlname != "none") { |
| 6230 | - $out .= '<form method="post" action="' . $page . '">'; |
|
| 6230 | + $out .= '<form method="post" action="'.$page.'">'; |
|
| 6231 | 6231 | $out .= '<input type="hidden" name="action" value="set_thirdparty">'; |
| 6232 | - $out .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 6232 | + $out .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 6233 | 6233 | $out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, 0, 'minwidth100', '', '', 1, array(), false, $excludeids); |
| 6234 | - $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
| 6234 | + $out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
| 6235 | 6235 | $out .= '</form>'; |
| 6236 | 6236 | } else { |
| 6237 | 6237 | if ($selected) { |
| 6238 | - require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 6238 | + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 6239 | 6239 | $soc = new Societe($this->db); |
| 6240 | 6240 | $soc->fetch($selected); |
| 6241 | 6241 | $out .= $soc->getNomUrl(0, ''); |
| 6242 | 6242 | } else { |
| 6243 | - $out .= '<span class="opacitymedium">' . $textifnothirdparty . '</span>'; |
|
| 6243 | + $out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>'; |
|
| 6244 | 6244 | } |
| 6245 | 6245 | } |
| 6246 | 6246 | |
@@ -6290,22 +6290,22 @@ discard block |
||
| 6290 | 6290 | $selected = 'EUR'; // Pour compatibilite |
| 6291 | 6291 | } |
| 6292 | 6292 | |
| 6293 | - $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6293 | + $out .= '<select class="flat maxwidth200onsmartphone minwidth300" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6294 | 6294 | if ($useempty) { |
| 6295 | 6295 | $out .= '<option value="-1" selected></option>'; |
| 6296 | 6296 | } |
| 6297 | 6297 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6298 | 6298 | $labeltoshow = $currency['label']; |
| 6299 | 6299 | if ($mode == 1) { |
| 6300 | - $labeltoshow .= ' <span class="opacitymedium">(' . $code_iso . ')</span>'; |
|
| 6300 | + $labeltoshow .= ' <span class="opacitymedium">('.$code_iso.')</span>'; |
|
| 6301 | 6301 | } else { |
| 6302 | - $labeltoshow .= ' <span class="opacitymedium">(' . $langs->getCurrencySymbol($code_iso) . ')</span>'; |
|
| 6302 | + $labeltoshow .= ' <span class="opacitymedium">('.$langs->getCurrencySymbol($code_iso).')</span>'; |
|
| 6303 | 6303 | } |
| 6304 | 6304 | |
| 6305 | 6305 | if ($selected && $selected == $code_iso) { |
| 6306 | - $out .= '<option value="' . $code_iso . '" selected data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6306 | + $out .= '<option value="'.$code_iso.'" selected data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6307 | 6307 | } else { |
| 6308 | - $out .= '<option value="' . $code_iso . '" data-html="' . dol_escape_htmltag($labeltoshow) . '">'; |
|
| 6308 | + $out .= '<option value="'.$code_iso.'" data-html="'.dol_escape_htmltag($labeltoshow).'">'; |
|
| 6309 | 6309 | } |
| 6310 | 6310 | $out .= $labeltoshow; |
| 6311 | 6311 | $out .= '</option>'; |
@@ -6316,7 +6316,7 @@ discard block |
||
| 6316 | 6316 | } |
| 6317 | 6317 | |
| 6318 | 6318 | // Make select dynamic |
| 6319 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6319 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6320 | 6320 | $out .= ajax_combobox($htmlname); |
| 6321 | 6321 | |
| 6322 | 6322 | return $out; |
@@ -6342,10 +6342,10 @@ discard block |
||
| 6342 | 6342 | |
| 6343 | 6343 | $TCurrency = array(); |
| 6344 | 6344 | |
| 6345 | - $sql = "SELECT code FROM " . $this->db->prefix() . "multicurrency"; |
|
| 6346 | - $sql .= " WHERE entity IN ('" . getEntity('mutlicurrency') . "')"; |
|
| 6345 | + $sql = "SELECT code FROM ".$this->db->prefix()."multicurrency"; |
|
| 6346 | + $sql .= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; |
|
| 6347 | 6347 | if ($filter) { |
| 6348 | - $sql .= " AND " . $filter; |
|
| 6348 | + $sql .= " AND ".$filter; |
|
| 6349 | 6349 | } |
| 6350 | 6350 | $resql = $this->db->query($sql); |
| 6351 | 6351 | if ($resql) { |
@@ -6355,7 +6355,7 @@ discard block |
||
| 6355 | 6355 | } |
| 6356 | 6356 | |
| 6357 | 6357 | $out = ''; |
| 6358 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 6358 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 6359 | 6359 | if ($useempty) { |
| 6360 | 6360 | $out .= '<option value=""> </option>'; |
| 6361 | 6361 | } |
@@ -6367,13 +6367,13 @@ discard block |
||
| 6367 | 6367 | foreach ($langs->cache_currencies as $code_iso => $currency) { |
| 6368 | 6368 | if (isset($TCurrency[$code_iso])) { |
| 6369 | 6369 | if (!empty($selected) && $selected == $code_iso) { |
| 6370 | - $out .= '<option value="' . $code_iso . '" selected="selected">'; |
|
| 6370 | + $out .= '<option value="'.$code_iso.'" selected="selected">'; |
|
| 6371 | 6371 | } else { |
| 6372 | - $out .= '<option value="' . $code_iso . '">'; |
|
| 6372 | + $out .= '<option value="'.$code_iso.'">'; |
|
| 6373 | 6373 | } |
| 6374 | 6374 | |
| 6375 | 6375 | $out .= $currency['label']; |
| 6376 | - $out .= ' (' . $langs->getCurrencySymbol($code_iso) . ')'; |
|
| 6376 | + $out .= ' ('.$langs->getCurrencySymbol($code_iso).')'; |
|
| 6377 | 6377 | $out .= '</option>'; |
| 6378 | 6378 | } |
| 6379 | 6379 | } |
@@ -6382,7 +6382,7 @@ discard block |
||
| 6382 | 6382 | $out .= '</select>'; |
| 6383 | 6383 | |
| 6384 | 6384 | // Make select dynamic |
| 6385 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 6385 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 6386 | 6386 | $out .= ajax_combobox($htmlname); |
| 6387 | 6387 | |
| 6388 | 6388 | return $out; |
@@ -6413,7 +6413,7 @@ discard block |
||
| 6413 | 6413 | $sql .= " WHERE t.fk_pays = c.rowid"; |
| 6414 | 6414 | $sql .= " AND t.active > 0"; |
| 6415 | 6415 | $sql .= " AND t.entity IN (".getEntity('c_tva').")"; |
| 6416 | - $sql .= " AND c.code IN (" . $this->db->sanitize($country_code, 1) . ")"; |
|
| 6416 | + $sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")"; |
|
| 6417 | 6417 | $sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC"; |
| 6418 | 6418 | |
| 6419 | 6419 | $resql = $this->db->query($sql); |
@@ -6425,30 +6425,30 @@ discard block |
||
| 6425 | 6425 | |
| 6426 | 6426 | $tmparray = array(); |
| 6427 | 6427 | $tmparray['rowid'] = $obj->rowid; |
| 6428 | - $tmparray['type_vat'] = $obj->type_vat; |
|
| 6429 | - $tmparray['code'] = $obj->code; |
|
| 6428 | + $tmparray['type_vat'] = $obj->type_vat; |
|
| 6429 | + $tmparray['code'] = $obj->code; |
|
| 6430 | 6430 | $tmparray['txtva'] = $obj->taux; |
| 6431 | - $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6431 | + $tmparray['nprtva'] = $obj->recuperableonly; |
|
| 6432 | 6432 | $tmparray['localtax1'] = $obj->localtax1; |
| 6433 | 6433 | $tmparray['localtax1_type'] = $obj->localtax1_type; |
| 6434 | 6434 | $tmparray['localtax2'] = $obj->localtax2; |
| 6435 | 6435 | $tmparray['localtax2_type'] = $obj->localtax1_type; |
| 6436 | - $tmparray['label'] = $obj->taux . '%' . ($obj->code ? ' (' . $obj->code . ')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6437 | - $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 |
|
| 6436 | + $tmparray['label'] = $obj->taux.'%'.($obj->code ? ' ('.$obj->code.')' : ''); // Label must contains only 0-9 , . % or * |
|
| 6437 | + $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 |
|
| 6438 | 6438 | $positiverates = ''; |
| 6439 | 6439 | if ($obj->taux) { |
| 6440 | - $positiverates .= ($positiverates ? '/' : '') . $obj->taux; |
|
| 6440 | + $positiverates .= ($positiverates ? '/' : '').$obj->taux; |
|
| 6441 | 6441 | } |
| 6442 | 6442 | if ($obj->localtax1) { |
| 6443 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax1; |
|
| 6443 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax1; |
|
| 6444 | 6444 | } |
| 6445 | 6445 | if ($obj->localtax2) { |
| 6446 | - $positiverates .= ($positiverates ? '/' : '') . $obj->localtax2; |
|
| 6446 | + $positiverates .= ($positiverates ? '/' : '').$obj->localtax2; |
|
| 6447 | 6447 | } |
| 6448 | 6448 | if (empty($positiverates)) { |
| 6449 | 6449 | $positiverates = '0'; |
| 6450 | 6450 | } |
| 6451 | - $tmparray['labelpositiverates'] = $positiverates . ($obj->code ? ' (' . $obj->code . ')' : ''); // Must never be used as key, only label |
|
| 6451 | + $tmparray['labelpositiverates'] = $positiverates.($obj->code ? ' ('.$obj->code.')' : ''); // Must never be used as key, only label |
|
| 6452 | 6452 | |
| 6453 | 6453 | $this->cache_vatrates[$obj->rowid] = $tmparray; |
| 6454 | 6454 | } |
@@ -6468,7 +6468,7 @@ discard block |
||
| 6468 | 6468 | return -1; |
| 6469 | 6469 | } |
| 6470 | 6470 | } else { |
| 6471 | - $this->error = '<span class="error">' . $this->db->error() . '</span>'; |
|
| 6471 | + $this->error = '<span class="error">'.$this->db->error().'</span>'; |
|
| 6472 | 6472 | return -2; |
| 6473 | 6473 | } |
| 6474 | 6474 | } |
@@ -6521,9 +6521,9 @@ discard block |
||
| 6521 | 6521 | // Check parameters |
| 6522 | 6522 | if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) { |
| 6523 | 6523 | if ($societe_vendeuse->id == $mysoc->id) { |
| 6524 | - $return .= '<span class="error">' . $langs->trans("ErrorYourCountryIsNotDefined") . '</span>'; |
|
| 6524 | + $return .= '<span class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</span>'; |
|
| 6525 | 6525 | } else { |
| 6526 | - $return .= '<span class="error">' . $langs->trans("ErrorSupplierCountryIsNotDefined") . '</span>'; |
|
| 6526 | + $return .= '<span class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</span>'; |
|
| 6527 | 6527 | } |
| 6528 | 6528 | return $return; |
| 6529 | 6529 | } |
@@ -6535,12 +6535,12 @@ discard block |
||
| 6535 | 6535 | // Define list of countries to use to search VAT rates to show |
| 6536 | 6536 | // First we defined code_country to use to find list |
| 6537 | 6537 | if (is_object($societe_vendeuse)) { |
| 6538 | - $code_country = "'" . $societe_vendeuse->country_code . "'"; |
|
| 6538 | + $code_country = "'".$societe_vendeuse->country_code."'"; |
|
| 6539 | 6539 | } else { |
| 6540 | - $code_country = "'" . $mysoc->country_code . "'"; // Pour compatibilite ascendente |
|
| 6540 | + $code_country = "'".$mysoc->country_code."'"; // Pour compatibilite ascendente |
|
| 6541 | 6541 | } |
| 6542 | 6542 | if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on |
| 6543 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
| 6543 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
| 6544 | 6544 | // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries |
| 6545 | 6545 | // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country |
| 6546 | 6546 | $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); |
@@ -6550,27 +6550,27 @@ discard block |
||
| 6550 | 6550 | if ($type == 1) { // We know product is a service |
| 6551 | 6551 | switch ($selectVatComboMode) { |
| 6552 | 6552 | case '1': |
| 6553 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6553 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6554 | 6554 | break; |
| 6555 | 6555 | case '2': |
| 6556 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6556 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6557 | 6557 | break; |
| 6558 | 6558 | } |
| 6559 | 6559 | } |
| 6560 | 6560 | } elseif (!$idprod) { // We don't know type of product |
| 6561 | 6561 | switch ($selectVatComboMode) { |
| 6562 | 6562 | case '1': |
| 6563 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6563 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6564 | 6564 | break; |
| 6565 | 6565 | case '2': |
| 6566 | - $code_country = "'" . $societe_acheteuse->country_code . "'"; |
|
| 6566 | + $code_country = "'".$societe_acheteuse->country_code."'"; |
|
| 6567 | 6567 | break; |
| 6568 | 6568 | } |
| 6569 | 6569 | } else { |
| 6570 | 6570 | $prodstatic = new Product($this->db); |
| 6571 | 6571 | $prodstatic->fetch($idprod); |
| 6572 | 6572 | if ($prodstatic->type == Product::TYPE_SERVICE) { // We know product is a service |
| 6573 | - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; |
|
| 6573 | + $code_country .= ",'".$societe_acheteuse->country_code."'"; |
|
| 6574 | 6574 | } |
| 6575 | 6575 | } |
| 6576 | 6576 | } |
@@ -6632,13 +6632,13 @@ discard block |
||
| 6632 | 6632 | // Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead |
| 6633 | 6633 | // of using supplier invoices (this is a very bad idea !) |
| 6634 | 6634 | if (!getDolGlobalString('EXPENSEREPORT_OVERRIDE_VAT')) { |
| 6635 | - $title = ' title="' . dol_escape_htmltag($langs->trans('VATIsNotUsed')) . '"'; |
|
| 6635 | + $title = ' title="'.dol_escape_htmltag($langs->trans('VATIsNotUsed')).'"'; |
|
| 6636 | 6636 | $disabled = true; |
| 6637 | 6637 | } |
| 6638 | 6638 | } |
| 6639 | 6639 | |
| 6640 | 6640 | if (!$options_only) { |
| 6641 | - $return .= '<select class="flat minwidth50imp maxwidth100" id="' . $htmlname . '" name="' . $htmlname . '"' . ($disabled ? ' disabled' : '') . $title . '>'; |
|
| 6641 | + $return .= '<select class="flat minwidth50imp maxwidth100" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled ? ' disabled' : '').$title.'>'; |
|
| 6642 | 6642 | } |
| 6643 | 6643 | |
| 6644 | 6644 | $selectedfound = false; |
@@ -6652,13 +6652,13 @@ discard block |
||
| 6652 | 6652 | $key = $rate['txtva']; |
| 6653 | 6653 | $key .= $rate['nprtva'] ? '*' : ''; |
| 6654 | 6654 | if ($mode > 0 && $rate['code']) { |
| 6655 | - $key .= ' (' . $rate['code'] . ')'; |
|
| 6655 | + $key .= ' ('.$rate['code'].')'; |
|
| 6656 | 6656 | } |
| 6657 | 6657 | if ($mode < 0) { |
| 6658 | 6658 | $key = $rate['rowid']; |
| 6659 | 6659 | } |
| 6660 | 6660 | |
| 6661 | - $return .= '<option value="' . $key . '"'; |
|
| 6661 | + $return .= '<option value="'.$key.'"'; |
|
| 6662 | 6662 | if (!$selectedfound) { |
| 6663 | 6663 | if ($defaultcode) { // If defaultcode is defined, we used it in priority to select combo option instead of using rate+npr flag |
| 6664 | 6664 | if ($defaultcode == $rate['code']) { |
@@ -6729,7 +6729,7 @@ discard block |
||
| 6729 | 6729 | 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 = '') |
| 6730 | 6730 | { |
| 6731 | 6731 | // phpcs:enable |
| 6732 | - dol_syslog(__METHOD__ . ': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6732 | + dol_syslog(__METHOD__.': using select_date is deprecated. Use selectDate instead.', LOG_WARNING); |
|
| 6733 | 6733 | $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); |
| 6734 | 6734 | if (!empty($nooutput)) { |
| 6735 | 6735 | return $retstring; |
@@ -6758,11 +6758,11 @@ discard block |
||
| 6758 | 6758 | { |
| 6759 | 6759 | global $langs; |
| 6760 | 6760 | |
| 6761 | - $ret = $this->selectDate($set_time, $prefix . '_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6761 | + $ret = $this->selectDate($set_time, $prefix.'_start', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("from"), 'tzuserrel'); |
|
| 6762 | 6762 | if ($forcenewline) { |
| 6763 | 6763 | $ret .= '<br>'; |
| 6764 | 6764 | } |
| 6765 | - $ret .= $this->selectDate($set_time_end, $prefix . '_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6765 | + $ret .= $this->selectDate($set_time_end, $prefix.'_end', 0, 0, $empty, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
|
| 6766 | 6766 | return $ret; |
| 6767 | 6767 | } |
| 6768 | 6768 | |
@@ -6828,7 +6828,7 @@ discard block |
||
| 6828 | 6828 | $orig_set_time = $set_time; |
| 6829 | 6829 | |
| 6830 | 6830 | if ($set_time === '' && $emptydate == 0) { |
| 6831 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 6831 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 6832 | 6832 | if ($gm == 'tzuser' || $gm == 'tzuserrel') { |
| 6833 | 6833 | $set_time = dol_now($gm); |
| 6834 | 6834 | } else { |
@@ -6896,38 +6896,38 @@ discard block |
||
| 6896 | 6896 | // Calendrier popup version eldy |
| 6897 | 6897 | if ($usecalendar == "eldy") { |
| 6898 | 6898 | // Input area to enter date manually |
| 6899 | - $retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"'; |
|
| 6899 | + $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
|
| 6900 | 6900 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6901 | - $retstring .= ' onChange="dpChangeDay(\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6901 | + $retstring .= ' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6902 | 6902 | $retstring .= '>'; |
| 6903 | 6903 | |
| 6904 | 6904 | // Icon calendar |
| 6905 | 6905 | $retstringbuttom = ''; |
| 6906 | 6906 | if (!$disabled) { |
| 6907 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6908 | - $base = DOL_URL_ROOT . '/core/'; |
|
| 6909 | - $retstringbuttom .= ' onClick="showDP(\'' . $base . '\',\'' . $prefix . '\',\'' . $langs->trans("FormatDateShortJavaInput") . '\',\'' . $langs->defaultlang . '\');"'; |
|
| 6910 | - $retstringbuttom .= '>' . img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6907 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"'; |
|
| 6908 | + $base = DOL_URL_ROOT.'/core/'; |
|
| 6909 | + $retstringbuttom .= ' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');"'; |
|
| 6910 | + $retstringbuttom .= '>'.img_object($langs->trans("SelectDate"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6911 | 6911 | } else { |
| 6912 | - $retstringbuttom = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6912 | + $retstringbuttom = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6913 | 6913 | } |
| 6914 | - $retstring = $retstringbuttom . $retstring; |
|
| 6914 | + $retstring = $retstringbuttom.$retstring; |
|
| 6915 | 6915 | |
| 6916 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6917 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6918 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6916 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6917 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6918 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6919 | 6919 | } elseif ($usecalendar == 'jquery') { |
| 6920 | 6920 | if (!$disabled) { |
| 6921 | 6921 | // Output javascript for datepicker |
| 6922 | 6922 | $minYear = getDolGlobalInt('MIN_YEAR_SELECT_DATE', (date('Y') - 100)); |
| 6923 | 6923 | $maxYear = getDolGlobalInt('MAX_YEAR_SELECT_DATE', (date('Y') + 100)); |
| 6924 | 6924 | |
| 6925 | - $retstring .= '<script nonce="' . getNonce() . '" type="text/javascript">'; |
|
| 6926 | - $retstring .= "$(function(){ $('#" . $prefix . "').datepicker({ |
|
| 6927 | - dateFormat: '" . $langs->trans("FormatDateShortJQueryInput") . "', |
|
| 6925 | + $retstring .= '<script nonce="'.getNonce().'" type="text/javascript">'; |
|
| 6926 | + $retstring .= "$(function(){ $('#".$prefix."').datepicker({ |
|
| 6927 | + dateFormat: '" . $langs->trans("FormatDateShortJQueryInput")."', |
|
| 6928 | 6928 | autoclose: true, |
| 6929 | 6929 | todayHighlight: true, |
| 6930 | - yearRange: '" . $minYear . ":" . $maxYear . "',"; |
|
| 6930 | + yearRange: '" . $minYear.":".$maxYear."',"; |
|
| 6931 | 6931 | if (!empty($conf->dol_use_jmobile)) { |
| 6932 | 6932 | $retstring .= " |
| 6933 | 6933 | beforeShow: function (input, datePicker) { |
@@ -6942,7 +6942,7 @@ discard block |
||
| 6942 | 6942 | if (!getDolGlobalString('MAIN_POPUP_CALENDAR_ON_FOCUS')) { |
| 6943 | 6943 | $retstring .= " |
| 6944 | 6944 | showOn: 'button', /* both has problem with autocompletion */ |
| 6945 | - buttonImage: '" . DOL_URL_ROOT . "/theme/" . dol_escape_js($conf->theme) . "/img/object_calendarday.png', |
|
| 6945 | + buttonImage: '" . DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png', |
|
| 6946 | 6946 | buttonImageOnly: true"; |
| 6947 | 6947 | } |
| 6948 | 6948 | $retstring .= " |
@@ -6954,8 +6954,8 @@ discard block |
||
| 6954 | 6954 | $retstring .= '<div class="nowraponall inline-block divfordateinput">'; |
| 6955 | 6955 | $retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"'; |
| 6956 | 6956 | $retstring .= ($disabled ? ' disabled' : ''); |
| 6957 | - $retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : ''); |
|
| 6958 | - $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6957 | + $retstring .= ($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : ''); |
|
| 6958 | + $retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript |
|
| 6959 | 6959 | $retstring .= '>'; |
| 6960 | 6960 | |
| 6961 | 6961 | // Icone calendrier |
@@ -6970,40 +6970,40 @@ discard block |
||
| 6970 | 6970 | $retstring.='});'; |
| 6971 | 6971 | $retstring.="</script>";*/ |
| 6972 | 6972 | } else { |
| 6973 | - $retstringbutton = '<button id="' . $prefix . 'Button" type="button" class="dpInvisibleButtons">' . img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"') . '</button>'; |
|
| 6974 | - $retsring = $retstringbutton . $retstring; |
|
| 6973 | + $retstringbutton = '<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"), 'calendarday', 'class="datecallink"').'</button>'; |
|
| 6974 | + $retsring = $retstringbutton.$retstring; |
|
| 6975 | 6975 | } |
| 6976 | 6976 | |
| 6977 | 6977 | $retstring .= '</div>'; |
| 6978 | - $retstring .= '<input type="hidden" id="' . $prefix . 'day" name="' . $prefix . 'day" value="' . $sday . '">' . "\n"; |
|
| 6979 | - $retstring .= '<input type="hidden" id="' . $prefix . 'month" name="' . $prefix . 'month" value="' . $smonth . '">' . "\n"; |
|
| 6980 | - $retstring .= '<input type="hidden" id="' . $prefix . 'year" name="' . $prefix . 'year" value="' . $syear . '">' . "\n"; |
|
| 6978 | + $retstring .= '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n"; |
|
| 6979 | + $retstring .= '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n"; |
|
| 6980 | + $retstring .= '<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n"; |
|
| 6981 | 6981 | } else { |
| 6982 | 6982 | $retstring .= "Bad value of MAIN_POPUP_CALENDAR"; |
| 6983 | 6983 | } |
| 6984 | 6984 | } else { |
| 6985 | 6985 | // Show date with combo selects |
| 6986 | 6986 | // Day |
| 6987 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50imp" id="' . $prefix . 'day" name="' . $prefix . 'day">'; |
|
| 6987 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50imp" id="'.$prefix.'day" name="'.$prefix.'day">'; |
|
| 6988 | 6988 | |
| 6989 | 6989 | if ($emptydate || $set_time == -1) { |
| 6990 | 6990 | $retstring .= '<option value="0" selected> </option>'; |
| 6991 | 6991 | } |
| 6992 | 6992 | |
| 6993 | 6993 | for ($day = 1; $day <= 31; $day++) { |
| 6994 | - $retstring .= '<option value="' . $day . '"' . ($day == $sday ? ' selected' : '') . '>' . $day . '</option>'; |
|
| 6994 | + $retstring .= '<option value="'.$day.'"'.($day == $sday ? ' selected' : '').'>'.$day.'</option>'; |
|
| 6995 | 6995 | } |
| 6996 | 6996 | |
| 6997 | 6997 | $retstring .= "</select>"; |
| 6998 | 6998 | |
| 6999 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'month" name="' . $prefix . 'month">'; |
|
| 6999 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'month" name="'.$prefix.'month">'; |
|
| 7000 | 7000 | if ($emptydate || $set_time == -1) { |
| 7001 | 7001 | $retstring .= '<option value="0" selected> </option>'; |
| 7002 | 7002 | } |
| 7003 | 7003 | |
| 7004 | 7004 | // Month |
| 7005 | 7005 | for ($month = 1; $month <= 12; $month++) { |
| 7006 | - $retstring .= '<option value="' . $month . '"' . ($month == $smonth ? ' selected' : '') . '>'; |
|
| 7006 | + $retstring .= '<option value="'.$month.'"'.($month == $smonth ? ' selected' : '').'>'; |
|
| 7007 | 7007 | $retstring .= dol_print_date(mktime(12, 0, 0, $month, 1, 2000), "%b"); |
| 7008 | 7008 | $retstring .= "</option>"; |
| 7009 | 7009 | } |
@@ -7011,12 +7011,12 @@ discard block |
||
| 7011 | 7011 | |
| 7012 | 7012 | // Year |
| 7013 | 7013 | if ($emptydate || $set_time == -1) { |
| 7014 | - $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 . '">'; |
|
| 7014 | + $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.'">'; |
|
| 7015 | 7015 | } else { |
| 7016 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth75imp" id="' . $prefix . 'year" name="' . $prefix . 'year">'; |
|
| 7016 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth75imp" id="'.$prefix.'year" name="'.$prefix.'year">'; |
|
| 7017 | 7017 | |
| 7018 | 7018 | for ($year = $syear - 10; $year < $syear + 10; $year++) { |
| 7019 | - $retstring .= '<option value="' . $year . '"' . ($year == $syear ? ' selected' : '') . '>' . $year . '</option>'; |
|
| 7019 | + $retstring .= '<option value="'.$year.'"'.($year == $syear ? ' selected' : '').'>'.$year.'</option>'; |
|
| 7020 | 7020 | } |
| 7021 | 7021 | $retstring .= "</select>\n"; |
| 7022 | 7022 | } |
@@ -7040,15 +7040,15 @@ discard block |
||
| 7040 | 7040 | } |
| 7041 | 7041 | } |
| 7042 | 7042 | // Show hour |
| 7043 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'hour' : '') . '" id="' . $prefix . 'hour" name="' . $prefix . 'hour">'; |
|
| 7043 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'hour' : '').'" id="'.$prefix.'hour" name="'.$prefix.'hour">'; |
|
| 7044 | 7044 | if ($emptyhours) { |
| 7045 | 7045 | $retstring .= '<option value="-1"> </option>'; |
| 7046 | 7046 | } |
| 7047 | 7047 | for ($hour = $hourstart; $hour < $hourend; $hour++) { |
| 7048 | 7048 | if (strlen($hour) < 2) { |
| 7049 | - $hour = "0" . $hour; |
|
| 7049 | + $hour = "0".$hour; |
|
| 7050 | 7050 | } |
| 7051 | - $retstring .= '<option value="' . $hour . '"' . (($hour == $shour) ? ' selected' : '') . '>' . $hour; |
|
| 7051 | + $retstring .= '<option value="'.$hour.'"'.(($hour == $shour) ? ' selected' : '').'>'.$hour; |
|
| 7052 | 7052 | //$retstring .= (empty($conf->dol_optimize_smallscreen) ? '' : 'H'); |
| 7053 | 7053 | $retstring .= '</option>'; |
| 7054 | 7054 | } |
@@ -7061,19 +7061,19 @@ discard block |
||
| 7061 | 7061 | |
| 7062 | 7062 | if ($m) { |
| 7063 | 7063 | // Show minutes |
| 7064 | - $retstring .= '<select' . ($disabled ? ' disabled' : '') . ' class="flat valignmiddle maxwidth50 ' . ($fullday ? $fullday . 'min' : '') . '" id="' . $prefix . 'min" name="' . $prefix . 'min">'; |
|
| 7064 | + $retstring .= '<select'.($disabled ? ' disabled' : '').' class="flat valignmiddle maxwidth50 '.($fullday ? $fullday.'min' : '').'" id="'.$prefix.'min" name="'.$prefix.'min">'; |
|
| 7065 | 7065 | if ($emptyhours) { |
| 7066 | 7066 | $retstring .= '<option value="-1"> </option>'; |
| 7067 | 7067 | } |
| 7068 | 7068 | for ($min = 0; $min < 60; $min += $stepminutes) { |
| 7069 | 7069 | if (strlen($min) < 2) { |
| 7070 | - $min = "0" . $min; |
|
| 7070 | + $min = "0".$min; |
|
| 7071 | 7071 | } |
| 7072 | - $retstring .= '<option value="' . $min . '"' . (($min == $smin) ? ' selected' : '') . '>' . $min . (empty($conf->dol_optimize_smallscreen) ? '' : '') . '</option>'; |
|
| 7072 | + $retstring .= '<option value="'.$min.'"'.(($min == $smin) ? ' selected' : '').'>'.$min.(empty($conf->dol_optimize_smallscreen) ? '' : '').'</option>'; |
|
| 7073 | 7073 | } |
| 7074 | 7074 | $retstring .= '</select>'; |
| 7075 | 7075 | |
| 7076 | - $retstring .= '<input type="hidden" name="' . $prefix . 'sec" value="' . $ssec . '">'; |
|
| 7076 | + $retstring .= '<input type="hidden" name="'.$prefix.'sec" value="'.$ssec.'">'; |
|
| 7077 | 7077 | } |
| 7078 | 7078 | |
| 7079 | 7079 | if ($d && $h) { |
@@ -7096,10 +7096,10 @@ discard block |
||
| 7096 | 7096 | |
| 7097 | 7097 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7098 | 7098 | if ($addnowlink == 1) { // server time expressed in user time setup |
| 7099 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7100 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7101 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7102 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7099 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7100 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7101 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7102 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7103 | 7103 | } elseif ($addnowlink == 2) { |
| 7104 | 7104 | /* Disabled because the output does not use the string format defined by FormatDateShort key to forge the value into #prefix. |
| 7105 | 7105 | * This break application for foreign languages. |
@@ -7108,10 +7108,10 @@ discard block |
||
| 7108 | 7108 | $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(parseInt(d.getMonth().pad()) + 1);'; |
| 7109 | 7109 | $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(d.getFullYear());'; |
| 7110 | 7110 | */ |
| 7111 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'day', 'tzuserrel') . '\');'; |
|
| 7112 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7113 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7114 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7111 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'day', 'tzuserrel').'\');'; |
|
| 7112 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7113 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7114 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7115 | 7115 | } |
| 7116 | 7116 | /*if ($usecalendar == "eldy") |
| 7117 | 7117 | { |
@@ -7131,11 +7131,11 @@ discard block |
||
| 7131 | 7131 | } |
| 7132 | 7132 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); '; |
| 7133 | 7133 | if ($addnowlink == 1) { |
| 7134 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7135 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7134 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7135 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7136 | 7136 | } elseif ($addnowlink == 2) { |
| 7137 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(d.getHours().pad());'; |
|
| 7138 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').change();'; |
|
| 7137 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(d.getHours().pad());'; |
|
| 7138 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').change();'; |
|
| 7139 | 7139 | } |
| 7140 | 7140 | |
| 7141 | 7141 | if ($fullday) { |
@@ -7149,11 +7149,11 @@ discard block |
||
| 7149 | 7149 | } |
| 7150 | 7150 | //$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); '; |
| 7151 | 7151 | if ($addnowlink == 1) { |
| 7152 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7153 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7152 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7153 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7154 | 7154 | } elseif ($addnowlink == 2) { |
| 7155 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(d.getMinutes().pad());'; |
|
| 7156 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').change();'; |
|
| 7155 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(d.getMinutes().pad());'; |
|
| 7156 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').change();'; |
|
| 7157 | 7157 | } |
| 7158 | 7158 | if ($fullday) { |
| 7159 | 7159 | $reset_scripts .= ' } '; |
@@ -7161,7 +7161,7 @@ discard block |
||
| 7161 | 7161 | } |
| 7162 | 7162 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7163 | 7163 | if ($reset_scripts && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 7164 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonNow" type="button" name="_useless" value="now" onClick="' . $reset_scripts . '">'; |
|
| 7164 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonNow" type="button" name="_useless" value="now" onClick="'.$reset_scripts.'">'; |
|
| 7165 | 7165 | $retstring .= $langs->trans("Now"); |
| 7166 | 7166 | $retstring .= '</button> '; |
| 7167 | 7167 | } |
@@ -7173,16 +7173,16 @@ discard block |
||
| 7173 | 7173 | $reset_scripts = ""; |
| 7174 | 7174 | |
| 7175 | 7175 | // Generate the date part, depending on the use or not of the javascript calendar |
| 7176 | - $reset_scripts .= 'jQuery(\'#' . $prefix . '\').val(\'' . dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel') . '\');'; |
|
| 7177 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'day\').val(\'' . dol_print_date($nowgmt, '%d', 'tzuserrel') . '\');'; |
|
| 7178 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'month\').val(\'' . dol_print_date($nowgmt, '%m', 'tzuserrel') . '\');'; |
|
| 7179 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'year\').val(\'' . dol_print_date($nowgmt, '%Y', 'tzuserrel') . '\');'; |
|
| 7176 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'\').val(\''.dol_print_date($nowgmt, 'dayinputnoreduce', 'tzuserrel').'\');'; |
|
| 7177 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'day\').val(\''.dol_print_date($nowgmt, '%d', 'tzuserrel').'\');'; |
|
| 7178 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'month\').val(\''.dol_print_date($nowgmt, '%m', 'tzuserrel').'\');'; |
|
| 7179 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'year\').val(\''.dol_print_date($nowgmt, '%Y', 'tzuserrel').'\');'; |
|
| 7180 | 7180 | // Update the hour part |
| 7181 | 7181 | if ($h) { |
| 7182 | 7182 | if ($fullday) { |
| 7183 | 7183 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7184 | 7184 | } |
| 7185 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'hour\').val(\'' . dol_print_date($nowgmt, '%H', 'tzuserrel') . '\');'; |
|
| 7185 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'hour\').val(\''.dol_print_date($nowgmt, '%H', 'tzuserrel').'\');'; |
|
| 7186 | 7186 | if ($fullday) { |
| 7187 | 7187 | $reset_scripts .= ' } '; |
| 7188 | 7188 | } |
@@ -7192,14 +7192,14 @@ discard block |
||
| 7192 | 7192 | if ($fullday) { |
| 7193 | 7193 | $reset_scripts .= " if (jQuery('#fullday:checked').val() == null) {"; |
| 7194 | 7194 | } |
| 7195 | - $reset_scripts .= 'jQuery(\'#' . $prefix . 'min\').val(\'' . dol_print_date($nowgmt, '%M', 'tzuserrel') . '\');'; |
|
| 7195 | + $reset_scripts .= 'jQuery(\'#'.$prefix.'min\').val(\''.dol_print_date($nowgmt, '%M', 'tzuserrel').'\');'; |
|
| 7196 | 7196 | if ($fullday) { |
| 7197 | 7197 | $reset_scripts .= ' } '; |
| 7198 | 7198 | } |
| 7199 | 7199 | } |
| 7200 | 7200 | // If reset_scripts is not empty, print the link with the reset_scripts in the onClick |
| 7201 | 7201 | if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { |
| 7202 | - $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="' . $prefix . 'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="' . $reset_scripts . '">'; |
|
| 7202 | + $retstring .= ' <button class="dpInvisibleButtons datenowlink" id="'.$prefix.'ButtonPlusOne" type="button" name="_useless2" value="plusone" onClick="'.$reset_scripts.'">'; |
|
| 7203 | 7203 | $retstring .= $langs->trans("DateStartPlusOne"); |
| 7204 | 7204 | $retstring .= '</button> '; |
| 7205 | 7205 | } |
@@ -7257,17 +7257,17 @@ discard block |
||
| 7257 | 7257 | unset($TDurationTypes[$value]); |
| 7258 | 7258 | } |
| 7259 | 7259 | |
| 7260 | - $retstring = '<select class="flat minwidth75 maxwidth100" id="select_' . $prefix . 'type_duration" name="' . $prefix . 'type_duration">'; |
|
| 7260 | + $retstring = '<select class="flat minwidth75 maxwidth100" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">'; |
|
| 7261 | 7261 | foreach ($TDurationTypes as $key => $typeduration) { |
| 7262 | - $retstring .= '<option value="' . $key . '"'; |
|
| 7262 | + $retstring .= '<option value="'.$key.'"'; |
|
| 7263 | 7263 | if ($key == $selected) { |
| 7264 | 7264 | $retstring .= " selected"; |
| 7265 | 7265 | } |
| 7266 | - $retstring .= ">" . $typeduration . "</option>"; |
|
| 7266 | + $retstring .= ">".$typeduration."</option>"; |
|
| 7267 | 7267 | } |
| 7268 | 7268 | $retstring .= "</select>"; |
| 7269 | 7269 | |
| 7270 | - $retstring .= ajax_combobox('select_' . $prefix . 'type_duration'); |
|
| 7270 | + $retstring .= ajax_combobox('select_'.$prefix.'type_duration'); |
|
| 7271 | 7271 | |
| 7272 | 7272 | return $retstring; |
| 7273 | 7273 | } |
@@ -7299,30 +7299,30 @@ discard block |
||
| 7299 | 7299 | |
| 7300 | 7300 | // Hours |
| 7301 | 7301 | if ($iSecond != '') { |
| 7302 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
| 7302 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
| 7303 | 7303 | |
| 7304 | 7304 | $hourSelected = convertSecondToTime($iSecond, 'allhour'); |
| 7305 | 7305 | $minSelected = convertSecondToTime($iSecond, 'min'); |
| 7306 | 7306 | } |
| 7307 | 7307 | |
| 7308 | 7308 | if ($typehour == 'select') { |
| 7309 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'hour" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7309 | + $retstring .= '<select class="flat" id="select_'.$prefix.'hour" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').'>'; |
|
| 7310 | 7310 | for ($hour = 0; $hour < 25; $hour++) { // For a duration, we allow 24 hours |
| 7311 | - $retstring .= '<option value="' . $hour . '"'; |
|
| 7311 | + $retstring .= '<option value="'.$hour.'"'; |
|
| 7312 | 7312 | if (is_numeric($hourSelected) && $hourSelected == $hour) { |
| 7313 | 7313 | $retstring .= " selected"; |
| 7314 | 7314 | } |
| 7315 | - $retstring .= ">" . $hour . "</option>"; |
|
| 7315 | + $retstring .= ">".$hour."</option>"; |
|
| 7316 | 7316 | } |
| 7317 | 7317 | $retstring .= "</select>"; |
| 7318 | 7318 | } elseif ($typehour == 'text' || $typehour == 'textselect') { |
| 7319 | - $retstring .= '<input placeholder="' . $langs->trans('HourShort') . '" type="number" min="0" name="' . $prefix . 'hour"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputhour right" value="' . (($hourSelected != '') ? ((int) $hourSelected) : '') . '">'; |
|
| 7319 | + $retstring .= '<input placeholder="'.$langs->trans('HourShort').'" type="number" min="0" name="'.$prefix.'hour"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputhour right" value="'.(($hourSelected != '') ? ((int) $hourSelected) : '').'">'; |
|
| 7320 | 7320 | } else { |
| 7321 | 7321 | return 'BadValueForParameterTypeHour'; |
| 7322 | 7322 | } |
| 7323 | 7323 | |
| 7324 | 7324 | if ($typehour != 'text') { |
| 7325 | - $retstring .= ' ' . $langs->trans('HourShort'); |
|
| 7325 | + $retstring .= ' '.$langs->trans('HourShort'); |
|
| 7326 | 7326 | } else { |
| 7327 | 7327 | $retstring .= '<span class="">:</span>'; |
| 7328 | 7328 | } |
@@ -7337,21 +7337,21 @@ discard block |
||
| 7337 | 7337 | } |
| 7338 | 7338 | |
| 7339 | 7339 | if ($typehour == 'select' || $typehour == 'textselect') { |
| 7340 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'min" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . '>'; |
|
| 7340 | + $retstring .= '<select class="flat" id="select_'.$prefix.'min" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').'>'; |
|
| 7341 | 7341 | for ($min = 0; $min <= 55; $min = $min + 5) { |
| 7342 | - $retstring .= '<option value="' . $min . '"'; |
|
| 7342 | + $retstring .= '<option value="'.$min.'"'; |
|
| 7343 | 7343 | if (is_numeric($minSelected) && $minSelected == $min) { |
| 7344 | 7344 | $retstring .= ' selected'; |
| 7345 | 7345 | } |
| 7346 | - $retstring .= '>' . $min . '</option>'; |
|
| 7346 | + $retstring .= '>'.$min.'</option>'; |
|
| 7347 | 7347 | } |
| 7348 | 7348 | $retstring .= "</select>"; |
| 7349 | 7349 | } elseif ($typehour == 'text') { |
| 7350 | - $retstring .= '<input placeholder="' . $langs->trans('MinuteShort') . '" type="number" min="0" name="' . $prefix . 'min"' . ($disabled ? ' disabled' : '') . ' class="flat maxwidth50 inputminute right" value="' . (($minSelected != '') ? ((int) $minSelected) : '') . '">'; |
|
| 7350 | + $retstring .= '<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" name="'.$prefix.'min"'.($disabled ? ' disabled' : '').' class="flat maxwidth50 inputminute right" value="'.(($minSelected != '') ? ((int) $minSelected) : '').'">'; |
|
| 7351 | 7351 | } |
| 7352 | 7352 | |
| 7353 | 7353 | if ($typehour != 'text') { |
| 7354 | - $retstring .= ' ' . $langs->trans('MinuteShort'); |
|
| 7354 | + $retstring .= ' '.$langs->trans('MinuteShort'); |
|
| 7355 | 7355 | } |
| 7356 | 7356 | |
| 7357 | 7357 | $retstring .= "</span>"; |
@@ -7399,7 +7399,7 @@ discard block |
||
| 7399 | 7399 | $placeholder = ''; |
| 7400 | 7400 | |
| 7401 | 7401 | if ($selected && empty($selected_input_value)) { |
| 7402 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7402 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7403 | 7403 | $tickettmpselect = new Ticket($this->db); |
| 7404 | 7404 | $tickettmpselect->fetch($selected); |
| 7405 | 7405 | $selected_input_value = $tickettmpselect->ref; |
@@ -7407,17 +7407,17 @@ discard block |
||
| 7407 | 7407 | } |
| 7408 | 7408 | |
| 7409 | 7409 | $urloption = ''; |
| 7410 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7410 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7411 | 7411 | |
| 7412 | 7412 | if (empty($hidelabel)) { |
| 7413 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7413 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7414 | 7414 | } elseif ($hidelabel > 1) { |
| 7415 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7415 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7416 | 7416 | if ($hidelabel == 2) { |
| 7417 | 7417 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7418 | 7418 | } |
| 7419 | 7419 | } |
| 7420 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7420 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7421 | 7421 | if ($hidelabel == 3) { |
| 7422 | 7422 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7423 | 7423 | } |
@@ -7461,8 +7461,8 @@ discard block |
||
| 7461 | 7461 | |
| 7462 | 7462 | $sql = "SELECT "; |
| 7463 | 7463 | $sql .= $selectFields; |
| 7464 | - $sql .= " FROM " . $this->db->prefix() . "ticket as p"; |
|
| 7465 | - $sql .= ' WHERE p.entity IN (' . getEntity('ticket') . ')'; |
|
| 7464 | + $sql .= " FROM ".$this->db->prefix()."ticket as p"; |
|
| 7465 | + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; |
|
| 7466 | 7466 | |
| 7467 | 7467 | // Add criteria on ref/label |
| 7468 | 7468 | if ($filterkey != '') { |
@@ -7478,7 +7478,7 @@ discard block |
||
| 7478 | 7478 | if ($i > 0) { |
| 7479 | 7479 | $sql .= " AND "; |
| 7480 | 7480 | } |
| 7481 | - $sql .= "(p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%' OR p.subject LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7481 | + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.subject LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7482 | 7482 | $sql .= ")"; |
| 7483 | 7483 | $i++; |
| 7484 | 7484 | } |
@@ -7491,22 +7491,22 @@ discard block |
||
| 7491 | 7491 | $sql .= $this->db->plimit($limit, 0); |
| 7492 | 7492 | |
| 7493 | 7493 | // Build output string |
| 7494 | - dol_syslog(get_class($this) . "::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7494 | + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); |
|
| 7495 | 7495 | $result = $this->db->query($sql); |
| 7496 | 7496 | if ($result) { |
| 7497 | - require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php'; |
|
| 7498 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; |
|
| 7497 | + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; |
|
| 7498 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; |
|
| 7499 | 7499 | |
| 7500 | 7500 | $num = $this->db->num_rows($result); |
| 7501 | 7501 | |
| 7502 | 7502 | $events = null; |
| 7503 | 7503 | |
| 7504 | 7504 | if (!$forcecombo) { |
| 7505 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7505 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7506 | 7506 | $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); |
| 7507 | 7507 | } |
| 7508 | 7508 | |
| 7509 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7509 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7510 | 7510 | |
| 7511 | 7511 | $textifempty = ''; |
| 7512 | 7512 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7523,7 +7523,7 @@ discard block |
||
| 7523 | 7523 | } |
| 7524 | 7524 | } |
| 7525 | 7525 | if ($showempty) { |
| 7526 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7526 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7527 | 7527 | } |
| 7528 | 7528 | |
| 7529 | 7529 | $i = 0; |
@@ -7578,13 +7578,13 @@ discard block |
||
| 7578 | 7578 | $outref = $objp->ref; |
| 7579 | 7579 | $outtype = $objp->fk_product_type; |
| 7580 | 7580 | |
| 7581 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7581 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7582 | 7582 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7583 | 7583 | $opt .= '>'; |
| 7584 | 7584 | $opt .= $objp->ref; |
| 7585 | 7585 | $objRef = $objp->ref; |
| 7586 | 7586 | if (!empty($filterkey) && $filterkey != '') { |
| 7587 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7587 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7588 | 7588 | } |
| 7589 | 7589 | |
| 7590 | 7590 | $opt .= "</option>\n"; |
@@ -7625,7 +7625,7 @@ discard block |
||
| 7625 | 7625 | $placeholder = ''; |
| 7626 | 7626 | |
| 7627 | 7627 | if ($selected && empty($selected_input_value)) { |
| 7628 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7628 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7629 | 7629 | $projecttmpselect = new Project($this->db); |
| 7630 | 7630 | $projecttmpselect->fetch($selected); |
| 7631 | 7631 | $selected_input_value = $projecttmpselect->ref; |
@@ -7633,17 +7633,17 @@ discard block |
||
| 7633 | 7633 | } |
| 7634 | 7634 | |
| 7635 | 7635 | $urloption = ''; |
| 7636 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7636 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7637 | 7637 | |
| 7638 | 7638 | if (empty($hidelabel)) { |
| 7639 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7639 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7640 | 7640 | } elseif ($hidelabel > 1) { |
| 7641 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7641 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7642 | 7642 | if ($hidelabel == 2) { |
| 7643 | 7643 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7644 | 7644 | } |
| 7645 | 7645 | } |
| 7646 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7646 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7647 | 7647 | if ($hidelabel == 3) { |
| 7648 | 7648 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7649 | 7649 | } |
@@ -7686,8 +7686,8 @@ discard block |
||
| 7686 | 7686 | |
| 7687 | 7687 | $sql = "SELECT "; |
| 7688 | 7688 | $sql .= $selectFields; |
| 7689 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
| 7690 | - $sql .= ' WHERE p.entity IN (' . getEntity('project') . ')'; |
|
| 7689 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
| 7690 | + $sql .= ' WHERE p.entity IN ('.getEntity('project').')'; |
|
| 7691 | 7691 | |
| 7692 | 7692 | // Add criteria on ref/label |
| 7693 | 7693 | if ($filterkey != '') { |
@@ -7703,7 +7703,7 @@ discard block |
||
| 7703 | 7703 | if ($i > 0) { |
| 7704 | 7704 | $sql .= " AND "; |
| 7705 | 7705 | } |
| 7706 | - $sql .= "p.ref LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7706 | + $sql .= "p.ref LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7707 | 7707 | $sql .= ""; |
| 7708 | 7708 | $i++; |
| 7709 | 7709 | } |
@@ -7716,22 +7716,22 @@ discard block |
||
| 7716 | 7716 | $sql .= $this->db->plimit($limit, 0); |
| 7717 | 7717 | |
| 7718 | 7718 | // Build output string |
| 7719 | - dol_syslog(get_class($this) . "::selectProjectsList search projects", LOG_DEBUG); |
|
| 7719 | + dol_syslog(get_class($this)."::selectProjectsList search projects", LOG_DEBUG); |
|
| 7720 | 7720 | $result = $this->db->query($sql); |
| 7721 | 7721 | if ($result) { |
| 7722 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 7723 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
| 7722 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 7723 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
| 7724 | 7724 | |
| 7725 | 7725 | $num = $this->db->num_rows($result); |
| 7726 | 7726 | |
| 7727 | 7727 | $events = null; |
| 7728 | 7728 | |
| 7729 | 7729 | if (!$forcecombo) { |
| 7730 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7730 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7731 | 7731 | $out .= ajax_combobox($htmlname, $events, $conf->global->PROJECT_USE_SEARCH_TO_SELECT); |
| 7732 | 7732 | } |
| 7733 | 7733 | |
| 7734 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7734 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7735 | 7735 | |
| 7736 | 7736 | $textifempty = ''; |
| 7737 | 7737 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7748,7 +7748,7 @@ discard block |
||
| 7748 | 7748 | } |
| 7749 | 7749 | } |
| 7750 | 7750 | if ($showempty) { |
| 7751 | - $out .= '<option value="0" selected>' . $textifempty . '</option>'; |
|
| 7751 | + $out .= '<option value="0" selected>'.$textifempty.'</option>'; |
|
| 7752 | 7752 | } |
| 7753 | 7753 | |
| 7754 | 7754 | $i = 0; |
@@ -7806,13 +7806,13 @@ discard block |
||
| 7806 | 7806 | $outlabel = $objp->label; |
| 7807 | 7807 | $outtype = $objp->fk_product_type; |
| 7808 | 7808 | |
| 7809 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 7809 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 7810 | 7810 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 7811 | 7811 | $opt .= '>'; |
| 7812 | 7812 | $opt .= $objp->ref; |
| 7813 | 7813 | $objRef = $objp->ref; |
| 7814 | 7814 | if (!empty($filterkey) && $filterkey != '') { |
| 7815 | - $objRef = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7815 | + $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1); |
|
| 7816 | 7816 | } |
| 7817 | 7817 | |
| 7818 | 7818 | $opt .= "</option>\n"; |
@@ -7855,7 +7855,7 @@ discard block |
||
| 7855 | 7855 | $urloption = ''; |
| 7856 | 7856 | |
| 7857 | 7857 | if ($selected && empty($selected_input_value)) { |
| 7858 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7858 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7859 | 7859 | $adherenttmpselect = new Adherent($this->db); |
| 7860 | 7860 | $adherenttmpselect->fetch($selected); |
| 7861 | 7861 | $selected_input_value = $adherenttmpselect->ref; |
@@ -7864,17 +7864,17 @@ discard block |
||
| 7864 | 7864 | |
| 7865 | 7865 | $urloption = ''; |
| 7866 | 7866 | |
| 7867 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7867 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/adherents/ajax/adherents.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); |
|
| 7868 | 7868 | |
| 7869 | 7869 | if (empty($hidelabel)) { |
| 7870 | - $out .= $langs->trans("RefOrLabel") . ' : '; |
|
| 7870 | + $out .= $langs->trans("RefOrLabel").' : '; |
|
| 7871 | 7871 | } elseif ($hidelabel > 1) { |
| 7872 | - $placeholder = ' placeholder="' . $langs->trans("RefOrLabel") . '"'; |
|
| 7872 | + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; |
|
| 7873 | 7873 | if ($hidelabel == 2) { |
| 7874 | 7874 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7875 | 7875 | } |
| 7876 | 7876 | } |
| 7877 | - $out .= '<input type="text" class="minwidth100" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' ' . (getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '') . ' />'; |
|
| 7877 | + $out .= '<input type="text" class="minwidth100" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(getDolGlobalString('PRODUCT_SEARCH_AUTOFOCUS') ? 'autofocus' : '').' />'; |
|
| 7878 | 7878 | if ($hidelabel == 3) { |
| 7879 | 7879 | $out .= img_picto($langs->trans("Search"), 'search'); |
| 7880 | 7880 | } |
@@ -7919,8 +7919,8 @@ discard block |
||
| 7919 | 7919 | |
| 7920 | 7920 | $sql = "SELECT "; |
| 7921 | 7921 | $sql .= $selectFields; |
| 7922 | - $sql .= " FROM " . $this->db->prefix() . "adherent as p"; |
|
| 7923 | - $sql .= ' WHERE p.entity IN (' . getEntity('adherent') . ')'; |
|
| 7922 | + $sql .= " FROM ".$this->db->prefix()."adherent as p"; |
|
| 7923 | + $sql .= ' WHERE p.entity IN ('.getEntity('adherent').')'; |
|
| 7924 | 7924 | |
| 7925 | 7925 | // Add criteria on ref/label |
| 7926 | 7926 | if ($filterkey != '') { |
@@ -7936,8 +7936,8 @@ discard block |
||
| 7936 | 7936 | if ($i > 0) { |
| 7937 | 7937 | $sql .= " AND "; |
| 7938 | 7938 | } |
| 7939 | - $sql .= "(p.firstname LIKE '" . $this->db->escape($prefix . $crit) . "%'"; |
|
| 7940 | - $sql .= " OR p.lastname LIKE '" . $this->db->escape($prefix . $crit) . "%')"; |
|
| 7939 | + $sql .= "(p.firstname LIKE '".$this->db->escape($prefix.$crit)."%'"; |
|
| 7940 | + $sql .= " OR p.lastname LIKE '".$this->db->escape($prefix.$crit)."%')"; |
|
| 7941 | 7941 | $i++; |
| 7942 | 7942 | } |
| 7943 | 7943 | if (count($search_crit) > 1) { |
@@ -7946,27 +7946,27 @@ discard block |
||
| 7946 | 7946 | $sql .= ')'; |
| 7947 | 7947 | } |
| 7948 | 7948 | if ($status != -1) { |
| 7949 | - $sql .= ' AND statut = ' . ((int) $status); |
|
| 7949 | + $sql .= ' AND statut = '.((int) $status); |
|
| 7950 | 7950 | } |
| 7951 | 7951 | $sql .= $this->db->plimit($limit, 0); |
| 7952 | 7952 | |
| 7953 | 7953 | // Build output string |
| 7954 | - dol_syslog(get_class($this) . "::selectMembersList search adherents", LOG_DEBUG); |
|
| 7954 | + dol_syslog(get_class($this)."::selectMembersList search adherents", LOG_DEBUG); |
|
| 7955 | 7955 | $result = $this->db->query($sql); |
| 7956 | 7956 | if ($result) { |
| 7957 | - require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; |
|
| 7958 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/member.lib.php'; |
|
| 7957 | + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; |
|
| 7958 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; |
|
| 7959 | 7959 | |
| 7960 | 7960 | $num = $this->db->num_rows($result); |
| 7961 | 7961 | |
| 7962 | 7962 | $events = null; |
| 7963 | 7963 | |
| 7964 | 7964 | if (!$forcecombo) { |
| 7965 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 7965 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 7966 | 7966 | $out .= ajax_combobox($htmlname, $events, getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT') ? $conf->global->PROJECT_USE_SEARCH_TO_SELECT : ''); |
| 7967 | 7967 | } |
| 7968 | 7968 | |
| 7969 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '" id="' . $htmlname . '">'; |
|
| 7969 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">'; |
|
| 7970 | 7970 | |
| 7971 | 7971 | $textifempty = ''; |
| 7972 | 7972 | // Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. |
@@ -7983,7 +7983,7 @@ discard block |
||
| 7983 | 7983 | } |
| 7984 | 7984 | } |
| 7985 | 7985 | if ($showempty) { |
| 7986 | - $out .= '<option value="-1" selected>' . $textifempty . '</option>'; |
|
| 7986 | + $out .= '<option value="-1" selected>'.$textifempty.'</option>'; |
|
| 7987 | 7987 | } |
| 7988 | 7988 | |
| 7989 | 7989 | $i = 0; |
@@ -8039,11 +8039,11 @@ discard block |
||
| 8039 | 8039 | $outlabel = dolGetFirstLastname($objp->firstname, $objp->lastname); |
| 8040 | 8040 | $outtype = $objp->fk_adherent_type; |
| 8041 | 8041 | |
| 8042 | - $opt = '<option value="' . $objp->rowid . '"'; |
|
| 8042 | + $opt = '<option value="'.$objp->rowid.'"'; |
|
| 8043 | 8043 | $opt .= ($objp->rowid == $selected) ? ' selected' : ''; |
| 8044 | 8044 | $opt .= '>'; |
| 8045 | 8045 | if (!empty($filterkey) && $filterkey != '') { |
| 8046 | - $outlabel = preg_replace('/(' . preg_quote($filterkey, '/') . ')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8046 | + $outlabel = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $outlabel, 1); |
|
| 8047 | 8047 | } |
| 8048 | 8048 | $opt .= $outlabel; |
| 8049 | 8049 | $opt .= "</option>\n"; |
@@ -8116,9 +8116,9 @@ discard block |
||
| 8116 | 8116 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
| 8117 | 8117 | $reg = array(); |
| 8118 | 8118 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
| 8119 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8119 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
| 8120 | 8120 | } |
| 8121 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8121 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
| 8122 | 8122 | |
| 8123 | 8123 | $classname = $InfoFieldList[0]; |
| 8124 | 8124 | $classpath = $InfoFieldList[1]; |
@@ -8149,8 +8149,8 @@ discard block |
||
| 8149 | 8149 | ); |
| 8150 | 8150 | |
| 8151 | 8151 | if (!is_object($objecttmp)) { |
| 8152 | - dol_syslog('selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
| 8153 | - return 'selectForForms: Error bad setup of field objectdescorig=' . $objectdescorig.', objectfield='.$objectfield; |
|
| 8152 | + dol_syslog('selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield, LOG_WARNING); |
|
| 8153 | + return 'selectForForms: Error bad setup of field objectdescorig='.$objectdescorig.', objectfield='.$objectfield; |
|
| 8154 | 8154 | } |
| 8155 | 8155 | |
| 8156 | 8156 | //var_dump($filter); |
@@ -8161,9 +8161,9 @@ discard block |
||
| 8161 | 8161 | if ($prefixforautocompletemode == 'product') { |
| 8162 | 8162 | $prefixforautocompletemode = 'produit'; |
| 8163 | 8163 | } |
| 8164 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8164 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8165 | 8165 | |
| 8166 | - dol_syslog(get_class($this) . "::selectForForms filter=" . $filter, LOG_DEBUG); |
|
| 8166 | + dol_syslog(get_class($this)."::selectForForms filter=".$filter, LOG_DEBUG); |
|
| 8167 | 8167 | |
| 8168 | 8168 | // Generate the combo HTML component |
| 8169 | 8169 | $out = ''; |
@@ -8177,13 +8177,13 @@ discard block |
||
| 8177 | 8177 | } |
| 8178 | 8178 | |
| 8179 | 8179 | // Set url and param to call to get json of the search results |
| 8180 | - $urlforajaxcall = DOL_URL_ROOT . '/core/ajax/selectobject.php'; |
|
| 8181 | - $urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : ''); |
|
| 8180 | + $urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php'; |
|
| 8181 | + $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&objectdesc='.urlencode($objectdescorig).'&objectfield='.urlencode($objectfield).($sortfield ? '&sortfield='.urlencode($sortfield) : ''); |
|
| 8182 | 8182 | |
| 8183 | 8183 | // Activate the auto complete using ajax call. |
| 8184 | 8184 | $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array()); |
| 8185 | 8185 | $out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>'; |
| 8186 | - $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) . '"' : '') . ' />'; |
|
| 8186 | + $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).'"' : '').' />'; |
|
| 8187 | 8187 | } else { |
| 8188 | 8188 | // Immediate load of table record. |
| 8189 | 8189 | $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter); |
@@ -8223,7 +8223,7 @@ discard block |
||
| 8223 | 8223 | if ($prefixforautocompletemode == 'societe') { |
| 8224 | 8224 | $prefixforautocompletemode = 'company'; |
| 8225 | 8225 | } |
| 8226 | - $confkeyforautocompletemode = strtoupper($prefixforautocompletemode) . '_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8226 | + $confkeyforautocompletemode = strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT |
|
| 8227 | 8227 | |
| 8228 | 8228 | if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) |
| 8229 | 8229 | $tmpfieldstoshow = ''; |
@@ -8232,7 +8232,7 @@ discard block |
||
| 8232 | 8232 | continue; |
| 8233 | 8233 | } |
| 8234 | 8234 | if (!empty($val['showoncombobox'])) { |
| 8235 | - $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '') . 't.' . $key; |
|
| 8235 | + $tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key; |
|
| 8236 | 8236 | } |
| 8237 | 8237 | } |
| 8238 | 8238 | if ($tmpfieldstoshow) { |
@@ -8260,18 +8260,18 @@ discard block |
||
| 8260 | 8260 | $num = 0; |
| 8261 | 8261 | |
| 8262 | 8262 | // Search data |
| 8263 | - $sql = "SELECT t.rowid, " . $fieldstoshow . " FROM " . $this->db->prefix() . $objecttmp->table_element . " as t"; |
|
| 8263 | + $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".$this->db->prefix().$objecttmp->table_element." as t"; |
|
| 8264 | 8264 | if (!empty($objecttmp->isextrafieldmanaged)) { |
| 8265 | - $sql .= " LEFT JOIN " . $this->db->prefix() . $objecttmp->table_element . "_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8265 | + $sql .= " LEFT JOIN ".$this->db->prefix().$objecttmp->table_element."_extrafields as e ON t.rowid=e.fk_object"; |
|
| 8266 | 8266 | } |
| 8267 | 8267 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8268 | 8268 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8269 | 8269 | $tmparray = explode('@', $objecttmp->ismultientitymanaged); |
| 8270 | - $sql .= " INNER JOIN " . $this->db->prefix() . $tmparray[1] . " as parenttable ON parenttable.rowid = t." . $tmparray[0]; |
|
| 8270 | + $sql .= " INNER JOIN ".$this->db->prefix().$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0]; |
|
| 8271 | 8271 | } |
| 8272 | 8272 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8273 | 8273 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8274 | - $sql .= ", " . $this->db->prefix() . "societe_commerciaux as sc"; |
|
| 8274 | + $sql .= ", ".$this->db->prefix()."societe_commerciaux as sc"; |
|
| 8275 | 8275 | } |
| 8276 | 8276 | } |
| 8277 | 8277 | } |
@@ -8291,21 +8291,21 @@ discard block |
||
| 8291 | 8291 | $sql .= " WHERE 1=1"; |
| 8292 | 8292 | if (isset($objecttmp->ismultientitymanaged)) { |
| 8293 | 8293 | if ($objecttmp->ismultientitymanaged == 1) { |
| 8294 | - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; |
|
| 8294 | + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; |
|
| 8295 | 8295 | } |
| 8296 | 8296 | if (!is_numeric($objecttmp->ismultientitymanaged)) { |
| 8297 | - $sql .= " AND parenttable.entity = t." . $tmparray[0]; |
|
| 8297 | + $sql .= " AND parenttable.entity = t.".$tmparray[0]; |
|
| 8298 | 8298 | } |
| 8299 | 8299 | if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { |
| 8300 | 8300 | if ($objecttmp->element == 'societe') { |
| 8301 | - $sql .= " AND t.rowid = " . ((int) $user->socid); |
|
| 8301 | + $sql .= " AND t.rowid = ".((int) $user->socid); |
|
| 8302 | 8302 | } else { |
| 8303 | - $sql .= " AND t.fk_soc = " . ((int) $user->socid); |
|
| 8303 | + $sql .= " AND t.fk_soc = ".((int) $user->socid); |
|
| 8304 | 8304 | } |
| 8305 | 8305 | } |
| 8306 | 8306 | if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') { |
| 8307 | 8307 | if (!$user->hasRight('societe', 'client', 'voir')) { |
| 8308 | - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = " . ((int) $user->id); |
|
| 8308 | + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); |
|
| 8309 | 8309 | } |
| 8310 | 8310 | } |
| 8311 | 8311 | } |
@@ -8317,7 +8317,7 @@ discard block |
||
| 8317 | 8317 | $errormessage = ''; |
| 8318 | 8318 | $sql .= forgeSQLFromUniversalSearchCriteria($filter, $errormessage); |
| 8319 | 8319 | if ($errormessage) { |
| 8320 | - return 'Error forging a SQL request from an universal criteria: ' . $errormessage; |
|
| 8320 | + return 'Error forging a SQL request from an universal criteria: '.$errormessage; |
|
| 8321 | 8321 | } |
| 8322 | 8322 | } |
| 8323 | 8323 | } |
@@ -8329,7 +8329,7 @@ discard block |
||
| 8329 | 8329 | $resql = $this->db->query($sql); |
| 8330 | 8330 | if ($resql) { |
| 8331 | 8331 | // Construct $out and $outarray |
| 8332 | - $out .= '<select id="' . $htmlname . '" class="flat minwidth100' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ($moreparams ? ' ' . $moreparams : '') . ' name="' . $htmlname . '">' . "\n"; |
|
| 8332 | + $out .= '<select id="'.$htmlname.'" class="flat minwidth100'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n"; |
|
| 8333 | 8333 | |
| 8334 | 8334 | // Warning: Do not use textifempty = ' ' or ' ' here, or search on key will search on ' key'. Seems it is no more true with selec2 v4 |
| 8335 | 8335 | $textifempty = ' '; |
@@ -8343,7 +8343,7 @@ discard block |
||
| 8343 | 8343 | } |
| 8344 | 8344 | } |
| 8345 | 8345 | if ($showempty) { |
| 8346 | - $out .= '<option value="-1">' . $textifempty . '</option>' . "\n"; |
|
| 8346 | + $out .= '<option value="-1">'.$textifempty.'</option>'."\n"; |
|
| 8347 | 8347 | } |
| 8348 | 8348 | |
| 8349 | 8349 | $num = $this->db->num_rows($resql); |
@@ -8366,9 +8366,9 @@ discard block |
||
| 8366 | 8366 | } |
| 8367 | 8367 | if (empty($outputmode)) { |
| 8368 | 8368 | if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { |
| 8369 | - $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>'; |
|
| 8369 | + $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>'; |
|
| 8370 | 8370 | } else { |
| 8371 | - $out .= '<option value="' . $obj->rowid . '" data-html="' . dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1) . '">' . dol_escape_htmltag($label, 0, 0, '', 0, 1) . '</option>'; |
|
| 8371 | + $out .= '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($labelhtml, 0, 0, '', 0, 1).'">'.dol_escape_htmltag($label, 0, 0, '', 0, 1).'</option>'; |
|
| 8372 | 8372 | } |
| 8373 | 8373 | } else { |
| 8374 | 8374 | array_push($outarray, array('key' => $obj->rowid, 'value' => $label, 'label' => $label)); |
@@ -8381,10 +8381,10 @@ discard block |
||
| 8381 | 8381 | } |
| 8382 | 8382 | } |
| 8383 | 8383 | |
| 8384 | - $out .= '</select>' . "\n"; |
|
| 8384 | + $out .= '</select>'."\n"; |
|
| 8385 | 8385 | |
| 8386 | 8386 | if (!$forcecombo) { |
| 8387 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8387 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8388 | 8388 | $out .= ajax_combobox($htmlname, null, getDolGlobalInt($confkeyforautocompletemode, 0)); |
| 8389 | 8389 | } |
| 8390 | 8390 | } else { |
@@ -8446,8 +8446,8 @@ discard block |
||
| 8446 | 8446 | } |
| 8447 | 8447 | } |
| 8448 | 8448 | $idname = str_replace(array('[', ']'), array('', ''), $htmlname); |
| 8449 | - $out .= '<select id="' . preg_replace('/^\./', '', $idname) . '" ' . ($disabled ? 'disabled="disabled" ' : '') . 'class="flat ' . (preg_replace('/^\./', '', $htmlname)) . ($morecss ? ' ' . $morecss : '') . ' selectformat"'; |
|
| 8450 | - $out .= ' name="' . preg_replace('/^\./', '', $htmlname) . '" ' . ($moreparam ? $moreparam : ''); |
|
| 8449 | + $out .= '<select id="'.preg_replace('/^\./', '', $idname).'" '.($disabled ? 'disabled="disabled" ' : '').'class="flat '.(preg_replace('/^\./', '', $htmlname)).($morecss ? ' '.$morecss : '').' selectformat"'; |
|
| 8450 | + $out .= ' name="'.preg_replace('/^\./', '', $htmlname).'" '.($moreparam ? $moreparam : ''); |
|
| 8451 | 8451 | $out .= '>'."\n"; |
| 8452 | 8452 | |
| 8453 | 8453 | if ($show_empty) { |
@@ -8458,7 +8458,7 @@ discard block |
||
| 8458 | 8458 | if (!is_numeric($show_empty)) { |
| 8459 | 8459 | $textforempty = $show_empty; |
| 8460 | 8460 | } |
| 8461 | - $out .= '<option class="optiongrey" ' . ($moreparamonempty ? $moreparamonempty . ' ' : '') . 'value="' . (((int) $show_empty) < 0 ? $show_empty : -1) . '"' . ($id == $show_empty ? ' selected' : '') . '>' . $textforempty . '</option>' . "\n"; |
|
| 8461 | + $out .= '<option class="optiongrey" '.($moreparamonempty ? $moreparamonempty.' ' : '').'value="'.(((int) $show_empty) < 0 ? $show_empty : -1).'"'.($id == $show_empty ? ' selected' : '').'>'.$textforempty.'</option>'."\n"; |
|
| 8462 | 8462 | } |
| 8463 | 8463 | if (is_array($array)) { |
| 8464 | 8464 | // Translate |
@@ -8481,7 +8481,7 @@ discard block |
||
| 8481 | 8481 | if (is_array($tmpvalue)) { |
| 8482 | 8482 | $value = $tmpvalue['label']; |
| 8483 | 8483 | $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; |
| 8484 | - $style = empty($tmpvalue['css']) ? '' : ' class="' . $tmpvalue['css'] . '"'; |
|
| 8484 | + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; |
|
| 8485 | 8485 | } else { |
| 8486 | 8486 | $value = $tmpvalue; |
| 8487 | 8487 | $disabled = ''; |
@@ -8496,9 +8496,9 @@ discard block |
||
| 8496 | 8496 | } |
| 8497 | 8497 | if ($key_in_label) { |
| 8498 | 8498 | if (empty($nohtmlescape)) { |
| 8499 | - $selectOptionValue = dol_escape_htmltag($key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8499 | + $selectOptionValue = dol_escape_htmltag($key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value)); |
|
| 8500 | 8500 | } else { |
| 8501 | - $selectOptionValue = $key . ' - ' . ($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8501 | + $selectOptionValue = $key.' - '.($maxlen ? dol_trunc($value, $maxlen) : $value); |
|
| 8502 | 8502 | } |
| 8503 | 8503 | } else { |
| 8504 | 8504 | if (empty($nohtmlescape)) { |
@@ -8510,8 +8510,8 @@ discard block |
||
| 8510 | 8510 | $selectOptionValue = ' '; |
| 8511 | 8511 | } |
| 8512 | 8512 | } |
| 8513 | - $out .= '<option value="' . $key . '"'; |
|
| 8514 | - $out .= $style . $disabled; |
|
| 8513 | + $out .= '<option value="'.$key.'"'; |
|
| 8514 | + $out .= $style.$disabled; |
|
| 8515 | 8515 | if (is_array($id)) { |
| 8516 | 8516 | if (in_array($key, $id) && !$disabled) { |
| 8517 | 8517 | $out .= ' selected'; // To preselect a value |
@@ -8523,7 +8523,7 @@ discard block |
||
| 8523 | 8523 | } |
| 8524 | 8524 | } |
| 8525 | 8525 | if ($nohtmlescape) { |
| 8526 | - $out .= ' data-html="' . dol_escape_htmltag($selectOptionValue) . '"'; |
|
| 8526 | + $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"'; |
|
| 8527 | 8527 | } |
| 8528 | 8528 | if (is_array($tmpvalue)) { |
| 8529 | 8529 | foreach ($tmpvalue as $keyforvalue => $valueforvalue) { |
@@ -8541,7 +8541,7 @@ discard block |
||
| 8541 | 8541 | // Add code for jquery to use multiselect |
| 8542 | 8542 | if ($addjscombo && $jsbeautify) { |
| 8543 | 8543 | // Enhance with select2 |
| 8544 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 8544 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 8545 | 8545 | $out .= ajax_combobox($idname, array(), 0, 0, 'resolve', (((int) $show_empty) < 0 ? (string) $show_empty : '-1'), $morecss); |
| 8546 | 8546 | } |
| 8547 | 8547 | |
@@ -8569,28 +8569,28 @@ discard block |
||
| 8569 | 8569 | public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) |
| 8570 | 8570 | { |
| 8571 | 8571 | global $conf, $langs; |
| 8572 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8572 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8573 | 8573 | |
| 8574 | 8574 | // TODO Use an internal dolibarr component instead of select2 |
| 8575 | 8575 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8576 | 8576 | return ''; |
| 8577 | 8577 | } |
| 8578 | 8578 | |
| 8579 | - $out = '<select type="text" class="' . $htmlname . ($morecss ? ' ' . $morecss : '') . '" ' . ($moreparam ? $moreparam . ' ' : '') . 'name="' . $htmlname . '"></select>'; |
|
| 8579 | + $out = '<select type="text" class="'.$htmlname.($morecss ? ' '.$morecss : '').'" '.($moreparam ? $moreparam.' ' : '').'name="'.$htmlname.'"></select>'; |
|
| 8580 | 8580 | |
| 8581 | 8581 | $outdelayed = ''; |
| 8582 | 8582 | if (!empty($conf->use_javascript_ajax)) { |
| 8583 | 8583 | $tmpplugin = 'select2'; |
| 8584 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8585 | - <script nonce="' . getNonce() . '"> |
|
| 8584 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8585 | + <script nonce="' . getNonce().'"> |
|
| 8586 | 8586 | $(document).ready(function () { |
| 8587 | 8587 | |
| 8588 | - ' . ($callurlonselect ? 'var saveRemoteData = [];' : '') . ' |
|
| 8588 | + ' . ($callurlonselect ? 'var saveRemoteData = [];' : '').' |
|
| 8589 | 8589 | |
| 8590 | - $(".' . $htmlname . '").select2({ |
|
| 8590 | + $(".' . $htmlname.'").select2({ |
|
| 8591 | 8591 | ajax: { |
| 8592 | 8592 | dir: "ltr", |
| 8593 | - url: "' . $url . '", |
|
| 8593 | + url: "' . $url.'", |
|
| 8594 | 8594 | dataType: \'json\', |
| 8595 | 8595 | delay: 250, |
| 8596 | 8596 | data: function (params) { |
@@ -8617,9 +8617,9 @@ discard block |
||
| 8617 | 8617 | }, |
| 8618 | 8618 | language: select2arrayoflanguage, |
| 8619 | 8619 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8620 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8620 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8621 | 8621 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8622 | - minimumInputLength: ' . ((int) $minimumInputLength) . ', |
|
| 8622 | + minimumInputLength: ' . ((int) $minimumInputLength).', |
|
| 8623 | 8623 | formatResult: function (result, container, query, escapeMarkup) { |
| 8624 | 8624 | return escapeMarkup(result.text); |
| 8625 | 8625 | }, |
@@ -8627,10 +8627,10 @@ discard block |
||
| 8627 | 8627 | |
| 8628 | 8628 | ' . ($callurlonselect ? ' |
| 8629 | 8629 | /* Code to execute a GET when we select a value */ |
| 8630 | - $(".' . $htmlname . '").change(function() { |
|
| 8631 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8630 | + $(".' . $htmlname.'").change(function() { |
|
| 8631 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8632 | 8632 | console.log("We select in selectArrayAjax the entry "+selected) |
| 8633 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8633 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8634 | 8634 | $.each( saveRemoteData, function( key, value ) { |
| 8635 | 8635 | if (key == selected) |
| 8636 | 8636 | { |
@@ -8638,7 +8638,7 @@ discard block |
||
| 8638 | 8638 | location.assign(value.url); |
| 8639 | 8639 | } |
| 8640 | 8640 | }); |
| 8641 | - });' : '') . ' |
|
| 8641 | + });' : '').' |
|
| 8642 | 8642 | |
| 8643 | 8643 | }); |
| 8644 | 8644 | </script>'; |
@@ -8674,14 +8674,14 @@ discard block |
||
| 8674 | 8674 | public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0, $textfortitle = '') |
| 8675 | 8675 | { |
| 8676 | 8676 | global $conf, $langs; |
| 8677 | - global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8677 | + global $delayedhtmlcontent; // Will be used later outside of this function |
|
| 8678 | 8678 | |
| 8679 | 8679 | // TODO Use an internal dolibarr component instead of select2 |
| 8680 | 8680 | if (!getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') && !defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8681 | 8681 | return ''; |
| 8682 | 8682 | } |
| 8683 | 8683 | |
| 8684 | - $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' ' . $morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8684 | + $out = '<select type="text"'.($textfortitle ? ' title="'.dol_escape_htmltag($textfortitle).'"' : '').' id="'.$htmlname.'" class="'.$htmlname.($morecss ? ' '.$morecss : '').'"'.($moreparam ? ' '.$moreparam : '').' name="'.$htmlname.'"><option></option></select>'; |
|
| 8685 | 8685 | |
| 8686 | 8686 | $formattedarrayresult = array(); |
| 8687 | 8687 | |
@@ -8696,20 +8696,20 @@ discard block |
||
| 8696 | 8696 | $outdelayed = ''; |
| 8697 | 8697 | if (!empty($conf->use_javascript_ajax)) { |
| 8698 | 8698 | $tmpplugin = 'select2'; |
| 8699 | - $outdelayed = "\n" . '<!-- JS CODE TO ENABLE ' . $tmpplugin . ' for id ' . $htmlname . ' --> |
|
| 8700 | - <script nonce="' . getNonce() . '"> |
|
| 8699 | + $outdelayed = "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' --> |
|
| 8700 | + <script nonce="' . getNonce().'"> |
|
| 8701 | 8701 | $(document).ready(function () { |
| 8702 | - var data = ' . json_encode($formattedarrayresult) . '; |
|
| 8702 | + var data = ' . json_encode($formattedarrayresult).'; |
|
| 8703 | 8703 | |
| 8704 | - ' . ($callurlonselect ? 'var saveRemoteData = ' . json_encode($array) . ';' : '') . ' |
|
| 8704 | + ' . ($callurlonselect ? 'var saveRemoteData = '.json_encode($array).';' : '').' |
|
| 8705 | 8705 | |
| 8706 | - $(".' . $htmlname . '").select2({ |
|
| 8706 | + $(".' . $htmlname.'").select2({ |
|
| 8707 | 8707 | data: data, |
| 8708 | 8708 | language: select2arrayoflanguage, |
| 8709 | 8709 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */ |
| 8710 | - placeholder: "' . dol_escape_js($placeholder) . '", |
|
| 8710 | + placeholder: "' . dol_escape_js($placeholder).'", |
|
| 8711 | 8711 | escapeMarkup: function (markup) { return markup; }, // let our custom formatter work |
| 8712 | - minimumInputLength: ' . $minimumInputLength . ', |
|
| 8712 | + minimumInputLength: ' . $minimumInputLength.', |
|
| 8713 | 8713 | formatResult: function (result, container, query, escapeMarkup) { |
| 8714 | 8714 | return escapeMarkup(result.text); |
| 8715 | 8715 | }, |
@@ -8748,11 +8748,11 @@ discard block |
||
| 8748 | 8748 | |
| 8749 | 8749 | ' . ($callurlonselect ? ' |
| 8750 | 8750 | /* Code to execute a GET when we select a value */ |
| 8751 | - $(".' . $htmlname . '").change(function() { |
|
| 8752 | - var selected = $(".' . $htmlname . '").val(); |
|
| 8751 | + $(".' . $htmlname.'").change(function() { |
|
| 8752 | + var selected = $(".' . $htmlname.'").val(); |
|
| 8753 | 8753 | console.log("We select "+selected) |
| 8754 | 8754 | |
| 8755 | - $(".' . $htmlname . '").val(""); /* reset visible combo value */ |
|
| 8755 | + $(".' . $htmlname.'").val(""); /* reset visible combo value */ |
|
| 8756 | 8756 | $.each( saveRemoteData, function( key, value ) { |
| 8757 | 8757 | if (key == selected) |
| 8758 | 8758 | { |
@@ -8760,7 +8760,7 @@ discard block |
||
| 8760 | 8760 | location.assign(value.url); |
| 8761 | 8761 | } |
| 8762 | 8762 | }); |
| 8763 | - });' : '') . ' |
|
| 8763 | + });' : '').' |
|
| 8764 | 8764 | |
| 8765 | 8765 | }); |
| 8766 | 8766 | </script>'; |
@@ -8809,7 +8809,7 @@ discard block |
||
| 8809 | 8809 | $useenhancedmultiselect = 0; |
| 8810 | 8810 | if (!empty($conf->use_javascript_ajax) && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 8811 | 8811 | if ($addjscombo) { |
| 8812 | - $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 8812 | + $useenhancedmultiselect = 1; // Use the js multiselect in one line. Possible only if $addjscombo not 0. |
|
| 8813 | 8813 | } |
| 8814 | 8814 | } |
| 8815 | 8815 | |
@@ -8818,7 +8818,7 @@ discard block |
||
| 8818 | 8818 | // submitted to nothing. |
| 8819 | 8819 | $out .= '<input type="hidden" name="'.$htmlname.'_multiselect" value="1">'; |
| 8820 | 8820 | // Output select component |
| 8821 | - $out .= '<select id="' . $htmlname . '" class="multiselect' . ($useenhancedmultiselect ? ' multiselectononeline' : '') . ($morecss ? ' ' . $morecss : '') . '" multiple name="' . $htmlname . '[]"' . ($moreattrib ? ' ' . $moreattrib : '') . ($width ? ' style="width: ' . (preg_match('/%/', $width) ? $width : $width . 'px') . '"' : '') . '>' . "\n"; |
|
| 8821 | + $out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n"; |
|
| 8822 | 8822 | if (is_array($array) && !empty($array)) { |
| 8823 | 8823 | if ($value_as_key) { |
| 8824 | 8824 | $array = array_combine($array, $array); |
@@ -8839,57 +8839,57 @@ discard block |
||
| 8839 | 8839 | $tmplabelhtml = empty($value['labelhtml']) ? '' : $value['labelhtml']; |
| 8840 | 8840 | } |
| 8841 | 8841 | $newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue); |
| 8842 | - $newval = ($key_in_label ? $tmpkey . ' - ' . $newval : $newval); |
|
| 8842 | + $newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval); |
|
| 8843 | 8843 | |
| 8844 | - $out .= '<option value="' . $tmpkey . '"'; |
|
| 8844 | + $out .= '<option value="'.$tmpkey.'"'; |
|
| 8845 | 8845 | if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) { |
| 8846 | 8846 | $out .= ' selected'; |
| 8847 | 8847 | } |
| 8848 | 8848 | if (!empty($tmplabelhtml)) { |
| 8849 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8849 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8850 | 8850 | } else { |
| 8851 | - $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #' . $tmpcolor . '"') : '') . $newval; |
|
| 8852 | - $out .= ' data-html="' . dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1) . '"'; |
|
| 8851 | + $tmplabelhtml = ($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval; |
|
| 8852 | + $out .= ' data-html="'.dol_escape_htmltag($tmplabelhtml, 0, 0, '', 0, 1).'"'; |
|
| 8853 | 8853 | } |
| 8854 | 8854 | $out .= '>'; |
| 8855 | 8855 | $out .= dol_htmlentitiesbr($newval); |
| 8856 | - $out .= '</option>' . "\n"; |
|
| 8856 | + $out .= '</option>'."\n"; |
|
| 8857 | 8857 | } |
| 8858 | 8858 | } |
| 8859 | 8859 | } |
| 8860 | - $out .= '</select>' . "\n"; |
|
| 8860 | + $out .= '</select>'."\n"; |
|
| 8861 | 8861 | |
| 8862 | 8862 | // Add code for jquery to use multiselect |
| 8863 | 8863 | if (!empty($conf->use_javascript_ajax) && getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT')) { |
| 8864 | - $out .= "\n" . '<!-- JS CODE TO ENABLE select for id ' . $htmlname . ', addjscombo=' . $addjscombo . ' -->'; |
|
| 8865 | - $out .= "\n" . '<script nonce="' . getNonce() . '">' . "\n"; |
|
| 8864 | + $out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->'; |
|
| 8865 | + $out .= "\n".'<script nonce="'.getNonce().'">'."\n"; |
|
| 8866 | 8866 | if ($addjscombo == 1) { |
| 8867 | 8867 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; |
| 8868 | - $out .= 'function formatResult(record, container) {' . "\n"; |
|
| 8868 | + $out .= 'function formatResult(record, container) {'."\n"; |
|
| 8869 | 8869 | // If property html set, we decode html entities and use this. |
| 8870 | 8870 | // Note that HTML content must have been sanitized from js with dol_escape_htmltag(xxx, 0, 0, '', 0, 1) when building the select option. |
| 8871 | 8871 | $out .= ' if ($(record.element).attr("data-html") != undefined) { return htmlEntityDecodeJs($(record.element).attr("data-html")); }'."\n"; |
| 8872 | 8872 | $out .= ' return record.text;'; |
| 8873 | - $out .= '}' . "\n"; |
|
| 8874 | - $out .= 'function formatSelection(record) {' . "\n"; |
|
| 8873 | + $out .= '}'."\n"; |
|
| 8874 | + $out .= 'function formatSelection(record) {'."\n"; |
|
| 8875 | 8875 | if ($elemtype == 'category') { |
| 8876 | - $out .= 'return \'<span><img src="' . DOL_URL_ROOT . '/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8876 | + $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';'; |
|
| 8877 | 8877 | } else { |
| 8878 | 8878 | $out .= 'return record.text;'; |
| 8879 | 8879 | } |
| 8880 | - $out .= '}' . "\n"; |
|
| 8880 | + $out .= '}'."\n"; |
|
| 8881 | 8881 | $out .= '$(document).ready(function () { |
| 8882 | - $(\'#' . $htmlname . '\').' . $tmpplugin . '({'; |
|
| 8882 | + $(\'#' . $htmlname.'\').'.$tmpplugin.'({'; |
|
| 8883 | 8883 | if ($placeholder) { |
| 8884 | 8884 | $out .= ' |
| 8885 | 8885 | placeholder: { |
| 8886 | 8886 | id: \'-1\', |
| 8887 | - text: \'' . dol_escape_js($placeholder) . '\' |
|
| 8887 | + text: \'' . dol_escape_js($placeholder).'\' |
|
| 8888 | 8888 | },'; |
| 8889 | 8889 | } |
| 8890 | 8890 | $out .= ' dir: \'ltr\', |
| 8891 | 8891 | containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */ |
| 8892 | - dropdownCssClass: \'' . $morecss . '\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
| 8892 | + dropdownCssClass: \'' . $morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */ |
|
| 8893 | 8893 | // Specify format function for dropdown item |
| 8894 | 8894 | formatResult: formatResult, |
| 8895 | 8895 | templateResult: formatResult, /* For 4.0 */ |
@@ -8901,21 +8901,21 @@ discard block |
||
| 8901 | 8901 | |
| 8902 | 8902 | /* Add also morecss to the css .select2 that is after the #htmlname, for component that are show dynamically after load, because select2 set |
| 8903 | 8903 | the size only if component is not hidden by default on load */ |
| 8904 | - $(\'#' . $htmlname . ' + .select2\').addClass(\'' . $morecss . '\'); |
|
| 8904 | + $(\'#' . $htmlname.' + .select2\').addClass(\''.$morecss.'\'); |
|
| 8905 | 8905 | });' . "\n"; |
| 8906 | 8906 | } elseif ($addjscombo == 2 && !defined('DISABLE_MULTISELECT')) { |
| 8907 | 8907 | // Add other js lib |
| 8908 | 8908 | // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin |
| 8909 | 8909 | // ... |
| 8910 | - $out .= 'console.log(\'addjscombo=2 for htmlname=' . $htmlname . '\');'; |
|
| 8910 | + $out .= 'console.log(\'addjscombo=2 for htmlname='.$htmlname.'\');'; |
|
| 8911 | 8911 | $out .= '$(document).ready(function () { |
| 8912 | - $(\'#' . $htmlname . '\').multiSelect({ |
|
| 8912 | + $(\'#' . $htmlname.'\').multiSelect({ |
|
| 8913 | 8913 | containerHTML: \'<div class="multi-select-container">\', |
| 8914 | 8914 | menuHTML: \'<div class="multi-select-menu">\', |
| 8915 | - buttonHTML: \'<span class="multi-select-button ' . $morecss . '">\', |
|
| 8915 | + buttonHTML: \'<span class="multi-select-button ' . $morecss.'">\', |
|
| 8916 | 8916 | menuItemHTML: \'<label class="multi-select-menuitem">\', |
| 8917 | 8917 | activeClass: \'multi-select-container--open\', |
| 8918 | - noneText: \'' . $placeholder . '\' |
|
| 8918 | + noneText: \'' . $placeholder.'\' |
|
| 8919 | 8919 | }); |
| 8920 | 8920 | })'; |
| 8921 | 8921 | } |
@@ -8947,7 +8947,7 @@ discard block |
||
| 8947 | 8947 | return ''; |
| 8948 | 8948 | } |
| 8949 | 8949 | |
| 8950 | - $tmpvar = "MAIN_SELECTEDFIELDS_" . $varpage; // To get list of saved selected fields to show |
|
| 8950 | + $tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show |
|
| 8951 | 8951 | |
| 8952 | 8952 | if (!empty($user->conf->$tmpvar)) { // A list of fields was already customized for user |
| 8953 | 8953 | $tmparray = explode(',', $user->conf->$tmpvar); |
@@ -8990,19 +8990,19 @@ discard block |
||
| 8990 | 8990 | } |
| 8991 | 8991 | |
| 8992 | 8992 | // Note: $val['checked'] <> 0 means we must show the field into the combo list |
| 8993 | - $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox' . $key . '" value="' . $key . '"' . ((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"') . '/><label for="checkbox' . $key . '">' . dol_escape_htmltag($langs->trans($val['label'])) . '</label></li>'; |
|
| 8994 | - $listcheckedstring .= (empty($val['checked']) ? '' : $key . ','); |
|
| 8993 | + $listoffieldsforselection .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.((empty($val['checked']) || $val['checked'] == '-1') ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>'; |
|
| 8994 | + $listcheckedstring .= (empty($val['checked']) ? '' : $key.','); |
|
| 8995 | 8995 | } |
| 8996 | 8996 | } |
| 8997 | 8997 | |
| 8998 | - $out = '<!-- Component multiSelectArrayWithCheckbox ' . $htmlname . ' --> |
|
| 8998 | + $out = '<!-- Component multiSelectArrayWithCheckbox '.$htmlname.' --> |
|
| 8999 | 8999 | |
| 9000 | 9000 | <dl class="dropdown"> |
| 9001 | 9001 | <dt> |
| 9002 | - <a href="#' . $htmlname . '"> |
|
| 9003 | - ' . img_picto('', 'list') . ' |
|
| 9002 | + <a href="#' . $htmlname.'"> |
|
| 9003 | + ' . img_picto('', 'list').' |
|
| 9004 | 9004 | </a> |
| 9005 | - <input type="hidden" class="' . $htmlname . '" name="' . $htmlname . '" value="' . $listcheckedstring . '"> |
|
| 9005 | + <input type="hidden" class="' . $htmlname.'" name="'.$htmlname.'" value="'.$listcheckedstring.'"> |
|
| 9006 | 9006 | </dt> |
| 9007 | 9007 | <dd class="dropdowndd"> |
| 9008 | 9008 | <div class="multiselectcheckbox'.$htmlname.'"> |
@@ -9014,19 +9014,19 @@ discard block |
||
| 9014 | 9014 | </dd> |
| 9015 | 9015 | </dl> |
| 9016 | 9016 | |
| 9017 | - <script nonce="' . getNonce() . '" type="text/javascript"> |
|
| 9017 | + <script nonce="' . getNonce().'" type="text/javascript"> |
|
| 9018 | 9018 | jQuery(document).ready(function () { |
| 9019 | - $(\'.multiselectcheckbox' . $htmlname . ' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9019 | + $(\'.multiselectcheckbox' . $htmlname.' input[type="checkbox"]\').on(\'click\', function () { |
|
| 9020 | 9020 | console.log("A new field was added/removed, we edit field input[name=formfilteraction]"); |
| 9021 | 9021 | |
| 9022 | 9022 | $("input:hidden[name=formfilteraction]").val(\'listafterchangingselectedfields\'); // Update field so we know we changed something on selected fields after POST |
| 9023 | 9023 | |
| 9024 | 9024 | var title = $(this).val() + ","; |
| 9025 | 9025 | if ($(this).is(\':checked\')) { |
| 9026 | - $(\'.' . $htmlname . '\').val(title + $(\'.' . $htmlname . '\').val()); |
|
| 9026 | + $(\'.' . $htmlname.'\').val(title + $(\'.'.$htmlname.'\').val()); |
|
| 9027 | 9027 | } |
| 9028 | 9028 | else { |
| 9029 | - $(\'.' . $htmlname . '\').val( $(\'.' . $htmlname . '\').val().replace(title, \'\') ) |
|
| 9029 | + $(\'.' . $htmlname.'\').val( $(\'.'.$htmlname.'\').val().replace(title, \'\') ) |
|
| 9030 | 9030 | } |
| 9031 | 9031 | // Now, we submit page |
| 9032 | 9032 | //$(this).parents(\'form:first\').submit(); |
@@ -9057,7 +9057,7 @@ discard block |
||
| 9057 | 9057 | */ |
| 9058 | 9058 | public function showCategories($id, $type, $rendermode = 0, $nolink = 0) |
| 9059 | 9059 | { |
| 9060 | - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 9060 | + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 9061 | 9061 | |
| 9062 | 9062 | $cat = new Categorie($this->db); |
| 9063 | 9063 | $categories = $cat->containing($id, $type); |
@@ -9067,10 +9067,10 @@ discard block |
||
| 9067 | 9067 | foreach ($categories as $c) { |
| 9068 | 9068 | $ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 9069 | 9069 | foreach ($ways as $way) { |
| 9070 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>'; |
|
| 9070 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>'; |
|
| 9071 | 9071 | } |
| 9072 | 9072 | } |
| 9073 | - return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>'; |
|
| 9073 | + return '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>'; |
|
| 9074 | 9074 | } |
| 9075 | 9075 | |
| 9076 | 9076 | if ($rendermode == 0) { |
@@ -9118,15 +9118,15 @@ discard block |
||
| 9118 | 9118 | |
| 9119 | 9119 | |
| 9120 | 9120 | print '<div class="div-table-responsive-no-min">'; |
| 9121 | - print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="' . $object->element . '" data-elementid="' . $object->id . '" >'; |
|
| 9121 | + print '<table class="noborder allwidth" data-block="showLinkedObject" data-element="'.$object->element.'" data-elementid="'.$object->id.'" >'; |
|
| 9122 | 9122 | |
| 9123 | 9123 | print '<tr class="liste_titre">'; |
| 9124 | - print '<td>' . $langs->trans("Type") . '</td>'; |
|
| 9125 | - print '<td>' . $langs->trans("Ref") . '</td>'; |
|
| 9124 | + print '<td>'.$langs->trans("Type").'</td>'; |
|
| 9125 | + print '<td>'.$langs->trans("Ref").'</td>'; |
|
| 9126 | 9126 | print '<td class="center"></td>'; |
| 9127 | - print '<td class="center">' . $langs->trans("Date") . '</td>'; |
|
| 9128 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9129 | - print '<td class="right">' . $langs->trans("Status") . '</td>'; |
|
| 9127 | + print '<td class="center">'.$langs->trans("Date").'</td>'; |
|
| 9128 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9129 | + print '<td class="right">'.$langs->trans("Status").'</td>'; |
|
| 9130 | 9130 | print '<td></td>'; |
| 9131 | 9131 | print '</tr>'; |
| 9132 | 9132 | |
@@ -9145,13 +9145,13 @@ discard block |
||
| 9145 | 9145 | if ($objecttype != 'supplier_proposal' && preg_match('/^([^_]+)_([^_]+)/i', $objecttype, $regs)) { |
| 9146 | 9146 | $element = $regs[1]; |
| 9147 | 9147 | $subelement = $regs[2]; |
| 9148 | - $tplpath = $element . '/' . $subelement; |
|
| 9148 | + $tplpath = $element.'/'.$subelement; |
|
| 9149 | 9149 | } |
| 9150 | 9150 | $tplname = 'linkedobjectblock'; |
| 9151 | 9151 | |
| 9152 | 9152 | // To work with non standard path |
| 9153 | 9153 | if ($objecttype == 'facture') { |
| 9154 | - $tplpath = 'compta/' . $element; |
|
| 9154 | + $tplpath = 'compta/'.$element; |
|
| 9155 | 9155 | if (!isModEnabled('facture')) { |
| 9156 | 9156 | continue; // Do not show if module disabled |
| 9157 | 9157 | } |
@@ -9162,7 +9162,7 @@ discard block |
||
| 9162 | 9162 | continue; // Do not show if module disabled |
| 9163 | 9163 | } |
| 9164 | 9164 | } elseif ($objecttype == 'propal') { |
| 9165 | - $tplpath = 'comm/' . $element; |
|
| 9165 | + $tplpath = 'comm/'.$element; |
|
| 9166 | 9166 | if (!isModEnabled('propal')) { |
| 9167 | 9167 | continue; // Do not show if module disabled |
| 9168 | 9168 | } |
@@ -9213,7 +9213,7 @@ discard block |
||
| 9213 | 9213 | $linkedObjectBlock = $objects; |
| 9214 | 9214 | |
| 9215 | 9215 | // Output template part (modules that overwrite templates must declare this into descriptor) |
| 9216 | - $dirtpls = array_merge($conf->modules_parts['tpl'], array('/' . $tplpath . '/tpl')); |
|
| 9216 | + $dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl')); |
|
| 9217 | 9217 | foreach ($dirtpls as $reldir) { |
| 9218 | 9218 | $reldir = rtrim($reldir, '/'); |
| 9219 | 9219 | if ($nboftypesoutput == ($nbofdifferenttypes - 1)) { // No more type to show after |
@@ -9221,7 +9221,7 @@ discard block |
||
| 9221 | 9221 | $noMoreLinkedObjectBlockAfter = 1; |
| 9222 | 9222 | } |
| 9223 | 9223 | |
| 9224 | - $res = @include dol_buildpath($reldir . '/' . $tplname . '.tpl.php'); |
|
| 9224 | + $res = @include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); |
|
| 9225 | 9225 | if ($res) { |
| 9226 | 9226 | $nboftypesoutput++; |
| 9227 | 9227 | break; |
@@ -9230,7 +9230,7 @@ discard block |
||
| 9230 | 9230 | } |
| 9231 | 9231 | |
| 9232 | 9232 | if (!$nboftypesoutput) { |
| 9233 | - print '<tr><td class="impair" colspan="7"><span class="opacitymedium">' . $langs->trans("None") . '</span></td></tr>'; |
|
| 9233 | + print '<tr><td class="impair" colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>'; |
|
| 9234 | 9234 | } |
| 9235 | 9235 | |
| 9236 | 9236 | print '</table>'; |
@@ -9270,14 +9270,14 @@ discard block |
||
| 9270 | 9270 | if (is_object($object->thirdparty) && !empty($object->thirdparty->id) && $object->thirdparty->id > 0) { |
| 9271 | 9271 | $listofidcompanytoscan = $object->thirdparty->id; |
| 9272 | 9272 | if (($object->thirdparty->parent > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PARENT_IN_LINKTO')) { |
| 9273 | - $listofidcompanytoscan .= ',' . $object->thirdparty->parent; |
|
| 9273 | + $listofidcompanytoscan .= ','.$object->thirdparty->parent; |
|
| 9274 | 9274 | } |
| 9275 | 9275 | if (($object->fk_project > 0) && getDolGlobalString('THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO')) { |
| 9276 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 9276 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 9277 | 9277 | $tmpproject = new Project($this->db); |
| 9278 | 9278 | $tmpproject->fetch($object->fk_project); |
| 9279 | 9279 | if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) { |
| 9280 | - $listofidcompanytoscan .= ',' . $tmpproject->socid; |
|
| 9280 | + $listofidcompanytoscan .= ','.$tmpproject->socid; |
|
| 9281 | 9281 | } |
| 9282 | 9282 | unset($tmpproject); |
| 9283 | 9283 | } |
@@ -9287,63 +9287,63 @@ discard block |
||
| 9287 | 9287 | 'enabled' => isModEnabled('propal'), |
| 9288 | 9288 | 'perms' => 1, |
| 9289 | 9289 | 'label' => 'LinkToProposal', |
| 9290 | - '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') . ')'), |
|
| 9290 | + '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').')'), |
|
| 9291 | 9291 | 'shipping' => array( |
| 9292 | 9292 | 'enabled' => isModEnabled('expedition'), |
| 9293 | 9293 | 'perms' => 1, |
| 9294 | 9294 | 'label' => 'LinkToExpedition', |
| 9295 | - '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') . ')'), |
|
| 9295 | + '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').')'), |
|
| 9296 | 9296 | 'order' => array( |
| 9297 | 9297 | 'enabled' => isModEnabled('commande'), |
| 9298 | 9298 | 'perms' => 1, |
| 9299 | 9299 | 'label' => 'LinkToOrder', |
| 9300 | - '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') . ')'), |
|
| 9300 | + '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').')'), |
|
| 9301 | 9301 | 'invoice' => array( |
| 9302 | 9302 | 'enabled' => isModEnabled('facture'), |
| 9303 | 9303 | 'perms' => 1, |
| 9304 | 9304 | 'label' => 'LinkToInvoice', |
| 9305 | - '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') . ')'), |
|
| 9305 | + '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').')'), |
|
| 9306 | 9306 | 'invoice_template' => array( |
| 9307 | 9307 | 'enabled' => isModEnabled('facture'), |
| 9308 | 9308 | 'perms' => 1, |
| 9309 | 9309 | 'label' => 'LinkToTemplateInvoice', |
| 9310 | - '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') . ')'), |
|
| 9310 | + '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').')'), |
|
| 9311 | 9311 | 'contrat' => array( |
| 9312 | 9312 | 'enabled' => isModEnabled('contrat'), |
| 9313 | 9313 | 'perms' => 1, |
| 9314 | 9314 | 'label' => 'LinkToContract', |
| 9315 | 9315 | '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 |
| 9316 | - 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' |
|
| 9316 | + 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' |
|
| 9317 | 9317 | ), |
| 9318 | 9318 | 'fichinter' => array( |
| 9319 | 9319 | 'enabled' => isModEnabled('ficheinter'), |
| 9320 | 9320 | 'perms' => 1, |
| 9321 | 9321 | 'label' => 'LinkToIntervention', |
| 9322 | - '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') . ')'), |
|
| 9322 | + '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').')'), |
|
| 9323 | 9323 | 'supplier_proposal' => array( |
| 9324 | 9324 | 'enabled' => isModEnabled('supplier_proposal'), |
| 9325 | 9325 | 'perms' => 1, |
| 9326 | 9326 | 'label' => 'LinkToSupplierProposal', |
| 9327 | - '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') . ')'), |
|
| 9327 | + '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').')'), |
|
| 9328 | 9328 | 'order_supplier' => array( |
| 9329 | 9329 | 'enabled' => isModEnabled("supplier_order"), |
| 9330 | 9330 | 'perms' => 1, |
| 9331 | 9331 | 'label' => 'LinkToSupplierOrder', |
| 9332 | - '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') . ')'), |
|
| 9332 | + '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').')'), |
|
| 9333 | 9333 | 'invoice_supplier' => array( |
| 9334 | 9334 | 'enabled' => isModEnabled("supplier_invoice"), |
| 9335 | 9335 | 'perms' => 1, 'label' => 'LinkToSupplierInvoice', |
| 9336 | - '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') . ')'), |
|
| 9336 | + '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').')'), |
|
| 9337 | 9337 | 'ticket' => array( |
| 9338 | 9338 | 'enabled' => isModEnabled('ticket'), |
| 9339 | 9339 | 'perms' => 1, |
| 9340 | 9340 | 'label' => 'LinkToTicket', |
| 9341 | - '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') . ')'), |
|
| 9341 | + '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').')'), |
|
| 9342 | 9342 | 'mo' => array( |
| 9343 | 9343 | 'enabled' => isModEnabled('mrp'), |
| 9344 | 9344 | 'perms' => 1, |
| 9345 | 9345 | 'label' => 'LinkToMo', |
| 9346 | - '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') . ')') |
|
| 9346 | + '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').')') |
|
| 9347 | 9347 | ); |
| 9348 | 9348 | } |
| 9349 | 9349 | |
@@ -9378,22 +9378,22 @@ discard block |
||
| 9378 | 9378 | } |
| 9379 | 9379 | |
| 9380 | 9380 | if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) { |
| 9381 | - print '<div id="' . $key . 'list"' . (empty($conf->use_javascript_ajax) ? '' : ' style="display:none"') . '>'; |
|
| 9381 | + print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>'; |
|
| 9382 | 9382 | |
| 9383 | 9383 | if (getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9384 | 9384 | print '<br>'."\n"; |
| 9385 | 9385 | print '<!-- form to add a link from anywhere -->'."\n"; |
| 9386 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">'; |
|
| 9387 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9386 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinkedbyref'.$key.'">'; |
|
| 9387 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9388 | 9388 | print '<input type="hidden" name="action" value="addlinkbyref">'; |
| 9389 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9390 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9389 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9390 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9391 | 9391 | print '<table class="noborder">'; |
| 9392 | 9392 | print '<tr>'; |
| 9393 | 9393 | //print '<td>' . $langs->trans("Ref") . '</td>'; |
| 9394 | - print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> '; |
|
| 9395 | - print '<input type="submit" class="button small valignmiddle" value="' . $langs->trans('ToLink') . '"> '; |
|
| 9396 | - print '<input type="submit" class="button small" name="cancel" value="' . $langs->trans('Cancel') . '"></td>'; |
|
| 9394 | + print '<td class="center"><input type="text" placeholder="'.dol_escape_htmltag($langs->trans("Ref")).'" name="reftolinkto" value="'.dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')).'"> '; |
|
| 9395 | + print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans('ToLink').'"> '; |
|
| 9396 | + print '<input type="submit" class="button small" name="cancel" value="'.$langs->trans('Cancel').'"></td>'; |
|
| 9397 | 9397 | print '</tr>'; |
| 9398 | 9398 | print '</table>'; |
| 9399 | 9399 | print '</form>'; |
@@ -9408,48 +9408,48 @@ discard block |
||
| 9408 | 9408 | |
| 9409 | 9409 | print '<br>'; |
| 9410 | 9410 | print '<!-- form to add a link from object to same thirdparty -->'."\n"; |
| 9411 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinked' . $key . '">'; |
|
| 9411 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="formlinked'.$key.'">'; |
|
| 9412 | 9412 | print '<input type="hidden" name="action" value="addlink">'; |
| 9413 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 9414 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 9415 | - print '<input type="hidden" name="addlink" value="' . $key . '">'; |
|
| 9413 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 9414 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 9415 | + print '<input type="hidden" name="addlink" value="'.$key.'">'; |
|
| 9416 | 9416 | print '<table class="noborder">'; |
| 9417 | 9417 | print '<tr class="liste_titre">'; |
| 9418 | 9418 | print '<td class="nowrap"></td>'; |
| 9419 | - print '<td class="center">' . $langs->trans("Ref") . '</td>'; |
|
| 9420 | - print '<td class="left">' . $langs->trans("RefCustomer") . '</td>'; |
|
| 9421 | - print '<td class="right">' . $langs->trans("AmountHTShort") . '</td>'; |
|
| 9422 | - print '<td class="left">' . $langs->trans("Company") . '</td>'; |
|
| 9419 | + print '<td class="center">'.$langs->trans("Ref").'</td>'; |
|
| 9420 | + print '<td class="left">'.$langs->trans("RefCustomer").'</td>'; |
|
| 9421 | + print '<td class="right">'.$langs->trans("AmountHTShort").'</td>'; |
|
| 9422 | + print '<td class="left">'.$langs->trans("Company").'</td>'; |
|
| 9423 | 9423 | print '</tr>'; |
| 9424 | 9424 | while ($i < $num) { |
| 9425 | 9425 | $objp = $this->db->fetch_object($resqllist); |
| 9426 | 9426 | |
| 9427 | 9427 | print '<tr class="oddeven">'; |
| 9428 | 9428 | print '<td class="left">'; |
| 9429 | - print '<input type="radio" name="idtolinkto" id="' . $key . '_' . $objp->rowid . '" value="' . $objp->rowid . '">'; |
|
| 9429 | + print '<input type="radio" name="idtolinkto" id="'.$key.'_'.$objp->rowid.'" value="'.$objp->rowid.'">'; |
|
| 9430 | 9430 | print '</td>'; |
| 9431 | - print '<td class="center"><label for="' . $key . '_' . $objp->rowid . '">' . $objp->ref . '</label></td>'; |
|
| 9432 | - print '<td>' . (!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')) . '</td>'; |
|
| 9431 | + print '<td class="center"><label for="'.$key.'_'.$objp->rowid.'">'.$objp->ref.'</label></td>'; |
|
| 9432 | + print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : (!empty($objp->ref_supplier) ? $objp->ref_supplier : '')).'</td>'; |
|
| 9433 | 9433 | print '<td class="right">'; |
| 9434 | 9434 | if ($possiblelink['label'] == 'LinkToContract') { |
| 9435 | 9435 | $form = new Form($this->db); |
| 9436 | - print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")) . ' '; |
|
| 9436 | + print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; |
|
| 9437 | 9437 | } |
| 9438 | - print '<span class="amount">' . (isset($objp->total_ht) ? price($objp->total_ht) : '') . '</span>'; |
|
| 9438 | + print '<span class="amount">'.(isset($objp->total_ht) ? price($objp->total_ht) : '').'</span>'; |
|
| 9439 | 9439 | print '</td>'; |
| 9440 | - print '<td>' . $objp->name . '</td>'; |
|
| 9440 | + print '<td>'.$objp->name.'</td>'; |
|
| 9441 | 9441 | print '</tr>'; |
| 9442 | 9442 | $i++; |
| 9443 | 9443 | } |
| 9444 | 9444 | print '</table>'; |
| 9445 | 9445 | print '<div class="center">'; |
| 9446 | 9446 | if ($num) { |
| 9447 | - print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="' . $langs->trans('ToLink') . '">'; |
|
| 9447 | + print '<input type="submit" class="button valignmiddle marginleftonly marginrightonly small" value="'.$langs->trans('ToLink').'">'; |
|
| 9448 | 9448 | } |
| 9449 | 9449 | if (empty($conf->use_javascript_ajax)) { |
| 9450 | - print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="' . $langs->trans("Cancel") . '"></div>'; |
|
| 9450 | + print '<input type="submit" class="button button-cancel marginleftonly marginrightonly small" name="cancel" value="'.$langs->trans("Cancel").'"></div>'; |
|
| 9451 | 9451 | } else { |
| 9452 | - 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>'; |
|
| 9452 | + 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>'; |
|
| 9453 | 9453 | } |
| 9454 | 9454 | print '</form>'; |
| 9455 | 9455 | $this->db->free($resqllist); |
@@ -9460,10 +9460,10 @@ discard block |
||
| 9460 | 9460 | |
| 9461 | 9461 | //$linktoelem.=($linktoelem?' ':''); |
| 9462 | 9462 | if ($num > 0 || getDolGlobalString('MAIN_LINK_BY_REF_IN_LINKTO')) { |
| 9463 | - $linktoelemlist .= '<li><a href="#linkto' . $key . '" class="linkto dropdowncloseonclick" rel="' . $key . '">' . $langs->trans($possiblelink['label']) . ' (' . $num . ')</a></li>'; |
|
| 9463 | + $linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>'; |
|
| 9464 | 9464 | // } else $linktoelem.=$langs->trans($possiblelink['label']); |
| 9465 | 9465 | } else { |
| 9466 | - $linktoelemlist .= '<li><span class="linktodisabled">' . $langs->trans($possiblelink['label']) . ' (0)</span></li>'; |
|
| 9466 | + $linktoelemlist .= '<li><span class="linktodisabled">'.$langs->trans($possiblelink['label']).' (0)</span></li>'; |
|
| 9467 | 9467 | } |
| 9468 | 9468 | } |
| 9469 | 9469 | } |
@@ -9473,11 +9473,11 @@ discard block |
||
| 9473 | 9473 | <dl class="dropdown" id="linktoobjectname"> |
| 9474 | 9474 | '; |
| 9475 | 9475 | if (!empty($conf->use_javascript_ajax)) { |
| 9476 | - $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>' . $langs->trans("LinkTo") . '...</a></dt>'; |
|
| 9476 | + $linktoelem .= '<dt><a href="#linktoobjectname"><span class="fas fa-link paddingrightonly"></span>'.$langs->trans("LinkTo").'...</a></dt>'; |
|
| 9477 | 9477 | } |
| 9478 | 9478 | $linktoelem .= '<dd> |
| 9479 | 9479 | <div class="multiselectlinkto"> |
| 9480 | - <ul class="ulselectedfields">' . $linktoelemlist . ' |
|
| 9480 | + <ul class="ulselectedfields">' . $linktoelemlist.' |
|
| 9481 | 9481 | </ul> |
| 9482 | 9482 | </div> |
| 9483 | 9483 | </dd> |
@@ -9488,7 +9488,7 @@ discard block |
||
| 9488 | 9488 | |
| 9489 | 9489 | if (!empty($conf->use_javascript_ajax)) { |
| 9490 | 9490 | print '<!-- Add js to show linkto box --> |
| 9491 | - <script nonce="' . getNonce() . '"> |
|
| 9491 | + <script nonce="' . getNonce().'"> |
|
| 9492 | 9492 | jQuery(document).ready(function() { |
| 9493 | 9493 | jQuery(".linkto").click(function() { |
| 9494 | 9494 | console.log("We choose to show/hide links for rel="+jQuery(this).attr(\'rel\')+" so #"+jQuery(this).attr(\'rel\')+"list"); |
@@ -9529,19 +9529,19 @@ discard block |
||
| 9529 | 9529 | |
| 9530 | 9530 | $disabled = ($disabled ? ' disabled' : ''); |
| 9531 | 9531 | |
| 9532 | - $resultyesno = '<select class="flat width75' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '"' . $disabled . '>' . "\n"; |
|
| 9532 | + $resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; |
|
| 9533 | 9533 | if ($useempty) { |
| 9534 | - $resultyesno .= '<option value="-1"' . (($value < 0) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 9534 | + $resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n"; |
|
| 9535 | 9535 | } |
| 9536 | 9536 | if (("$value" == 'yes') || ($value == 1)) { |
| 9537 | - $resultyesno .= '<option value="' . $yes . '" selected>' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9538 | - $resultyesno .= '<option value="' . $no . '">' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9537 | + $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9538 | + $resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9539 | 9539 | } else { |
| 9540 | 9540 | $selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected'); |
| 9541 | - $resultyesno .= '<option value="' . $yes . '">' . $langs->trans($labelyes) . '</option>' . "\n"; |
|
| 9542 | - $resultyesno .= '<option value="' . $no . '"' . $selected . '>' . $langs->trans($labelno) . '</option>' . "\n"; |
|
| 9541 | + $resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n"; |
|
| 9542 | + $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n"; |
|
| 9543 | 9543 | } |
| 9544 | - $resultyesno .= '</select>' . "\n"; |
|
| 9544 | + $resultyesno .= '</select>'."\n"; |
|
| 9545 | 9545 | |
| 9546 | 9546 | if ($addjscombo) { |
| 9547 | 9547 | $resultyesno .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($useempty < 0 ? (string) $useempty : '-1'), $morecss); |
@@ -9565,12 +9565,12 @@ discard block |
||
| 9565 | 9565 | { |
| 9566 | 9566 | // phpcs:enable |
| 9567 | 9567 | $sql = "SELECT rowid, label"; |
| 9568 | - $sql .= " FROM " . $this->db->prefix() . "export_model"; |
|
| 9569 | - $sql .= " WHERE type = '" . $this->db->escape($type) . "'"; |
|
| 9568 | + $sql .= " FROM ".$this->db->prefix()."export_model"; |
|
| 9569 | + $sql .= " WHERE type = '".$this->db->escape($type)."'"; |
|
| 9570 | 9570 | $sql .= " ORDER BY rowid"; |
| 9571 | 9571 | $result = $this->db->query($sql); |
| 9572 | 9572 | if ($result) { |
| 9573 | - print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 9573 | + print '<select class="flat" id="select_'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 9574 | 9574 | if ($useempty) { |
| 9575 | 9575 | print '<option value="-1"> </option>'; |
| 9576 | 9576 | } |
@@ -9580,9 +9580,9 @@ discard block |
||
| 9580 | 9580 | while ($i < $num) { |
| 9581 | 9581 | $obj = $this->db->fetch_object($result); |
| 9582 | 9582 | if ($selected == $obj->rowid) { |
| 9583 | - print '<option value="' . $obj->rowid . '" selected>'; |
|
| 9583 | + print '<option value="'.$obj->rowid.'" selected>'; |
|
| 9584 | 9584 | } else { |
| 9585 | - print '<option value="' . $obj->rowid . '">'; |
|
| 9585 | + print '<option value="'.$obj->rowid.'">'; |
|
| 9586 | 9586 | } |
| 9587 | 9587 | print $obj->label; |
| 9588 | 9588 | print '</option>'; |
@@ -9672,8 +9672,8 @@ discard block |
||
| 9672 | 9672 | $stringforfirstkey .= ' CTL +'; |
| 9673 | 9673 | } |
| 9674 | 9674 | |
| 9675 | - $previous_ref = $object->ref_previous ? '<a accesskey="p" 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>'; |
|
| 9676 | - $next_ref = $object->ref_next ? '<a accesskey="n" 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>'; |
|
| 9675 | + $previous_ref = $object->ref_previous ? '<a accesskey="p" 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>'; |
|
| 9676 | + $next_ref = $object->ref_next ? '<a accesskey="n" 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>'; |
|
| 9677 | 9677 | } |
| 9678 | 9678 | |
| 9679 | 9679 | //print "xx".$previous_ref."x".$next_ref; |
@@ -9681,18 +9681,18 @@ discard block |
||
| 9681 | 9681 | |
| 9682 | 9682 | // Right part of banner |
| 9683 | 9683 | if ($morehtmlright) { |
| 9684 | - $ret .= '<div class="inline-block floatleft">' . $morehtmlright . '</div>'; |
|
| 9684 | + $ret .= '<div class="inline-block floatleft">'.$morehtmlright.'</div>'; |
|
| 9685 | 9685 | } |
| 9686 | 9686 | |
| 9687 | 9687 | if ($previous_ref || $next_ref || $morehtml) { |
| 9688 | 9688 | $ret .= '<div class="pagination paginationref"><ul class="right">'; |
| 9689 | 9689 | } |
| 9690 | 9690 | if ($morehtml) { |
| 9691 | - $ret .= '<li class="noborder litext' . (($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '') . '">' . $morehtml . '</li>'; |
|
| 9691 | + $ret .= '<li class="noborder litext'.(($shownav && $previous_ref && $next_ref) ? ' clearbothonsmartphone' : '').'">'.$morehtml.'</li>'; |
|
| 9692 | 9692 | } |
| 9693 | 9693 | if ($shownav && ($previous_ref || $next_ref)) { |
| 9694 | - $ret .= '<li class="pagination">' . $previous_ref . '</li>'; |
|
| 9695 | - $ret .= '<li class="pagination">' . $next_ref . '</li>'; |
|
| 9694 | + $ret .= '<li class="pagination">'.$previous_ref.'</li>'; |
|
| 9695 | + $ret .= '<li class="pagination">'.$next_ref.'</li>'; |
|
| 9696 | 9696 | } |
| 9697 | 9697 | if ($previous_ref || $next_ref || $morehtml) { |
| 9698 | 9698 | $ret .= '</ul></div>'; |
@@ -9707,7 +9707,7 @@ discard block |
||
| 9707 | 9707 | $morehtmlstatus = $hookmanager->resPrint; |
| 9708 | 9708 | } |
| 9709 | 9709 | if ($morehtmlstatus) { |
| 9710 | - $ret .= '<div class="statusref">' . $morehtmlstatus . '</div>'; |
|
| 9710 | + $ret .= '<div class="statusref">'.$morehtmlstatus.'</div>'; |
|
| 9711 | 9711 | } |
| 9712 | 9712 | |
| 9713 | 9713 | $parameters = array(); |
@@ -9721,14 +9721,14 @@ discard block |
||
| 9721 | 9721 | // Left part of banner |
| 9722 | 9722 | if ($morehtmlleft) { |
| 9723 | 9723 | if ($conf->browser->layout == 'phone') { |
| 9724 | - $ret .= '<!-- morehtmlleft --><div class="floatleft">' . $morehtmlleft . '</div>'; |
|
| 9724 | + $ret .= '<!-- morehtmlleft --><div class="floatleft">'.$morehtmlleft.'</div>'; |
|
| 9725 | 9725 | } else { |
| 9726 | - $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">' . $morehtmlleft . '</div>'; |
|
| 9726 | + $ret .= '<!-- morehtmlleft --><div class="inline-block floatleft">'.$morehtmlleft.'</div>'; |
|
| 9727 | 9727 | } |
| 9728 | 9728 | } |
| 9729 | 9729 | |
| 9730 | 9730 | //if ($conf->browser->layout == 'phone') $ret.='<div class="clearboth"></div>'; |
| 9731 | - $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid' . (($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '') . '">'; |
|
| 9731 | + $ret .= '<div class="inline-block floatleft valignmiddle maxwidth750 marginbottomonly refid'.(($shownav && ($previous_ref || $next_ref)) ? ' refidpadding' : '').'">'; |
|
| 9732 | 9732 | |
| 9733 | 9733 | // For thirdparty, contact, user, member, the ref is the id, so we show something else |
| 9734 | 9734 | if ($object->element == 'societe') { |
@@ -9742,7 +9742,7 @@ discard block |
||
| 9742 | 9742 | |
| 9743 | 9743 | if (is_array($arrayoflangcode) && count($arrayoflangcode)) { |
| 9744 | 9744 | if (!is_object($extralanguages)) { |
| 9745 | - include_once DOL_DOCUMENT_ROOT . '/core/class/extralanguages.class.php'; |
|
| 9745 | + include_once DOL_DOCUMENT_ROOT.'/core/class/extralanguages.class.php'; |
|
| 9746 | 9746 | $extralanguages = new ExtraLanguages($this->db); |
| 9747 | 9747 | } |
| 9748 | 9748 | $extralanguages->fetch_name_extralanguages('societe'); |
@@ -9757,27 +9757,27 @@ discard block |
||
| 9757 | 9757 | if ($object->array_languages['name'][$extralangcode]) { |
| 9758 | 9758 | $htmltext .= $object->array_languages['name'][$extralangcode]; |
| 9759 | 9759 | } else { |
| 9760 | - $htmltext .= '<span class="opacitymedium">' . $langs->trans("SwitchInEditModeToAddTranslation") . '</span>'; |
|
| 9760 | + $htmltext .= '<span class="opacitymedium">'.$langs->trans("SwitchInEditModeToAddTranslation").'</span>'; |
|
| 9761 | 9761 | } |
| 9762 | 9762 | } |
| 9763 | - $ret .= '<!-- Show translations of name -->' . "\n"; |
|
| 9763 | + $ret .= '<!-- Show translations of name -->'."\n"; |
|
| 9764 | 9764 | $ret .= $this->textwithpicto('', $htmltext, -1, 'language', 'opacitymedium paddingleft'); |
| 9765 | 9765 | } |
| 9766 | 9766 | } |
| 9767 | 9767 | } elseif ($object->element == 'member') { |
| 9768 | - $ret .= $object->ref . '<br>'; |
|
| 9768 | + $ret .= $object->ref.'<br>'; |
|
| 9769 | 9769 | $fullname = $object->getFullName($langs); |
| 9770 | 9770 | if ($object->morphy == 'mor' && $object->societe) { |
| 9771 | - $ret .= dol_htmlentities($object->societe) . ((!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''); |
|
| 9771 | + $ret .= dol_htmlentities($object->societe).((!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''); |
|
| 9772 | 9772 | } else { |
| 9773 | - $ret .= dol_htmlentities($fullname) . $addgendertxt . ((!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''); |
|
| 9773 | + $ret .= dol_htmlentities($fullname).$addgendertxt.((!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''); |
|
| 9774 | 9774 | } |
| 9775 | 9775 | } elseif (in_array($object->element, array('contact', 'user'))) { |
| 9776 | - $ret .= dol_htmlentities($object->getFullName($langs)) . $addgendertxt; |
|
| 9776 | + $ret .= dol_htmlentities($object->getFullName($langs)).$addgendertxt; |
|
| 9777 | 9777 | } elseif ($object->element == 'usergroup') { |
| 9778 | 9778 | $ret .= dol_htmlentities($object->name); |
| 9779 | 9779 | } elseif (in_array($object->element, array('action', 'agenda'))) { |
| 9780 | - $ret .= $object->ref . '<br>' . $object->label; |
|
| 9780 | + $ret .= $object->ref.'<br>'.$object->label; |
|
| 9781 | 9781 | } elseif (in_array($object->element, array('adherent_type'))) { |
| 9782 | 9782 | $ret .= $object->label; |
| 9783 | 9783 | } elseif ($object->element == 'ecm_directories') { |
@@ -9829,9 +9829,9 @@ discard block |
||
| 9829 | 9829 | } |
| 9830 | 9830 | |
| 9831 | 9831 | // Barcode image |
| 9832 | - $url = DOL_URL_ROOT . '/viewimage.php?modulepart=barcode&generator=' . urlencode($object->barcode_type_coder) . '&code=' . urlencode($object->barcode) . '&encoding=' . urlencode($object->barcode_type_code); |
|
| 9833 | - $out = '<!-- url barcode = ' . $url . ' -->'; |
|
| 9834 | - $out .= '<img src="' . $url . '"' . ($morecss ? ' class="' . $morecss . '"' : '') . '>'; |
|
| 9832 | + $url = DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($object->barcode_type_coder).'&code='.urlencode($object->barcode).'&encoding='.urlencode($object->barcode_type_code); |
|
| 9833 | + $out = '<!-- url barcode = '.$url.' -->'; |
|
| 9834 | + $out .= '<img src="'.$url.'"'.($morecss ? ' class="'.$morecss.'"' : '').'>'; |
|
| 9835 | 9835 | |
| 9836 | 9836 | return $out; |
| 9837 | 9837 | } |
@@ -9871,28 +9871,28 @@ discard block |
||
| 9871 | 9871 | if (!empty($object->logo)) { |
| 9872 | 9872 | if (dolIsAllowedForPreview($object->logo)) { |
| 9873 | 9873 | if ((string) $imagesize == 'mini') { |
| 9874 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9874 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs |
|
| 9875 | 9875 | } elseif ((string) $imagesize == 'small') { |
| 9876 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . getImageFileNameForSize($object->logo, '_small'); |
|
| 9876 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small'); |
|
| 9877 | 9877 | } else { |
| 9878 | - $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9878 | + $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9879 | 9879 | } |
| 9880 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty') . 'logos/' . $object->logo; |
|
| 9880 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo; |
|
| 9881 | 9881 | } |
| 9882 | 9882 | } |
| 9883 | 9883 | $email = $object->email; |
| 9884 | 9884 | } elseif ($modulepart == 'contact') { |
| 9885 | - $dir = $conf->societe->multidir_output[$entity] . '/contact'; |
|
| 9885 | + $dir = $conf->societe->multidir_output[$entity].'/contact'; |
|
| 9886 | 9886 | if (!empty($object->photo)) { |
| 9887 | 9887 | if (dolIsAllowedForPreview($object->photo)) { |
| 9888 | 9888 | if ((string) $imagesize == 'mini') { |
| 9889 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9889 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9890 | 9890 | } elseif ((string) $imagesize == 'small') { |
| 9891 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9891 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9892 | 9892 | } else { |
| 9893 | - $file = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9893 | + $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9894 | 9894 | } |
| 9895 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact') . 'photos/' . $object->photo; |
|
| 9895 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo; |
|
| 9896 | 9896 | } |
| 9897 | 9897 | } |
| 9898 | 9898 | $email = $object->email; |
@@ -9902,17 +9902,17 @@ discard block |
||
| 9902 | 9902 | if (!empty($object->photo)) { |
| 9903 | 9903 | if (dolIsAllowedForPreview($object->photo)) { |
| 9904 | 9904 | if ((string) $imagesize == 'mini') { |
| 9905 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9905 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9906 | 9906 | } elseif ((string) $imagesize == 'small') { |
| 9907 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9907 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9908 | 9908 | } else { |
| 9909 | - $file = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9909 | + $file = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9910 | 9910 | } |
| 9911 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'user') . 'photos/' . $object->photo; |
|
| 9911 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').'photos/'.$object->photo; |
|
| 9912 | 9912 | } |
| 9913 | 9913 | } |
| 9914 | 9914 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9915 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9915 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9916 | 9916 | } |
| 9917 | 9917 | $email = $object->email; |
| 9918 | 9918 | $capture = 'user'; |
@@ -9921,17 +9921,17 @@ discard block |
||
| 9921 | 9921 | if (!empty($object->photo)) { |
| 9922 | 9922 | if (dolIsAllowedForPreview($object->photo)) { |
| 9923 | 9923 | if ((string) $imagesize == 'mini') { |
| 9924 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_mini'); |
|
| 9924 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); |
|
| 9925 | 9925 | } elseif ((string) $imagesize == 'small') { |
| 9926 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . getImageFileNameForSize($object->photo, '_small'); |
|
| 9926 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); |
|
| 9927 | 9927 | } else { |
| 9928 | - $file = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9928 | + $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9929 | 9929 | } |
| 9930 | - $originalfile = get_exdir(0, 0, 0, 0, $object, 'member') . 'photos/' . $object->photo; |
|
| 9930 | + $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; |
|
| 9931 | 9931 | } |
| 9932 | 9932 | } |
| 9933 | 9933 | if (getDolGlobalString('MAIN_OLD_IMAGE_LINKS')) { |
| 9934 | - $altfile = $object->id . ".jpg"; // For backward compatibility |
|
| 9934 | + $altfile = $object->id.".jpg"; // For backward compatibility |
|
| 9935 | 9935 | } |
| 9936 | 9936 | $email = $object->email; |
| 9937 | 9937 | $capture = 'user'; |
@@ -9957,35 +9957,35 @@ discard block |
||
| 9957 | 9957 | $ret = ''; |
| 9958 | 9958 | |
| 9959 | 9959 | if ($dir) { |
| 9960 | - if ($file && file_exists($dir . "/" . $file)) { |
|
| 9960 | + if ($file && file_exists($dir."/".$file)) { |
|
| 9961 | 9961 | if ($addlinktofullsize) { |
| 9962 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9962 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9963 | 9963 | if ($urladvanced) { |
| 9964 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9964 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9965 | 9965 | } else { |
| 9966 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9966 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9967 | 9967 | } |
| 9968 | 9968 | } |
| 9969 | - $ret .= '<img alt="Photo" 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 . '">'; |
|
| 9969 | + $ret .= '<img alt="Photo" 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.'">'; |
|
| 9970 | 9970 | if ($addlinktofullsize) { |
| 9971 | 9971 | $ret .= '</a>'; |
| 9972 | 9972 | } |
| 9973 | - } elseif ($altfile && file_exists($dir . "/" . $altfile)) { |
|
| 9973 | + } elseif ($altfile && file_exists($dir."/".$altfile)) { |
|
| 9974 | 9974 | if ($addlinktofullsize) { |
| 9975 | - $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity=' . $entity); |
|
| 9975 | + $urladvanced = getAdvancedPreviewUrl($modulepart, $originalfile, 0, '&entity='.$entity); |
|
| 9976 | 9976 | if ($urladvanced) { |
| 9977 | - $ret .= '<a href="' . $urladvanced . '">'; |
|
| 9977 | + $ret .= '<a href="'.$urladvanced.'">'; |
|
| 9978 | 9978 | } else { |
| 9979 | - $ret .= '<a href="' . DOL_URL_ROOT . '/viewimage.php?modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($originalfile) . '&cache=' . $cache . '">'; |
|
| 9979 | + $ret .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($originalfile).'&cache='.$cache.'">'; |
|
| 9980 | 9980 | } |
| 9981 | 9981 | } |
| 9982 | - $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 . '">'; |
|
| 9982 | + $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.'">'; |
|
| 9983 | 9983 | if ($addlinktofullsize) { |
| 9984 | 9984 | $ret .= '</a>'; |
| 9985 | 9985 | } |
| 9986 | 9986 | } else { |
| 9987 | 9987 | $nophoto = '/public/theme/common/nophoto.png'; |
| 9988 | - $defaultimg = 'identicon'; // For gravatar |
|
| 9988 | + $defaultimg = 'identicon'; // For gravatar |
|
| 9989 | 9989 | if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found |
| 9990 | 9990 | if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) { |
| 9991 | 9991 | $nophoto = 'company'; |
@@ -10003,13 +10003,13 @@ discard block |
||
| 10003 | 10003 | if (isModEnabled('gravatar') && $email && empty($noexternsourceoverwrite)) { |
| 10004 | 10004 | // see https://gravatar.com/site/implement/images/php/ |
| 10005 | 10005 | $ret .= '<!-- Put link to gravatar -->'; |
| 10006 | - $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 |
|
| 10006 | + $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 |
|
| 10007 | 10007 | } else { |
| 10008 | 10008 | if ($nophoto == 'company') { |
| 10009 | - $ret .= '<div class="divforspanimg photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . '>' . img_picto('', 'company') . '</div>'; |
|
| 10009 | + $ret .= '<div class="divforspanimg photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'>'.img_picto('', 'company').'</div>'; |
|
| 10010 | 10010 | $ret .= '<div class="difforspanimgright"></div>'; |
| 10011 | 10011 | } else { |
| 10012 | - $ret .= '<img class="photo' . $modulepart . ($cssclass ? ' ' . $cssclass : '') . '" alt="" ' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' src="' . DOL_URL_ROOT . $nophoto . '">'; |
|
| 10012 | + $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; |
|
| 10013 | 10013 | } |
| 10014 | 10014 | } |
| 10015 | 10015 | } |
@@ -10020,15 +10020,15 @@ discard block |
||
| 10020 | 10020 | } |
| 10021 | 10021 | $ret .= '<table class="nobordernopadding centpercent">'; |
| 10022 | 10022 | if ($object->photo) { |
| 10023 | - $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">' . $langs->trans("Delete") . '</label><br><br></td></tr>'; |
|
| 10023 | + $ret .= '<tr><td><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> <label for="photodelete">'.$langs->trans("Delete").'</label><br><br></td></tr>'; |
|
| 10024 | 10024 | } |
| 10025 | 10025 | $ret .= '<tr><td class="tdoverflow">'; |
| 10026 | 10026 | $maxfilesizearray = getMaxFileSizeArray(); |
| 10027 | 10027 | $maxmin = $maxfilesizearray['maxmin']; |
| 10028 | 10028 | if ($maxmin > 0) { |
| 10029 | - $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10029 | + $ret .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 10030 | 10030 | } |
| 10031 | - $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"' . ($capture ? ' capture="' . $capture . '"' : '') . '>'; |
|
| 10031 | + $ret .= '<input type="file" class="flat maxwidth200onsmartphone" name="photo" id="photoinput" accept="image/*"'.($capture ? ' capture="'.$capture.'"' : '').'>'; |
|
| 10032 | 10032 | $ret .= '</td></tr>'; |
| 10033 | 10033 | $ret .= '</table>'; |
| 10034 | 10034 | } |
@@ -10082,38 +10082,38 @@ discard block |
||
| 10082 | 10082 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10083 | 10083 | $sql .= ", e.label"; |
| 10084 | 10084 | } |
| 10085 | - $sql .= " FROM " . $this->db->prefix() . "usergroup as ug "; |
|
| 10085 | + $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; |
|
| 10086 | 10086 | if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { |
| 10087 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid=ug.entity"; |
|
| 10087 | + $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; |
|
| 10088 | 10088 | if ($force_entity) { |
| 10089 | - $sql .= " WHERE ug.entity IN (0, " . $force_entity . ")"; |
|
| 10089 | + $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; |
|
| 10090 | 10090 | } else { |
| 10091 | 10091 | $sql .= " WHERE ug.entity IS NOT NULL"; |
| 10092 | 10092 | } |
| 10093 | 10093 | } else { |
| 10094 | - $sql .= " WHERE ug.entity IN (0, " . $conf->entity . ")"; |
|
| 10094 | + $sql .= " WHERE ug.entity IN (0, ".$conf->entity.")"; |
|
| 10095 | 10095 | } |
| 10096 | 10096 | if (is_array($exclude) && $excludeGroups) { |
| 10097 | - $sql .= " AND ug.rowid NOT IN (" . $this->db->sanitize($excludeGroups) . ")"; |
|
| 10097 | + $sql .= " AND ug.rowid NOT IN (".$this->db->sanitize($excludeGroups).")"; |
|
| 10098 | 10098 | } |
| 10099 | 10099 | if (is_array($include) && $includeGroups) { |
| 10100 | - $sql .= " AND ug.rowid IN (" . $this->db->sanitize($includeGroups) . ")"; |
|
| 10100 | + $sql .= " AND ug.rowid IN (".$this->db->sanitize($includeGroups).")"; |
|
| 10101 | 10101 | } |
| 10102 | 10102 | $sql .= " ORDER BY ug.nom ASC"; |
| 10103 | 10103 | |
| 10104 | - dol_syslog(get_class($this) . "::select_dolgroups", LOG_DEBUG); |
|
| 10104 | + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); |
|
| 10105 | 10105 | $resql = $this->db->query($sql); |
| 10106 | 10106 | if ($resql) { |
| 10107 | 10107 | // Enhance with select2 |
| 10108 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10108 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10109 | 10109 | |
| 10110 | - $out .= '<select class="flat minwidth200' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . ($multiple ? '[]' : '') . '" ' . ($multiple ? 'multiple' : '') . ' ' . ($disabled ? ' disabled' : '') . '>'; |
|
| 10110 | + $out .= '<select class="flat minwidth200'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; |
|
| 10111 | 10111 | |
| 10112 | 10112 | $num = $this->db->num_rows($resql); |
| 10113 | 10113 | $i = 0; |
| 10114 | 10114 | if ($num) { |
| 10115 | 10115 | if ($show_empty && !$multiple) { |
| 10116 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '> </option>' . "\n"; |
|
| 10116 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'> </option>'."\n"; |
|
| 10117 | 10117 | } |
| 10118 | 10118 | |
| 10119 | 10119 | while ($i < $num) { |
@@ -10126,11 +10126,11 @@ discard block |
||
| 10126 | 10126 | $label = $obj->name; |
| 10127 | 10127 | $labelhtml = $obj->name; |
| 10128 | 10128 | if (isModEnabled('multicompany') && !getDolGlobalInt('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity == 1) { |
| 10129 | - $label .= " (" . $obj->label . ")"; |
|
| 10130 | - $labelhtml .= ' <span class="opacitymedium">(' . $obj->label . ')</span>'; |
|
| 10129 | + $label .= " (".$obj->label.")"; |
|
| 10130 | + $labelhtml .= ' <span class="opacitymedium">('.$obj->label.')</span>'; |
|
| 10131 | 10131 | } |
| 10132 | 10132 | |
| 10133 | - $out .= '<option value="' . $obj->rowid . '"'; |
|
| 10133 | + $out .= '<option value="'.$obj->rowid.'"'; |
|
| 10134 | 10134 | if ($disableline) { |
| 10135 | 10135 | $out .= ' disabled'; |
| 10136 | 10136 | } |
@@ -10146,9 +10146,9 @@ discard block |
||
| 10146 | 10146 | } |
| 10147 | 10147 | } else { |
| 10148 | 10148 | if ($show_empty) { |
| 10149 | - $out .= '<option value="-1"' . (in_array(-1, $selected) ? ' selected' : '') . '></option>' . "\n"; |
|
| 10149 | + $out .= '<option value="-1"'.(in_array(-1, $selected) ? ' selected' : '').'></option>'."\n"; |
|
| 10150 | 10150 | } |
| 10151 | - $out .= '<option value="" disabled>' . $langs->trans("NoUserGroupDefined") . '</option>'; |
|
| 10151 | + $out .= '<option value="" disabled>'.$langs->trans("NoUserGroupDefined").'</option>'; |
|
| 10152 | 10152 | } |
| 10153 | 10153 | $out .= '</select>'; |
| 10154 | 10154 | |
@@ -10197,25 +10197,25 @@ discard block |
||
| 10197 | 10197 | $out = ''; |
| 10198 | 10198 | |
| 10199 | 10199 | if (!empty($conf->use_javascript_ajax)) { |
| 10200 | - $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>'; |
|
| 10200 | + $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="'.$cssclass.'s" name="'.$cssclass.'s" class="checkallactions"></div>'; |
|
| 10201 | 10201 | } |
| 10202 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10202 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10203 | 10203 | $(document).ready(function() { |
| 10204 | - $("#' . $cssclass . 's").click(function() { |
|
| 10204 | + $("#' . $cssclass.'s").click(function() { |
|
| 10205 | 10205 | if($(this).is(\':checked\')){ |
| 10206 | - console.log("We check all ' . $cssclass . ' and trigger the change method"); |
|
| 10207 | - $(".' . $cssclass . '").prop(\'checked\', true).trigger(\'change\'); |
|
| 10206 | + console.log("We check all ' . $cssclass.' and trigger the change method"); |
|
| 10207 | + $(".' . $cssclass.'").prop(\'checked\', true).trigger(\'change\'); |
|
| 10208 | 10208 | } |
| 10209 | 10209 | else |
| 10210 | 10210 | { |
| 10211 | 10211 | console.log("We uncheck all"); |
| 10212 | - $(".' . $cssclass . '").prop(\'checked\', false).trigger(\'change\'); |
|
| 10212 | + $(".' . $cssclass.'").prop(\'checked\', false).trigger(\'change\'); |
|
| 10213 | 10213 | }' . "\n"; |
| 10214 | 10214 | if ($calljsfunction) { |
| 10215 | - $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10215 | + $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "'.$massactionname.'", "'.$cssclass.'"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; |
|
| 10216 | 10216 | } |
| 10217 | 10217 | $out .= ' }); |
| 10218 | - $(".' . $cssclass . '").change(function() { |
|
| 10218 | + $(".' . $cssclass.'").change(function() { |
|
| 10219 | 10219 | $(this).closest("tr").toggleClass("highlight", this.checked); |
| 10220 | 10220 | }); |
| 10221 | 10221 | }); |
@@ -10260,67 +10260,67 @@ discard block |
||
| 10260 | 10260 | global $langs, $user; |
| 10261 | 10261 | |
| 10262 | 10262 | $out = ''; |
| 10263 | - $sql = "SELECT rowid, label FROM " . $this->db->prefix() . "c_exp_tax_cat WHERE active = 1"; |
|
| 10264 | - $sql .= " AND entity IN (0," . getEntity('exp_tax_cat') . ")"; |
|
| 10263 | + $sql = "SELECT rowid, label FROM ".$this->db->prefix()."c_exp_tax_cat WHERE active = 1"; |
|
| 10264 | + $sql .= " AND entity IN (0,".getEntity('exp_tax_cat').")"; |
|
| 10265 | 10265 | if (!empty($excludeid)) { |
| 10266 | - $sql .= " AND rowid NOT IN (" . $this->db->sanitize(implode(',', $excludeid)) . ")"; |
|
| 10266 | + $sql .= " AND rowid NOT IN (".$this->db->sanitize(implode(',', $excludeid)).")"; |
|
| 10267 | 10267 | } |
| 10268 | 10268 | $sql .= " ORDER BY label"; |
| 10269 | 10269 | |
| 10270 | 10270 | $resql = $this->db->query($sql); |
| 10271 | 10271 | if ($resql) { |
| 10272 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp maxwidth200">'; |
|
| 10272 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp maxwidth200">'; |
|
| 10273 | 10273 | if ($useempty) { |
| 10274 | 10274 | $out .= '<option value="0"> </option>'; |
| 10275 | 10275 | } |
| 10276 | 10276 | |
| 10277 | 10277 | while ($obj = $this->db->fetch_object($resql)) { |
| 10278 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . $langs->trans($obj->label) . '</option>'; |
|
| 10278 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>'; |
|
| 10279 | 10279 | } |
| 10280 | 10280 | $out .= '</select>'; |
| 10281 | - $out .= ajax_combobox('select_' . $htmlname); |
|
| 10281 | + $out .= ajax_combobox('select_'.$htmlname); |
|
| 10282 | 10282 | |
| 10283 | 10283 | if (!empty($htmlname) && $user->admin && $info_admin) { |
| 10284 | - $out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10284 | + $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); |
|
| 10285 | 10285 | } |
| 10286 | 10286 | |
| 10287 | 10287 | if (!empty($target)) { |
| 10288 | - $sql = "SELECT c.id FROM " . $this->db->prefix() . "c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10288 | + $sql = "SELECT c.id FROM ".$this->db->prefix()."c_type_fees as c WHERE c.code = 'EX_KME' AND c.active = 1"; |
|
| 10289 | 10289 | $resql = $this->db->query($sql); |
| 10290 | 10290 | if ($resql) { |
| 10291 | 10291 | if ($this->db->num_rows($resql) > 0) { |
| 10292 | 10292 | $obj = $this->db->fetch_object($resql); |
| 10293 | - $out .= '<script nonce="' . getNonce() . '"> |
|
| 10293 | + $out .= '<script nonce="'.getNonce().'"> |
|
| 10294 | 10294 | $(function() { |
| 10295 | - $("select[name=' . $target . ']").on("change", function() { |
|
| 10295 | + $("select[name=' . $target.']").on("change", function() { |
|
| 10296 | 10296 | var current_val = $(this).val(); |
| 10297 | - if (current_val == ' . $obj->id . ') {'; |
|
| 10297 | + if (current_val == ' . $obj->id.') {'; |
|
| 10298 | 10298 | if (!empty($default_selected) || !empty($selected)) { |
| 10299 | - $out .= '$("select[name=' . $htmlname . ']").val("' . ($default_selected > 0 ? $default_selected : $selected) . '");'; |
|
| 10299 | + $out .= '$("select[name='.$htmlname.']").val("'.($default_selected > 0 ? $default_selected : $selected).'");'; |
|
| 10300 | 10300 | } |
| 10301 | 10301 | |
| 10302 | 10302 | $out .= ' |
| 10303 | - $("select[name=' . $htmlname . ']").change(); |
|
| 10303 | + $("select[name=' . $htmlname.']").change(); |
|
| 10304 | 10304 | } |
| 10305 | 10305 | }); |
| 10306 | 10306 | |
| 10307 | - $("select[name=' . $htmlname . ']").change(function() { |
|
| 10307 | + $("select[name=' . $htmlname.']").change(function() { |
|
| 10308 | 10308 | |
| 10309 | - if ($("select[name=' . $target . ']").val() == ' . $obj->id . ') { |
|
| 10309 | + if ($("select[name=' . $target.']").val() == '.$obj->id.') { |
|
| 10310 | 10310 | // get price of kilometer to fill the unit price |
| 10311 | 10311 | $.ajax({ |
| 10312 | 10312 | method: "POST", |
| 10313 | 10313 | dataType: "json", |
| 10314 | - data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken() . '\' }, |
|
| 10315 | - url: "' . (DOL_URL_ROOT . '/expensereport/ajax/ajaxik.php?' . implode('&', $params)) . '", |
|
| 10314 | + data: { fk_c_exp_tax_cat: $(this).val(), token: \'' . currentToken().'\' }, |
|
| 10315 | + url: "' . (DOL_URL_ROOT.'/expensereport/ajax/ajaxik.php?'.implode('&', $params)).'", |
|
| 10316 | 10316 | }).done(function( data, textStatus, jqXHR ) { |
| 10317 | 10317 | console.log(data); |
| 10318 | 10318 | if (typeof data.up != "undefined") { |
| 10319 | 10319 | $("input[name=value_unit]").val(data.up); |
| 10320 | - $("select[name=' . $htmlname . ']").attr("title", data.title); |
|
| 10320 | + $("select[name=' . $htmlname.']").attr("title", data.title); |
|
| 10321 | 10321 | } else { |
| 10322 | 10322 | $("input[name=value_unit]").val(""); |
| 10323 | - $("select[name=' . $htmlname . ']").attr("title", ""); |
|
| 10323 | + $("select[name=' . $htmlname.']").attr("title", ""); |
|
| 10324 | 10324 | } |
| 10325 | 10325 | }); |
| 10326 | 10326 | } |
@@ -10350,18 +10350,18 @@ discard block |
||
| 10350 | 10350 | global $conf, $langs; |
| 10351 | 10351 | |
| 10352 | 10352 | $out = ''; |
| 10353 | - $sql = "SELECT rowid, range_ik FROM " . $this->db->prefix() . "c_exp_tax_range"; |
|
| 10354 | - $sql .= " WHERE entity = " . $conf->entity . " AND active = 1"; |
|
| 10353 | + $sql = "SELECT rowid, range_ik FROM ".$this->db->prefix()."c_exp_tax_range"; |
|
| 10354 | + $sql .= " WHERE entity = ".$conf->entity." AND active = 1"; |
|
| 10355 | 10355 | |
| 10356 | 10356 | $resql = $this->db->query($sql); |
| 10357 | 10357 | if ($resql) { |
| 10358 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10358 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10359 | 10359 | if ($useempty) { |
| 10360 | 10360 | $out .= '<option value="0"></option>'; |
| 10361 | 10361 | } |
| 10362 | 10362 | |
| 10363 | 10363 | while ($obj = $this->db->fetch_object($resql)) { |
| 10364 | - $out .= '<option ' . ($selected == $obj->rowid ? 'selected="selected"' : '') . ' value="' . $obj->rowid . '">' . price($obj->range_ik, 0, $langs, 1, 0) . '</option>'; |
|
| 10364 | + $out .= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.price($obj->range_ik, 0, $langs, 1, 0).'</option>'; |
|
| 10365 | 10365 | } |
| 10366 | 10366 | $out .= '</select>'; |
| 10367 | 10367 | } else { |
@@ -10392,12 +10392,12 @@ discard block |
||
| 10392 | 10392 | |
| 10393 | 10393 | $resql = $this->db->query($sql); |
| 10394 | 10394 | if ($resql) { |
| 10395 | - $out = '<select id="select_' . $htmlname . '" name="' . $htmlname . '" class="' . $htmlname . ' flat minwidth75imp">'; |
|
| 10395 | + $out = '<select id="select_'.$htmlname.'" name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">'; |
|
| 10396 | 10396 | if ($useempty) { |
| 10397 | 10397 | $out .= '<option value="0"></option>'; |
| 10398 | 10398 | } |
| 10399 | 10399 | if ($allchoice) { |
| 10400 | - $out .= '<option value="-1">' . $langs->trans('AllExpenseReport') . '</option>'; |
|
| 10400 | + $out .= '<option value="-1">'.$langs->trans('AllExpenseReport').'</option>'; |
|
| 10401 | 10401 | } |
| 10402 | 10402 | |
| 10403 | 10403 | $field = 'code'; |
@@ -10407,7 +10407,7 @@ discard block |
||
| 10407 | 10407 | |
| 10408 | 10408 | while ($obj = $this->db->fetch_object($resql)) { |
| 10409 | 10409 | $key = $langs->trans($obj->code); |
| 10410 | - $out .= '<option ' . ($selected == $obj->{$field} ? 'selected="selected"' : '') . ' value="' . $obj->{$field} . '">' . ($key != $obj->code ? $key : $obj->label) . '</option>'; |
|
| 10410 | + $out .= '<option '.($selected == $obj->{$field} ? 'selected="selected"' : '').' value="'.$obj->{$field}.'">'.($key != $obj->code ? $key : $obj->label).'</option>'; |
|
| 10411 | 10411 | } |
| 10412 | 10412 | $out .= '</select>'; |
| 10413 | 10413 | |
@@ -10441,7 +10441,7 @@ discard block |
||
| 10441 | 10441 | { |
| 10442 | 10442 | global $user, $conf, $langs; |
| 10443 | 10443 | |
| 10444 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
| 10444 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
| 10445 | 10445 | |
| 10446 | 10446 | if (is_null($usertofilter)) { |
| 10447 | 10447 | $usertofilter = $user; |
@@ -10465,10 +10465,10 @@ discard block |
||
| 10465 | 10465 | $sql = "SELECT f.rowid, f.ref as fref, 'nolabel' as flabel, p.rowid as pid, f.ref, |
| 10466 | 10466 | p.title, p.fk_soc, p.fk_statut, p.public,"; |
| 10467 | 10467 | $sql .= ' s.nom as name'; |
| 10468 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
| 10469 | - $sql .= ' LEFT JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10470 | - $sql .= ' ' . $this->db->prefix() . 'facture as f'; |
|
| 10471 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
| 10468 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
| 10469 | + $sql .= ' LEFT JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc,'; |
|
| 10470 | + $sql .= ' '.$this->db->prefix().'facture as f'; |
|
| 10471 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
| 10472 | 10472 | $sql .= " AND f.fk_projet = p.rowid AND f.fk_statut=0"; //Brouillons seulement |
| 10473 | 10473 | //if ($projectsListId) $sql.= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
| 10474 | 10474 | //if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
@@ -10479,14 +10479,14 @@ discard block |
||
| 10479 | 10479 | if ($resql) { |
| 10480 | 10480 | // Use select2 selector |
| 10481 | 10481 | if (!empty($conf->use_javascript_ajax)) { |
| 10482 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10482 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10483 | 10483 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10484 | 10484 | $out .= $comboenhancement; |
| 10485 | 10485 | $morecss = 'minwidth200imp maxwidth500'; |
| 10486 | 10486 | } |
| 10487 | 10487 | |
| 10488 | 10488 | if (empty($option_only)) { |
| 10489 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10489 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10490 | 10490 | } |
| 10491 | 10491 | if (!empty($show_empty)) { |
| 10492 | 10492 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10516,33 +10516,33 @@ discard block |
||
| 10516 | 10516 | if ($showproject == 'all') { |
| 10517 | 10517 | $labeltoshow .= dol_trunc($obj->ref, 18); // Invoice ref |
| 10518 | 10518 | if ($obj->name) { |
| 10519 | - $labeltoshow .= ' - ' . $obj->name; // Soc name |
|
| 10519 | + $labeltoshow .= ' - '.$obj->name; // Soc name |
|
| 10520 | 10520 | } |
| 10521 | 10521 | |
| 10522 | 10522 | $disabled = 0; |
| 10523 | 10523 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
| 10524 | 10524 | $disabled = 1; |
| 10525 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
| 10525 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
| 10526 | 10526 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
| 10527 | 10527 | if ($discard_closed == 2) { |
| 10528 | 10528 | $disabled = 1; |
| 10529 | 10529 | } |
| 10530 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10530 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10531 | 10531 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
| 10532 | 10532 | $disabled = 1; |
| 10533 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
| 10533 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
| 10534 | 10534 | } |
| 10535 | 10535 | } |
| 10536 | 10536 | |
| 10537 | 10537 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10538 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10538 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10539 | 10539 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10540 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10540 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10541 | 10541 | } else { |
| 10542 | 10542 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
| 10543 | 10543 | $resultat = ''; |
| 10544 | 10544 | } else { |
| 10545 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10545 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10546 | 10546 | if ($disabled) { |
| 10547 | 10547 | $resultat .= ' disabled'; |
| 10548 | 10548 | } |
@@ -10594,22 +10594,22 @@ discard block |
||
| 10594 | 10594 | |
| 10595 | 10595 | $sql = 'SELECT f.rowid, f.entity, f.titre as title, f.suspended, f.fk_soc'; |
| 10596 | 10596 | //$sql.= ', el.fk_source'; |
| 10597 | - $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as f'; |
|
| 10598 | - $sql .= " WHERE f.entity IN (" . getEntity('invoice') . ")"; |
|
| 10597 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; |
|
| 10598 | + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; |
|
| 10599 | 10599 | $sql .= " ORDER BY f.titre ASC"; |
| 10600 | 10600 | |
| 10601 | 10601 | $resql = $this->db->query($sql); |
| 10602 | 10602 | if ($resql) { |
| 10603 | 10603 | // Use select2 selector |
| 10604 | 10604 | if (!empty($conf->use_javascript_ajax)) { |
| 10605 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
| 10605 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
| 10606 | 10606 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
| 10607 | 10607 | $out .= $comboenhancement; |
| 10608 | 10608 | $morecss = 'minwidth200imp maxwidth500'; |
| 10609 | 10609 | } |
| 10610 | 10610 | |
| 10611 | 10611 | if (empty($option_only)) { |
| 10612 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
| 10612 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
| 10613 | 10613 | } |
| 10614 | 10614 | if (!empty($show_empty)) { |
| 10615 | 10615 | $out .= '<option value="0" class="optiongrey">'; |
@@ -10628,19 +10628,19 @@ discard block |
||
| 10628 | 10628 | $disabled = 0; |
| 10629 | 10629 | if (!empty($obj->suspended)) { |
| 10630 | 10630 | $disabled = 1; |
| 10631 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
| 10631 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
| 10632 | 10632 | } |
| 10633 | 10633 | |
| 10634 | 10634 | |
| 10635 | 10635 | if (!empty($selected) && $selected == $obj->rowid) { |
| 10636 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
| 10636 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
| 10637 | 10637 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
| 10638 | - $out .= '>' . $labeltoshow . '</option>'; |
|
| 10638 | + $out .= '>'.$labeltoshow.'</option>'; |
|
| 10639 | 10639 | } else { |
| 10640 | 10640 | if ($disabled && ($selected != $obj->rowid)) { |
| 10641 | 10641 | $resultat = ''; |
| 10642 | 10642 | } else { |
| 10643 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
| 10643 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
| 10644 | 10644 | if ($disabled) { |
| 10645 | 10645 | $resultat .= ' disabled'; |
| 10646 | 10646 | } |
@@ -10680,14 +10680,14 @@ discard block |
||
| 10680 | 10680 | global $langs; |
| 10681 | 10681 | |
| 10682 | 10682 | if ($search_component_params_hidden != '' && !preg_match('/^\(.*\)$/', $search_component_params_hidden)) { // If $search_component_params_hidden does not start and end with () |
| 10683 | - $search_component_params_hidden = '(' . $search_component_params_hidden . ')'; |
|
| 10683 | + $search_component_params_hidden = '('.$search_component_params_hidden.')'; |
|
| 10684 | 10684 | } |
| 10685 | 10685 | |
| 10686 | 10686 | $ret = ''; |
| 10687 | 10687 | |
| 10688 | 10688 | $ret .= '<div class="divadvancedsearchfieldcomp inline-block">'; |
| 10689 | 10689 | $ret .= '<a href="#" class="dropdownsearch-toggle unsetcolor">'; |
| 10690 | - $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="' . dol_escape_htmltag($langs->trans("Filters")) . '" id="idsubimgproductdistribution"></span>'; |
|
| 10690 | + $ret .= '<span class="fas fa-filter linkobject boxfilter paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("Filters")).'" id="idsubimgproductdistribution"></span>'; |
|
| 10691 | 10691 | $ret .= '</a>'; |
| 10692 | 10692 | |
| 10693 | 10693 | $ret .= '<div class="divadvancedsearchfieldcompinput inline-block minwidth500 maxwidth300onsmartphone">'; |
@@ -10713,8 +10713,8 @@ discard block |
||
| 10713 | 10713 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
| 10714 | 10714 | $searchtags = removeGlobalParenthesis($searchtags); |
| 10715 | 10715 | |
| 10716 | - $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey+1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10717 | - $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey+1).'">x</span> '; |
|
| 10716 | + $ret .= '<span class="marginleftonlyshort valignmiddle tagsearch" data-ufilterid="'.($tmpkey + 1).'" data-ufilter="'.dol_escape_htmltag($tmpval).'">'; |
|
| 10717 | + $ret .= '<span class="tagsearchdelete select2-selection__choice__remove" data-ufilterid="'.($tmpkey + 1).'">x</span> '; |
|
| 10718 | 10718 | $ret .= dol_escape_htmltag($searchtags); |
| 10719 | 10719 | $ret .= '</span>'; |
| 10720 | 10720 | } |
@@ -10731,29 +10731,29 @@ discard block |
||
| 10731 | 10731 | $ret .= '<input type="hidden" name="show_search_component_params_hidden" value="1">'; |
| 10732 | 10732 | } |
| 10733 | 10733 | $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%')) -->"; |
| 10734 | - $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="' . dol_escape_htmltag($search_component_params_hidden) . '">'; |
|
| 10734 | + $ret .= '<input type="hidden" id="search_component_params_hidden" name="search_component_params_hidden" value="'.dol_escape_htmltag($search_component_params_hidden).'">'; |
|
| 10735 | 10735 | // $ret .= "<!-- sql= ".forgeSQLFromUniversalSearchCriteria($search_component_params_hidden, $errormessage)." -->"; |
| 10736 | 10736 | |
| 10737 | 10737 | // For compatibility with forms that show themself the search criteria in addition of this component, we output these fields |
| 10738 | 10738 | foreach ($arrayofcriterias as $criteria) { |
| 10739 | 10739 | foreach ($criteria as $criteriafamilykey => $criteriafamilyval) { |
| 10740 | - if (in_array('search_' . $criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10740 | + if (in_array('search_'.$criteriafamilykey, $arrayofinputfieldsalreadyoutput)) { |
|
| 10741 | 10741 | continue; |
| 10742 | 10742 | } |
| 10743 | 10743 | if (in_array($criteriafamilykey, array('rowid', 'ref_ext', 'entity', 'extraparams'))) { |
| 10744 | 10744 | continue; |
| 10745 | 10745 | } |
| 10746 | 10746 | if (in_array($criteriafamilyval['type'], array('date', 'datetime', 'timestamp'))) { |
| 10747 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_start">'; |
|
| 10748 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startyear">'; |
|
| 10749 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startmonth">'; |
|
| 10750 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_startday">'; |
|
| 10751 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_end">'; |
|
| 10752 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endyear">'; |
|
| 10753 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endmonth">'; |
|
| 10754 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '_endday">'; |
|
| 10747 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_start">'; |
|
| 10748 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startyear">'; |
|
| 10749 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startmonth">'; |
|
| 10750 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_startday">'; |
|
| 10751 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_end">'; |
|
| 10752 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endyear">'; |
|
| 10753 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endmonth">'; |
|
| 10754 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'_endday">'; |
|
| 10755 | 10755 | } else { |
| 10756 | - $ret .= '<input type="hidden" name="search_' . $criteriafamilykey . '">'; |
|
| 10756 | + $ret .= '<input type="hidden" name="search_'.$criteriafamilykey.'">'; |
|
| 10757 | 10757 | } |
| 10758 | 10758 | } |
| 10759 | 10759 | } |
@@ -10761,7 +10761,7 @@ discard block |
||
| 10761 | 10761 | $ret .= '</div>'; |
| 10762 | 10762 | |
| 10763 | 10763 | $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"; |
| 10764 | - $ret .= '<input type="text" placeholder="' . $langs->trans("Filters") . '" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10764 | + $ret .= '<input type="text" placeholder="'.$langs->trans("Filters").'" id="search_component_params_input" name="search_component_params_input" class="noborderbottom search_component_input" value="">'; |
|
| 10765 | 10765 | |
| 10766 | 10766 | $ret .= '</div>'; |
| 10767 | 10767 | $ret .= '</div>'; |
@@ -10814,7 +10814,7 @@ discard block |
||
| 10814 | 10814 | |
| 10815 | 10815 | $TModels = array(); |
| 10816 | 10816 | |
| 10817 | - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; |
|
| 10817 | + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
|
| 10818 | 10818 | $formmail = new FormMail($this->db); |
| 10819 | 10819 | $result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs); |
| 10820 | 10820 | |
@@ -10827,17 +10827,17 @@ discard block |
||
| 10827 | 10827 | } |
| 10828 | 10828 | } |
| 10829 | 10829 | |
| 10830 | - $retstring .= '<select class="flat" id="select_' . $prefix . 'model_mail" name="' . $prefix . 'model_mail">'; |
|
| 10830 | + $retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">'; |
|
| 10831 | 10831 | |
| 10832 | 10832 | foreach ($TModels as $id_model => $label_model) { |
| 10833 | - $retstring .= '<option value="' . $id_model . '"'; |
|
| 10834 | - $retstring .= ">" . $label_model . "</option>"; |
|
| 10833 | + $retstring .= '<option value="'.$id_model.'"'; |
|
| 10834 | + $retstring .= ">".$label_model."</option>"; |
|
| 10835 | 10835 | } |
| 10836 | 10836 | |
| 10837 | 10837 | $retstring .= "</select>"; |
| 10838 | 10838 | |
| 10839 | 10839 | if ($addjscombo) { |
| 10840 | - $retstring .= ajax_combobox('select_' . $prefix . 'model_mail'); |
|
| 10840 | + $retstring .= ajax_combobox('select_'.$prefix.'model_mail'); |
|
| 10841 | 10841 | } |
| 10842 | 10842 | |
| 10843 | 10843 | return $retstring; |
@@ -10888,16 +10888,16 @@ discard block |
||
| 10888 | 10888 | |
| 10889 | 10889 | foreach ($buttons as $button) { |
| 10890 | 10890 | $addclass = empty($button['addclass']) ? '' : $button['addclass']; |
| 10891 | - $retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">'; |
|
| 10891 | + $retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">'; |
|
| 10892 | 10892 | } |
| 10893 | 10893 | $retstring .= $withoutdiv ? '' : '</div>'; |
| 10894 | 10894 | |
| 10895 | 10895 | if ($dol_openinpopup) { |
| 10896 | - $retstring .= '<!-- buttons are shown into a $dol_openinpopup=' . $dol_openinpopup . ' context, so we enable the close of dialog on cancel -->' . "\n"; |
|
| 10897 | - $retstring .= '<script nonce="' . getNonce() . '">'; |
|
| 10896 | + $retstring .= '<!-- buttons are shown into a $dol_openinpopup='.$dol_openinpopup.' context, so we enable the close of dialog on cancel -->'."\n"; |
|
| 10897 | + $retstring .= '<script nonce="'.getNonce().'">'; |
|
| 10898 | 10898 | $retstring .= 'jQuery(".button-cancel").click(function(e) { |
| 10899 | - e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup . '\'); |
|
| 10900 | - window.parent.jQuery(\'#idfordialog' . $dol_openinpopup . '\').dialog(\'close\'); |
|
| 10899 | + e.preventDefault(); console.log(\'We click on cancel in iframe popup ' . $dol_openinpopup.'\'); |
|
| 10900 | + window.parent.jQuery(\'#idfordialog' . $dol_openinpopup.'\').dialog(\'close\'); |
|
| 10901 | 10901 | });'; |
| 10902 | 10902 | $retstring .= '</script>'; |
| 10903 | 10903 | } |
@@ -10926,7 +10926,7 @@ discard block |
||
| 10926 | 10926 | dol_syslog(__METHOD__, LOG_DEBUG); |
| 10927 | 10927 | |
| 10928 | 10928 | $sql = "SELECT rowid, code, label as label"; |
| 10929 | - $sql .= " FROM " . MAIN_DB_PREFIX . 'c_invoice_subtype'; |
|
| 10929 | + $sql .= " FROM ".MAIN_DB_PREFIX.'c_invoice_subtype'; |
|
| 10930 | 10930 | $sql .= " WHERE active = 1"; |
| 10931 | 10931 | |
| 10932 | 10932 | $resql = $this->db->query($sql); |
@@ -10937,7 +10937,7 @@ discard block |
||
| 10937 | 10937 | $obj = $this->db->fetch_object($resql); |
| 10938 | 10938 | |
| 10939 | 10939 | // If translation exists, we use it, otherwise we take the default wording |
| 10940 | - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10940 | + $label = ($langs->trans("InvoiceSubtype".$obj->rowid) != "InvoiceSubtype".$obj->rowid) ? $langs->trans("InvoiceSubtype".$obj->rowid) : (($obj->label != '-') ? $obj->label : ''); |
|
| 10941 | 10941 | $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; |
| 10942 | 10942 | $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; |
| 10943 | 10943 | $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; |
@@ -10969,18 +10969,18 @@ discard block |
||
| 10969 | 10969 | global $langs, $user; |
| 10970 | 10970 | |
| 10971 | 10971 | $out = ''; |
| 10972 | - dol_syslog(__METHOD__ . " selected=" . $selected . ", htmlname=" . $htmlname, LOG_DEBUG); |
|
| 10972 | + dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); |
|
| 10973 | 10973 | |
| 10974 | 10974 | $this->load_cache_invoice_subtype(); |
| 10975 | 10975 | |
| 10976 | - $out .= '<select id="' . $htmlname . '" class="flat selectsubtype' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">'; |
|
| 10976 | + $out .= '<select id="'.$htmlname.'" class="flat selectsubtype'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">'; |
|
| 10977 | 10977 | if ($addempty) { |
| 10978 | 10978 | $out .= '<option value="0"> </option>'; |
| 10979 | 10979 | } |
| 10980 | 10980 | |
| 10981 | 10981 | foreach ($this->cache_invoice_subtype as $rowid => $subtype) { |
| 10982 | 10982 | $label = $subtype['label']; |
| 10983 | - $out .= '<option value="' . $subtype['rowid'] . '"'; |
|
| 10983 | + $out .= '<option value="'.$subtype['rowid'].'"'; |
|
| 10984 | 10984 | if ($selected == $subtype['rowid']) { |
| 10985 | 10985 | $out .= ' selected="selected"'; |
| 10986 | 10986 | } |
@@ -407,11 +407,11 @@ discard block |
||
| 407 | 407 | $this->planned_workload = $obj->planned_workload; |
| 408 | 408 | $this->date_c = $this->db->jdate($obj->datec); |
| 409 | 409 | $this->date_start = $this->db->jdate($obj->date_start); |
| 410 | - $this->date_end = $this->db->jdate($obj->date_end); |
|
| 410 | + $this->date_end = $this->db->jdate($obj->date_end); |
|
| 411 | 411 | $this->fk_user_creat = $obj->fk_user_creat; |
| 412 | 412 | $this->fk_user_valid = $obj->fk_user_valid; |
| 413 | 413 | $this->fk_statut = $obj->status; |
| 414 | - $this->status = $obj->status; |
|
| 414 | + $this->status = $obj->status; |
|
| 415 | 415 | $this->progress = $obj->progress; |
| 416 | 416 | $this->budget_amount = $obj->budget_amount; |
| 417 | 417 | $this->priority = $obj->priority; |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | $project->getLinesArray(null); // this method does not return <= 0 if fails |
| 530 | 530 | $projectCompleted = array_reduce( |
| 531 | 531 | $project->lines, |
| 532 | - function ($allTasksCompleted, $task) { |
|
| 532 | + function($allTasksCompleted, $task) { |
|
| 533 | 533 | return $allTasksCompleted && $task->progress >= 100; |
| 534 | 534 | }, |
| 535 | 535 | 1 |
@@ -1149,9 +1149,9 @@ discard block |
||
| 1149 | 1149 | $tasks[$i]->billed = $obj->billed; |
| 1150 | 1150 | } |
| 1151 | 1151 | |
| 1152 | - $tasks[$i]->progress = $obj->progress; |
|
| 1152 | + $tasks[$i]->progress = $obj->progress; |
|
| 1153 | 1153 | $tasks[$i]->fk_statut = $obj->status; |
| 1154 | - $tasks[$i]->status = $obj->status; |
|
| 1154 | + $tasks[$i]->status = $obj->status; |
|
| 1155 | 1155 | $tasks[$i]->public = $obj->public; |
| 1156 | 1156 | $tasks[$i]->date_start = $this->db->jdate($obj->date_start); |
| 1157 | 1157 | $tasks[$i]->date_end = $this->db->jdate($obj->date_end); |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | } |
| 1409 | 1409 | |
| 1410 | 1410 | // Update hourly rate of this time spent entry |
| 1411 | - $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user)); |
|
| 1411 | + $resql_thm_user = $this->db->query("SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $timespent->fk_user)); |
|
| 1412 | 1412 | if (!empty($resql_thm_user)) { |
| 1413 | 1413 | $obj_thm_user = $this->db->fetch_object($resql_thm_user); |
| 1414 | 1414 | $timespent->thm = $obj_thm_user->thm; |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | $newobj->timespent_line_withhour = $obj->task_date_withhour; |
| 1505 | 1505 | $newobj->timespent_line_duration = $obj->task_duration; |
| 1506 | 1506 | $newobj->timespent_line_fk_user = $obj->fk_user; |
| 1507 | - $newobj->timespent_line_thm = $obj->thm; // hourly rate |
|
| 1507 | + $newobj->timespent_line_thm = $obj->thm; // hourly rate |
|
| 1508 | 1508 | $newobj->timespent_line_note = $obj->note; |
| 1509 | 1509 | |
| 1510 | 1510 | $arrayres[] = $newobj; |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | $newobj->timespent_withhour = $obj->task_date_withhour; |
| 1743 | 1743 | $newobj->timespent_duration = $obj->task_duration; |
| 1744 | 1744 | $newobj->timespent_fk_user = $obj->fk_user; |
| 1745 | - $newobj->timespent_thm = $obj->thm; // hourly rate |
|
| 1745 | + $newobj->timespent_thm = $obj->thm; // hourly rate |
|
| 1746 | 1746 | $newobj->timespent_note = $obj->note; |
| 1747 | 1747 | |
| 1748 | 1748 | $arrayres[] = $newobj; |
@@ -1840,14 +1840,14 @@ discard block |
||
| 1840 | 1840 | if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM'))) { |
| 1841 | 1841 | if ($this->timespent_old_duration != $this->timespent_duration) { |
| 1842 | 1842 | // Recalculate amount of time spent for task and update denormalized field |
| 1843 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task"; |
|
| 1844 | - $sql .= " SET duration_effective = (SELECT SUM(element_duration) FROM " . MAIN_DB_PREFIX . "element_time as ptt where ptt.elementtype = 'task' AND ptt.fk_element = " . ((int) $this->id) . ")"; |
|
| 1843 | + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; |
|
| 1844 | + $sql .= " SET duration_effective = (SELECT SUM(element_duration) FROM ".MAIN_DB_PREFIX."element_time as ptt where ptt.elementtype = 'task' AND ptt.fk_element = ".((int) $this->id).")"; |
|
| 1845 | 1845 | if (isset($this->progress)) { |
| 1846 | - $sql .= ", progress = " . ((float) $this->progress); // Do not overwrite value if not provided |
|
| 1846 | + $sql .= ", progress = ".((float) $this->progress); // Do not overwrite value if not provided |
|
| 1847 | 1847 | } |
| 1848 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
| 1848 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
| 1849 | 1849 | |
| 1850 | - dol_syslog(get_class($this) . "::updateTimeSpent", LOG_DEBUG); |
|
| 1850 | + dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); |
|
| 1851 | 1851 | if (!$this->db->query($sql)) { |
| 1852 | 1852 | $this->error = $this->db->lasterror(); |
| 1853 | 1853 | $this->db->rollback(); |
@@ -1858,7 +1858,7 @@ discard block |
||
| 1858 | 1858 | // Update hourly rate of this time spent entry, but only if it was not set initially |
| 1859 | 1859 | $res_update = 1; |
| 1860 | 1860 | if (empty($timespent->thm) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM')) { |
| 1861 | - $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user)); |
|
| 1861 | + $resql_thm_user = $this->db->query("SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $timespent->fk_user)); |
|
| 1862 | 1862 | if (!empty($resql_thm_user)) { |
| 1863 | 1863 | $obj_thm_user = $this->db->fetch_object($resql_thm_user); |
| 1864 | 1864 | $timespent->thm = $obj_thm_user->thm; |
@@ -1995,8 +1995,8 @@ discard block |
||
| 1995 | 1995 | |
| 1996 | 1996 | $defaultref = ''; |
| 1997 | 1997 | $obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; |
| 1998 | - if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
| 1999 | - require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
| 1998 | + if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
| 1999 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
| 2000 | 2000 | $modTask = new $obj(); |
| 2001 | 2001 | $defaultref = $modTask->getNextValue(0, $clone_task); |
| 2002 | 2002 | } |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | //print "before decoding $val\n"; |
| 100 | 100 | do { |
| 101 | 101 | $oldval = $val; |
| 102 | - $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
| 102 | + $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
| 103 | 103 | // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser. |
| 104 | - $val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function ($m) { |
|
| 104 | + $val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function($m) { |
|
| 105 | 105 | // Decode 'n', ... |
| 106 | 106 | return realCharForNumericEntities($m); |
| 107 | 107 | }, $val); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login |
| 141 | 141 | $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
| 142 | 142 | $inj += preg_match('/<svg/i', $val); // <svg can be allowed in POST |
| 143 | - $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
| 143 | + $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
| 144 | 144 | $inj += preg_match('/union.+select/i', $val); |
| 145 | 145 | } |
| 146 | 146 | if ($type == 3) { |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | session_set_cookie_params($sessioncookieparams); |
| 381 | 381 | } |
| 382 | 382 | session_name($sessionname); |
| 383 | - session_start(); // This call the open and read of session handler |
|
| 383 | + session_start(); // This call the open and read of session handler |
|
| 384 | 384 | //exit; // this exist generates a call to write and close |
| 385 | 385 | } |
| 386 | 386 | |
@@ -408,11 +408,11 @@ discard block |
||
| 408 | 408 | if (!$ok) { |
| 409 | 409 | if (session_id() && isset($_SESSION["dol_login"]) && $_SESSION["dol_login"] != $conf->global->MAIN_ONLY_LOGIN_ALLOWED) { |
| 410 | 410 | print 'Sorry, your application is offline.'."\n"; |
| 411 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
| 411 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "'.getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
| 412 | 412 | $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); |
| 413 | 413 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
| 414 | 414 | } else { |
| 415 | - print 'Sorry, your application is offline. Only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
| 415 | + print 'Sorry, your application is offline. Only administrator user "'.getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
| 416 | 416 | $nexturl = DOL_URL_ROOT.'/'; |
| 417 | 417 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
| 418 | 418 | } |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
| 621 | 621 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
| 622 | 622 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
| 623 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 623 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 624 | 624 | } |
| 625 | 625 | print " into setup).\n"; |
| 626 | 626 | } |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | unset($_GET['action']); |
| 649 | 649 | unset($_GET['confirmmassaction']); |
| 650 | 650 | unset($_GET['massaction']); |
| 651 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 651 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 652 | 652 | if (isset($savid)) { |
| 653 | 653 | $_POST['id'] = ((int) $savid); |
| 654 | 654 | } |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | |
| 818 | 818 | $allowedmethodtopostusername = 3; |
| 819 | 819 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
| 820 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 820 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 821 | 821 | } |
| 822 | 822 | // TODO Remove use of $_COOKIE['login_dolibarr'] ? Replace $usertotest = with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); |
| 823 | 823 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -955,7 +955,7 @@ discard block |
||
| 955 | 955 | if (!empty($_SERVER["HTTP_USER_AGENT"]) && $_SERVER["HTTP_USER_AGENT"] == 'securitytest') { |
| 956 | 956 | http_response_code(401); // It makes easier to understand if session was broken during security tests |
| 957 | 957 | } |
| 958 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 958 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 959 | 959 | } |
| 960 | 960 | exit; |
| 961 | 961 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
| 1301 | 1301 | } else { |
| 1302 | 1302 | // We may have NOLOGIN set, but NOREQUIREUSER not |
| 1303 | 1303 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
| 1304 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1304 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1305 | 1305 | } |
| 1306 | 1306 | } |
| 1307 | 1307 | |
@@ -1485,7 +1485,7 @@ discard block |
||
| 1485 | 1485 | |
| 1486 | 1486 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
| 1487 | 1487 | $message = GETPOST('seteventmessages', 'alpha'); |
| 1488 | - $messages = explode(',', $message); |
|
| 1488 | + $messages = explode(',', $message); |
|
| 1489 | 1489 | foreach ($messages as $key => $msg) { |
| 1490 | 1490 | $tmp = explode(':', $msg); |
| 1491 | 1491 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1790,7 +1790,7 @@ discard block |
||
| 1790 | 1790 | |
| 1791 | 1791 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
| 1792 | 1792 | // TODO: use auto theme color switch |
| 1793 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1793 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | // Auto refresh page |
@@ -2108,7 +2108,7 @@ discard block |
||
| 2108 | 2108 | print $head."\n"; |
| 2109 | 2109 | } |
| 2110 | 2110 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
| 2111 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
| 2111 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
| 2112 | 2112 | } |
| 2113 | 2113 | |
| 2114 | 2114 | $parameters = array(); |
@@ -2885,7 +2885,7 @@ discard block |
||
| 2885 | 2885 | $langs->load(explode('@', $item['name'])[1]); |
| 2886 | 2886 | $dropDownQuickAddHtml .= ' |
| 2887 | 2887 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
| 2888 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
| 2888 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
| 2889 | 2889 | '; |
| 2890 | 2890 | } |
| 2891 | 2891 | |
@@ -3734,7 +3734,7 @@ discard block |
||
| 3734 | 3734 | $forceping = GETPOST('forceping', 'alpha'); |
| 3735 | 3735 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
| 3736 | 3736 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
| 3737 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3737 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3738 | 3738 | |
| 3739 | 3739 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
| 3740 | 3740 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -281,14 +281,14 @@ discard block |
||
| 281 | 281 | /** |
| 282 | 282 | * Status |
| 283 | 283 | */ |
| 284 | - const STATUS_NOT_READ = 0; // Draft. Not take into account yet. |
|
| 285 | - const STATUS_READ = 1; // Ticket was read. |
|
| 286 | - const STATUS_ASSIGNED = 2; // Ticket was just assigned to someone. Not in progress yet. |
|
| 287 | - const STATUS_IN_PROGRESS = 3; // In progress |
|
| 288 | - const STATUS_NEED_MORE_INFO = 5; // Waiting requester feedback |
|
| 289 | - const STATUS_WAITING = 7; // On hold |
|
| 290 | - const STATUS_CLOSED = 8; // Closed - Solved |
|
| 291 | - const STATUS_CANCELED = 9; // Closed - Not solved |
|
| 284 | + const STATUS_NOT_READ = 0; // Draft. Not take into account yet. |
|
| 285 | + const STATUS_READ = 1; // Ticket was read. |
|
| 286 | + const STATUS_ASSIGNED = 2; // Ticket was just assigned to someone. Not in progress yet. |
|
| 287 | + const STATUS_IN_PROGRESS = 3; // In progress |
|
| 288 | + const STATUS_NEED_MORE_INFO = 5; // Waiting requester feedback |
|
| 289 | + const STATUS_WAITING = 7; // On hold |
|
| 290 | + const STATUS_CLOSED = 8; // Closed - Solved |
|
| 291 | + const STATUS_CANCELED = 9; // Closed - Not solved |
|
| 292 | 292 | |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | $sql .= " t.tms,"; |
| 815 | 815 | $sql .= " type.label as type_label, category.label as category_label, severity.label as severity_label"; |
| 816 | 816 | // Add fields for extrafields |
| 817 | - if ($extrafields->attributes[$this->table_element]['count']> 0) { |
|
| 817 | + if ($extrafields->attributes[$this->table_element]['count'] > 0) { |
|
| 818 | 818 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
| 819 | 819 | $sql .= ($extrafields->attributes[$this->table_element]['type'][$key] != 'separate' ? ",ef.".$key." as options_".$key : ''); |
| 820 | 820 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc"; |
| 827 | 827 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as uc ON uc.rowid = t.fk_user_create"; |
| 828 | 828 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON ua.rowid = t.fk_user_assign"; |
| 829 | - if ($extrafields->attributes[$this->table_element]['count']> 0) { |
|
| 829 | + if ($extrafields->attributes[$this->table_element]['count'] > 0) { |
|
| 830 | 830 | if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label'])) { |
| 831 | 831 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as ef on (t.rowid = ef.fk_object)"; |
| 832 | 832 | } |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | $line->date_close = $this->db->jdate($obj->date_close); |
| 933 | 933 | |
| 934 | 934 | // Extra fields |
| 935 | - if ($extrafields->attributes[$this->table_element]['count']> 0) { |
|
| 935 | + if ($extrafields->attributes[$this->table_element]['count'] > 0) { |
|
| 936 | 936 | if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label'])) { |
| 937 | 937 | foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { |
| 938 | 938 | $tmpkey = 'options_'.$key; |
@@ -1549,9 +1549,9 @@ discard block |
||
| 1549 | 1549 | } |
| 1550 | 1550 | // show categories for this record only in ajax to not overload lists |
| 1551 | 1551 | if (isModEnabled('categorie') && !$nofetch) { |
| 1552 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1552 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1553 | 1553 | $form = new Form($this->db); |
| 1554 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1); |
|
| 1554 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_TICKET, 1); |
|
| 1555 | 1555 | } |
| 1556 | 1556 | |
| 1557 | 1557 | return $datas; |
@@ -1781,7 +1781,7 @@ discard block |
||
| 1781 | 1781 | // Insert entry into agenda with code 'TICKET_MSG' |
| 1782 | 1782 | include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
| 1783 | 1783 | $actioncomm = new ActionComm($this->db); |
| 1784 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // This is not an entry that must appears into manual calendar but only into CRM calendar |
|
| 1784 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // This is not an entry that must appears into manual calendar but only into CRM calendar |
|
| 1785 | 1785 | $actioncomm->code = 'TICKET_MSG'; |
| 1786 | 1786 | if ($this->private) { |
| 1787 | 1787 | $actioncomm->code = 'TICKET_MSG_PRIVATE'; |
@@ -2431,7 +2431,7 @@ discard block |
||
| 2431 | 2431 | if (is_resource($handle)) { |
| 2432 | 2432 | while (($file = readdir($handle)) !== false) { |
| 2433 | 2433 | if (!utf8_check($file)) { |
| 2434 | - $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory |
|
| 2434 | + $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory |
|
| 2435 | 2435 | } |
| 2436 | 2436 | if (dol_is_file($dir.$file)) { |
| 2437 | 2437 | return true; |
@@ -2469,7 +2469,7 @@ discard block |
||
| 2469 | 2469 | $formmail->trackid = (is_null($forcetrackid) ? 'tic'.$this->id : ''); |
| 2470 | 2470 | $attachedfiles = $formmail->get_attached_files(); |
| 2471 | 2471 | |
| 2472 | - $filepath = $attachedfiles['paths']; // path is for example user->dir_temp.'/'.$user->id.'/'... |
|
| 2472 | + $filepath = $attachedfiles['paths']; // path is for example user->dir_temp.'/'.$user->id.'/'... |
|
| 2473 | 2473 | $filename = $attachedfiles['names']; |
| 2474 | 2474 | $mimetype = $attachedfiles['mimes']; |
| 2475 | 2475 | |
@@ -2860,7 +2860,7 @@ discard block |
||
| 2860 | 2860 | |
| 2861 | 2861 | // If public interface is not enable, use link to internal page into mail |
| 2862 | 2862 | $url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ? |
| 2863 | - (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id; |
|
| 2863 | + (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE').'/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id; |
|
| 2864 | 2864 | $message .= '<br>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$object->track_id.'</a><br>'; |
| 2865 | 2865 | |
| 2866 | 2866 | // Build final message |
@@ -2894,7 +2894,7 @@ discard block |
||
| 2894 | 2894 | if ($result) { |
| 2895 | 2895 | // update last_msg_sent date (for last message sent to external users) |
| 2896 | 2896 | $this->date_last_msg_sent = dol_now(); |
| 2897 | - $this->update($user, 1); // disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table. |
|
| 2897 | + $this->update($user, 1); // disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table. |
|
| 2898 | 2898 | } |
| 2899 | 2899 | } |
| 2900 | 2900 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * \remarks To run this script as CLI: phpunit filename.php |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -global $conf,$user,$langs,$db; |
|
| 29 | +global $conf, $user, $langs, $db; |
|
| 30 | 30 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 31 | 31 | //require_once 'PHPUnit/Autoload.php'; |
| 32 | 32 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | parent::__construct($name); |
| 67 | 67 | |
| 68 | 68 | //$this->sharedFixture |
| 69 | - global $conf,$user,$langs,$db; |
|
| 69 | + global $conf, $user, $langs, $db; |
|
| 70 | 70 | $this->savconf = $conf; |
| 71 | 71 | $this->savuser = $user; |
| 72 | 72 | $this->savlangs = $langs; |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public static function setUpBeforeClass(): void |
| 86 | 86 | { |
| 87 | - global $conf,$user,$langs,$db; |
|
| 88 | - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
| 87 | + global $conf, $user, $langs, $db; |
|
| 88 | + $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
|
| 89 | 89 | |
| 90 | 90 | print __METHOD__."\n"; |
| 91 | 91 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public static function tearDownAfterClass(): void |
| 99 | 99 | { |
| 100 | - global $conf,$user,$langs,$db; |
|
| 100 | + global $conf, $user, $langs, $db; |
|
| 101 | 101 | $db->rollback(); |
| 102 | 102 | |
| 103 | 103 | print __METHOD__."\n"; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | protected function setUp(): void |
| 112 | 112 | { |
| 113 | - global $conf,$user,$langs,$db; |
|
| 113 | + global $conf, $user, $langs, $db; |
|
| 114 | 114 | $conf = $this->savconf; |
| 115 | 115 | $user = $this->savuser; |
| 116 | 116 | $langs = $this->savlangs; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function testDolBasename() |
| 138 | 138 | { |
| 139 | - global $conf,$user,$langs,$db; |
|
| 139 | + global $conf, $user, $langs, $db; |
|
| 140 | 140 | $conf = $this->savconf; |
| 141 | 141 | $user = $this->savuser; |
| 142 | 142 | $langs = $this->savlangs; |
@@ -150,11 +150,11 @@ discard block |
||
| 150 | 150 | print __METHOD__." result=".$result."\n"; |
| 151 | 151 | $this->assertEquals('a_file', $result); |
| 152 | 152 | |
| 153 | - $result = dol_basename('adir/νεο'); // With cyrillic data. Here basename fails to return correct value |
|
| 153 | + $result = dol_basename('adir/νεο'); // With cyrillic data. Here basename fails to return correct value |
|
| 154 | 154 | print __METHOD__." result=".$result."\n"; |
| 155 | 155 | $this->assertEquals('νεο', $result); |
| 156 | 156 | |
| 157 | - $result = dol_basename('adir/νεο/'); // With cyrillic data. Here basename fails to return correct value |
|
| 157 | + $result = dol_basename('adir/νεο/'); // With cyrillic data. Here basename fails to return correct value |
|
| 158 | 158 | print __METHOD__." result=".$result."\n"; |
| 159 | 159 | $this->assertEquals('νεο', $result); |
| 160 | 160 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | public function testDolCountNbOfLine() |
| 169 | 169 | { |
| 170 | - global $conf,$user,$langs,$db; |
|
| 170 | + global $conf, $user, $langs, $db; |
|
| 171 | 171 | $conf = $this->savconf; |
| 172 | 172 | $user = $this->savuser; |
| 173 | 173 | $langs = $this->savlangs; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function testDolIsFileDir() |
| 190 | 190 | { |
| 191 | - global $conf,$user,$langs,$db; |
|
| 191 | + global $conf, $user, $langs, $db; |
|
| 192 | 192 | $conf = $this->savconf; |
| 193 | 193 | $user = $this->savuser; |
| 194 | 194 | $langs = $this->savlangs; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function testDolOther() |
| 216 | 216 | { |
| 217 | - global $conf,$user,$langs,$db; |
|
| 217 | + global $conf, $user, $langs, $db; |
|
| 218 | 218 | $conf = $this->savconf; |
| 219 | 219 | $user = $this->savuser; |
| 220 | 220 | $langs = $this->savlangs; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | public function testDolMimeType() |
| 247 | 247 | { |
| 248 | - global $conf,$user,$langs,$db; |
|
| 248 | + global $conf, $user, $langs, $db; |
|
| 249 | 249 | $conf = $this->savconf; |
| 250 | 250 | $user = $this->savuser; |
| 251 | 251 | $langs = $this->savlangs; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function testDolDeleteDir() |
| 293 | 293 | { |
| 294 | - global $conf,$user,$langs,$db; |
|
| 294 | + global $conf, $user, $langs, $db; |
|
| 295 | 295 | $conf = $this->savconf; |
| 296 | 296 | $user = $this->savuser; |
| 297 | 297 | $langs = $this->savlangs; |
@@ -301,13 +301,13 @@ discard block |
||
| 301 | 301 | $dirout2 = $conf->admin->dir_temp.'/test2'; |
| 302 | 302 | |
| 303 | 303 | $count = 0; |
| 304 | - $result = dol_delete_dir_recursive($dirout, $count); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it |
|
| 304 | + $result = dol_delete_dir_recursive($dirout, $count); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it |
|
| 305 | 305 | print __METHOD__." result=".$result."\n"; |
| 306 | 306 | $this->assertGreaterThanOrEqual(0, $result); |
| 307 | 307 | |
| 308 | 308 | $count = 0; |
| 309 | 309 | $countdeleted = 0; |
| 310 | - $result = dol_delete_dir_recursive($dirout, $count, 1, 0, $countdeleted); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it |
|
| 310 | + $result = dol_delete_dir_recursive($dirout, $count, 1, 0, $countdeleted); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it |
|
| 311 | 311 | print __METHOD__." result=".$result."\n"; |
| 312 | 312 | $this->assertGreaterThanOrEqual(0, $result); |
| 313 | 313 | $this->assertGreaterThanOrEqual(0, $countdeleted); |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | dol_mkdir($dirout2); |
| 316 | 316 | $count = 0; |
| 317 | 317 | $countdeleted = 0; |
| 318 | - $result = dol_delete_dir_recursive($dirout2, $count, 1, 0, $countdeleted); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it |
|
| 318 | + $result = dol_delete_dir_recursive($dirout2, $count, 1, 0, $countdeleted); // If it has no permission to delete, it will fails as if dir does not exists, so we can't test it |
|
| 319 | 319 | print __METHOD__." result=".$result."\n"; |
| 320 | 320 | $this->assertGreaterThanOrEqual(1, $result); |
| 321 | 321 | $this->assertGreaterThanOrEqual(1, $countdeleted); |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | public function testDolCopyMoveDelete() |
| 331 | 331 | { |
| 332 | - global $conf,$user,$langs,$db; |
|
| 332 | + global $conf, $user, $langs, $db; |
|
| 333 | 333 | $conf = $this->savconf; |
| 334 | 334 | $user = $this->savuser; |
| 335 | 335 | $langs = $this->savlangs; |
@@ -339,21 +339,21 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | $result = dol_copy($file, '/adir/that/does/not/exists/file.csv'); |
| 341 | 341 | print __METHOD__." result=".$result."\n"; |
| 342 | - $this->assertLessThan(0, $result, "$result".'copy dir that does not exists'); // We should have error |
|
| 342 | + $this->assertLessThan(0, $result, "$result".'copy dir that does not exists'); // We should have error |
|
| 343 | 343 | |
| 344 | 344 | $result = dol_copy($file, $conf->admin->dir_temp.'/file.csv', 0, 1); |
| 345 | 345 | print __METHOD__." result=".$result."\n"; |
| 346 | - $this->assertGreaterThanOrEqual(1, $result, 'copy file ('.$file.') into a dir that exists ('.$conf->admin->dir_temp.'/file.csv)'); // Should be 1 |
|
| 346 | + $this->assertGreaterThanOrEqual(1, $result, 'copy file ('.$file.') into a dir that exists ('.$conf->admin->dir_temp.'/file.csv)'); // Should be 1 |
|
| 347 | 347 | |
| 348 | 348 | // Again to test with overwriting=0 |
| 349 | 349 | $result = dol_copy($file, $conf->admin->dir_temp.'/file.csv', 0, 0); |
| 350 | 350 | print __METHOD__." result=".$result."\n"; |
| 351 | - $this->assertEquals(0, $result, 'copy destination already exists, no overwrite'); // Should be 0 |
|
| 351 | + $this->assertEquals(0, $result, 'copy destination already exists, no overwrite'); // Should be 0 |
|
| 352 | 352 | |
| 353 | 353 | // Again to test with overwriting=1 |
| 354 | 354 | $result = dol_copy($file, $conf->admin->dir_temp.'/file.csv', 0, 1); |
| 355 | 355 | print __METHOD__." result=".$result."\n"; |
| 356 | - $this->assertGreaterThanOrEqual(1, $result, 'copy destination already exists, overwrite'); // Should be 1 |
|
| 356 | + $this->assertGreaterThanOrEqual(1, $result, 'copy destination already exists, overwrite'); // Should be 1 |
|
| 357 | 357 | |
| 358 | 358 | // To test a move that should work |
| 359 | 359 | $result = dol_move($conf->admin->dir_temp.'/file.csv', $conf->admin->dir_temp.'/file2.csv', 0, 1); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | // Test copy with special char / delete with blob |
| 384 | 384 | $result = dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv', 0, 1); |
| 385 | 385 | print __METHOD__." result=".$result."\n"; |
| 386 | - $this->assertGreaterThanOrEqual(1, $result, 'copy file with special chars, overwrite'); // Should be 1 |
|
| 386 | + $this->assertGreaterThanOrEqual(1, $result, 'copy file with special chars, overwrite'); // Should be 1 |
|
| 387 | 387 | |
| 388 | 388 | // Try to delete using a glob criteria |
| 389 | 389 | $result = dol_delete_file($conf->admin->dir_temp.'/file with [x]*é.csv'); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | public function testDolCompressUnCompress() |
| 400 | 400 | { |
| 401 | - global $conf,$user,$langs,$db; |
|
| 401 | + global $conf, $user, $langs, $db; |
|
| 402 | 402 | $conf = $this->savconf; |
| 403 | 403 | $user = $this->savuser; |
| 404 | 404 | $langs = $this->savlangs; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | */ |
| 487 | 487 | public function testDolCheckSecureAccessDocument() |
| 488 | 488 | { |
| 489 | - global $conf,$user,$langs,$db; |
|
| 489 | + global $conf, $user, $langs, $db; |
|
| 490 | 490 | $conf = $this->savconf; |
| 491 | 491 | $user = $this->savuser; |
| 492 | 492 | $langs = $this->savlangs; |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | // Check access to SPECIMEN |
| 507 | 507 | $user->rights->facture->lire = 0; |
| 508 | 508 | $user->rights->facture->creer = 0; |
| 509 | - $filename = 'SPECIMEN.pdf'; // Filename relative to module part |
|
| 509 | + $filename = 'SPECIMEN.pdf'; // Filename relative to module part |
|
| 510 | 510 | $result = dol_check_secure_access_document('facture', $filename, 0, '', '', 'read'); |
| 511 | 511 | $this->assertEquals(1, $result['accessallowed'], "Check access allowed to '$filename'".json_encode($result)); |
| 512 | 512 | |
@@ -514,32 +514,32 @@ discard block |
||
| 514 | 514 | // Check read permission |
| 515 | 515 | $user->rights->facture->lire = 1; |
| 516 | 516 | $user->rights->facture->creer = 1; |
| 517 | - $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 517 | + $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 518 | 518 | $result = dol_check_secure_access_document('facture', $filename, 0, '', '', 'read'); |
| 519 | 519 | $this->assertEquals(1, $result['accessallowed'], "Check access allowed to '$filename'".json_encode($result)); |
| 520 | 520 | |
| 521 | 521 | $user->rights->facture->lire = 0; |
| 522 | 522 | $user->rights->facture->creer = 0; |
| 523 | - $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 523 | + $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 524 | 524 | $result = dol_check_secure_access_document('facture', $filename, 0, '', '', 'read'); |
| 525 | 525 | $this->assertEquals(0, $result['accessallowed'], "Check access denied to '$filename':".json_encode($result)); |
| 526 | 526 | |
| 527 | 527 | // Check write permission |
| 528 | 528 | $user->rights->facture->lire = 0; |
| 529 | 529 | $user->rights->facture->creer = 0; |
| 530 | - $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 530 | + $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 531 | 531 | $result = dol_check_secure_access_document('facture', $filename, 0, '', '', 'write'); |
| 532 | 532 | $this->assertEquals(0, $result['accessallowed']); |
| 533 | 533 | |
| 534 | 534 | $user->rights->facture->lire = 1; |
| 535 | 535 | $user->rights->facture->creer = 1; |
| 536 | - $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 536 | + $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 537 | 537 | $result = dol_check_secure_access_document('facture', $filename, 0, '', '', 'write'); |
| 538 | 538 | $this->assertEquals(1, $result['accessallowed']); |
| 539 | 539 | |
| 540 | 540 | $user->rights->facture->lire = 1; |
| 541 | 541 | $user->rights->facture->creer = 0; |
| 542 | - $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 542 | + $filename = 'FA010101/FA010101.pdf'; // Filename relative to module part |
|
| 543 | 543 | $result = dol_check_secure_access_document('facture', $filename, 0, '', '', 'write'); |
| 544 | 544 | $this->assertEquals(0, $result['accessallowed']); |
| 545 | 545 | |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | */ |
| 557 | 557 | public function testDolDirMove() |
| 558 | 558 | { |
| 559 | - global $conf,$user,$langs,$db; |
|
| 559 | + global $conf, $user, $langs, $db; |
|
| 560 | 560 | $conf = $this->savconf; |
| 561 | 561 | $user = $this->savuser; |
| 562 | 562 | $langs = $this->savlangs; |