add feature word_typed_listener_allowed_only_for_empty_customerf
This commit is contained in:
parent
beb3c3944e
commit
89fe6a37c1
@ -552,4 +552,11 @@ class Helper {
|
||||
return Helper::getArrayValue(\Yii::$app->params ,'door_pass_validity_interval_minutes','10');
|
||||
}
|
||||
|
||||
public static function isWordTypedListenerAllowedOnlyForEmptyCustomer(){
|
||||
$key = "word_typed_listener_allowed_only_for_empty_customer";
|
||||
// return Helper::getArrayValue(\Yii::$app->params ,$key,'0') === '1';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$REST_ALLOW_VERIFY_ONLY=getenv('FITNESS_REST_ALLOW_VERIFY_ONLY');
|
||||
$FITNESS_WORD_TYPED_LISTENER_ALLOWED_ONLY_FOR_EMPTY_CUSTOMER=getenv('FITNESS_WORD_TYPED_LISTENER_ALLOWED_ONLY_FOR_EMPTY_CUSTOMER');
|
||||
|
||||
return [
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
@ -23,5 +24,6 @@ return [
|
||||
'reception_show_stock' => false,
|
||||
'login_admin_email' => false,
|
||||
'warn_ticket_expire_in_usage_count' => 10,
|
||||
'rest_allow_verify_only' => $REST_ALLOW_VERIFY_ONLY === 'true'
|
||||
'rest_allow_verify_only' => $REST_ALLOW_VERIFY_ONLY === 'true',
|
||||
'word_typed_listener_allowed_only_for_empty_customer' => $FITNESS_WORD_TYPED_LISTENER_ALLOWED_ONLY_FOR_EMPTY_CUSTOMER,
|
||||
];
|
||||
|
||||
@ -26,6 +26,7 @@ AppAsset::register($this);
|
||||
<title><?= Html::encode($this->title) ?></title>
|
||||
<script>
|
||||
var reception_card_url = '<?php echo Url::toRoute('customer/reception');?>';
|
||||
var isWordTypedListenerAllowedOnlyForEmptyCustomer = <?= \common\components\Helper::isWordTypedListenerAllowedOnlyForEmptyCustomer() ? 'true' : 'false' ?>
|
||||
</script>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
|
||||
@ -41,8 +41,16 @@ function addDocumentKeypressedListener(){
|
||||
var word;
|
||||
word = data.word;
|
||||
if ( word && word.length > 0){
|
||||
|
||||
location.href= reception_card_url +'&number=' + word;
|
||||
var redirectAllowed = true;
|
||||
if ( isWordTypedListenerAllowedOnlyForEmptyCustomer ){
|
||||
if ( location.href !== reception_card_url ){
|
||||
redirectAllowed = false;
|
||||
console.info("disalbling customer redirect. reason: isWordTypedListenerAllowedOnlyForEmptyCustomer = true")
|
||||
}
|
||||
}
|
||||
if ( redirectAllowed){
|
||||
location.href= reception_card_url +'&number=' + word;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user