add changes
This commit is contained in:
parent
c5bfae9ec1
commit
f30acbc7d2
@ -9,6 +9,7 @@ use backend\assets\InventoryItemIndexAsset;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\InventoryItemSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
/* @var $model \common\models\Inventory */
|
||||
|
||||
$this->title = Yii::t('common/inventory-item', 'Leltár részletei');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
@ -19,58 +20,51 @@ InventoryItemIndexAsset::register($this);
|
||||
$options = [];
|
||||
$options['products'] = $productOptions;
|
||||
|
||||
$this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
|
||||
$this->registerJs('inventoryItemIndex.init( ' . json_encode($options) . ' );');
|
||||
|
||||
?>
|
||||
|
||||
<style>
|
||||
.table th{
|
||||
white-space: normal;
|
||||
}
|
||||
.table td{
|
||||
.table th {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.table td.numeric{
|
||||
.table td {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.table td.numeric {
|
||||
width: 110px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="inventory-item-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_inventory',
|
||||
'name',
|
||||
['attribute'=>'id_user',
|
||||
'value'=>$model->userName
|
||||
['attribute' => 'id_user',
|
||||
'value' => $model->userName
|
||||
],
|
||||
['attribute'=>'id_account',
|
||||
'value'=>$model->accountName
|
||||
['attribute' => 'id_account',
|
||||
'value' => $model->accountName
|
||||
],
|
||||
['attribute'=>'status',
|
||||
'value'=>$model->getStatusHuman(),
|
||||
['attribute' => 'status',
|
||||
'value' => $model->getStatusHuman(),
|
||||
'label' => "Állapot"
|
||||
],
|
||||
'created_at:datetime',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php
|
||||
if ( $model->isOpen()){
|
||||
echo Html::a("Lezárás",['inventory/close' , 'id' => $model->id_inventory ] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
|
||||
if ($model->isOpen()) {
|
||||
echo Html::a("Lezárás", ['inventory/close', 'id' => $model->id_inventory], ['data-method' => 'post', 'class' => 'btn btn-danger']);
|
||||
}
|
||||
?>
|
||||
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
Magyarázat:
|
||||
<ul>
|
||||
@ -94,13 +88,10 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php echo Html::a("XLS letöltése", Url::current(['InventoryItemSearch[output]' =>'xls']),['class' =>'btn btn-primary'])?>
|
||||
<?php echo Html::a("XLS letöltése", Url::current(['InventoryItemSearch[output]' => 'xls']), ['class' => 'btn btn-primary']) ?>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
||||
$columns = [
|
||||
[
|
||||
'attribute' => 'item_name',
|
||||
@ -160,33 +151,28 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
|
||||
|
||||
|
||||
];
|
||||
|
||||
if ( $model->isOpen() ){
|
||||
|
||||
if ($model->isOpen()) {
|
||||
$columns[] = ['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{update}',
|
||||
'urlCreator' => function ($action, $model, $key, $index){
|
||||
return Url::to(['inventory-item/update', 'id' => $model['item_id_inventory_item' ] ]) ;
|
||||
},
|
||||
'buttons' =>[
|
||||
'update' =>function ($url, $model, $key) {
|
||||
return Html::a('Módosítás', $url,['class' => 'btn btn-xs btn-success',
|
||||
'buttons' => [
|
||||
'update' => function ($url) {
|
||||
return Html::a('Módosítás', $url, ['class' => 'btn btn-xs btn-success',
|
||||
'data' => [
|
||||
],
|
||||
]) ;
|
||||
]);
|
||||
}
|
||||
],
|
||||
'urlCreator' => function($action, $model, $key, $index){
|
||||
'urlCreator' => function ($action, $model) {
|
||||
$result = "";
|
||||
if ( $action == 'update'){
|
||||
$result = Url::toRoute( [ 'update-item' ,'id' => $model['item_id_inventory_item']]);
|
||||
if ($action == 'update') {
|
||||
$result = Url::toRoute(['update-item', 'id' => $model['item_id_inventory_item']]);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
] ;
|
||||
];
|
||||
}
|
||||
|
||||
echo GridView::widget( [
|
||||
echo GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => $columns
|
||||
]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user