Skip to content

Commit

Permalink
Povinná cena (#844)
Browse files Browse the repository at this point in the history
* tracy maxdepth

* povinna cena

* povinna cena

* odstraneni maxdepth
  • Loading branch information
jan-stanek authored Mar 5, 2022
1 parent 5130ffd commit 740e24e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/AdminModule/Forms/EditRoleFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,13 @@ public function create(int $id): Form

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

// $form->addCheckbox('syncedWithSkautIs', 'admin.acl.roles_synced_with_skaut_is');

$form->addCheckbox('feeFromSubevents', 'admin.acl.roles_fee_from_subevents_checkbox')
->addCondition(Form::EQUAL, false)
->toggle('fee');

$form->addText('fee', 'admin.acl.roles_fee')
->setOption('id', 'fee')
->addCondition(Form::FILLED)
->addRule(Form::FILLED, 'admin.acl.roles_fee_empty')
->addRule(Form::INTEGER, 'admin.acl.roles_fee_format');

$form->addText('minimumAge', 'admin.acl.roles.minimum_age.label')
Expand Down Expand Up @@ -181,9 +179,8 @@ public function create(int $id): Form
'registerableTo' => $this->role->getRegisterableTo(),
'capacity' => $this->role->getCapacity(),
'approvedAfterRegistration' => $this->role->isApprovedAfterRegistration(),
// 'syncedWithSkautIs' => $this->role->isSyncedWithSkautIS(),
'feeFromSubevents' => $this->role->getFee() === null,
'fee' => $this->role->getFee(),
'fee' => $this->role->getFee() ?? 0,
'minimumAge' => $this->role->getMinimumAge(),
'permissions' => $this->permissionRepository->findPermissionsIds($this->role->getPermissions()),
'pages' => $this->pageRepository->findPagesSlugs($this->role->getPages()),
Expand Down Expand Up @@ -217,7 +214,6 @@ public function processForm(Form $form, stdClass $values): void
$this->role->setRegisterableTo($values->registerableTo);
$this->role->setCapacity($capacity);
$this->role->setApprovedAfterRegistration($values->approvedAfterRegistration);
// $this->role->setSyncedWithSkautIS($values->syncedWithSkautIs);
$this->role->setMinimumAge($values->minimumAge);
$this->role->setPermissions($this->permissionRepository->findPermissionsByIds($values->permissions));
$this->role->setPages($this->pageRepository->findPagesBySlugs($values->pages));
Expand Down
1 change: 1 addition & 0 deletions app/lang/admin.cs_CZ.neon
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ acl:
roles_occupancy: "Obsazenost"
roles_fee_from_subevents_checkbox: "určit cenu podle podakcí"
roles_fee: "Cena"
roles_fee_empty: "Zadejte cenu."
roles_fee_format: "Zadejte číslo."
roles_fee_from_subevents: "Podle podakcí"
roles_approved_after_registration: "nevyžadovat schválení registrace organizátorem"
Expand Down

0 comments on commit 740e24e

Please sign in to comment.