Skip to content

Commit

Permalink
Merge pull request #70 from systopia/show-message-if-there-is-no-fund…
Browse files Browse the repository at this point in the history
…ing-program-for-new-applications

Show message if there's no funding program for new applications
  • Loading branch information
dontub authored Sep 26, 2024
2 parents a8aac7b + bc05ccc commit eef1e49
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/Controller/ChooseFundingProgramController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ public function form() {
return [];
}

if (1 === count($fundingProgramOptions)) {
$fundingProgramOptionsCount = count($fundingProgramOptions);
if (0 === $fundingProgramOptionsCount) {
$this->messenger()->addStatus($this->t('Currently there is no funding program for new applications.'));

return [];
}

if (1 === $fundingProgramOptionsCount) {
$fundingProgramId = key($fundingProgramOptions);
try {
$fundingCaseTypes = $this->fundingApi->getFundingCaseTypesByFundingProgramId(
Expand Down
8 changes: 6 additions & 2 deletions translations/civiremote_funding.pot
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,16 @@ msgstr ""
msgid "Failed to load available funding programs: @error"
msgstr ""

#: src/Controller/ChooseFundingProgramController.php:67
#: src/Controller/ChooseFundingProgramController.php:60
msgid "Currently there is no funding program for new applications."
msgstr ""

#: src/Controller/ChooseFundingProgramController.php:74
#: src/Form/ChooseFundingProgramForm.php:83
msgid "Failed to load funding case types: @error"
msgstr ""

#: src/Controller/ChooseFundingProgramController.php:74
#: src/Controller/ChooseFundingProgramController.php:81
#: src/Form/ChooseFundingProgramForm.php:90
msgid "No funding case type available in the selected funding program."
msgstr ""
Expand Down
8 changes: 6 additions & 2 deletions translations/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,16 @@ msgstr "Antragsverlauf"
msgid "Failed to load available funding programs: @error"
msgstr "Laden der verfügbaren Förderprogramme fehlgeschlagen: @error"

#: src/Controller/ChooseFundingProgramController.php:67
#: src/Controller/ChooseFundingProgramController.php:60
msgid "Currently there is no funding program for new applications."
msgstr "Momentan gibt es kein Förderprogramm für neue Anträge."

#: src/Controller/ChooseFundingProgramController.php:74
#: src/Form/ChooseFundingProgramForm.php:83
msgid "Failed to load funding case types: @error"
msgstr "Laden der Förderfalltypen fehlgeschlagen: @error"

#: src/Controller/ChooseFundingProgramController.php:74
#: src/Controller/ChooseFundingProgramController.php:81
#: src/Form/ChooseFundingProgramForm.php:90
msgid "No funding case type available in the selected funding program."
msgstr "Kein Förderfalltyp im gewählten Förderprogramm verfügbar."
Expand Down

0 comments on commit eef1e49

Please sign in to comment.