Commit 1b56164e1040f0cf486f6f7c3aa24a3173ea0ec3
1 parent
af52e881
test
Showing
9 changed files
with
330 additions
and
215 deletions
Show diff stats
common/models/Portfolio.php
common/models/Vacancy.php
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | use Yii; | 5 | use Yii; |
6 | use yii\behaviors\BlameableBehavior; | 6 | use yii\behaviors\BlameableBehavior; |
7 | use yii\behaviors\TimestampBehavior; | 7 | use yii\behaviors\TimestampBehavior; |
8 | + use yii\db\ActiveQuery; | ||
8 | use yii\db\Expression; | 9 | use yii\db\Expression; |
9 | 10 | ||
10 | /** | 11 | /** |
@@ -19,6 +20,9 @@ | @@ -19,6 +20,9 @@ | ||
19 | * @property string $user_name | 20 | * @property string $user_name |
20 | * @property string $city | 21 | * @property string $city |
21 | * @property string $description | 22 | * @property string $description |
23 | + * @property string $phone | ||
24 | + * @property string $salary | ||
25 | + * @property integer $salary_currency | ||
22 | * @property Employment[] $employments | 26 | * @property Employment[] $employments |
23 | * @property VacancyEmployment[] $vacancyEmployments | 27 | * @property VacancyEmployment[] $vacancyEmployments |
24 | */ | 28 | */ |
@@ -68,7 +72,7 @@ | @@ -68,7 +72,7 @@ | ||
68 | 'string', | 72 | 'string', |
69 | ], | 73 | ], |
70 | [ | 74 | [ |
71 | - [ 'employmentInput' ], | 75 | + [ 'employmentInput', 'specializationInput' ], |
72 | 'safe', | 76 | 'safe', |
73 | ], | 77 | ], |
74 | [ | 78 | [ |
@@ -106,6 +110,9 @@ | @@ -106,6 +110,9 @@ | ||
106 | 'city' => Yii::t('app', 'Город'), | 110 | 'city' => Yii::t('app', 'Город'), |
107 | 'description' => Yii::t('app', 'Описание'), | 111 | 'description' => Yii::t('app', 'Описание'), |
108 | 'employmentInput' => Yii::t('app', 'Вид занятости'), | 112 | 'employmentInput' => Yii::t('app', 'Вид занятости'), |
113 | + 'phone' => Yii::t('app', 'Телефон'), | ||
114 | + 'salary' => Yii::t('app', 'Заработная плата'), | ||
115 | + 'salary_currency' => Yii::t('app', 'Валюта'), | ||
109 | ]; | 116 | ]; |
110 | } | 117 | } |
111 | 118 | ||
@@ -140,4 +147,35 @@ | @@ -140,4 +147,35 @@ | ||
140 | return Fields::getData($this->vacancy_id, Vacancy::className(), 'requirements'); | 147 | return Fields::getData($this->vacancy_id, Vacancy::className(), 'requirements'); |
141 | } | 148 | } |
142 | 149 | ||
150 | + /** | ||
151 | + * @return ActiveQuery | ||
152 | + */ | ||
153 | + public function getSpecializations() | ||
154 | + { | ||
155 | + return $this->hasMany(Specialization::className(), [ 'specialization_id' => 'specialization_id' ]) | ||
156 | + ->viaTable('vacancy_specialization', [ 'vacancy_id' => 'vacancy_id' ]); | ||
157 | + } | ||
158 | + | ||
159 | + /** | ||
160 | + * Return array of Vacancy's specialization IDs | ||
161 | + * @return integer[] | ||
162 | + */ | ||
163 | + public function getSpecializationInput() | ||
164 | + { | ||
165 | + return $this->getSpecializations() | ||
166 | + ->asArray() | ||
167 | + ->indexBy('specialization_id') | ||
168 | + ->column(); | ||
169 | + } | ||
170 | + | ||
171 | + /** | ||
172 | + * Setter which allow to set Vacancy's specializations for further saving to the DB. | ||
173 | + * | ||
174 | + * @param integer[] $value | ||
175 | + */ | ||
176 | + public function setSpecializationInput($value) | ||
177 | + { | ||
178 | + $this->specializationInput = $value; | ||
179 | + } | ||
180 | + | ||
143 | } | 181 | } |
console/migrations/m160217_092739_currency_table.php
console/migrations/m160217_145813_add_fields_february.php
@@ -20,6 +20,7 @@ | @@ -20,6 +20,7 @@ | ||
20 | 20 | ||
21 | /* Add phone column to vacancy */ | 21 | /* Add phone column to vacancy */ |
22 | $this->addColumn('{{%vacancy}}', 'phone', $this->string()); | 22 | $this->addColumn('{{%vacancy}}', 'phone', $this->string()); |
23 | + $this->addColumn('{{%vacancy}}', 'salary', $this->string()); | ||
23 | } | 24 | } |
24 | 25 | ||
25 | public function down() | 26 | public function down() |
@@ -28,6 +29,7 @@ | @@ -28,6 +29,7 @@ | ||
28 | $this->dropForeignKey('vacancy_specialization_specialization', '{{%vacancy_specialization}}'); | 29 | $this->dropForeignKey('vacancy_specialization_specialization', '{{%vacancy_specialization}}'); |
29 | 30 | ||
30 | $this->dropColumn('{{%vacancy}}', 'phone'); | 31 | $this->dropColumn('{{%vacancy}}', 'phone'); |
32 | + $this->dropColumn('{{%vacancy}}', 'salary'); | ||
31 | 33 | ||
32 | $this->dropTable('{{%vacancy_specialization}}'); | 34 | $this->dropTable('{{%vacancy_specialization}}'); |
33 | } | 35 | } |
frontend/controllers/AccountsController.php
@@ -75,12 +75,10 @@ | @@ -75,12 +75,10 @@ | ||
75 | 75 | ||
76 | /** | 76 | /** |
77 | * Page of additional skills, consist: | 77 | * Page of additional skills, consist: |
78 | - * | ||
79 | * * working with programs; | 78 | * * working with programs; |
80 | * * education; | 79 | * * education; |
81 | * * own developments and patents; | 80 | * * own developments and patents; |
82 | * * courses and trainings; | 81 | * * courses and trainings; |
83 | - * | ||
84 | * @return string | 82 | * @return string |
85 | */ | 83 | */ |
86 | public function actionAddSkills() | 84 | public function actionAddSkills() |
@@ -94,7 +92,6 @@ | @@ -94,7 +92,6 @@ | ||
94 | 92 | ||
95 | /** | 93 | /** |
96 | * Page of blog grid view | 94 | * Page of blog grid view |
97 | - * | ||
98 | * @return string | 95 | * @return string |
99 | */ | 96 | */ |
100 | public function actionBlog() | 97 | public function actionBlog() |
@@ -110,7 +107,6 @@ | @@ -110,7 +107,6 @@ | ||
110 | 107 | ||
111 | /** | 108 | /** |
112 | * Page of creating one record of blog. | 109 | * Page of creating one record of blog. |
113 | - * | ||
114 | * @return string|\yii\web\Response Page html / Redirect | 110 | * @return string|\yii\web\Response Page html / Redirect |
115 | */ | 111 | */ |
116 | public function actionBlogCreate() | 112 | public function actionBlogCreate() |
@@ -175,11 +171,9 @@ | @@ -175,11 +171,9 @@ | ||
175 | 171 | ||
176 | /** | 172 | /** |
177 | * Page of contacts. Consist: | 173 | * Page of contacts. Consist: |
178 | - * | ||
179 | * * phones; | 174 | * * phones; |
180 | * * social pages; | 175 | * * social pages; |
181 | * * sites; | 176 | * * sites; |
182 | - * | ||
183 | * @return string page html | 177 | * @return string page html |
184 | */ | 178 | */ |
185 | public function actionContacts() | 179 | public function actionContacts() |
@@ -199,7 +193,6 @@ | @@ -199,7 +193,6 @@ | ||
199 | 193 | ||
200 | /** | 194 | /** |
201 | * Page of description. Consist of information about User. | 195 | * Page of description. Consist of information about User. |
202 | - * | ||
203 | * @return string page html | 196 | * @return string page html |
204 | */ | 197 | */ |
205 | public function actionDescription() | 198 | public function actionDescription() |
@@ -219,11 +212,9 @@ | @@ -219,11 +212,9 @@ | ||
219 | 212 | ||
220 | /** | 213 | /** |
221 | * Page of seniority. Consist: | 214 | * Page of seniority. Consist: |
222 | - * | ||
223 | * * current job; | 215 | * * current job; |
224 | * * year of the beginning of designing | 216 | * * year of the beginning of designing |
225 | * * previous jobs | 217 | * * previous jobs |
226 | - * | ||
227 | * @return string page html | 218 | * @return string page html |
228 | */ | 219 | */ |
229 | public function actionEmployment() | 220 | public function actionEmployment() |
@@ -278,7 +269,6 @@ | @@ -278,7 +269,6 @@ | ||
278 | 269 | ||
279 | /** | 270 | /** |
280 | * Page of User's image galleries | 271 | * Page of User's image galleries |
281 | - * | ||
282 | * @return string | 272 | * @return string |
283 | */ | 273 | */ |
284 | public function actionGallery() | 274 | public function actionGallery() |
@@ -294,7 +284,6 @@ | @@ -294,7 +284,6 @@ | ||
294 | 284 | ||
295 | /** | 285 | /** |
296 | * Page of User's videos | 286 | * Page of User's videos |
297 | - * | ||
298 | * @return string | 287 | * @return string |
299 | */ | 288 | */ |
300 | public function actionGalleryVideo() | 289 | public function actionGalleryVideo() |
@@ -302,23 +291,20 @@ | @@ -302,23 +291,20 @@ | ||
302 | 291 | ||
303 | $user = \Yii::$app->user->identity; | 292 | $user = \Yii::$app->user->identity; |
304 | 293 | ||
305 | - $video = Fields::getData($user->id,Gallery::className(),'youtube'); | 294 | + $video = Fields::getData($user->id, Gallery::className(), 'youtube'); |
306 | 295 | ||
307 | - | ||
308 | - | ||
309 | - if(!empty(Yii::$app->request->post('Fields'))) { | 296 | + if(!empty( Yii::$app->request->post('Fields') )) { |
310 | Fields::saveFieldVideoData(Yii::$app->request->post('Fields'), $user->id, Gallery::className(), 'ru'); | 297 | Fields::saveFieldVideoData(Yii::$app->request->post('Fields'), $user->id, Gallery::className(), 'ru'); |
311 | } | 298 | } |
312 | 299 | ||
313 | return $this->render('gallery-video', [ | 300 | return $this->render('gallery-video', [ |
314 | - 'video' => $video, | 301 | + 'video' => $video, |
315 | 'user' => $user, | 302 | 'user' => $user, |
316 | ]); | 303 | ]); |
317 | } | 304 | } |
318 | 305 | ||
319 | /** | 306 | /** |
320 | * Page of creating a photo gallery | 307 | * Page of creating a photo gallery |
321 | - * | ||
322 | * @return string|\yii\web\Response | 308 | * @return string|\yii\web\Response |
323 | */ | 309 | */ |
324 | public function actionGalleryCreate() | 310 | public function actionGalleryCreate() |
@@ -411,7 +397,6 @@ | @@ -411,7 +397,6 @@ | ||
411 | * </ul> | 397 | * </ul> |
412 | * </li> | 398 | * </li> |
413 | * </ul> | 399 | * </ul> |
414 | - * | ||
415 | * @return string page html | 400 | * @return string page html |
416 | */ | 401 | */ |
417 | public function actionGeneral() | 402 | public function actionGeneral() |
@@ -458,14 +443,13 @@ | @@ -458,14 +443,13 @@ | ||
458 | 443 | ||
459 | /** | 444 | /** |
460 | * Page of User's portfolio | 445 | * Page of User's portfolio |
461 | - * | ||
462 | * @return string | 446 | * @return string |
463 | */ | 447 | */ |
464 | public function actionPortfolio() | 448 | public function actionPortfolio() |
465 | { | 449 | { |
466 | $searchModel = new PortfolioSearch(); | 450 | $searchModel = new PortfolioSearch(); |
467 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | 451 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
468 | - $dataProvider->pagination->pageSize=5; | 452 | + $dataProvider->pagination->pageSize = 5; |
469 | return $this->render('portfolio', [ | 453 | return $this->render('portfolio', [ |
470 | 'searchModel' => $searchModel, | 454 | 'searchModel' => $searchModel, |
471 | 'dataProvider' => $dataProvider, | 455 | 'dataProvider' => $dataProvider, |
@@ -474,13 +458,15 @@ | @@ -474,13 +458,15 @@ | ||
474 | 458 | ||
475 | /** | 459 | /** |
476 | * Page of creating User's portfolio records. | 460 | * Page of creating User's portfolio records. |
477 | - * | ||
478 | * @return string|\yii\web\Response | 461 | * @return string|\yii\web\Response |
479 | */ | 462 | */ |
480 | public function actionPortfolioCreate() | 463 | public function actionPortfolioCreate() |
481 | { | 464 | { |
482 | $portfolio = new Portfolio(); | 465 | $portfolio = new Portfolio(); |
483 | - $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | 466 | + $specializations = Specialization::find() |
467 | + ->where([ 'specialization_pid' => 0 ]) | ||
468 | + ->orderBy('specialization_id') | ||
469 | + ->all(); | ||
484 | $post = \Yii::$app->request->post(); | 470 | $post = \Yii::$app->request->post(); |
485 | if(!empty( $post )) { | 471 | if(!empty( $post )) { |
486 | $portfolio->load($post); | 472 | $portfolio->load($post); |
@@ -489,16 +475,13 @@ | @@ -489,16 +475,13 @@ | ||
489 | $portfolio->save(); | 475 | $portfolio->save(); |
490 | $portfolio->unlinkAll('specializations', true); | 476 | $portfolio->unlinkAll('specializations', true); |
491 | foreach($portfolio->specializationInput as $one_specialization) { | 477 | foreach($portfolio->specializationInput as $one_specialization) { |
492 | - if($one_specialization){ | ||
493 | - | ||
494 | - $portfolio->link('specializations', Specialization::findOne($one_specialization)); | ||
495 | - } | 478 | + $portfolio->link('specializations', Specialization::findOne($one_specialization)); |
496 | } | 479 | } |
497 | return $this->redirect('portfolio'); | 480 | return $this->redirect('portfolio'); |
498 | } | 481 | } |
499 | } | 482 | } |
500 | return $this->render('_portfolio_form', [ | 483 | return $this->render('_portfolio_form', [ |
501 | - 'portfolio' => $portfolio, | 484 | + 'portfolio' => $portfolio, |
502 | 'specializations' => $specializations, | 485 | 'specializations' => $specializations, |
503 | ]); | 486 | ]); |
504 | } | 487 | } |
@@ -521,7 +504,10 @@ | @@ -521,7 +504,10 @@ | ||
521 | throw new NotFoundHttpException('Запись не найдена'); | 504 | throw new NotFoundHttpException('Запись не найдена'); |
522 | } | 505 | } |
523 | 506 | ||
524 | - $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | 507 | + $specializations = Specialization::find() |
508 | + ->where([ 'specialization_pid' => 0 ]) | ||
509 | + ->orderBy('specialization_id') | ||
510 | + ->all(); | ||
525 | 511 | ||
526 | $post = \Yii::$app->request->post(); | 512 | $post = \Yii::$app->request->post(); |
527 | 513 | ||
@@ -531,18 +517,15 @@ | @@ -531,18 +517,15 @@ | ||
531 | if(!$portfolio->hasErrors()) { | 517 | if(!$portfolio->hasErrors()) { |
532 | $portfolio->save(); | 518 | $portfolio->save(); |
533 | $portfolio->unlinkAll('specializations', true); | 519 | $portfolio->unlinkAll('specializations', true); |
534 | - | ||
535 | foreach($portfolio->specializationInput as $one_specialization) { | 520 | foreach($portfolio->specializationInput as $one_specialization) { |
536 | - if($one_specialization){ | ||
537 | $portfolio->link('specializations', Specialization::findOne($one_specialization)); | 521 | $portfolio->link('specializations', Specialization::findOne($one_specialization)); |
538 | - } | ||
539 | } | 522 | } |
540 | return $this->redirect('portfolio'); | 523 | return $this->redirect('portfolio'); |
541 | } | 524 | } |
542 | } | 525 | } |
543 | 526 | ||
544 | return $this->render('_portfolio_form', [ | 527 | return $this->render('_portfolio_form', [ |
545 | - 'portfolio' => $portfolio, | 528 | + 'portfolio' => $portfolio, |
546 | 'specializations' => $specializations, | 529 | 'specializations' => $specializations, |
547 | ]); | 530 | ]); |
548 | } | 531 | } |
@@ -570,7 +553,6 @@ | @@ -570,7 +553,6 @@ | ||
570 | 553 | ||
571 | /** | 554 | /** |
572 | * Page of User's projects. | 555 | * Page of User's projects. |
573 | - * | ||
574 | * @return string | 556 | * @return string |
575 | */ | 557 | */ |
576 | public function actionProjects() | 558 | public function actionProjects() |
@@ -586,14 +568,16 @@ | @@ -586,14 +568,16 @@ | ||
586 | 568 | ||
587 | /** | 569 | /** |
588 | * Page of creating User's project. | 570 | * Page of creating User's project. |
589 | - * | ||
590 | * @return string|\yii\web\Response | 571 | * @return string|\yii\web\Response |
591 | */ | 572 | */ |
592 | public function actionProjectsCreate() | 573 | public function actionProjectsCreate() |
593 | { | 574 | { |
594 | $project = new Project(); | 575 | $project = new Project(); |
595 | 576 | ||
596 | - $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | 577 | + $specializations = Specialization::find() |
578 | + ->where([ 'specialization_pid' => 0 ]) | ||
579 | + ->orderBy('specialization_id') | ||
580 | + ->all(); | ||
597 | 581 | ||
598 | $payment = Payment::find() | 582 | $payment = Payment::find() |
599 | ->select([ | 583 | ->select([ |
@@ -645,10 +629,10 @@ | @@ -645,10 +629,10 @@ | ||
645 | } | 629 | } |
646 | } | 630 | } |
647 | return $this->render('_projects_form', [ | 631 | return $this->render('_projects_form', [ |
648 | - 'project' => $project, | 632 | + 'project' => $project, |
649 | 'specializations' => $specializations, | 633 | 'specializations' => $specializations, |
650 | - 'payment' => $payment, | ||
651 | - 'projects' => $projects, | 634 | + 'payment' => $payment, |
635 | + 'projects' => $projects, | ||
652 | ]); | 636 | ]); |
653 | } | 637 | } |
654 | 638 | ||
@@ -669,7 +653,10 @@ | @@ -669,7 +653,10 @@ | ||
669 | if(!$project instanceof ActiveRecord) { | 653 | if(!$project instanceof ActiveRecord) { |
670 | throw new NotFoundHttpException('Запись не найдена'); | 654 | throw new NotFoundHttpException('Запись не найдена'); |
671 | } | 655 | } |
672 | - $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | 656 | + $specializations = Specialization::find() |
657 | + ->where([ 'specialization_pid' => 0 ]) | ||
658 | + ->orderBy('specialization_id') | ||
659 | + ->all(); | ||
673 | $payment = Payment::find() | 660 | $payment = Payment::find() |
674 | ->select([ | 661 | ->select([ |
675 | 'name', | 662 | 'name', |
@@ -719,10 +706,10 @@ | @@ -719,10 +706,10 @@ | ||
719 | } | 706 | } |
720 | } | 707 | } |
721 | return $this->render('_projects_form', [ | 708 | return $this->render('_projects_form', [ |
722 | - 'project' => $project, | 709 | + 'project' => $project, |
723 | 'specializations' => $specializations, | 710 | 'specializations' => $specializations, |
724 | - 'payment' => $payment, | ||
725 | - 'projects' => $projects, | 711 | + 'payment' => $payment, |
712 | + 'projects' => $projects, | ||
726 | ]); | 713 | ]); |
727 | } | 714 | } |
728 | 715 | ||
@@ -738,8 +725,8 @@ | @@ -738,8 +725,8 @@ | ||
738 | { | 725 | { |
739 | $user = \Yii::$app->user->identity; | 726 | $user = \Yii::$app->user->identity; |
740 | $project = $user->getProjects() | 727 | $project = $user->getProjects() |
741 | - ->where([ 'project_id' => $id ]) | ||
742 | - ->one(); | 728 | + ->where([ 'project_id' => $id ]) |
729 | + ->one(); | ||
743 | if(!$project instanceof ActiveRecord) { | 730 | if(!$project instanceof ActiveRecord) { |
744 | throw new NotFoundHttpException('Запись не найдена'); | 731 | throw new NotFoundHttpException('Запись не найдена'); |
745 | } | 732 | } |
@@ -759,7 +746,6 @@ | @@ -759,7 +746,6 @@ | ||
759 | * * delivery of materials; | 746 | * * delivery of materials; |
760 | * * minimal prepayment; | 747 | * * minimal prepayment; |
761 | * * payment types; | 748 | * * payment types; |
762 | - * | ||
763 | * @return string | 749 | * @return string |
764 | */ | 750 | */ |
765 | public function actionService() | 751 | public function actionService() |
@@ -769,7 +755,10 @@ | @@ -769,7 +755,10 @@ | ||
769 | if(empty( $user_info )) { | 755 | if(empty( $user_info )) { |
770 | $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); | 756 | $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); |
771 | } | 757 | } |
772 | - $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | 758 | + $specializations = Specialization::find() |
759 | + ->where([ 'specialization_pid' => 0 ]) | ||
760 | + ->orderBy('specialization_id') | ||
761 | + ->all(); | ||
773 | $payment = Payment::find() | 762 | $payment = Payment::find() |
774 | ->select([ | 763 | ->select([ |
775 | 'name', | 764 | 'name', |
@@ -778,7 +767,7 @@ | @@ -778,7 +767,7 @@ | ||
778 | ->indexBy('payment_id') | 767 | ->indexBy('payment_id') |
779 | ->asArray() | 768 | ->asArray() |
780 | ->column(); | 769 | ->column(); |
781 | - $currencies = | 770 | + $currencies = Currency::getCurrencyDropdown(); |
782 | $post = \Yii::$app->request->post(); | 771 | $post = \Yii::$app->request->post(); |
783 | if(!empty( $post )) { | 772 | if(!empty( $post )) { |
784 | $user_info->load($post); | 773 | $user_info->load($post); |
@@ -797,17 +786,17 @@ | @@ -797,17 +786,17 @@ | ||
797 | } | 786 | } |
798 | } | 787 | } |
799 | return $this->render('service', [ | 788 | return $this->render('service', [ |
800 | - 'user' => $user, | ||
801 | - 'user_info' => $user_info, | 789 | + 'user' => $user, |
790 | + 'user_info' => $user_info, | ||
802 | 'specializations' => $specializations, | 791 | 'specializations' => $specializations, |
803 | - 'payment' => $payment, | 792 | + 'payment' => $payment, |
793 | + 'currencies' => $currencies, | ||
804 | ]); | 794 | ]); |
805 | } | 795 | } |
806 | 796 | ||
807 | /** | 797 | /** |
808 | * Page of account setting. Consist of: | 798 | * Page of account setting. Consist of: |
809 | * * changing password; | 799 | * * changing password; |
810 | - * | ||
811 | * @return string | 800 | * @return string |
812 | */ | 801 | */ |
813 | public function actionSetting() | 802 | public function actionSetting() |
@@ -847,7 +836,6 @@ | @@ -847,7 +836,6 @@ | ||
847 | 836 | ||
848 | /** | 837 | /** |
849 | * Page of company's team | 838 | * Page of company's team |
850 | - * | ||
851 | * @return string | 839 | * @return string |
852 | */ | 840 | */ |
853 | public function actionTeam() | 841 | public function actionTeam() |
@@ -863,7 +851,6 @@ | @@ -863,7 +851,6 @@ | ||
863 | 851 | ||
864 | /** | 852 | /** |
865 | * Page of creating company's team member | 853 | * Page of creating company's team member |
866 | - * | ||
867 | * @return string|\yii\web\Response | 854 | * @return string|\yii\web\Response |
868 | */ | 855 | */ |
869 | public function actionTeamCreate() | 856 | public function actionTeamCreate() |
@@ -966,7 +953,6 @@ | @@ -966,7 +953,6 @@ | ||
966 | 953 | ||
967 | /** | 954 | /** |
968 | * Page of company's vacancies | 955 | * Page of company's vacancies |
969 | - * | ||
970 | * @return string | 956 | * @return string |
971 | */ | 957 | */ |
972 | public function actionVacancy() | 958 | public function actionVacancy() |
@@ -982,7 +968,6 @@ | @@ -982,7 +968,6 @@ | ||
982 | 968 | ||
983 | /** | 969 | /** |
984 | * Page of creating company's vacancies. | 970 | * Page of creating company's vacancies. |
985 | - * | ||
986 | * @return string|\yii\web\Response | 971 | * @return string|\yii\web\Response |
987 | */ | 972 | */ |
988 | public function actionVacancyCreate() | 973 | public function actionVacancyCreate() |
@@ -996,6 +981,11 @@ | @@ -996,6 +981,11 @@ | ||
996 | ->indexBy('employment_id') | 981 | ->indexBy('employment_id') |
997 | ->asArray() | 982 | ->asArray() |
998 | ->column(); | 983 | ->column(); |
984 | + $specializations = Specialization::find() | ||
985 | + ->where([ 'specialization_pid' => 0 ]) | ||
986 | + ->orderBy('specialization_id') | ||
987 | + ->all(); | ||
988 | + $currencies = Currency::getCurrencyDropdown(); | ||
999 | $post = \Yii::$app->request->post(); | 989 | $post = \Yii::$app->request->post(); |
1000 | if(!empty( $post )) { | 990 | if(!empty( $post )) { |
1001 | $vacancy->load($post); | 991 | $vacancy->load($post); |
@@ -1007,6 +997,10 @@ | @@ -1007,6 +997,10 @@ | ||
1007 | foreach($vacancy->employmentInput as $one_employment) { | 997 | foreach($vacancy->employmentInput as $one_employment) { |
1008 | $vacancy->link('employments', Employment::findOne($one_employment)); | 998 | $vacancy->link('employments', Employment::findOne($one_employment)); |
1009 | } | 999 | } |
1000 | + $vacancy->unlinkAll('specializations', true); | ||
1001 | + foreach($vacancy->specializationInput as $one_specialization) { | ||
1002 | + $vacancy->link('specializations', Specialization::findOne($one_specialization)); | ||
1003 | + } | ||
1010 | return $this->redirect([ | 1004 | return $this->redirect([ |
1011 | 'vacancy-update', | 1005 | 'vacancy-update', |
1012 | 'id' => $vacancy->vacancy_id, | 1006 | 'id' => $vacancy->vacancy_id, |
@@ -1014,8 +1008,10 @@ | @@ -1014,8 +1008,10 @@ | ||
1014 | } | 1008 | } |
1015 | } | 1009 | } |
1016 | return $this->render('_vacancy_form', [ | 1010 | return $this->render('_vacancy_form', [ |
1017 | - 'vacancy' => $vacancy, | ||
1018 | - 'employment' => $employment, | 1011 | + 'vacancy' => $vacancy, |
1012 | + 'employment' => $employment, | ||
1013 | + 'currencies' => $currencies, | ||
1014 | + 'specializations' => $specializations, | ||
1019 | ]); | 1015 | ]); |
1020 | } | 1016 | } |
1021 | 1017 | ||
@@ -1031,8 +1027,8 @@ | @@ -1031,8 +1027,8 @@ | ||
1031 | { | 1027 | { |
1032 | $user = \Yii::$app->user->identity; | 1028 | $user = \Yii::$app->user->identity; |
1033 | $vacancy = $user->getVacancies() | 1029 | $vacancy = $user->getVacancies() |
1034 | - ->where([ 'vacancy_id' => $id ]) | ||
1035 | - ->one(); | 1030 | + ->where([ 'vacancy_id' => $id ]) |
1031 | + ->one(); | ||
1036 | if(!$vacancy instanceof ActiveRecord) { | 1032 | if(!$vacancy instanceof ActiveRecord) { |
1037 | throw new NotFoundHttpException('Запись не найдена'); | 1033 | throw new NotFoundHttpException('Запись не найдена'); |
1038 | } | 1034 | } |
@@ -1044,6 +1040,11 @@ | @@ -1044,6 +1040,11 @@ | ||
1044 | ->indexBy('employment_id') | 1040 | ->indexBy('employment_id') |
1045 | ->asArray() | 1041 | ->asArray() |
1046 | ->column(); | 1042 | ->column(); |
1043 | + $specializations = Specialization::find() | ||
1044 | + ->where([ 'specialization_pid' => 0 ]) | ||
1045 | + ->orderBy('specialization_id') | ||
1046 | + ->all(); | ||
1047 | + $currencies = Currency::getCurrencyDropdown(); | ||
1047 | $post = \Yii::$app->request->post(); | 1048 | $post = \Yii::$app->request->post(); |
1048 | if(!empty( $post )) { | 1049 | if(!empty( $post )) { |
1049 | $vacancy->load($post); | 1050 | $vacancy->load($post); |
@@ -1055,6 +1056,10 @@ | @@ -1055,6 +1056,10 @@ | ||
1055 | foreach($vacancy->employmentInput as $one_employment) { | 1056 | foreach($vacancy->employmentInput as $one_employment) { |
1056 | $vacancy->link('employments', Employment::findOne($one_employment)); | 1057 | $vacancy->link('employments', Employment::findOne($one_employment)); |
1057 | } | 1058 | } |
1059 | + $vacancy->unlinkAll('specializations', true); | ||
1060 | + foreach($vacancy->specializationInput as $one_specialization) { | ||
1061 | + $vacancy->link('specializations', Specialization::findOne($one_specialization)); | ||
1062 | + } | ||
1058 | return $this->redirect([ | 1063 | return $this->redirect([ |
1059 | 'vacancy-update', | 1064 | 'vacancy-update', |
1060 | 'id' => $vacancy->vacancy_id, | 1065 | 'id' => $vacancy->vacancy_id, |
@@ -1062,8 +1067,10 @@ | @@ -1062,8 +1067,10 @@ | ||
1062 | } | 1067 | } |
1063 | } | 1068 | } |
1064 | return $this->render('_vacancy_form', [ | 1069 | return $this->render('_vacancy_form', [ |
1065 | - 'vacancy' => $vacancy, | ||
1066 | - 'employment' => $employment, | 1070 | + 'vacancy' => $vacancy, |
1071 | + 'employment' => $employment, | ||
1072 | + 'currencies' => $currencies, | ||
1073 | + 'specializations' => $specializations, | ||
1067 | ]); | 1074 | ]); |
1068 | } | 1075 | } |
1069 | 1076 | ||
@@ -1079,8 +1086,8 @@ | @@ -1079,8 +1086,8 @@ | ||
1079 | { | 1086 | { |
1080 | $user = \Yii::$app->user->identity; | 1087 | $user = \Yii::$app->user->identity; |
1081 | $vacancy = $user->getVacancies() | 1088 | $vacancy = $user->getVacancies() |
1082 | - ->where([ 'vacancy_id' => $id ]) | ||
1083 | - ->one(); | 1089 | + ->where([ 'vacancy_id' => $id ]) |
1090 | + ->one(); | ||
1084 | if(!$vacancy instanceof ActiveRecord) { | 1091 | if(!$vacancy instanceof ActiveRecord) { |
1085 | throw new NotFoundHttpException('Запись не найдена'); | 1092 | throw new NotFoundHttpException('Запись не найдена'); |
1086 | 1093 |
frontend/views/accounts/_portfolio_form.php
1 | <?php | 1 | <?php |
2 | /** | 2 | /** |
3 | * @var Portfolio $portfolio | 3 | * @var Portfolio $portfolio |
4 | + * @var integer[] $specializations | ||
4 | */ | 5 | */ |
5 | use common\models\Option; | 6 | use common\models\Option; |
6 | use common\models\Portfolio; | 7 | use common\models\Portfolio; |
@@ -42,34 +43,42 @@ use yii\web\JsExpression; | @@ -42,34 +43,42 @@ use yii\web\JsExpression; | ||
42 | </div> | 43 | </div> |
43 | </div> | 44 | </div> |
44 | 45 | ||
45 | - | ||
46 | -<div class="input-blocks-wrapper"> | ||
47 | - <ul class="content-menu-first"> | ||
48 | - <?php foreach($specializations as $specialization):?> | ||
49 | - <li data-img="<?= $specialization->image?>"> | ||
50 | - <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name?></a> | ||
51 | - <ul> | ||
52 | - <?php foreach($specialization->children as $child_first):?> | ||
53 | - | ||
54 | - <?php if($child_first instanceof Specialization):?> | ||
55 | - <li> | ||
56 | - <a href="#"><?= $child_first->specialization_name?></a> | ||
57 | - <ul> | ||
58 | - <?php foreach($child_first->children as $child_second):?> | ||
59 | - <?php if($child_first instanceof Specialization): ?> | ||
60 | - <li><a href="#"><?= Html::checkbox('Portfolio[specializationInput][]', in_array($child_second->specialization_id, ArrayHelper::getColumn($portfolio->specializations,'specialization_id')),['value' => $child_second->specialization_id, 'label' =>$child_second->specialization_name])?></a></li> | ||
61 | - <?php endif;?> | ||
62 | - <?php endforeach; ?> | ||
63 | - </ul> | ||
64 | - </li> | ||
65 | - <?php endif; ?> | ||
66 | - <?php endforeach; ?> | ||
67 | - | ||
68 | - </ul> | ||
69 | - </li> | ||
70 | - <?php endforeach; ?> | ||
71 | - </ul> | ||
72 | -</div> | 46 | + <div class="input-blocks-wrapper"> |
47 | + <ul class="content-menu-first"> | ||
48 | + <?php foreach($specializations as $specialization): ?> | ||
49 | + <li data-img="<?= $specialization->image ?>"> | ||
50 | + <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name ?></a> | ||
51 | + <ul> | ||
52 | + <?php foreach($specialization->children as $child_first): ?> | ||
53 | + | ||
54 | + <?php if($child_first instanceof Specialization): ?> | ||
55 | + <li> | ||
56 | + <a href="#"><?= $child_first->specialization_name ?></a> | ||
57 | + <ul> | ||
58 | + <?php foreach($child_first->children as $child_second): ?> | ||
59 | + <?php if($child_first instanceof Specialization): ?> | ||
60 | + <li> | ||
61 | + <a href="#"> | ||
62 | + <?= $form->field($portfolio, "specializationInput[{$child_second->specialization_id}]") | ||
63 | + ->checkbox([ | ||
64 | + 'value' => $child_second->specialization_id, | ||
65 | + 'label' => $child_second->specialization_name, | ||
66 | + 'uncheck' => NULL, | ||
67 | + ]) ?> | ||
68 | + </a> | ||
69 | + </li> | ||
70 | + <?php endif; ?> | ||
71 | + <?php endforeach; ?> | ||
72 | + </ul> | ||
73 | + </li> | ||
74 | + <?php endif; ?> | ||
75 | + <?php endforeach; ?> | ||
76 | + | ||
77 | + </ul> | ||
78 | + </li> | ||
79 | + <?php endforeach; ?> | ||
80 | + </ul> | ||
81 | + </div> | ||
73 | 82 | ||
74 | 83 | ||
75 | 84 |
frontend/views/accounts/_vacancy_form.php
@@ -2,11 +2,13 @@ | @@ -2,11 +2,13 @@ | ||
2 | /** | 2 | /** |
3 | * @var Vacancy $vacancy | 3 | * @var Vacancy $vacancy |
4 | * @var Employment[] $employment | 4 | * @var Employment[] $employment |
5 | + * @var string[] $currencies | ||
6 | + * @var Specialization[] $specializations | ||
5 | */ | 7 | */ |
6 | use common\models\Employment; | 8 | use common\models\Employment; |
9 | + use common\models\Specialization; | ||
7 | use common\models\Vacancy; | 10 | use common\models\Vacancy; |
8 | use common\widgets\FieldEditor; | 11 | use common\widgets\FieldEditor; |
9 | - use common\widgets\ImageUploader; | ||
10 | use kartik\select2\Select2; | 12 | use kartik\select2\Select2; |
11 | use mihaildev\ckeditor\CKEditor; | 13 | use mihaildev\ckeditor\CKEditor; |
12 | use yii\helpers\Html; | 14 | use yii\helpers\Html; |
@@ -29,8 +31,6 @@ | @@ -29,8 +31,6 @@ | ||
29 | </div> | 31 | </div> |
30 | </div> | 32 | </div> |
31 | 33 | ||
32 | - | ||
33 | - | ||
34 | <div class="input-blocks-wrapper"> | 34 | <div class="input-blocks-wrapper"> |
35 | <div class="input-blocks"> | 35 | <div class="input-blocks"> |
36 | <?= $form->field($vacancy, 'link') | 36 | <?= $form->field($vacancy, 'link') |
@@ -48,8 +48,8 @@ | @@ -48,8 +48,8 @@ | ||
48 | 48 | ||
49 | <div class="input-blocks-wrapper"> | 49 | <div class="input-blocks-wrapper"> |
50 | <div class="input-blocks"> | 50 | <div class="input-blocks"> |
51 | - <span style="color: red">сюда нужен инпут телефон</span> | ||
52 | - | 51 | + <?= $form->field($vacancy, 'phone') |
52 | + ->textInput (['class'=> 'custom-input-2']); ?> | ||
53 | <span class="admin-hint-vacancy-contact">Ваш</span> | 53 | <span class="admin-hint-vacancy-contact">Ваш</span> |
54 | </div> | 54 | </div> |
55 | </div> | 55 | </div> |
@@ -77,6 +77,52 @@ | @@ -77,6 +77,52 @@ | ||
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | 79 | ||
80 | +<div class="input-blocks-wrapper"> | ||
81 | + <div class="input-blocks"> | ||
82 | + <?= $form->field($vacancy, 'salary') | ||
83 | + ->textInput (['class'=> 'custom-input-2']); ?> | ||
84 | + <?= $form->field($vacancy, 'salary_currency') | ||
85 | + ->label(false)->dropDownList($currencies); ?> | ||
86 | + </div> | ||
87 | +</div> | ||
88 | + | ||
89 | +<div class="input-blocks-wrapper"> | ||
90 | + <ul class="content-menu-first"> | ||
91 | + <?php foreach($specializations as $specialization): ?> | ||
92 | + <li data-img="<?= $specialization->image ?>"> | ||
93 | + <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name ?></a> | ||
94 | + <ul> | ||
95 | + <?php foreach($specialization->children as $child_first): ?> | ||
96 | + | ||
97 | + <?php if($child_first instanceof Specialization): ?> | ||
98 | + <li> | ||
99 | + <a href="#"><?= $child_first->specialization_name ?></a> | ||
100 | + <ul> | ||
101 | + <?php foreach($child_first->children as $child_second): ?> | ||
102 | + <?php if($child_first instanceof Specialization): ?> | ||
103 | + <li> | ||
104 | + <a href="#"> | ||
105 | + <?= $form->field($vacancy, "specializationInput[{$child_second->specialization_id}]") | ||
106 | + ->checkbox([ | ||
107 | + 'value' => $child_second->specialization_id, | ||
108 | + 'label' => $child_second->specialization_name, | ||
109 | + 'uncheck' => NULL, | ||
110 | + ]) ?> | ||
111 | + </a> | ||
112 | + </li> | ||
113 | + <?php endif; ?> | ||
114 | + <?php endforeach; ?> | ||
115 | + </ul> | ||
116 | + </li> | ||
117 | + <?php endif; ?> | ||
118 | + <?php endforeach; ?> | ||
119 | + | ||
120 | + </ul> | ||
121 | + </li> | ||
122 | + <?php endforeach; ?> | ||
123 | + </ul> | ||
124 | +</div> | ||
125 | + | ||
80 | <div class="input-blocks-wrapper admin-vacancy-check" style="margin-top: 29px"> | 126 | <div class="input-blocks-wrapper admin-vacancy-check" style="margin-top: 29px"> |
81 | <div class="input-blocks"> | 127 | <div class="input-blocks"> |
82 | <?= $form->field($vacancy, 'employmentInput') | 128 | <?= $form->field($vacancy, 'employmentInput') |
frontend/views/accounts/employment.php
@@ -109,7 +109,7 @@ | @@ -109,7 +109,7 @@ | ||
109 | 109 | ||
110 | <div class="input-blocks-wrapper"> | 110 | <div class="input-blocks-wrapper"> |
111 | <div class="input-blocks"> | 111 | <div class="input-blocks"> |
112 | - <?= $form->field ($current, '[0]date_start') | 112 | + <?= $form->field ($job_model, '['. ($index + 1) .']date_start') |
113 | ->label ('Дата начала работы') | 113 | ->label ('Дата начала работы') |
114 | ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); | 114 | ->widget (DatePicker::className (), ['options' => ['class' => 'custom-input-2'], 'language' => 'ru', 'dateFormat' => 'dd-MM-yyyy', 'clientOptions' => ['changeYear' => true, 'yearRange' => 'c-20:c', 'changeMonth' => true]]); |
115 | ?> | 115 | ?> |
@@ -179,7 +179,6 @@ | @@ -179,7 +179,6 @@ | ||
179 | var lastindex; | 179 | var lastindex; |
180 | if(result != null) { | 180 | if(result != null) { |
181 | lastindex = result[1]; | 181 | lastindex = result[1]; |
182 | - console.log('111111111') | ||
183 | } else { | 182 | } else { |
184 | lastindex = 1; | 183 | lastindex = 1; |
185 | $('.prev_job_container').removeClass('none-job-inputs') | 184 | $('.prev_job_container').removeClass('none-job-inputs') |
frontend/views/accounts/service.php
1 | <?php | 1 | <?php |
2 | /** | 2 | /** |
3 | - * @var User $user | ||
4 | - * @var UserInfo $user_info | ||
5 | - * @var string[] $specialization | ||
6 | - * @var string[] $payment | 3 | + * @var User $user |
4 | + * @var UserInfo $user_info | ||
5 | + * @var string[] $specialization | ||
6 | + * @var string[] $payment | ||
7 | + * @var string[] $currecnies | ||
7 | */ | 8 | */ |
8 | use common\models\Currency; | 9 | use common\models\Currency; |
9 | use common\models\Specialization; | 10 | use common\models\Specialization; |
@@ -32,39 +33,46 @@ | @@ -32,39 +33,46 @@ | ||
32 | ?> | 33 | ?> |
33 | <div class="input-blocks-wrapper"> | 34 | <div class="input-blocks-wrapper"> |
34 | <div class="input-blocks"> | 35 | <div class="input-blocks"> |
35 | - <?= | ||
36 | - $form->field($user_info, 'salary_currency')->label(false)->dropDownList(Currency::getCurrencyDropdown()); | ||
37 | - ?> | 36 | + <?= $form->field($user_info, 'salary_currency') |
37 | + ->label(false) | ||
38 | + ->dropDownList($currencies); ?> | ||
38 | <?= $form->field($user_info, 'salary', [ | 39 | <?= $form->field($user_info, 'salary', [ |
39 | 'template' => "{label}<br /><span class='admn-input-txt'>от</span>{input}<span class='admn-input-txt'>за час</span>\n{hint}\n{error}", | 40 | 'template' => "{label}<br /><span class='admn-input-txt'>от</span>{input}<span class='admn-input-txt'>за час</span>\n{hint}\n{error}", |
40 | 'options' => [ 'class' => 'form-inline' ], | 41 | 'options' => [ 'class' => 'form-inline' ], |
41 | ]) | 42 | ]) |
42 | - ->label('Стоимость работ') | ||
43 | - ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']); | ||
44 | - ?> | 43 | + ->label('Стоимость работ') |
44 | + ->textInput([ | ||
45 | + 'class' => 'custom-input-2 custom-input-2-date', | ||
46 | + 'type' => 'number', | ||
47 | + ]); ?> | ||
45 | </div> | 48 | </div> |
46 | </div> | 49 | </div> |
47 | 50 | ||
48 | <div class="input-blocks-wrapper"> | 51 | <div class="input-blocks-wrapper"> |
49 | <ul class="content-menu-first"> | 52 | <ul class="content-menu-first"> |
50 | - <?php foreach($specializations as $specialization):?> | ||
51 | - <li data-img="<?= $specialization->image?>"> | ||
52 | - <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name?></a> | 53 | + <?php foreach($specializations as $specialization): ?> |
54 | + <li data-img="<?= $specialization->image ?>"> | ||
55 | + <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name ?></a> | ||
53 | <ul> | 56 | <ul> |
54 | - <?php foreach($specialization->children as $child_first):?> | 57 | + <?php foreach($specialization->children as $child_first): ?> |
55 | 58 | ||
56 | - <?php if($child_first instanceof Specialization):?> | 59 | + <?php if($child_first instanceof Specialization): ?> |
57 | <li> | 60 | <li> |
58 | - <a href="#"><?= $child_first->specialization_name?></a> | 61 | + <a href="#"><?= $child_first->specialization_name ?></a> |
59 | <ul> | 62 | <ul> |
60 | - <?php foreach($child_first->children as $child_second):?> | 63 | + <?php foreach($child_first->children as $child_second): ?> |
61 | <?php if($child_first instanceof Specialization): ?> | 64 | <?php if($child_first instanceof Specialization): ?> |
62 | <li> | 65 | <li> |
63 | <a href="#"> | 66 | <a href="#"> |
64 | - <?= $form->field($user, "specializationInput[{$child_second->specialization_id}]")->checkbox(['value' => $child_second->specialization_id, 'label' => $child_second->specialization_name, 'uncheck' => null, 'checked' => 'checked']) ?> | 67 | + <?= $form->field($user, "specializationInput[{$child_second->specialization_id}]") |
68 | + ->checkbox([ | ||
69 | + 'value' => $child_second->specialization_id, | ||
70 | + 'label' => $child_second->specialization_name, | ||
71 | + 'uncheck' => NULL, | ||
72 | + ]) ?> | ||
65 | </a> | 73 | </a> |
66 | </li> | 74 | </li> |
67 | - <?php endif;?> | 75 | + <?php endif; ?> |
68 | <?php endforeach; ?> | 76 | <?php endforeach; ?> |
69 | </ul> | 77 | </ul> |
70 | </li> | 78 | </li> |
@@ -78,23 +86,25 @@ | @@ -78,23 +86,25 @@ | ||
78 | </div> | 86 | </div> |
79 | <div class="input-blocks-wrapper"> | 87 | <div class="input-blocks-wrapper"> |
80 | <div class="input-blocks"> | 88 | <div class="input-blocks"> |
81 | - <?= | ||
82 | - $form->field($user_info, 'geographies')->widget(Select2::classname(), [ | ||
83 | - 'options' => ['placeholder' => 'Выбор города ...', 'multiple' => true], | ||
84 | - 'pluginOptions' => [ | ||
85 | - 'allowClear' => true, | ||
86 | - 'minimumInputLength' => 3, | ||
87 | - 'ajax' => [ | ||
88 | - 'url' => \yii\helpers\Url::to(['site/city']), | ||
89 | - 'dataType' => 'json', | ||
90 | - 'data' => new JsExpression('function(params) { return {q:params.term}; }') | ||
91 | - ], | ||
92 | - 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | ||
93 | - 'templateResult' => new JsExpression('function(city) { return city.text; }'), | ||
94 | - 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | ||
95 | - ], | ||
96 | - ]); | ||
97 | - ?> | 89 | + <?= $form->field($user_info, 'geographies') |
90 | + ->widget(Select2::classname(), [ | ||
91 | + 'options' => [ | ||
92 | + 'placeholder' => 'Выбор города ...', | ||
93 | + 'multiple' => true, | ||
94 | + ], | ||
95 | + 'pluginOptions' => [ | ||
96 | + 'allowClear' => true, | ||
97 | + 'minimumInputLength' => 3, | ||
98 | + 'ajax' => [ | ||
99 | + 'url' => \yii\helpers\Url::to([ 'site/city' ]), | ||
100 | + 'dataType' => 'json', | ||
101 | + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | ||
102 | + ], | ||
103 | + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | ||
104 | + 'templateResult' => new JsExpression('function(city) { return city.text; }'), | ||
105 | + 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | ||
106 | + ], | ||
107 | + ]); ?> | ||
98 | </div> | 108 | </div> |
99 | </div> | 109 | </div> |
100 | <div class="input-blocks-wrapper"> | 110 | <div class="input-blocks-wrapper"> |
@@ -103,92 +113,94 @@ | @@ -103,92 +113,94 @@ | ||
103 | 'template' => "{label}<br />{input}<span class='admn-input-txt'>лет</span>\n{hint}\n{error}", | 113 | 'template' => "{label}<br />{input}<span class='admn-input-txt'>лет</span>\n{hint}\n{error}", |
104 | 'options' => [ 'class' => 'form-inline' ], | 114 | 'options' => [ 'class' => 'form-inline' ], |
105 | ]) | 115 | ]) |
106 | - ->label('Гарантия качества работ') | ||
107 | - ->textInput (['class'=> 'custom-input-2 custom-input-2-date custom-input-2-margin-r','type'=>'number']) ?> | 116 | + ->label('Гарантия качества работ') |
117 | + ->textInput([ | ||
118 | + 'class' => 'custom-input-2 custom-input-2-date custom-input-2-margin-r', | ||
119 | + 'type' => 'number', | ||
120 | + ]) ?> | ||
108 | </div> | 121 | </div> |
109 | </div> | 122 | </div> |
110 | 123 | ||
111 | <div class="input-blocks-wrapper"> | 124 | <div class="input-blocks-wrapper"> |
112 | <div class="input-blocks"> | 125 | <div class="input-blocks"> |
113 | <?= $form->field($user_info, 'contract', [ 'options' => [ 'class' => 'form-inline' ] ]) | 126 | <?= $form->field($user_info, 'contract', [ 'options' => [ 'class' => 'form-inline' ] ]) |
114 | - ->label('Работа по договору') | ||
115 | - ->radioList([ | ||
116 | - 1 => 'Да', | ||
117 | - 0 => 'Нет', | ||
118 | - ], | ||
119 | - [ | ||
120 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
121 | - $return = '<div class="admin-who-check">'; | ||
122 | - $return .= '<input class="custom-radio" id="select_admin_doc'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
123 | - $return .= '<label for="select_admin_doc'.$value.'" >'; | ||
124 | - $return .= '<span></span>' . ucwords($label); | ||
125 | - $return .= '</label>'; | ||
126 | - $return .= '</div>'; | ||
127 | - return $return; | ||
128 | - } | ||
129 | - ]) ?> | 127 | + ->label('Работа по договору') |
128 | + ->radioList([ | ||
129 | + 1 => 'Да', | ||
130 | + 0 => 'Нет', | ||
131 | + ], [ | ||
132 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
133 | + $return = '<div class="admin-who-check">'; | ||
134 | + $return .= '<input class="custom-radio" id="select_admin_doc' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
135 | + $return .= '<label for="select_admin_doc' . $value . '" >'; | ||
136 | + $return .= '<span></span>' . ucwords($label); | ||
137 | + $return .= '</label>'; | ||
138 | + $return .= '</div>'; | ||
139 | + return $return; | ||
140 | + }, | ||
141 | + ]) ?> | ||
130 | </div> | 142 | </div> |
131 | </div> | 143 | </div> |
132 | 144 | ||
133 | <div class="input-blocks-wrapper"> | 145 | <div class="input-blocks-wrapper"> |
134 | <div class="input-blocks"> | 146 | <div class="input-blocks"> |
135 | <?= $form->field($user_info, 'estimate', [ 'options' => [ 'class' => 'form-inline' ] ]) | 147 | <?= $form->field($user_info, 'estimate', [ 'options' => [ 'class' => 'form-inline' ] ]) |
136 | - ->label('Предоставляете смету') | ||
137 | - ->radioList([ | ||
138 | - 1 => 'Да', | ||
139 | - 0 => 'Нет', | ||
140 | - ], [ | ||
141 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
142 | - $return = '<div class="admin-who-check">'; | ||
143 | - $return .= '<input class="custom-radio" id="select_admin_estimate'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
144 | - $return .= '<label for="select_admin_estimate'.$value.'" >'; | ||
145 | - $return .= '<span></span>' . ucwords($label); | ||
146 | - $return .= '</label>'; | ||
147 | - $return .= '</div>'; | ||
148 | - return $return; | ||
149 | - } | ||
150 | - ]) ?> | 148 | + ->label('Предоставляете смету') |
149 | + ->radioList([ | ||
150 | + 1 => 'Да', | ||
151 | + 0 => 'Нет', | ||
152 | + ], [ | ||
153 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
154 | + $return = '<div class="admin-who-check">'; | ||
155 | + $return .= '<input class="custom-radio" id="select_admin_estimate' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
156 | + $return .= '<label for="select_admin_estimate' . $value . '" >'; | ||
157 | + $return .= '<span></span>' . ucwords($label); | ||
158 | + $return .= '</label>'; | ||
159 | + $return .= '</div>'; | ||
160 | + return $return; | ||
161 | + }, | ||
162 | + ]) ?> | ||
151 | </div> | 163 | </div> |
152 | </div> | 164 | </div> |
153 | 165 | ||
154 | <div class="input-blocks-wrapper"> | 166 | <div class="input-blocks-wrapper"> |
155 | <div class="input-blocks"> | 167 | <div class="input-blocks"> |
156 | <?= $form->field($user_info, 'purchase', [ 'options' => [ 'class' => 'form-inline' ] ]) | 168 | <?= $form->field($user_info, 'purchase', [ 'options' => [ 'class' => 'form-inline' ] ]) |
157 | - ->label('Делаете сами закупку материалов') | ||
158 | - ->radioList([ | ||
159 | - 1 => 'Да', | ||
160 | - 0 => 'Нет', | ||
161 | - ], [ | ||
162 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
163 | - $return = '<div class="admin-who-check">'; | ||
164 | - $return .= '<input class="custom-radio" id="select_admin_purchase'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
165 | - $return .= '<label for="select_admin_purchase'.$value.'" >'; | ||
166 | - $return .= '<span></span>' . ucwords($label); | ||
167 | - $return .= '</label>'; | ||
168 | - $return .= '</div>'; | ||
169 | - return $return; | ||
170 | - } | ||
171 | - ]) ?> | 169 | + ->label('Делаете сами закупку материалов') |
170 | + ->radioList([ | ||
171 | + 1 => 'Да', | ||
172 | + 0 => 'Нет', | ||
173 | + ], [ | ||
174 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
175 | + $return = '<div class="admin-who-check">'; | ||
176 | + $return .= '<input class="custom-radio" id="select_admin_purchase' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
177 | + $return .= '<label for="select_admin_purchase' . $value . '" >'; | ||
178 | + $return .= '<span></span>' . ucwords($label); | ||
179 | + $return .= '</label>'; | ||
180 | + $return .= '</div>'; | ||
181 | + return $return; | ||
182 | + }, | ||
183 | + ]) ?> | ||
172 | </div> | 184 | </div> |
173 | </div> | 185 | </div> |
174 | <div class="input-blocks-wrapper"> | 186 | <div class="input-blocks-wrapper"> |
175 | <div class="input-blocks"> | 187 | <div class="input-blocks"> |
176 | <?= $form->field($user_info, 'delivery', [ 'options' => [ 'class' => 'form-inline' ] ]) | 188 | <?= $form->field($user_info, 'delivery', [ 'options' => [ 'class' => 'form-inline' ] ]) |
177 | - ->label('Занимаетесь сами доставкой материалов') | ||
178 | - ->radioList([ | ||
179 | - 1 => 'Да', | ||
180 | - 0 => 'Нет', | ||
181 | - ], [ | ||
182 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
183 | - $return = '<div class="admin-who-check">'; | ||
184 | - $return .= '<input class="custom-radio" id="select_admin_delivery'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
185 | - $return .= '<label for="select_admin_delivery'.$value.'" >'; | ||
186 | - $return .= '<span></span>' . ucwords($label); | ||
187 | - $return .= '</label>'; | ||
188 | - $return .= '</div>'; | ||
189 | - return $return; | ||
190 | - } | ||
191 | - ]) ?> | 189 | + ->label('Занимаетесь сами доставкой материалов') |
190 | + ->radioList([ | ||
191 | + 1 => 'Да', | ||
192 | + 0 => 'Нет', | ||
193 | + ], [ | ||
194 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
195 | + $return = '<div class="admin-who-check">'; | ||
196 | + $return .= '<input class="custom-radio" id="select_admin_delivery' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
197 | + $return .= '<label for="select_admin_delivery' . $value . '" >'; | ||
198 | + $return .= '<span></span>' . ucwords($label); | ||
199 | + $return .= '</label>'; | ||
200 | + $return .= '</div>'; | ||
201 | + return $return; | ||
202 | + }, | ||
203 | + ]) ?> | ||
192 | </div> | 204 | </div> |
193 | </div> | 205 | </div> |
194 | 206 | ||
@@ -198,28 +210,29 @@ | @@ -198,28 +210,29 @@ | ||
198 | 'template' => "{label}<br />{input}<span class='admn-input-txt'>%</span>\n{hint}\n{error}", | 210 | 'template' => "{label}<br />{input}<span class='admn-input-txt'>%</span>\n{hint}\n{error}", |
199 | 'options' => [ 'class' => 'form-inline' ], | 211 | 'options' => [ 'class' => 'form-inline' ], |
200 | ]) | 212 | ]) |
201 | - ->label('Минимальная предоплата за работы') | ||
202 | - ->textInput (['class'=> 'custom-input-2 custom-input-2-date custom-input-2-margin-r','type'=>'number'])?> | 213 | + ->label('Минимальная предоплата за работы') |
214 | + ->textInput([ | ||
215 | + 'class' => 'custom-input-2 custom-input-2-date custom-input-2-margin-r', | ||
216 | + 'type' => 'number', | ||
217 | + ]) ?> | ||
203 | </div> | 218 | </div> |
204 | </div> | 219 | </div> |
205 | 220 | ||
206 | <div class="input-blocks-wrapper style border-general"> | 221 | <div class="input-blocks-wrapper style border-general"> |
207 | <div class="input-blocks"> | 222 | <div class="input-blocks"> |
208 | <?= $form->field($user, 'paymentInput', [ 'template' => "{label}\n{input}\n{error}" ]) | 223 | <?= $form->field($user, 'paymentInput', [ 'template' => "{label}\n{input}\n{error}" ]) |
209 | - ->label('Способы оплаты') | ||
210 | - ->checkboxList($payment, | ||
211 | - [ | ||
212 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
213 | - $return = '<div class="admin-who-check-payment">'; | ||
214 | - $return .= '<input class="custom-check" id="select_admin_payment'.$value.'" type="checkbox" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
215 | - $return .= '<label for="select_admin_payment'.$value.'" >'; | ||
216 | - $return .= '<span></span>' . ucwords($label); | ||
217 | - $return .= '</label>'; | ||
218 | - $return .= '</div>'; | ||
219 | - return $return; | ||
220 | - } | ||
221 | - ] | ||
222 | - ) ?> | 224 | + ->label('Способы оплаты') |
225 | + ->checkboxList($payment, [ | ||
226 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
227 | + $return = '<div class="admin-who-check-payment">'; | ||
228 | + $return .= '<input class="custom-check" id="select_admin_payment' . $value . '" type="checkbox" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
229 | + $return .= '<label for="select_admin_payment' . $value . '" >'; | ||
230 | + $return .= '<span></span>' . ucwords($label); | ||
231 | + $return .= '</label>'; | ||
232 | + $return .= '</div>'; | ||
233 | + return $return; | ||
234 | + }, | ||
235 | + ]) ?> | ||
223 | </div> | 236 | </div> |
224 | </div> | 237 | </div> |
225 | 238 |