mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Added new Userfield type "Number (currency)" (closes #2276)
This commit is contained in:
parent
82d899d609
commit
f6bdb6e836
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
### Userfields
|
### Userfields
|
||||||
|
|
||||||
- xxx
|
- New Userfield type "Number (currency)", just like the type "Number (decimal)", but it will render the value according to / with the configured currency
|
||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@ msgstr "Number (integral)"
|
|||||||
msgid "number-decimal"
|
msgid "number-decimal"
|
||||||
msgstr "Number (decimal)"
|
msgstr "Number (decimal)"
|
||||||
|
|
||||||
|
msgid "number-currency"
|
||||||
|
msgstr "Number (currency)"
|
||||||
|
|
||||||
msgid "date"
|
msgid "date"
|
||||||
msgstr "Date (without time)"
|
msgstr "Date (without time)"
|
||||||
|
|
||||||
|
@ -28,6 +28,10 @@ msgstr ""
|
|||||||
msgid "number-decimal"
|
msgid "number-decimal"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
# Number (currency)
|
||||||
|
msgid "number-currency"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
# Date (without time)
|
# Date (without time)
|
||||||
msgid "date"
|
msgid "date"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -7,10 +7,11 @@ class UserfieldsService extends BaseService
|
|||||||
const USERFIELD_TYPE_CHECKBOX = 'checkbox';
|
const USERFIELD_TYPE_CHECKBOX = 'checkbox';
|
||||||
const USERFIELD_TYPE_DATE = 'date';
|
const USERFIELD_TYPE_DATE = 'date';
|
||||||
const USERFIELD_TYPE_DATETIME = 'datetime';
|
const USERFIELD_TYPE_DATETIME = 'datetime';
|
||||||
const USERFIELD_TYPE_DECIMAL_NUMBER = 'number-decimal';
|
const USERFIELD_TYPE_NUMBER_INT = 'number-integral';
|
||||||
|
const USERFIELD_TYPE_NUMBER_DECIMAL = 'number-decimal';
|
||||||
|
const USERFIELD_TYPE_NUMBER_CURRENCY = 'number-currency';
|
||||||
const USERFIELD_TYPE_FILE = 'file';
|
const USERFIELD_TYPE_FILE = 'file';
|
||||||
const USERFIELD_TYPE_IMAGE = 'image';
|
const USERFIELD_TYPE_IMAGE = 'image';
|
||||||
const USERFIELD_TYPE_INTEGRAL_NUMBER = 'number-integral';
|
|
||||||
const USERFIELD_TYPE_LINK = 'link';
|
const USERFIELD_TYPE_LINK = 'link';
|
||||||
const USERFIELD_TYPE_LINK_WITH_TITLE = 'link-with-title';
|
const USERFIELD_TYPE_LINK_WITH_TITLE = 'link-with-title';
|
||||||
const USERFIELD_TYPE_PRESET_CHECKLIST = 'preset-checklist';
|
const USERFIELD_TYPE_PRESET_CHECKLIST = 'preset-checklist';
|
||||||
|
@ -48,6 +48,10 @@ $excludeFieldTypes = [];
|
|||||||
alt="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}"
|
alt="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}"
|
||||||
loading="lazy">
|
loading="lazy">
|
||||||
</a>
|
</a>
|
||||||
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_DECIMAL)
|
||||||
|
<span class="locale-number locale-number-generic">{{ $userfieldObject->value }}</span>
|
||||||
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_CURRENCY)
|
||||||
|
<span class="locale-number locale-number-currency">{{ $userfieldObject->value }}</span>
|
||||||
@else
|
@else
|
||||||
{{ $userfieldObject->value }}
|
{{ $userfieldObject->value }}
|
||||||
@endif
|
@endif
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
@if($userfield->input_required == 1) required @endif></textarea>
|
@if($userfield->input_required == 1) required @endif></textarea>
|
||||||
<div class="invalid-feedback">{{ $__t('Mandatory Userfield') }}</div>
|
<div class="invalid-feedback">{{ $__t('Mandatory Userfield') }}</div>
|
||||||
</div>
|
</div>
|
||||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_INTEGRAL_NUMBER)
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_INT)
|
||||||
@include('components.numberpicker', array(
|
@include('components.numberpicker', array(
|
||||||
'id' => $userfield->name,
|
'id' => $userfield->name,
|
||||||
'label' => $userfield->caption,
|
'label' => $userfield->caption,
|
||||||
@ -45,7 +45,7 @@
|
|||||||
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
|
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
|
||||||
'value' => ''
|
'value' => ''
|
||||||
))
|
))
|
||||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_DECIMAL_NUMBER)
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_DECIMAL)
|
||||||
@include('components.numberpicker', array(
|
@include('components.numberpicker', array(
|
||||||
'id' => '',
|
'id' => '',
|
||||||
'label' => $userfield->caption,
|
'label' => $userfield->caption,
|
||||||
@ -57,6 +57,18 @@
|
|||||||
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
|
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
|
||||||
'value' => ''
|
'value' => ''
|
||||||
))
|
))
|
||||||
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_CURRENCY)
|
||||||
|
@include('components.numberpicker', array(
|
||||||
|
'id' => '',
|
||||||
|
'label' => $userfield->caption,
|
||||||
|
'noNameAttribute' => true,
|
||||||
|
'min' => 0,
|
||||||
|
'decimals' => 4,
|
||||||
|
'isRequired' => $userfield->input_required == 1,
|
||||||
|
'additionalCssClasses' => 'userfield-input locale-number-input locale-number-currency',
|
||||||
|
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
|
||||||
|
'value' => ''
|
||||||
|
))
|
||||||
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_DATE)
|
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_DATE)
|
||||||
@include('components.datetimepicker2', array(
|
@include('components.datetimepicker2', array(
|
||||||
'id' => $userfield->name,
|
'id' => $userfield->name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user