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 @@