add ticket type model + crud ( bérlet típus)

This commit is contained in:
2015-09-22 11:59:58 +02:00
parent ab885b13e9
commit db8fca5630
9 changed files with 242 additions and 106 deletions

View File

@@ -23,19 +23,35 @@ $this->params['breadcrumbs'][] = $this->title;
'dataProvider' => $dataProvider,
'columns' => [
'name',
'max_usage_count',
'price_brutto',
'time_unit_type',
'max_usage_count',
'time_unit_count',
'id_account',
'flag_student',
'status',
'created_at',
'updated_at',
[
'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',
],
'created_at:datetime',
'updated_at:datetime',
[
'class' => 'yii\grid\ActionColumn',
'template' =>'{view} {edit}'
'template' =>'{view} {update}'
],
],

View File

@@ -4,10 +4,9 @@ use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\TicketType */
/* @var $accounts common\models\Account[] */
$this->title = Yii::t('common/ticket_type', 'Update {modelClass}: ', [
'modelClass' => 'Ticket Type',
]) . ' ' . $model->name;
$this->title = Yii::t('common/ticket_type', 'Update ticket type:' ) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_type', 'Ticket Types'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_ticket_type]];
$this->params['breadcrumbs'][] = Yii::t('common/ticket_type', 'Update');
@@ -18,6 +17,8 @@ $this->params['breadcrumbs'][] = Yii::t('common/ticket_type', 'Update');
<?= $this->render('_form', [
'model' => $model,
'accounts' => $accounts,
]) ?>
</div>

View File

@@ -48,10 +48,12 @@ $this->params['breadcrumbs'][] = $this->title;
'price_brutto',
[
'attribute' => 'id_account',
'value' => $model->account->name,
'label' => Yii::t('common/ticket_type','Account')
'value' => $model->accountName,
],
'flag_student',
[
'attribute' => 'flag_student',
'value' => ( $model->isStudent() ? Yii::t('common', 'Yes' ) : Yii::t('common', 'No' ) ),
],
[
'attribute' => 'status',
'value' => $model->statusHuman