From 77919b3bf8cd8cc58ba249e6aa19692ef7ea18b0 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Fri, 8 Oct 2021 11:39:26 +0200 Subject: [PATCH] minor changes --- common/manager/EventRegistrationManager.php | 68 ++++++++++--------- common/models/Ticket.php | 4 +- customer/app/src/app/app-routing.module.ts | 17 ++--- .../month-calendar-event.component.html | 4 -- .../event-details/event-details.component.ts | 2 + customer/app/src/styles.scss | 2 +- frontend/views/ticket/index.php | 22 ++++-- 7 files changed, 62 insertions(+), 57 deletions(-) diff --git a/common/manager/EventRegistrationManager.php b/common/manager/EventRegistrationManager.php index a0bc824..8c9488b 100644 --- a/common/manager/EventRegistrationManager.php +++ b/common/manager/EventRegistrationManager.php @@ -46,16 +46,22 @@ class EventRegistrationManager extends BaseObject const CANCEL_TIME_LIMIT_REACHED = 15; public static $STATES = [ - self::CARD_NOT_FOUND => 'CARD_NOT_FOUND', - self::CUSTOMER_NOT_FOUND => 'CUSTOMER_NOT_FOUND', - self::TICKET_NOT_FOUND => 'TICKET_NOT_FOUND', - self::NO_FREE_SEATS => 'NO_FREE_SEATS', - self::EVENT_TYPE_NOT_FOUND => 'EVENT_TYPE_NOT_FOUND', - self::TICKET_INSUFFICIENT => 'TICKET_INSUFFICIENT', - self::UNKNOWN_ERROR => 'UNKNOWN_ERROR', - self::MAX_SEAT_COUNT_EXCEEDED => 'MAX_SEAT_COUNT_EXCEEDED', - self::EVENT_UNAVAILABLE => 'EVENT_UNAVAILABLE', - self::ALREADY_REGISTERED => 'ALREADY_REGISTERED', + self::CARD_NOT_FOUND => "Kártya nem található", + self::CUSTOMER_NOT_FOUND => "Vendég nem található", + self::TICKET_NOT_FOUND => "Bérlet nem található", + self::NO_FREE_SEATS => "Nincs szabad hely", + self::EVENT_TYPE_NOT_FOUND => "Esemény típus nem található", + self::TICKET_INSUFFICIENT => "Bérlet nem található", + self::UNKNOWN_ERROR => "Ismeretlen hiba", + self::MAX_SEAT_COUNT_EXCEEDED => "Nincs szabad hely", + self::EVENT_UNAVAILABLE => "Esemény nem elérhető", + self::ALREADY_REGISTERED => "Már regisztrálva van", + self::EVENT_START_DATE_IN_PAST => "Az esemény már elkezdődött", + + self::EVENT_NOT_FOUND => "Esemény tnem található", + self::ALREADY_CANCELLED => "Ez a regisztráció már lemndásra került", + self::ALREADY_DELETED => "Ez a regisztráció már törlésre került", + self::CANCEL_TIME_LIMIT_REACHED => "Ez a regisztráció már nem mondható le", ]; /** @@ -251,29 +257,29 @@ class EventRegistrationManager extends BaseObject } - /** - * @param EventRegistration $registration - * @return bool - * @throws \yii\base\Exception - */ - public function deleteRegistration($registration) - { - if (isset($registration->deleted_at)) { - return false; - } - -// $ticket = Ticket::findOne(['id_ticket' => $registration->id_ticket]); -// if( !isset($ticket ) ) { -// throw new \yii\base\Exception('Ticket not found: ' . $registration->id_ticket); +// /** +// * @param EventRegistration $registration +// * @return bool +// * @throws \yii\base\Exception +// */ +// public function deleteRegistration($registration) +// { +// if (isset($registration->deleted_at)) { +// return false; // } // -// $ticket->restoreReservationCount(1); -// $ticket->save(false); - - $registration->deleted_at = date('Y-m-d H:i:s'); - return $registration->save(false); - - } +//// $ticket = Ticket::findOne(['id_ticket' => $registration->id_ticket]); +//// if( !isset($ticket ) ) { +//// throw new \yii\base\Exception('Ticket not found: ' . $registration->id_ticket); +//// } +//// +//// $ticket->restoreReservationCount(1); +//// $ticket->save(false); +// +// $registration->deleted_at = date('Y-m-d H:i:s'); +// return $registration->save(false); +// +// } /** * Delete an event diff --git a/common/models/Ticket.php b/common/models/Ticket.php index 2643fd0..234a0c5 100644 --- a/common/models/Ticket.php +++ b/common/models/Ticket.php @@ -174,8 +174,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord 'payment_method' => Yii::t('common/transfer', 'Fizetési mód'), 'original_price' => Yii::t('common/transfer', 'Eredeti ár'), 'original_end' => Yii::t('common/transfer', 'Eredeti érvényesség vége'), - 'max_reservation_count' => Yii::t('common/transfer', 'Max foglalások száma'), - 'reservation_count' => Yii::t('common/transfer', 'Foglalások száma'), + 'max_reservation_count' => Yii::t('common/transfer', 'Max foglalások'), + 'reservation_count' => Yii::t('common/transfer', 'Felhasznált foglalások'), ]; } diff --git a/customer/app/src/app/app-routing.module.ts b/customer/app/src/app/app-routing.module.ts index cd6c677..3a87b2d 100644 --- a/customer/app/src/app/app-routing.module.ts +++ b/customer/app/src/app/app-routing.module.ts @@ -26,27 +26,18 @@ const routes: Routes = [ path: '', component: SecuredLayoutComponent, children: [ - { path: 'home', component: HomeComponent , pathMatch: 'full'}, - { path: 'home/:idTrainer/:idEventType', component: HomeComponent , pathMatch: 'full'}, + { path: 'home', component: HomeComponent , pathMatch: 'full', canActivate: [AuthGuard]}, + { path: 'home/:idTrainer/:idEventType', component: HomeComponent , pathMatch: 'full' ,canActivate: [AuthGuard]}, { path: 'logout', redirectTo: '/login' , pathMatch: 'full'}, { path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] }, { path: 'events', component: EventsComponent, canActivate: [AuthGuard] }, { path: 'event-details/:idEvent', component: EventDetailsComponent, canActivate: [AuthGuard] , pathMatch: 'full' }, { path: 'registrations', component: RegistrationsComponent, canActivate: [AuthGuard] , pathMatch: 'full' }, - { path: 'registration/:idRegistration', component: RegistrationComponent }, - { path: 'password-change', component: PasswordChangeComponent } + { path: 'registration/:idRegistration', component: RegistrationComponent, canActivate: [AuthGuard] }, + { path: 'password-change', component: PasswordChangeComponent, canActivate: [AuthGuard] } ] }, { path: '**', redirectTo: '' } - // { path: 'home', component: HomeComponent }, - // { path: '', redirectTo: '/home' , pathMatch: 'full'}, - // { path: 'login', component: LoginComponent }, - // { path: 'logout', redirectTo: '/login' , pathMatch: 'full'}, - // { path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] }, - // { path: 'events', component: EventsComponent, canActivate: [AuthGuard] }, - // { path: 'event-details/:idEvent', component: EventDetailsComponent, canActivate: [AuthGuard] , pathMatch: 'full' }, - // { path: 'registrations', component: RegistrationsComponent, canActivate: [AuthGuard] , pathMatch: 'full' }, - // { path: 'registration/:idRegistration', component: RegistrationComponent, canActivate: [AuthGuard] , pathMatch: 'full' }, ]; @NgModule({ diff --git a/customer/app/src/app/components/month-calendar-event/month-calendar-event.component.html b/customer/app/src/app/components/month-calendar-event/month-calendar-event.component.html index fdbf12e..a2a3b02 100644 --- a/customer/app/src/app/components/month-calendar-event/month-calendar-event.component.html +++ b/customer/app/src/app/components/month-calendar-event/month-calendar-event.component.html @@ -1,11 +1,7 @@
- - -
diff --git a/customer/app/src/app/pages/event-details/event-details.component.ts b/customer/app/src/app/pages/event-details/event-details.component.ts index 06643e2..5cb5443 100644 --- a/customer/app/src/app/pages/event-details/event-details.component.ts +++ b/customer/app/src/app/pages/event-details/event-details.component.ts @@ -88,6 +88,8 @@ export class EventDetailsComponent implements OnInit { message = "Már regisztárlt erre az edzésre!"; break; case RegistrationErrors.MAX_SEAT_COUNT_EXCEEDED: + message = "Már nem áll rendelkezésre több foglalható alkalom a bérletén!" + break; case RegistrationErrors.TICKET_INSUFFICIENT: case RegistrationErrors.TICKET_NOT_FOUND: message = "Nem rendelkezik megfelelő bérlettel!" diff --git a/customer/app/src/styles.scss b/customer/app/src/styles.scss index 80dc2b7..87fbc0b 100644 --- a/customer/app/src/styles.scss +++ b/customer/app/src/styles.scss @@ -65,7 +65,7 @@ body{ min-height: 100%; height: 100%; background: url("~/assets/images/cutlercross-background.jpg"); - background-repeat: repeat-y; + background-repeat: repeat; } diff --git a/frontend/views/ticket/index.php b/frontend/views/ticket/index.php index 78549ea..ab3ab33 100644 --- a/frontend/views/ticket/index.php +++ b/frontend/views/ticket/index.php @@ -20,6 +20,11 @@ $customer = $receptionForm->customer; $this->title = Yii::t('common/ticket', 'Tickets'); $this->params['breadcrumbs'][] = $this->title; ?> +
@@ -35,6 +40,9 @@ $this->params['breadcrumbs'][] = $this->title;

[ +// 'class' => '' +// ], 'dataProvider' => $dataProvider, 'columns' => [ [ @@ -53,7 +61,9 @@ $this->params['breadcrumbs'][] = $this->title; 'start:date', 'end:date', 'max_usage_count', - 'usage_count', + 'usage_count', + 'max_reservation_count', + 'reservation_count', [ 'attribute' => 'id_user', 'value' => 'userName' @@ -69,7 +79,7 @@ $this->params['breadcrumbs'][] = $this->title; ], */ 'price_brutto', - + 'created_at:datetime', ['class' => 'yii\grid\ActionColumn', 'template' =>'{delete} {update}', @@ -77,23 +87,23 @@ $this->params['breadcrumbs'][] = $this->title; 'update' => function($url, $model, $key){ return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('', $url, [ 'title' => "Bérlet módosítása", 'class'=>'btn btn-primary btn-xs', ]) ; - }, + }, 'delete' => function($url, $model, $key){ return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('', $url, [ 'title' => "Bérlet törlése", 'class'=>'btn btn-primary btn-xs', 'data' => [ 'confirm' => Yii::t('common/waste', 'Biztosan törli a bérletet?'), 'method' => 'post', ]]) ; - }, + }, ], // 'buttons ' => [ - + // 'update' =>function ($url, $model, $key){ // return "update"; // }, // 'delete' =>function ($url, $model, $key){ // return "delete"; - + // } // ] // 'template' => function($model){ return $model->status == Ticket::STATUS_DELETED ? "" : "'{delete} {update}'" ;},