add mover cutler door

This commit is contained in:
2017-06-17 22:01:11 +02:00
parent b9399acc2e
commit f538a82def
13 changed files with 175 additions and 44 deletions

View File

@@ -405,6 +405,18 @@ class CardController extends \backend\controllers\BackendController {
$result = $command->execute();
\Yii::info("Clearing flag key ready: " . $result );
}
if ( Helper::isTicketTypeDoorAllowedCheckOn()){
\Yii::info ( "updating door allowed flag" );
$command = $connection->createCommand ( Ticket::SQL_UPDATE_DOOR_ALLOWED_FLAG() );
$result = $command->execute ();
\Yii::info ( "Door allowed flag updated: ". $result );
}else{
\Yii::info ( "clearing door allowed flag" );
$command = $connection->createCommand ( Card::SQL_CLEAR_STATUS_DOOR_ALLOWED_FLAG() );
$result = $command->execute ();
\Yii::info ( "Door allowed flag cleared: ". $result );
}
}
return $this->render("recalculate");
}

View File

@@ -56,13 +56,17 @@ use yii\helpers\ArrayHelper;
<?= $form->field($model, 'status')->checkbox( ['value' => 10, 'label' => Yii::t('common/ticket_type', "Active") ]) ?>
<?= $form->field($model, 'flag_student')->checkbox( ['value' => 1, 'label' => Yii::t('common/ticket_type', "Student") ]) ?>
<?= mkTitle("Csoportos beszedés")?>
<?= $form->field($model, 'installment_enabled')->checkbox( ['value' => 1, 'label' => Yii::t('common/ticket_type', "Csoportos beszedéses a bruttó áron felül") ]) ?>
<p>A részletek havonta kerülnek beszedésre</p>
<?= $form->field($model, 'installment_money')->textInput() ?>
<?= $form->field($model, 'installment_count')->textInput() ?>
<?php // if ( \common\components\Helper::isTicketTypeDoorAllowedCheckOn()){ ?>
<?= $form->field($model, 'door_allowed')->checkbox( ['value' => 1, 'label' => 'Forgóvilla engedi' ]) ?>
<?php //}?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/ticket_type', 'Create') : Yii::t('common/ticket_type', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>

View File

@@ -21,42 +21,54 @@ $this->params['breadcrumbs'][] = $this->title;
</p>
<?php }?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
<?php
$columns = [
'name',
'price_brutto',
'max_usage_count',
'time_unit_count',
[
'attribute' =>'time_unit_type',
'value' =>'timeUnitHuman',
],
[
'attribute' => 'id_account',
'value' => 'accountName',
],
[
'attribute' =>'flag_student',
'value' =>function($model, $key, $index, $column){
return $model->isStudent() ? Yii::t('common', "Yes") : Yii::t('common', "No") ;
},
],
[
'attribute' =>'status',
'value' =>'statusHuman',
],
'attribute' =>'time_unit_type',
'value' =>'timeUnitHuman',
],
[
'attribute' => 'id_account',
'value' => 'accountName',
],
[
'attribute' =>'flag_student',
'value' =>function($model, $key, $index, $column){
return $model->isStudent() ? Yii::t('common', "Yes") : Yii::t('common', "No") ;
},
],
[
'attribute' =>'door_allowed',
'value' =>function($model, $key, $index, $column){
return $model->isDoor() ? Yii::t('common', "Yes") : Yii::t('common', "No") ;
},
'visible' => \common\components\Helper::isTicketTypeDoorAllowedCheckOn()
],
[
'attribute' =>'status',
'value' =>'statusHuman',
],
'created_at:datetime',
'updated_at:datetime',
[
'class' => 'yii\grid\ActionColumn',
'template' => RoleDefinition::getRoleTemplate( ['admin' => '{view} {update}','employee' => '{view}' , 'reception' => '{view}']),
],
],
'class' => 'yii\grid\ActionColumn',
'template' => RoleDefinition::getRoleTemplate( ['admin' => '{view} {update}','employee' => '{view}' , 'reception' => '{view}']),
],
];
?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => $columns
]); ?>
</div>

View File

@@ -50,6 +50,11 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'status',
'value' => $model->statusHuman
],
[
'attribute' => 'door_allowed',
'value' => ( $model->isDoor() ? Yii::t('common', 'Yes' ) : Yii::t('common', 'No' ) ),
//'visible' => \common\components\Helper::isTicketTypeDoorAllowedCheckOn()
],
'created_at:datetime',
'updated_at:datetime',
[