Skip to content

Commit 740e24e

Browse files
authored
Povinná cena (#844)
* tracy maxdepth * povinna cena * povinna cena * odstraneni maxdepth
1 parent 5130ffd commit 740e24e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

app/AdminModule/Forms/EditRoleFormFactory.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,13 @@ public function create(int $id): Form
111111

112112
$form->addCheckbox('approvedAfterRegistration', 'admin.acl.roles_approved_after_registration');
113113

114-
// $form->addCheckbox('syncedWithSkautIs', 'admin.acl.roles_synced_with_skaut_is');
115-
116114
$form->addCheckbox('feeFromSubevents', 'admin.acl.roles_fee_from_subevents_checkbox')
117115
->addCondition(Form::EQUAL, false)
118116
->toggle('fee');
119117

120118
$form->addText('fee', 'admin.acl.roles_fee')
121119
->setOption('id', 'fee')
122-
->addCondition(Form::FILLED)
120+
->addRule(Form::FILLED, 'admin.acl.roles_fee_empty')
123121
->addRule(Form::INTEGER, 'admin.acl.roles_fee_format');
124122

125123
$form->addText('minimumAge', 'admin.acl.roles.minimum_age.label')
@@ -181,9 +179,8 @@ public function create(int $id): Form
181179
'registerableTo' => $this->role->getRegisterableTo(),
182180
'capacity' => $this->role->getCapacity(),
183181
'approvedAfterRegistration' => $this->role->isApprovedAfterRegistration(),
184-
// 'syncedWithSkautIs' => $this->role->isSyncedWithSkautIS(),
185182
'feeFromSubevents' => $this->role->getFee() === null,
186-
'fee' => $this->role->getFee(),
183+
'fee' => $this->role->getFee() ?? 0,
187184
'minimumAge' => $this->role->getMinimumAge(),
188185
'permissions' => $this->permissionRepository->findPermissionsIds($this->role->getPermissions()),
189186
'pages' => $this->pageRepository->findPagesSlugs($this->role->getPages()),
@@ -217,7 +214,6 @@ public function processForm(Form $form, stdClass $values): void
217214
$this->role->setRegisterableTo($values->registerableTo);
218215
$this->role->setCapacity($capacity);
219216
$this->role->setApprovedAfterRegistration($values->approvedAfterRegistration);
220-
// $this->role->setSyncedWithSkautIS($values->syncedWithSkautIs);
221217
$this->role->setMinimumAge($values->minimumAge);
222218
$this->role->setPermissions($this->permissionRepository->findPermissionsByIds($values->permissions));
223219
$this->role->setPages($this->pageRepository->findPagesBySlugs($values->pages));

app/lang/admin.cs_CZ.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ acl:
551551
roles_occupancy: "Obsazenost"
552552
roles_fee_from_subevents_checkbox: "určit cenu podle podakcí"
553553
roles_fee: "Cena"
554+
roles_fee_empty: "Zadejte cenu."
554555
roles_fee_format: "Zadejte číslo."
555556
roles_fee_from_subevents: "Podle podakcí"
556557
roles_approved_after_registration: "nevyžadovat schválení registrace organizátorem"

0 commit comments

Comments
 (0)