add reception redirection change when card with key read

This commit is contained in:
Roland Schneider 2016-02-24 21:40:21 +01:00
parent ae212eddd4
commit 3b7f42014b
5 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,8 @@
-0.0.41
- add button kulcs "visszaad"
- fix ReceptionFomr#getFirstKey method
- reception read card/key number field : if card with key is read,
then redirect to product/sale
-0.0.40
- fix contract pdf design
-0.0.39

View File

@ -4,7 +4,7 @@ return [
'supportEmail' => 'rocho02@gmail.com',
'infoEmail' => 'info@rocho-net.hu',
'user.passwordResetTokenExpire' => 3600,
'version' => 'v0.0.40',
'version' => 'v0.0.41',
'company' => 'movar',//gyor
'company_name' => "Freimann Kft.",
'product_visiblity' => 'account',// on reception which products to display. account or global

View File

@ -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 ]);

View File

@ -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
* */

View File

@ -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',