| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class QuantityField extends NumericField |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | private static $allowed_actions = [ |
||
|
|
|||
| 22 | 'newvalue', |
||
| 23 | ]; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param array $properties |
||
| 27 | * @return string |
||
| 28 | */ |
||
| 29 | public function Field($properties = []) |
||
| 30 | { |
||
| 31 | //Requirements::javascript('dynamic/foxystripe: javascript/quantity.js'); |
||
| 32 | //Requirements::css('dynamic/foxystripe: client/dist/css/quantityfield.css'); |
||
| 33 | |||
| 34 | |||
| 35 | $this->setAttribute('data-link', $this->Link('newvalue')); |
||
| 36 | $this->setAttribute('data-code', $this->getForm()->getProduct()->Code); |
||
| 37 | $this->setAttribute('data-id', $this->getForm()->getProduct()->ID); |
||
| 38 | |||
| 39 | return parent::Field($properties); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param SS_HTTPRequest $request |
||
| 44 | * @return bool|string |
||
| 45 | */ |
||
| 46 | public function newvalue(HTTPRequest $request) |
||
| 57 | } |
||
| 58 | } |
||
| 59 |