backend/group-training : improve delete© week
This commit is contained in:
@@ -230,11 +230,11 @@ class EventRegistrationManager extends BaseObject
|
||||
}
|
||||
|
||||
if (isset($registration->canceled_at)) {
|
||||
throw new BadRequestHttpException('The registration is already canceled', self::ALREADY_CANCELLED);
|
||||
throw new BadRequestHttpException('The registration is already canceled: '.$registration->id, self::ALREADY_CANCELLED);
|
||||
}
|
||||
|
||||
if (isset($registration->deleted_at)) {
|
||||
throw new BadRequestHttpException('The reservation is already deleted', self::ALREADY_DELETED);
|
||||
throw new BadRequestHttpException('The reservation is already deleted: '.$registration->id, self::ALREADY_DELETED);
|
||||
}
|
||||
|
||||
$event = Event::findOne($registration->id_event);
|
||||
@@ -245,10 +245,10 @@ class EventRegistrationManager extends BaseObject
|
||||
|
||||
$now = strtotime("now UTC");
|
||||
|
||||
if ($reason != EventRegistration::CANCEL_REASON_CUSTOMER) {
|
||||
if ($reason == EventRegistration::CANCEL_REASON_CUSTOMER) {
|
||||
$timeUntilEventStart = $event->start - $now;
|
||||
if ($timeUntilEventStart < Helper::getGroupTrainingRegistrationCancelLimitMinutes() * 60) {
|
||||
throw new BadRequestHttpException('The reservation is already deleted', self::CANCEL_TIME_LIMIT_REACHED);
|
||||
throw new BadRequestHttpException('The reservation can\'t be deleted', self::CANCEL_TIME_LIMIT_REACHED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,9 +302,8 @@ class EventRegistrationManager extends BaseObject
|
||||
$tx = $db->beginTransaction();
|
||||
try {
|
||||
|
||||
$eventRegistrationManager = new EventRegistrationManager();
|
||||
$allRegistrations = $eventRegistrationManager->findAllRegistrations($event->id);
|
||||
$activeRegistrations = $eventRegistrationManager->findActiveRegistrations($event->id);
|
||||
$allRegistrations = $this->findAllRegistrations($event->id);
|
||||
$activeRegistrations = $this->findActiveRegistrations($event->id);
|
||||
|
||||
// ////////////////////////////////
|
||||
// if event has no registrations
|
||||
|
||||
Reference in New Issue
Block a user