title = Yii::t('app', 'Bills'); $this->params['breadcrumbs'][] = $this->title; $this->registerJs(<< $dataProvider, 'filterModel' => $searchModel, 'columns' => [ [ 'attribute' => 'user_at_org', 'value' => 'user.at_org', 'visible' => Yii::$app->user->can('admin'), ], [ 'attribute' => 'bid_id', 'value' => function ($model) { return Html::a($model->bid_id, [ '/bidding/view', 'id' => $model->bid_id, ], ['target' => '_blank'] ); }, 'format' => 'raw', ], [ 'attribute' => 'auction_id', 'value' => function ($model) { return Html::a($model->auction->id, [ '/publishing/view', 'id' => $model->auction->id, ], ['target' => '_blank'] ); }, 'format' => 'raw', ], [ 'attribute' => 'type', 'value' => function ($model) { return getValue(Bills::types(), $model->type); }, 'filter' => Bills::types(), ], [ 'attribute' => 'payed', 'filter' => Bills::payStatuses(), 'format' => 'raw', 'value' => function ($model) { if (!Yii::$app->user->can('admin')) { return getValue(Bills::payStatuses(), $model->payed); } else { return Html::radioList('payed' . $model->id, [$model->payed], Bills::payStatuses(), [ 'class' => 'payed-radio', 'data-url' => Url::to([ '/bills/payed', 'id' => $model->id ]) ] ); } } ], [ 'class' => 'yii\grid\ActionColumn', 'template' => '{edit}{download}', 'buttons' => [ 'download' => function ($url, $model, $key) { return Html::a( '', [ '/bills/download-requisites', 'id' => $model->id ], [ 'target' => '_blank', 'title' => Yii::t('app', 'Download bill') ] ); }, ] ], ], ]); ?>