add ugiro changes

This commit is contained in:
Roland Schneider 2016-04-18 19:22:53 +02:00
parent 01ada90e8c
commit 776e0ea3e0
4 changed files with 47 additions and 1 deletions

View File

@ -14,6 +14,7 @@ use yii\web\UploadedFile;
use yii\data\ArrayDataProvider; use yii\data\ArrayDataProvider;
use yii\db\Query; use yii\db\Query;
use yii\data\ActiveDataProvider; use yii\data\ActiveDataProvider;
use common\models\MessageDetsta;
/** /**
* UgiroController implements the CRUD actions for Ugiro model. * UgiroController implements the CRUD actions for Ugiro model.
@ -97,6 +98,7 @@ class UgiroController extends Controller {
'koteg' => $model 'koteg' => $model
] ); ] );
$processor->run (); $processor->run ();
$this->redirect(['view', 'id' => $model->id_ugiro]);
} else { } else {
\Yii::$app->session->setFlash ( 'danger', 'Nem lehet futtatni a fájlt' ); \Yii::$app->session->setFlash ( 'danger', 'Nem lehet futtatni a fájlt' );
\Yii::error ( "a koteg státusza nem STATUS_RECIEVED. A koteg azonosíótja:" . $model->id_ugiro ); \Yii::error ( "a koteg státusza nem STATUS_RECIEVED. A koteg azonosíótja:" . $model->id_ugiro );
@ -111,8 +113,19 @@ class UgiroController extends Controller {
} }
} }
$query = MessageDetsta::find();
$query->andWhere(['id_ugiro' => $model->id_ugiro]);
$query->orderBy([ 'created_at' => SORT_ASC ]);
$detstaDp = new ActiveDataProvider([
'query' => $query,
'pagination' => false,
'sort' => false
]);
return $this->render ( 'view', [ return $this->render ( 'view', [
'model' => $this->findModel ( $id ) 'model' => $this->findModel ( $id ) ,
'detstaDp' => $detstaDp
] ); ] );
} }
protected function downloadUgiro($model) { protected function downloadUgiro($model) {

View File

@ -5,6 +5,9 @@ use yii\widgets\DetailView;
use yii\helpers\Url; use yii\helpers\Url;
use common\models\Ugiro; use common\models\Ugiro;
use yii\widgets\ActiveForm; use yii\widgets\ActiveForm;
use yii\grid\GridView;
use yii\base\Widget;
use yii\grid\ActionColumn;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $model common\models\Ugiro */ /* @var $model common\models\Ugiro */
@ -85,6 +88,29 @@ $attributes = [
'attributes' => $attributes, 'attributes' => $attributes,
]) ?> ]) ?>
<h1>Detsta válaszok</h1>
<?php
echo GridView::widget(
[
'dataProvider' => $detstaDp,
'columns' =>[
[
'attribute' => 'created_at',
'label' => 'Létrehozva'
],
[
'class' => ActionColumn::className()
]
]
]
);
?>
</div> </div>
<div class="btns"> <div class="btns">
<?php <?php

View File

@ -59,4 +59,6 @@ class MessageDetsta extends BaseFitnessActiveRecord
} }
} }

View File

@ -93,6 +93,11 @@ class Ugiro extends \yii\db\ActiveRecord
->viaTable('ugiro_request_assignment', ['id_ugiro' => 'id_ugiro']); ->viaTable('ugiro_request_assignment', ['id_ugiro' => 'id_ugiro']);
} }
public function getDetstaUzenetek()
{
return $this->hasMany(MessageDetsta::className(), ['id_ugiro' => 'id_ugiro']);
}
public static function statuses() { public static function statuses() {
return [ return [