mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 04:14:36 +02:00
Fixed CurrencyEntityType
This commit is contained in:
parent
8d5427a1c3
commit
672d55624f
5 changed files with 59 additions and 8 deletions
|
@ -75,6 +75,29 @@ class CurrencyEntityType extends StructuralEntityType
|
|||
$resolver->setDefault('short', false);
|
||||
}
|
||||
|
||||
protected function generateChoiceAttr(AbstractStructuralDBElement $choice, $key, $value, $options): array
|
||||
{
|
||||
$tmp = parent::generateChoiceAttr($choice, $key, $value, $options);
|
||||
|
||||
if(!empty($choice->getIsoCode())) {
|
||||
$symbol = Currencies::getSymbol($choice->getIsoCode());
|
||||
} else {
|
||||
$symbol = null;
|
||||
}
|
||||
|
||||
if ($options['short']) {
|
||||
$tmp['data-short'] = $symbol;
|
||||
} else {
|
||||
$tmp['data-short'] = $choice->getName();
|
||||
}
|
||||
|
||||
$tmp += [
|
||||
'data-symbol' => $symbol,
|
||||
];
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
protected function getChoiceContent(AbstractStructuralDBElement $choice, $key, $value, $options): string
|
||||
{
|
||||
if(!$choice instanceof Currency) {
|
||||
|
|
|
@ -104,7 +104,7 @@ class StructuralEntityType extends AbstractType
|
|||
'data-controller' => $options['controller'],
|
||||
];
|
||||
if ($options['empty_message']) {
|
||||
$tmp['data-empty_message'] = $options['empty_message'];
|
||||
$tmp['data-empty-message'] = $options['empty_message'];
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue