diff --git a/backend/controllers/UgiroController.php b/backend/controllers/UgiroController.php index 63869bd..fbb8a0f 100644 --- a/backend/controllers/UgiroController.php +++ b/backend/controllers/UgiroController.php @@ -14,6 +14,7 @@ use yii\web\UploadedFile; use yii\data\ArrayDataProvider; use yii\db\Query; use yii\data\ActiveDataProvider; +use common\models\MessageDetsta; /** * UgiroController implements the CRUD actions for Ugiro model. @@ -97,6 +98,7 @@ class UgiroController extends Controller { 'koteg' => $model ] ); $processor->run (); + $this->redirect(['view', 'id' => $model->id_ugiro]); } else { \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 ); @@ -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', [ - 'model' => $this->findModel ( $id ) + 'model' => $this->findModel ( $id ) , + 'detstaDp' => $detstaDp ] ); } protected function downloadUgiro($model) { diff --git a/backend/views/ugiro/view.php b/backend/views/ugiro/view.php index d410afa..10c587b 100644 --- a/backend/views/ugiro/view.php +++ b/backend/views/ugiro/view.php @@ -5,6 +5,9 @@ use yii\widgets\DetailView; use yii\helpers\Url; use common\models\Ugiro; use yii\widgets\ActiveForm; +use yii\grid\GridView; +use yii\base\Widget; +use yii\grid\ActionColumn; /* @var $this yii\web\View */ /* @var $model common\models\Ugiro */ @@ -85,6 +88,29 @@ $attributes = [ 'attributes' => $attributes, ]) ?> + +

Detsta válaszok

+ $detstaDp, + 'columns' =>[ + [ + 'attribute' => 'created_at', + 'label' => 'Létrehozva' + ], + [ + 'class' => ActionColumn::className() + ] + ] + + ] + ); + + + + ?> +
viaTable('ugiro_request_assignment', ['id_ugiro' => 'id_ugiro']); } + public function getDetstaUzenetek() + { + return $this->hasMany(MessageDetsta::className(), ['id_ugiro' => 'id_ugiro']); + } + public static function statuses() { return [