diff --git a/app/AdminModule/Forms/EditRoleFormFactory.php b/app/AdminModule/Forms/EditRoleFormFactory.php index c7e05c91e..fd4c82b13 100644 --- a/app/AdminModule/Forms/EditRoleFormFactory.php +++ b/app/AdminModule/Forms/EditRoleFormFactory.php @@ -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') @@ -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()), @@ -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)); diff --git a/app/lang/admin.cs_CZ.neon b/app/lang/admin.cs_CZ.neon index 55a8c34d7..9483c8eb7 100644 --- a/app/lang/admin.cs_CZ.neon +++ b/app/lang/admin.cs_CZ.neon @@ -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"