minor changes

This commit is contained in:
Roland Schneider
2021-10-08 11:39:26 +02:00
parent b993f5dee0
commit 77919b3bf8
7 changed files with 62 additions and 57 deletions

View File

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

View File

@@ -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'),
];
}

View File

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

View File

@@ -1,11 +1,7 @@
<div
(click)="selectEvent()"
class="event d-flex flex-direction-row py-1 px-1 mb-2 border-radius-1 small text-white {{getEventThemeClass()}}"
title="Test Event 2"
>
<!-- [class.bg-dark]="maySelect()"-->
<!-- [class.bg-primary]="isRegistered()"-->
<!-- [class.bg-secondary]="isDisabled()"-->
<div class=" event-bar-container flex-grow-0 flex-shrink-0 d-flex" style="flex-basis: 10px;">
<div class="event-bar flex-grow-1 flex-shrink-1 my-1 border-radius-1 bg-white" ></div>

View File

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

View File

@@ -65,7 +65,7 @@ body{
min-height: 100%;
height: 100%;
background: url("~/assets/images/cutlercross-background.jpg");
background-repeat: repeat-y;
background-repeat: repeat;
}

View File

@@ -20,6 +20,11 @@ $customer = $receptionForm->customer;
$this->title = Yii::t('common/ticket', 'Tickets');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.ticket-index .grid-view th {
white-space: pre-wrap;
}
</style>
<div class="ticket-index">
@@ -35,6 +40,9 @@ $this->params['breadcrumbs'][] = $this->title;
</p>
<?= GridView::widget([
// 'options' => [
// 'class' => ''
// ],
'dataProvider' => $dataProvider,
'columns' => [
[
@@ -54,6 +62,8 @@ $this->params['breadcrumbs'][] = $this->title;
'end:date',
'max_usage_count',
'usage_count',
'max_reservation_count',
'reservation_count',
[
'attribute' => 'id_user',
'value' => 'userName'