fix move out , if usage count reached max usage count
fix gui: card number will be loaded only if form is empty
This commit is contained in:
@@ -26,7 +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' ?>
|
||||
var isWordTypedListenerAllowedOnlyForEmptyCustomer = <?= \common\components\Helper::isWordTypedListenerAllowedOnlyForEmptyCustomer() ? 'true' : 'false' ?>;
|
||||
</script>
|
||||
<?php $this->head() ?>
|
||||
</head>
|
||||
|
||||
@@ -40,12 +40,17 @@ function addDocumentKeypressedListener(){
|
||||
$( document ).on( "wordtyped", function( event, data ) {
|
||||
var word;
|
||||
word = data.word;
|
||||
console.info("word typed",word);
|
||||
console.info("isWordTypedListenerAllowedOnlyForEmptyCustomer",isWordTypedListenerAllowedOnlyForEmptyCustomer);
|
||||
if ( word && word.length > 0){
|
||||
var redirectAllowed = true;
|
||||
if ( isWordTypedListenerAllowedOnlyForEmptyCustomer ){
|
||||
if ( location.href !== reception_card_url ){
|
||||
let params = new URLSearchParams(location.search)
|
||||
let cardNumber = params.get("number");
|
||||
|
||||
if ( cardNumber && cardNumber.length > 0){
|
||||
redirectAllowed = false;
|
||||
console.info("disalbling customer redirect. reason: isWordTypedListenerAllowedOnlyForEmptyCustomer = true")
|
||||
console.info("redirect disabled! number param exists", word, cardNumber );
|
||||
}
|
||||
}
|
||||
if ( redirectAllowed){
|
||||
|
||||
Reference in New Issue
Block a user