add property and property definition

This commit is contained in:
Roland Schneider
2021-10-11 22:32:43 +02:00
parent a2c828cc19
commit e6d4d0ffc4
13 changed files with 604 additions and 1 deletions

View File

@@ -3,11 +3,13 @@
namespace common\manager;
use common\components\Helper;
use common\helpers\AppArrayHelper;
use common\models\Card;
use common\models\CardEventRegistrationForm;
use common\models\Customer;
use common\models\Event;
use common\models\EventRegistration;
use common\models\PropertyDefinition;
use common\models\Ticket;
use customerapi\models\available\EventInterval;
use customerapi\models\registrations\EventRegistrationAvailable;
@@ -247,7 +249,12 @@ class EventRegistrationManager extends BaseObject
if ($reason == EventRegistration::CANCEL_REASON_CUSTOMER) {
$timeUntilEventStart = $event->start - $now;
if ($timeUntilEventStart < Helper::getGroupTrainingRegistrationCancelLimitMinutes() * 60) {
$settingsManager = new PropertySettingsManager();
$limitMinutes = $settingsManager->getSetting(
PropertyDefinition::DEFINITION_GROUP_TRAINING_CUSTOMER_CANCEL_TIME_LIMIT,
Helper::getGroupTrainingRegistrationCancelLimitMinutes()
);
if ($timeUntilEventStart <= $limitMinutes* 60) {
throw new BadRequestHttpException('The reservation can\'t be deleted', self::CANCEL_TIME_LIMIT_REACHED);
}
}