externelize group training registration canel limit minutes into params.php
This commit is contained in:
parent
f0bf8684e4
commit
15398dc8d1
@ -404,6 +404,10 @@ class Helper {
|
||||
return \Yii::$app->params['group_training.url'];
|
||||
}
|
||||
|
||||
public static function getGroupTrainingRegistrationCancelLimitMinutes(){
|
||||
return \Yii::$app->params['group_training.registration.cancel.limit.minutes'];
|
||||
}
|
||||
|
||||
public static function getRealUserIp() {
|
||||
$client = @$_SERVER ['HTTP_CLIENT_IP'];
|
||||
$forward = @$_SERVER ['HTTP_X_FORWARDED_FOR'];
|
||||
|
||||
@ -65,5 +65,6 @@ return [
|
||||
'warn_ticket_expire_in_days_count' => 3,
|
||||
'warn_ticket_expire_in_usage_count' => 3,
|
||||
'inventory.products.only.active' => true,
|
||||
'group_training.url' => 'https://fitnessadmin.hu'
|
||||
'group_training.url' => 'https://fitnessadmin.hu',
|
||||
'group_training.registration.cancel.limit.minutes' => 60
|
||||
];
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace common\manager;
|
||||
|
||||
use common\components\Helper;
|
||||
use common\models\Card;
|
||||
use common\models\CardEventRegistrationForm;
|
||||
use common\models\Customer;
|
||||
@ -246,7 +247,7 @@ class EventRegistrationManager extends BaseObject
|
||||
|
||||
if ($reason != EventRegistration::CANCEL_REASON_CUSTOMER) {
|
||||
$timeUntilEventStart = $event->start - $now;
|
||||
if ($timeUntilEventStart < 30 * 60) {
|
||||
if ($timeUntilEventStart < Helper::getGroupTrainingRegistrationCancelLimitMinutes() * 60) {
|
||||
throw new BadRequestHttpException('The reservation is already deleted', self::CANCEL_TIME_LIMIT_REACHED);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user