minor changes
This commit is contained in:
@@ -46,16 +46,22 @@ class EventRegistrationManager extends BaseObject
|
|||||||
const CANCEL_TIME_LIMIT_REACHED = 15;
|
const CANCEL_TIME_LIMIT_REACHED = 15;
|
||||||
|
|
||||||
public static $STATES = [
|
public static $STATES = [
|
||||||
self::CARD_NOT_FOUND => 'CARD_NOT_FOUND',
|
self::CARD_NOT_FOUND => "Kártya nem található",
|
||||||
self::CUSTOMER_NOT_FOUND => 'CUSTOMER_NOT_FOUND',
|
self::CUSTOMER_NOT_FOUND => "Vendég nem található",
|
||||||
self::TICKET_NOT_FOUND => 'TICKET_NOT_FOUND',
|
self::TICKET_NOT_FOUND => "Bérlet nem található",
|
||||||
self::NO_FREE_SEATS => 'NO_FREE_SEATS',
|
self::NO_FREE_SEATS => "Nincs szabad hely",
|
||||||
self::EVENT_TYPE_NOT_FOUND => 'EVENT_TYPE_NOT_FOUND',
|
self::EVENT_TYPE_NOT_FOUND => "Esemény típus nem található",
|
||||||
self::TICKET_INSUFFICIENT => 'TICKET_INSUFFICIENT',
|
self::TICKET_INSUFFICIENT => "Bérlet nem található",
|
||||||
self::UNKNOWN_ERROR => 'UNKNOWN_ERROR',
|
self::UNKNOWN_ERROR => "Ismeretlen hiba",
|
||||||
self::MAX_SEAT_COUNT_EXCEEDED => 'MAX_SEAT_COUNT_EXCEEDED',
|
self::MAX_SEAT_COUNT_EXCEEDED => "Nincs szabad hely",
|
||||||
self::EVENT_UNAVAILABLE => 'EVENT_UNAVAILABLE',
|
self::EVENT_UNAVAILABLE => "Esemény nem elérhető",
|
||||||
self::ALREADY_REGISTERED => 'ALREADY_REGISTERED',
|
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
|
// * @param EventRegistration $registration
|
||||||
* @return bool
|
// * @return bool
|
||||||
* @throws \yii\base\Exception
|
// * @throws \yii\base\Exception
|
||||||
*/
|
// */
|
||||||
public function deleteRegistration($registration)
|
// public function deleteRegistration($registration)
|
||||||
{
|
// {
|
||||||
if (isset($registration->deleted_at)) {
|
// if (isset($registration->deleted_at)) {
|
||||||
return false;
|
// return 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 = Ticket::findOne(['id_ticket' => $registration->id_ticket]);
|
||||||
// $ticket->save(false);
|
//// if( !isset($ticket ) ) {
|
||||||
|
//// throw new \yii\base\Exception('Ticket not found: ' . $registration->id_ticket);
|
||||||
$registration->deleted_at = date('Y-m-d H:i:s');
|
//// }
|
||||||
return $registration->save(false);
|
////
|
||||||
|
//// $ticket->restoreReservationCount(1);
|
||||||
}
|
//// $ticket->save(false);
|
||||||
|
//
|
||||||
|
// $registration->deleted_at = date('Y-m-d H:i:s');
|
||||||
|
// return $registration->save(false);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete an event
|
* Delete an event
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
|||||||
'payment_method' => Yii::t('common/transfer', 'Fizetési mód'),
|
'payment_method' => Yii::t('common/transfer', 'Fizetési mód'),
|
||||||
'original_price' => Yii::t('common/transfer', 'Eredeti ár'),
|
'original_price' => Yii::t('common/transfer', 'Eredeti ár'),
|
||||||
'original_end' => Yii::t('common/transfer', 'Eredeti érvényesség vége'),
|
'original_end' => Yii::t('common/transfer', 'Eredeti érvényesség vége'),
|
||||||
'max_reservation_count' => Yii::t('common/transfer', 'Max foglalások száma'),
|
'max_reservation_count' => Yii::t('common/transfer', 'Max foglalások'),
|
||||||
'reservation_count' => Yii::t('common/transfer', 'Foglalások száma'),
|
'reservation_count' => Yii::t('common/transfer', 'Felhasznált foglalások'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,27 +26,18 @@ const routes: Routes = [
|
|||||||
path: '',
|
path: '',
|
||||||
component: SecuredLayoutComponent,
|
component: SecuredLayoutComponent,
|
||||||
children: [
|
children: [
|
||||||
{ path: 'home', component: HomeComponent , pathMatch: 'full'},
|
{ path: 'home', component: HomeComponent , pathMatch: 'full', canActivate: [AuthGuard]},
|
||||||
{ path: 'home/:idTrainer/:idEventType', component: HomeComponent , pathMatch: 'full'},
|
{ path: 'home/:idTrainer/:idEventType', component: HomeComponent , pathMatch: 'full' ,canActivate: [AuthGuard]},
|
||||||
{ path: 'logout', redirectTo: '/login' , pathMatch: 'full'},
|
{ path: 'logout', redirectTo: '/login' , pathMatch: 'full'},
|
||||||
{ path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] },
|
{ path: 'profile', component: ProfileComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'events', component: EventsComponent, canActivate: [AuthGuard] },
|
{ path: 'events', component: EventsComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'event-details/:idEvent', component: EventDetailsComponent, canActivate: [AuthGuard] , pathMatch: 'full' },
|
{ path: 'event-details/:idEvent', component: EventDetailsComponent, canActivate: [AuthGuard] , pathMatch: 'full' },
|
||||||
{ path: 'registrations', component: RegistrationsComponent, canActivate: [AuthGuard] , pathMatch: 'full' },
|
{ path: 'registrations', component: RegistrationsComponent, canActivate: [AuthGuard] , pathMatch: 'full' },
|
||||||
{ path: 'registration/:idRegistration', component: RegistrationComponent },
|
{ path: 'registration/:idRegistration', component: RegistrationComponent, canActivate: [AuthGuard] },
|
||||||
{ path: 'password-change', component: PasswordChangeComponent }
|
{ path: 'password-change', component: PasswordChangeComponent, canActivate: [AuthGuard] }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ path: '**', redirectTo: '' }
|
{ 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({
|
@NgModule({
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
<div
|
<div
|
||||||
(click)="selectEvent()"
|
(click)="selectEvent()"
|
||||||
class="event d-flex flex-direction-row py-1 px-1 mb-2 border-radius-1 small text-white {{getEventThemeClass()}}"
|
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-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>
|
<div class="event-bar flex-grow-1 flex-shrink-1 my-1 border-radius-1 bg-white" ></div>
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ export class EventDetailsComponent implements OnInit {
|
|||||||
message = "Már regisztárlt erre az edzésre!";
|
message = "Már regisztárlt erre az edzésre!";
|
||||||
break;
|
break;
|
||||||
case RegistrationErrors.MAX_SEAT_COUNT_EXCEEDED:
|
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_INSUFFICIENT:
|
||||||
case RegistrationErrors.TICKET_NOT_FOUND:
|
case RegistrationErrors.TICKET_NOT_FOUND:
|
||||||
message = "Nem rendelkezik megfelelő bérlettel!"
|
message = "Nem rendelkezik megfelelő bérlettel!"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ body{
|
|||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: url("~/assets/images/cutlercross-background.jpg");
|
background: url("~/assets/images/cutlercross-background.jpg");
|
||||||
background-repeat: repeat-y;
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ $customer = $receptionForm->customer;
|
|||||||
$this->title = Yii::t('common/ticket', 'Tickets');
|
$this->title = Yii::t('common/ticket', 'Tickets');
|
||||||
$this->params['breadcrumbs'][] = $this->title;
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
?>
|
?>
|
||||||
|
<style>
|
||||||
|
.ticket-index .grid-view th {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="ticket-index">
|
<div class="ticket-index">
|
||||||
|
|
||||||
|
|
||||||
@@ -35,6 +40,9 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?= GridView::widget([
|
<?= GridView::widget([
|
||||||
|
// 'options' => [
|
||||||
|
// 'class' => ''
|
||||||
|
// ],
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
'columns' => [
|
'columns' => [
|
||||||
[
|
[
|
||||||
@@ -53,7 +61,9 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'start:date',
|
'start:date',
|
||||||
'end:date',
|
'end:date',
|
||||||
'max_usage_count',
|
'max_usage_count',
|
||||||
'usage_count',
|
'usage_count',
|
||||||
|
'max_reservation_count',
|
||||||
|
'reservation_count',
|
||||||
[
|
[
|
||||||
'attribute' => 'id_user',
|
'attribute' => 'id_user',
|
||||||
'value' => 'userName'
|
'value' => 'userName'
|
||||||
@@ -69,7 +79,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
],
|
],
|
||||||
*/
|
*/
|
||||||
'price_brutto',
|
'price_brutto',
|
||||||
|
|
||||||
'created_at:datetime',
|
'created_at:datetime',
|
||||||
['class' => 'yii\grid\ActionColumn',
|
['class' => 'yii\grid\ActionColumn',
|
||||||
'template' =>'{delete} {update}',
|
'template' =>'{delete} {update}',
|
||||||
@@ -77,23 +87,23 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'update' => function($url, $model, $key){
|
'update' => function($url, $model, $key){
|
||||||
return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url,
|
return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url,
|
||||||
[ 'title' => "Bérlet módosítása", 'class'=>'btn btn-primary btn-xs', ]) ;
|
[ 'title' => "Bérlet módosítása", 'class'=>'btn btn-primary btn-xs', ]) ;
|
||||||
},
|
},
|
||||||
'delete' => function($url, $model, $key){
|
'delete' => function($url, $model, $key){
|
||||||
return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('<span class="glyphicon glyphicon-trash"></span>', $url,
|
return $model->status == Ticket::STATUS_DELETED ? "" : Html::a('<span class="glyphicon glyphicon-trash"></span>', $url,
|
||||||
[ 'title' => "Bérlet törlése", 'class'=>'btn btn-primary btn-xs', 'data' => [
|
[ 'title' => "Bérlet törlése", 'class'=>'btn btn-primary btn-xs', 'data' => [
|
||||||
'confirm' => Yii::t('common/waste', 'Biztosan törli a bérletet?'),
|
'confirm' => Yii::t('common/waste', 'Biztosan törli a bérletet?'),
|
||||||
'method' => 'post',
|
'method' => 'post',
|
||||||
]]) ;
|
]]) ;
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// 'buttons ' => [
|
// 'buttons ' => [
|
||||||
|
|
||||||
// 'update' =>function ($url, $model, $key){
|
// 'update' =>function ($url, $model, $key){
|
||||||
// return "update";
|
// return "update";
|
||||||
// },
|
// },
|
||||||
// 'delete' =>function ($url, $model, $key){
|
// 'delete' =>function ($url, $model, $key){
|
||||||
// return "delete";
|
// return "delete";
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
// 'template' => function($model){ return $model->status == Ticket::STATUS_DELETED ? "" : "'{delete} {update}'" ;},
|
// 'template' => function($model){ return $model->status == Ticket::STATUS_DELETED ? "" : "'{delete} {update}'" ;},
|
||||||
|
|||||||
Reference in New Issue
Block a user