Commit 71ad29c4d2449bae325689a8f727488c90e96f3e

Authored by Yarik
1 parent c4b9c0bd

test

common/modules/comment/widgets/views/form-project-comment.php
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <div class="new-portf-add-comm style"> 14 <div class="new-portf-add-comm style">
15 <div class="box-wr"> 15 <div class="box-wr">
16 <div class="box-all"> 16 <div class="box-all">
17 - <div class="tender-add-answer-title"><?= Yii::t('add', 'add_answer') ?></div> 17 + <div class="tender-add-answer-title"><?= Yii::t('app', 'add_answer') ?></div>
18 <div class="form-tender-answer style"> 18 <div class="form-tender-answer style">
19 <?php 19 <?php
20 $form = ActiveForm::begin([ 'options' => [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data' ] ]); 20 $form = ActiveForm::begin([ 'options' => [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data' ] ]);
frontend/controllers/TenderController.php
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
26 use common\models\Page; 26 use common\models\Page;
27 use frontend\models\Option; 27 use frontend\models\Option;
28 use common\models\Social; 28 use common\models\Social;
  29 + use yii\web\NotFoundHttpException;
29 30
30 /** 31 /**
31 * Site controller 32 * Site controller
@@ -87,6 +88,8 @@ @@ -87,6 +88,8 @@
87 $model = Project::findOne($tender_id); 88 $model = Project::findOne($tender_id);
88 if(!empty($model)) { 89 if(!empty($model)) {
89 $model->updateCounters(['view_count' => 1]); 90 $model->updateCounters(['view_count' => 1]);
  91 + } else {
  92 + throw new NotFoundHttpException(Yii::t('app', 'project_not_found'));
90 } 93 }
91 94
92 return $this->render('view', [ 95 return $this->render('view', [
frontend/messages/ru/app.php
@@ -157,5 +157,6 @@ @@ -157,5 +157,6 @@
157 'add_field' => 'Добавить поле', 157 'add_field' => 'Добавить поле',
158 'add_more' => 'Добавить еще', 158 'add_more' => 'Добавить еще',
159 'hidden_project' => 'Снять с тендера', 159 'hidden_project' => 'Снять с тендера',
  160 + 'project_not_found' => 'Данный проект не найден',
160 161
161 ]; 162 ];
162 \ No newline at end of file 163 \ No newline at end of file
frontend/views/site/index.php
1 <?php 1 <?php
2 -  
3 - use common\models\Project;  
4 - use common\modules\fileloader\widgets\FileloaderWidget;  
5 use \yii\helpers\Html; 2 use \yii\helpers\Html;
6 use \common\models\Specialization; 3 use \common\models\Specialization;
7 - use yii\widgets\ActiveForm;  
8 4
9 /** 5 /**
10 * @var $this yii\web\View 6 * @var $this yii\web\View