add reception redirection change when card with key read
This commit is contained in:
@@ -60,6 +60,8 @@ class CustomerController extends Controller
|
||||
|
||||
if ( $model->isFreeCard() ){
|
||||
return $this->redirect([ 'create', 'number' => $model->card->number ]);
|
||||
}else if ( $model->isCardWithKey()){
|
||||
return $this->redirect([ 'product/sale', 'number' => $model->card->number ]);
|
||||
}else if ( $model->isCustomerWithTicket()){
|
||||
// return $this->redirect([ 'product/sale', 'number' => $model->card->number ]);
|
||||
// return $this->redirect([ 'customer/reception', 'number' => $model->card->number ]);
|
||||
|
||||
@@ -130,7 +130,7 @@ class ReceptionForm extends Model
|
||||
public function getFirstKey(){
|
||||
$result = null;
|
||||
if ( isset($this->keys) && is_array($this->keys) && count($this->keys) > 0 ){
|
||||
$esut = $this->keys[0];
|
||||
$result = $this->keys[0];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -209,6 +209,21 @@ class ReceptionForm extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function isCardWithKey(){
|
||||
$result = false;
|
||||
|
||||
if ( $this->isCardWithCustomer() ){
|
||||
\Yii::info("isCardWithKey - customer is with card");
|
||||
$key = $this->getFirstKey();
|
||||
\Yii::info("isCardWithKey - key: " . print_r($key, true));
|
||||
if ( isset($key)){
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true, if no card and customer found
|
||||
* */
|
||||
|
||||
@@ -38,7 +38,15 @@ if ( $model->isCardWithCustomer() ){
|
||||
],
|
||||
[
|
||||
'label' => 'Kulcsok',
|
||||
'value' => $model->keysText,
|
||||
'value' =>
|
||||
empty($model->keysText) ? '' : (
|
||||
"<form method='POST' action='". Url::toRoute(['key/toggle', "number" => $model->card->number])."'>"
|
||||
.$model->keysText
|
||||
.Html::hiddenInput("KeyToggleForm[key]", $model->keysText)
|
||||
.Html::submitButton("Visszaad", [ 'style' => 'float: right;', 'class' => 'btn btn-primary btn-xs'])
|
||||
."</form>")
|
||||
,
|
||||
'format' => 'raw'
|
||||
],
|
||||
[
|
||||
'label' => 'Fénykép',
|
||||
|
||||
Reference in New Issue
Block a user