@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * \brief File of class to pricecy field (price with currency) |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | -require_once DOL_DOCUMENT_ROOT . '/core/class/fields/commonfield.class.php'; |
|
| 24 | +require_once DOL_DOCUMENT_ROOT.'/core/class/fields/commonfield.class.php'; |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function printInputSearchField($fieldInfos, $key, $value, $keyPrefix = '', $keySuffix = '', $moreCss = '', $moreAttrib = '') |
| 51 | 51 | { |
| 52 | 52 | $moreCss = $this->getInputCss($fieldInfos, $moreCss); |
| 53 | - $htmlName = $keyPrefix . $key . $keySuffix; |
|
| 53 | + $htmlName = $keyPrefix.$key.$keySuffix; |
|
| 54 | 54 | $tmp = $this->getPriceAndCurrencyFromValue($fieldInfos, $value); |
| 55 | 55 | $value = $tmp['price']; |
| 56 | 56 | $currency = $tmp['currency']; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $out = self::$form->inputType('text', $htmlName, (string) $value, $htmlName, $moreCss, $moreAttrib); |
| 65 | 65 | if (!empty($fieldCurrency)) { |
| 66 | - $out .= self::$form->selectCurrency($currency, $htmlName . 'currency_id'); |
|
| 66 | + $out .= self::$form->selectCurrency($currency, $htmlName.'currency_id'); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $out; |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $moreCss = $this->getInputCss($fieldInfos, $moreCss); |
| 87 | 87 | $autoFocus = $fieldInfos->inputAutofocus ? ' autofocus' : ''; |
| 88 | - $htmlName = $keyPrefix . $key . $keySuffix; |
|
| 88 | + $htmlName = $keyPrefix.$key.$keySuffix; |
|
| 89 | 89 | $tmp = $this->getPriceAndCurrencyFromValue($fieldInfos, $value); |
| 90 | 90 | $value = $tmp['price']; |
| 91 | 91 | $currency = $tmp['currency']; |
| 92 | 92 | $value = !$this->isEmptyValue($fieldInfos, $value) ? price($value) : ''; |
| 93 | 93 | |
| 94 | - $out = self::$form->inputType('text', $htmlName, (string) $value, $htmlName, $moreCss, $moreAttrib . $autoFocus); |
|
| 95 | - $out .= self::$form->selectCurrency($currency, $htmlName . 'currency_id'); |
|
| 94 | + $out = self::$form->inputType('text', $htmlName, (string) $value, $htmlName, $moreCss, $moreAttrib.$autoFocus); |
|
| 95 | + $out .= self::$form->selectCurrency($currency, $htmlName.'currency_id'); |
|
| 96 | 96 | |
| 97 | 97 | return '<span class="form-select-price-currency-container">'.$out.'</span>'; |
| 98 | 98 | } |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function verifyPostFieldValue($fieldInfos, $key, $keyPrefix = '', $keySuffix = '') |
| 173 | 173 | { |
| 174 | - $htmlName = $keyPrefix . $key . $keySuffix; |
|
| 175 | - $value = GETPOST($htmlName, 'restricthtml') . ':' . GETPOST($htmlName . "currency_id", 'restricthtml'); |
|
| 174 | + $htmlName = $keyPrefix.$key.$keySuffix; |
|
| 175 | + $value = GETPOST($htmlName, 'restricthtml').':'.GETPOST($htmlName."currency_id", 'restricthtml'); |
|
| 176 | 176 | $value = str_replace(',', '.', $value); |
| 177 | 177 | |
| 178 | 178 | return $this->verifyFieldValue($fieldInfos, $key, $value); |
@@ -191,10 +191,10 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function getPostFieldValue($fieldInfos, $key, $defaultValue = null, $keyPrefix = '', $keySuffix = '') |
| 193 | 193 | { |
| 194 | - $htmlName = $keyPrefix . $key . $keySuffix; |
|
| 194 | + $htmlName = $keyPrefix.$key.$keySuffix; |
|
| 195 | 195 | |
| 196 | 196 | if (GETPOSTISSET($htmlName)) { |
| 197 | - $value = price2num(GETPOST($htmlName, 'alphanohtml')) . ':' . GETPOST($htmlName . "currency_id", 'alpha'); |
|
| 197 | + $value = price2num(GETPOST($htmlName, 'alphanohtml')).':'.GETPOST($htmlName."currency_id", 'alpha'); |
|
| 198 | 198 | } else { |
| 199 | 199 | $value = $defaultValue; |
| 200 | 200 | } |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function getPostSearchFieldValue($fieldInfos, $key, $defaultValue = null, $keyPrefix = '', $keySuffix = '') |
| 217 | 217 | { |
| 218 | - $htmlName = $keyPrefix . $key . $keySuffix; |
|
| 218 | + $htmlName = $keyPrefix.$key.$keySuffix; |
|
| 219 | 219 | |
| 220 | 220 | if (GETPOSTISSET($htmlName)) { |
| 221 | 221 | $value = array( |
| 222 | 222 | 'value' => GETPOST($htmlName, 'alphanohtml'), |
| 223 | - 'currency' => GETPOST($htmlName . "currency_id", 'alpha'), |
|
| 223 | + 'currency' => GETPOST($htmlName."currency_id", 'alpha'), |
|
| 224 | 224 | ); |
| 225 | 225 | } else { |
| 226 | 226 | $value = $defaultValue; |
@@ -251,10 +251,10 @@ discard block |
||
| 251 | 251 | $fieldCurrency = $tmp['fieldCurrency']; |
| 252 | 252 | |
| 253 | 253 | if (!empty($filterValue)) { |
| 254 | - return natural_search($aliasPrice . $fieldPrice, $filterValue, 1); |
|
| 254 | + return natural_search($aliasPrice.$fieldPrice, $filterValue, 1); |
|
| 255 | 255 | } |
| 256 | 256 | if (!empty($filterCurrency) && !empty($fieldCurrency)) { |
| 257 | - return natural_search($aliasCurrency . $fieldCurrency, $filterCurrency, 0); |
|
| 257 | + return natural_search($aliasCurrency.$fieldCurrency, $filterCurrency, 0); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | return ''; |