From c71c3356582a1c82678c43b11985be3a2f2c509a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Tue, 21 Nov 2023 20:05:36 +0100 Subject: [PATCH] hide tickets from profile if not active (#1115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Staněk --- app/Model/Settings/Settings.php | 5 ----- app/WebModule/Presenters/ProfilePresenter.php | 2 ++ app/WebModule/Presenters/templates/Profile/default.latte | 6 ++++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Model/Settings/Settings.php b/app/Model/Settings/Settings.php index 506276ec4..d5ffb6f82 100644 --- a/app/Model/Settings/Settings.php +++ b/app/Model/Settings/Settings.php @@ -99,11 +99,6 @@ class Settings */ public const ACCOUNTANT = 'accountant'; - /** - * Místo vystavení dokladu. - */ - public const PRINT_LOCATION = 'print_location'; - /** * Číslo účtu. */ diff --git a/app/WebModule/Presenters/ProfilePresenter.php b/app/WebModule/Presenters/ProfilePresenter.php index 2fd9a53ef..477d83c16 100644 --- a/app/WebModule/Presenters/ProfilePresenter.php +++ b/app/WebModule/Presenters/ProfilePresenter.php @@ -6,6 +6,7 @@ use App\Model\Enums\PaymentType; use App\Model\Settings\Exceptions\SettingsItemNotFoundException; +use App\Model\Settings\Queries\SettingDateTimeValueQuery; use App\Model\Settings\Queries\SettingStringValueQuery; use App\Model\Settings\Settings; use App\Model\Structure\Repositories\SubeventRepository; @@ -84,6 +85,7 @@ public function renderDefault(): void $this->template->isAllowedEditCustomInputs = $this->applicationService->isAllowedEditCustomInputs(); $this->template->userPrograms = $this->queryBus->handle(new UserAttendsProgramsQuery($this->dbUser)); $this->template->accountNumber = $this->queryBus->handle(new SettingStringValueQuery(Settings::ACCOUNT_NUMBER)); + $this->template->ticketsActive = $this->queryBus->handle(new SettingDateTimeValueQuery(Settings::TICKETS_FROM)) !== null; } /** diff --git a/app/WebModule/Presenters/templates/Profile/default.latte b/app/WebModule/Presenters/templates/Profile/default.latte index 1e42d488f..63ccdd49a 100644 --- a/app/WebModule/Presenters/templates/Profile/default.latte +++ b/app/WebModule/Presenters/templates/Profile/default.latte @@ -53,8 +53,10 @@ - {_web.profile.seminar.ticket.heading} - {control ticket} + {if $ticketsActive} + {_web.profile.seminar.ticket.heading} + {control ticket} + {/if}