From 7e6d3f52368ebe4849e358682a8e28bddce69a03 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 25 Feb 2016 12:13:59 +0200 Subject: [PATCH] 24.02.16 --- common/models/Project.php | 9 +++++++++ frontend/controllers/TenderController.php | 9 +++++++-- frontend/models/SignupForm.php | 6 ++++++ frontend/views/search/_projects_list_view.php | 15 +++++++++------ frontend/views/site/registration.php | 12 ++++++++++-- frontend/views/tender/view.php | 35 +++++++++++++++-------------------- 6 files changed, 56 insertions(+), 30 deletions(-) diff --git a/common/models/Project.php b/common/models/Project.php index f3f6a6e..2956cc0 100644 --- a/common/models/Project.php +++ b/common/models/Project.php @@ -173,6 +173,15 @@ ->viaTable('project_payment', [ 'project_id' => 'project_id' ]); } + + /** + * @return \yii\db\ActiveQuery + */ + public function getOwner() + { + return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); + } + /** * @return \yii\db\ActiveQuery */ diff --git a/frontend/controllers/TenderController.php b/frontend/controllers/TenderController.php index 6936821..812516d 100755 --- a/frontend/controllers/TenderController.php +++ b/frontend/controllers/TenderController.php @@ -1,6 +1,7 @@ redirect(['search/project']); } - public function actionView(/*$tender_id*/) + public function actionView($tender_id) { - return $this->render('view'); + $model = Project::findOne($tender_id); + + return $this->render('view',[ + 'model' => $model + ]); } } diff --git a/frontend/models/SignupForm.php b/frontend/models/SignupForm.php index 6a3aa88..7e502f9 100755 --- a/frontend/models/SignupForm.php +++ b/frontend/models/SignupForm.php @@ -21,6 +21,7 @@ class SignupForm extends Model public $is_customer; public $is_freelancer; public $city; + public $company_name; /** * @inheritdoc @@ -41,6 +42,10 @@ class SignupForm extends Model ['email', 'string', 'max' => 255], ['email', 'unique', 'targetClass' => '\common\models\User', 'message' => 'This email address has already been taken.'], + ['company_name', 'required'], + ['firstname', 'required'], + + ['verifyCode', 'captcha'], ['type', 'integer'], @@ -92,6 +97,7 @@ class SignupForm extends Model 'alt_location' => 'Город не в списке', 'is_customer' => '', 'is_freelancer' => '', + 'company_name' => 'Название компании' ]; } diff --git a/frontend/views/search/_projects_list_view.php b/frontend/views/search/_projects_list_view.php index e3c54e6..00036b2 100644 --- a/frontend/views/search/_projects_list_view.php +++ b/frontend/views/search/_projects_list_view.php @@ -1,28 +1,31 @@
- name, Url::toRoute( ['tender/view','tender_id' =>$model->project_id] )) ?> -
Бюджет: budget?> budgetCurrency->label?> (contractual ? "Договорной" : "Не договорной" ?>)
+ name, Url::toRoute( ['tender/view','tender_id' =>$model->project_id] ), ['class' => 'srch-prof-title']) ?> +
Бюджет: budget?> budgetCurrency->label?> (contractual ? "Договорной" : "Недоговорной" ?>)
+ + parent->name)):?>
ПОДРЯД
- parent->name)):?> Из проекта: parent->name, Url::toRoute(['tender/view', 'tender_id' =>$model->parent->project_id ])) ?> -
+ +
- description?> + description, 1000)?>
city?>
- formatter->asDatetime($model->date_end, 'Y-MM-d')?> + formatter->asDatetime($model->date_end, 'dd.MM.Y')?>
4 предложения diff --git a/frontend/views/site/registration.php b/frontend/views/site/registration.php index 53d74b9..d8b414b 100644 --- a/frontend/views/site/registration.php +++ b/frontend/views/site/registration.php @@ -53,14 +53,16 @@ - field ($model, 'type',['options'=> ['class'=>'check-radio-wr']]) + type = '1'; + echo $form->field ($model, 'type',['options'=> ['class'=>'check-radio-wr']]) ->label (false) ->radioList ( [1 => 'Частное лицо', 2 => 'Компания'], [ 'item' => function($index, $label, $name, $checked, $value) { $return = '
'; - $return .= ''; + $return .= ''; $return .= ''; $return .= '
'; return $return; @@ -87,6 +89,12 @@
+ field($model, 'company_name')->textInput(['class'=>'custom-input-2'])?> +
+
+ +
+
field($model, 'firstname')->textInput(['class'=>'custom-input-2'])?>
diff --git a/frontend/views/tender/view.php b/frontend/views/tender/view.php index ca8015c..0464d1e 100755 --- a/frontend/views/tender/view.php +++ b/frontend/views/tender/view.php @@ -1,7 +1,8 @@ title = 'My Yii Application'; ?>
-
Создание проекта квартиры
+
name ?>
+ parent->name)):?>
ПОДРЯД
- Из проекта: ЖК Княжеский + Из проекта: parent->name, Url::toRoute(['tender/view', 'tender_id' =>$model->parent->project_id ])) ?>
+
- Бюджет: 30 000 грн + Бюджет: budget?> budgetCurrency->label?>
- 20.04.2016 + formatter->asDatetime($model->date_end, 'dd.MM.Y')?>
@@ -125,30 +128,22 @@ $this->title = 'My Yii Application';
- ПодрядОсновной проект + parent->name)):?> + Подряд$model->parent->project_id ])) ?> +
Краткая информация о проекте
-

1.1 Строительная площадка расположена по адресу: г. Киев.

-

1.2 Существующий объект представляет собой помещение общей площадью ориентировочно – 140 м2.

-

1.3. Цель проекта состоит в проведении внутренних общестроительных и отделочных работ.

-

1.4. При разработке методов строительства и выборе материалов, используемых в настоящем проекте, необходимо учитывать климатические условия, характерные для г. Киева.

-

- 1.5. Требования к проектированию и производству работ определяются следующими документами: -

    -
  • - Техническим заданием.
  • -
  • - Строительными нормами и правилами.
  • -
-

-

Все проектные решения и все разделы рабочего проекта должны быть согласованы с Заказчиком в объеме, необходимом для последующей сдачи инженерных систем и коммуникаций.

+ description ?>
-- libgit2 0.21.4