Skip to content

Commit

Permalink
Allow KCC to have organ regulations
Browse files Browse the repository at this point in the history
Contrary to what we originally agreed in during implementation, the board
believes it is still desirable to have the option for KCCs enabled.

Original discussion:
#357 (comment)
  • Loading branch information
tomudding committed Jun 19, 2024
1 parent 2dbfbb7 commit 8682a1f
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 41 deletions.
34 changes: 20 additions & 14 deletions module/Application/language/en.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions module/Application/language/gewisdb.pot

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 22 additions & 19 deletions module/Application/language/nl.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions module/Database/src/Form/OrganRegulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function __construct(
[
'value' => 'kcc',
'label' => $this->translator->translate('Financial Audit Committee'),
'disabled' => true,
],
[
'value' => 'rva',
Expand Down Expand Up @@ -135,7 +134,7 @@ public function getInputFilterSpecification(): array
'options' => [
'messages' => [
Callback::INVALID_VALUE => $this->translator->translate(
'Organ regulations can only be created for \'committee\' or \'fraternity\'.',
'Organ regulations can only be created for \'committee\', \'fraternity\', or \'financial audit committee\'.',

Check warning on line 137 in module/Database/src/Form/OrganRegulation.php

View workflow job for this annotation

GitHub Actions / php-codesniffer / PHP_CodeSniffer (8.3)

Line exceeds 120 characters; contains 145 characters
),
],
'callback' => [$this, 'organTypeNotDisabled'],
Expand Down
4 changes: 3 additions & 1 deletion module/Database/src/Hydrator/OrganRegulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ public function hydrate(
$data['type'] = OrganTypes::from($data['type']);
}

// Only allow committees and fraternities. This should already be handled by the form, just a fail-safe.
// Only allow committees, fraternities, and financial audit committees. This should already be handled by the
// form, so this is just a fail-safe.
if (
OrganTypes::Committee !== $data['type']
&& OrganTypes::Fraternity !== $data['type']
&& OrganTypes::KCC !== $data['type']
) {
throw new UnexpectedValueException('Unexpected organ type for organ regulation.');
}
Expand Down
10 changes: 8 additions & 2 deletions module/Database/src/Model/SubDecision/OrganRegulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ protected function getAlternativeTemplate(): string
*/
public function getContent(): string
{
if (OrganTypes::Committee === $this->getOrganType()) {
if (
OrganTypes::Committee === $this->getOrganType()
|| OrganTypes::KCC === $this->getOrganType()
) {
$organType = 'commissie';
} elseif (OrganTypes::Fraternity === $this->getOrganType()) {
$organType = 'dispuuts';
Expand All @@ -193,7 +196,10 @@ public function getContent(): string

public function getAlternativeContent(): string
{
if (OrganTypes::Committee === $this->getOrganType()) {
if (
OrganTypes::Committee === $this->getOrganType()
|| OrganTypes::KCC === $this->getOrganType()
) {
$organType = 'committee ';
} elseif (OrganTypes::Fraternity === $this->getOrganType()) {
$organType = 'fraternity ';
Expand Down

0 comments on commit 8682a1f

Please sign in to comment.