Commit 4c9663e0d402ecff04854e3abf148d9f4c242832
1 parent
04b478b9
test
Showing
12 changed files
with
228 additions
and
70 deletions
Show diff stats
common/models/Blog.php
common/models/BlogSearch.php
| @@ -16,6 +16,8 @@ | @@ -16,6 +16,8 @@ | ||
| 16 | class BlogSearch extends Blog | 16 | class BlogSearch extends Blog |
| 17 | { | 17 | { |
| 18 | 18 | ||
| 19 | + public $date_add_from; | ||
| 20 | + public $date_add_to; | ||
| 19 | /** | 21 | /** |
| 20 | * @inheritdoc | 22 | * @inheritdoc |
| 21 | */ | 23 | */ |
| @@ -38,9 +40,25 @@ | @@ -38,9 +40,25 @@ | ||
| 38 | 'date_add', | 40 | 'date_add', |
| 39 | 'description', | 41 | 'description', |
| 40 | 'cover', | 42 | 'cover', |
| 43 | + 'date_add_from', | ||
| 44 | + 'date_add_to', | ||
| 41 | ], | 45 | ], |
| 42 | 'safe', | 46 | 'safe', |
| 43 | ], | 47 | ], |
| 48 | + [ | ||
| 49 | + [ | ||
| 50 | + 'date_add_from', | ||
| 51 | + ], | ||
| 52 | + 'default', | ||
| 53 | + 'value' => date('Y-m-d', 0), | ||
| 54 | + ], | ||
| 55 | + [ | ||
| 56 | + [ | ||
| 57 | + 'date_add_to', | ||
| 58 | + ], | ||
| 59 | + 'default', | ||
| 60 | + 'value' => date('Y-m-d'), | ||
| 61 | + ], | ||
| 44 | ]; | 62 | ]; |
| 45 | } | 63 | } |
| 46 | 64 | ||
| @@ -89,17 +107,19 @@ | @@ -89,17 +107,19 @@ | ||
| 89 | ]); | 107 | ]); |
| 90 | 108 | ||
| 91 | $query->andFilterWhere([ | 109 | $query->andFilterWhere([ |
| 110 | + 'between', | ||
| 111 | + 'date_add', | ||
| 112 | + $this->date_add_from, | ||
| 113 | + $this->date_add_to, | ||
| 114 | + ]); | ||
| 115 | + | ||
| 116 | + $query->andFilterWhere([ | ||
| 92 | 'like', | 117 | 'like', |
| 93 | 'name', | 118 | 'name', |
| 94 | $this->name, | 119 | $this->name, |
| 95 | ]) | 120 | ]) |
| 96 | ->andFilterWhere([ | 121 | ->andFilterWhere([ |
| 97 | 'like', | 122 | 'like', |
| 98 | - 'link', | ||
| 99 | - $this->link, | ||
| 100 | - ]) | ||
| 101 | - ->andFilterWhere([ | ||
| 102 | - 'like', | ||
| 103 | 'description', | 123 | 'description', |
| 104 | $this->description, | 124 | $this->description, |
| 105 | ]) | 125 | ]) |
common/models/GallerySearch.php
| @@ -13,6 +13,8 @@ | @@ -13,6 +13,8 @@ | ||
| 13 | class GallerySearch extends Gallery | 13 | class GallerySearch extends Gallery |
| 14 | { | 14 | { |
| 15 | 15 | ||
| 16 | + public $date_add_from; | ||
| 17 | + public $date_add_to; | ||
| 16 | /** | 18 | /** |
| 17 | * @inheritdoc | 19 | * @inheritdoc |
| 18 | */ | 20 | */ |
| @@ -33,9 +35,25 @@ | @@ -33,9 +35,25 @@ | ||
| 33 | 'date_add', | 35 | 'date_add', |
| 34 | 'cover', | 36 | 'cover', |
| 35 | 'photo', | 37 | 'photo', |
| 38 | + 'date_add_from', | ||
| 39 | + 'date_add_to', | ||
| 36 | ], | 40 | ], |
| 37 | 'safe', | 41 | 'safe', |
| 38 | ], | 42 | ], |
| 43 | + [ | ||
| 44 | + [ | ||
| 45 | + 'date_add_from', | ||
| 46 | + ], | ||
| 47 | + 'default', | ||
| 48 | + 'value' => date('Y-m-d', 0), | ||
| 49 | + ], | ||
| 50 | + [ | ||
| 51 | + [ | ||
| 52 | + 'date_add_to', | ||
| 53 | + ], | ||
| 54 | + 'default', | ||
| 55 | + 'value' => date('Y-m-d'), | ||
| 56 | + ], | ||
| 39 | ]; | 57 | ]; |
| 40 | } | 58 | } |
| 41 | 59 | ||
| @@ -86,6 +104,13 @@ | @@ -86,6 +104,13 @@ | ||
| 86 | ]); | 104 | ]); |
| 87 | 105 | ||
| 88 | $query->andFilterWhere([ | 106 | $query->andFilterWhere([ |
| 107 | + 'between', | ||
| 108 | + 'date_add', | ||
| 109 | + $this->date_add_from, | ||
| 110 | + $this->date_add_to, | ||
| 111 | + ]); | ||
| 112 | + | ||
| 113 | + $query->andFilterWhere([ | ||
| 89 | 'like', | 114 | 'like', |
| 90 | 'name', | 115 | 'name', |
| 91 | $this->name, | 116 | $this->name, |
common/models/PortfolioSearch.php
| @@ -13,6 +13,8 @@ | @@ -13,6 +13,8 @@ | ||
| 13 | class PortfolioSearch extends Portfolio | 13 | class PortfolioSearch extends Portfolio |
| 14 | { | 14 | { |
| 15 | 15 | ||
| 16 | + public $date_add_from; | ||
| 17 | + public $date_add_to; | ||
| 16 | /** | 18 | /** |
| 17 | * @inheritdoc | 19 | * @inheritdoc |
| 18 | */ | 20 | */ |
| @@ -39,9 +41,25 @@ | @@ -39,9 +41,25 @@ | ||
| 39 | 'description', | 41 | 'description', |
| 40 | 'cover', | 42 | 'cover', |
| 41 | 'specializationString', | 43 | 'specializationString', |
| 44 | + 'date_add_from', | ||
| 45 | + 'date_add_to', | ||
| 42 | ], | 46 | ], |
| 43 | 'safe', | 47 | 'safe', |
| 44 | ], | 48 | ], |
| 49 | + [ | ||
| 50 | + [ | ||
| 51 | + 'date_add_from', | ||
| 52 | + ], | ||
| 53 | + 'default', | ||
| 54 | + 'value' => date('Y-m-d', 0), | ||
| 55 | + ], | ||
| 56 | + [ | ||
| 57 | + [ | ||
| 58 | + 'date_add_to', | ||
| 59 | + ], | ||
| 60 | + 'default', | ||
| 61 | + 'value' => date('Y-m-d'), | ||
| 62 | + ], | ||
| 45 | ]; | 63 | ]; |
| 46 | } | 64 | } |
| 47 | 65 | ||
| @@ -79,7 +97,19 @@ | @@ -79,7 +97,19 @@ | ||
| 79 | return $dataProvider; | 97 | return $dataProvider; |
| 80 | } | 98 | } |
| 81 | 99 | ||
| 82 | - $query->joinWith('specializations'); | 100 | + $query2 = [ ]; |
| 101 | + if(!empty( $this->specializationString )) { | ||
| 102 | + $query2 = Portfolio::find() | ||
| 103 | + ->select([ 'portfolio.portfolio_id' ], 'DISTINCT') | ||
| 104 | + ->joinWith([ 'specializations' ]) | ||
| 105 | + ->where([ | ||
| 106 | + 'like', | ||
| 107 | + 'specialization_name', | ||
| 108 | + $this->specializationString, | ||
| 109 | + ]) | ||
| 110 | + ->asArray() | ||
| 111 | + ->column(); | ||
| 112 | + } | ||
| 83 | 113 | ||
| 84 | $query->andWhere([ 'user_id' => \Yii::$app->user->getId() ]); | 114 | $query->andWhere([ 'user_id' => \Yii::$app->user->getId() ]); |
| 85 | 115 | ||
| @@ -93,6 +123,19 @@ | @@ -93,6 +123,19 @@ | ||
| 93 | ]); | 123 | ]); |
| 94 | 124 | ||
| 95 | $query->andFilterWhere([ | 125 | $query->andFilterWhere([ |
| 126 | + 'between', | ||
| 127 | + 'date_add', | ||
| 128 | + $this->date_add_from, | ||
| 129 | + $this->date_add_to, | ||
| 130 | + ]); | ||
| 131 | + | ||
| 132 | + $query->andFilterWhere( | ||
| 133 | + [ | ||
| 134 | + 'portfolio_id' => $query2, | ||
| 135 | + ] | ||
| 136 | + ); | ||
| 137 | + | ||
| 138 | + $query->andFilterWhere([ | ||
| 96 | 'like', | 139 | 'like', |
| 97 | 'name', | 140 | 'name', |
| 98 | $this->name, | 141 | $this->name, |
| @@ -126,11 +169,6 @@ | @@ -126,11 +169,6 @@ | ||
| 126 | 'like', | 169 | 'like', |
| 127 | 'cover', | 170 | 'cover', |
| 128 | $this->cover, | 171 | $this->cover, |
| 129 | - ]) | ||
| 130 | - ->andFilterWhere([ | ||
| 131 | - 'like', | ||
| 132 | - 'specialization.specialization_name', | ||
| 133 | - $this->specializationString, | ||
| 134 | ]); | 172 | ]); |
| 135 | 173 | ||
| 136 | return $dataProvider; | 174 | return $dataProvider; |
common/models/Project.php
| @@ -116,12 +116,12 @@ | @@ -116,12 +116,12 @@ | ||
| 116 | 'value' => [ ], | 116 | 'value' => [ ], |
| 117 | ], | 117 | ], |
| 118 | [ | 118 | [ |
| 119 | - ['deadline'], | 119 | + [ 'deadline' ], |
| 120 | 'integer', | 120 | 'integer', |
| 121 | 'min' => 1, | 121 | 'min' => 1, |
| 122 | ], | 122 | ], |
| 123 | [ | 123 | [ |
| 124 | - ['deadline'], | 124 | + [ 'deadline' ], |
| 125 | 'default', | 125 | 'default', |
| 126 | 'value' => 1, | 126 | 'value' => 1, |
| 127 | ], | 127 | ], |
| @@ -190,6 +190,7 @@ | @@ -190,6 +190,7 @@ | ||
| 190 | { | 190 | { |
| 191 | return $this->getSpecializations() | 191 | return $this->getSpecializations() |
| 192 | ->asArray() | 192 | ->asArray() |
| 193 | + ->indexBy('specialization_id') | ||
| 193 | ->column(); | 194 | ->column(); |
| 194 | } | 195 | } |
| 195 | 196 |
common/models/ProjectSearch.php
| @@ -87,7 +87,19 @@ | @@ -87,7 +87,19 @@ | ||
| 87 | return $dataProvider; | 87 | return $dataProvider; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | - $query->joinWith('specializations'); | 90 | + $query2 = [ ]; |
| 91 | + if(!empty( $this->specializationString )) { | ||
| 92 | + $query2 = Project::find() | ||
| 93 | + ->select([ 'project.project_id' ], 'DISTINCT') | ||
| 94 | + ->joinWith([ 'specializations' ]) | ||
| 95 | + ->where([ | ||
| 96 | + 'like', | ||
| 97 | + 'specialization_name', | ||
| 98 | + $this->specializationString, | ||
| 99 | + ]) | ||
| 100 | + ->asArray() | ||
| 101 | + ->column(); | ||
| 102 | + } | ||
| 91 | 103 | ||
| 92 | $query->andWhere([ 'user_id' => \Yii::$app->user->getId() ]); | 104 | $query->andWhere([ 'user_id' => \Yii::$app->user->getId() ]); |
| 93 | 105 | ||
| @@ -104,6 +116,12 @@ | @@ -104,6 +116,12 @@ | ||
| 104 | 'contractual' => $this->contractual, | 116 | 'contractual' => $this->contractual, |
| 105 | ]); | 117 | ]); |
| 106 | 118 | ||
| 119 | + $query->andFilterWhere( | ||
| 120 | + [ | ||
| 121 | + 'project_id' => $query2, | ||
| 122 | + ] | ||
| 123 | + ); | ||
| 124 | + | ||
| 107 | $query->andFilterWhere([ | 125 | $query->andFilterWhere([ |
| 108 | 'like', | 126 | 'like', |
| 109 | 'name', | 127 | 'name', |
| @@ -143,11 +161,6 @@ | @@ -143,11 +161,6 @@ | ||
| 143 | 'like', | 161 | 'like', |
| 144 | 'file', | 162 | 'file', |
| 145 | $this->file, | 163 | $this->file, |
| 146 | - ]) | ||
| 147 | - ->andFilterWhere([ | ||
| 148 | - 'like', | ||
| 149 | - 'specialization.specialization_name', | ||
| 150 | - $this->specializationString, | ||
| 151 | ]); | 164 | ]); |
| 152 | 165 | ||
| 153 | return $dataProvider; | 166 | return $dataProvider; |
common/models/User.php
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | */ | 26 | */ |
| 27 | class User extends ActiveRecord implements IdentityInterface, UserRbacInterface | 27 | class User extends ActiveRecord implements IdentityInterface, UserRbacInterface |
| 28 | { | 28 | { |
| 29 | + | ||
| 29 | const STATUS_DELETED = 0; | 30 | const STATUS_DELETED = 0; |
| 30 | const STATUS_ACTIVE = 10; | 31 | const STATUS_ACTIVE = 10; |
| 31 | 32 | ||
| @@ -294,7 +295,6 @@ | @@ -294,7 +295,6 @@ | ||
| 294 | 295 | ||
| 295 | /** | 296 | /** |
| 296 | * Returns name of the User | 297 | * Returns name of the User |
| 297 | - * | ||
| 298 | * @return string | 298 | * @return string |
| 299 | */ | 299 | */ |
| 300 | public function getUserName() | 300 | public function getUserName() |
| @@ -304,7 +304,6 @@ | @@ -304,7 +304,6 @@ | ||
| 304 | 304 | ||
| 305 | /** | 305 | /** |
| 306 | * Return array of all User's roles | 306 | * Return array of all User's roles |
| 307 | - * | ||
| 308 | * @return array | 307 | * @return array |
| 309 | */ | 308 | */ |
| 310 | public function getRoles() | 309 | public function getRoles() |
| @@ -315,9 +314,10 @@ | @@ -315,9 +314,10 @@ | ||
| 315 | } | 314 | } |
| 316 | 315 | ||
| 317 | /** | 316 | /** |
| 318 | - * @param Role[] $roles User roles returned by [ManagerInterface]->[getRolesByUser($id)] | ||
| 319 | - * @param ManagerInterface $auth Auth manager | ||
| 320 | - * @param array $result | 317 | + * @param Role[] $roles User roles returned by |
| 318 | + * [ManagerInterface]->[getRolesByUser($id)] | ||
| 319 | + * @param ManagerInterface $auth Auth manager | ||
| 320 | + * @param array $result | ||
| 321 | * | 321 | * |
| 322 | * @return array | 322 | * @return array |
| 323 | */ | 323 | */ |
| @@ -339,7 +339,6 @@ | @@ -339,7 +339,6 @@ | ||
| 339 | 339 | ||
| 340 | /** | 340 | /** |
| 341 | * Return UserInfo for this User | 341 | * Return UserInfo for this User |
| 342 | - * | ||
| 343 | * @return \yii\db\ActiveQuery | 342 | * @return \yii\db\ActiveQuery |
| 344 | */ | 343 | */ |
| 345 | public function getUserInfo() | 344 | public function getUserInfo() |
| @@ -349,9 +348,7 @@ | @@ -349,9 +348,7 @@ | ||
| 349 | 348 | ||
| 350 | /** | 349 | /** |
| 351 | * Check if User is Performer | 350 | * Check if User is Performer |
| 352 | - * | ||
| 353 | * <i>currently in development mode</i> | 351 | * <i>currently in development mode</i> |
| 354 | - * | ||
| 355 | * @return bool | 352 | * @return bool |
| 356 | */ | 353 | */ |
| 357 | public function getIsPerformer() | 354 | public function getIsPerformer() |
| @@ -361,7 +358,6 @@ | @@ -361,7 +358,6 @@ | ||
| 361 | 358 | ||
| 362 | /** | 359 | /** |
| 363 | * Return CompanyInfo for this User | 360 | * Return CompanyInfo for this User |
| 364 | - * | ||
| 365 | * @return \yii\db\ActiveQuery | 361 | * @return \yii\db\ActiveQuery |
| 366 | */ | 362 | */ |
| 367 | public function getCompanyInfo() | 363 | public function getCompanyInfo() |
| @@ -371,7 +367,6 @@ | @@ -371,7 +367,6 @@ | ||
| 371 | 367 | ||
| 372 | /** | 368 | /** |
| 373 | * Return array of User's phones | 369 | * Return array of User's phones |
| 374 | - * | ||
| 375 | * @return array | 370 | * @return array |
| 376 | */ | 371 | */ |
| 377 | public function getPhones() | 372 | public function getPhones() |
| @@ -381,7 +376,6 @@ | @@ -381,7 +376,6 @@ | ||
| 381 | 376 | ||
| 382 | /** | 377 | /** |
| 383 | * Return array of User's site | 378 | * Return array of User's site |
| 384 | - * | ||
| 385 | * @return array | 379 | * @return array |
| 386 | */ | 380 | */ |
| 387 | public function getSite() | 381 | public function getSite() |
| @@ -391,7 +385,6 @@ | @@ -391,7 +385,6 @@ | ||
| 391 | 385 | ||
| 392 | /** | 386 | /** |
| 393 | * Return full address of User in view like: | 387 | * Return full address of User in view like: |
| 394 | - * | ||
| 395 | * <code>{country}, {city}, {street}, {house}</code> | 388 | * <code>{country}, {city}, {street}, {house}</code> |
| 396 | * @return string | 389 | * @return string |
| 397 | */ | 390 | */ |
| @@ -402,7 +395,6 @@ | @@ -402,7 +395,6 @@ | ||
| 402 | 395 | ||
| 403 | /** | 396 | /** |
| 404 | * Return relative interval of time from User registration date until now. | 397 | * Return relative interval of time from User registration date until now. |
| 405 | - * | ||
| 406 | * @return string | 398 | * @return string |
| 407 | */ | 399 | */ |
| 408 | public function getLiveTime() | 400 | public function getLiveTime() |
| @@ -414,9 +406,7 @@ | @@ -414,9 +406,7 @@ | ||
| 414 | 406 | ||
| 415 | /** | 407 | /** |
| 416 | * Check if User is Customer | 408 | * Check if User is Customer |
| 417 | - * | ||
| 418 | * <i>currently in development</i> | 409 | * <i>currently in development</i> |
| 419 | - * | ||
| 420 | * @return bool | 410 | * @return bool |
| 421 | */ | 411 | */ |
| 422 | public function getIsCustomer() | 412 | public function getIsCustomer() |
| @@ -426,7 +416,6 @@ | @@ -426,7 +416,6 @@ | ||
| 426 | 416 | ||
| 427 | /** | 417 | /** |
| 428 | * Return array of payments types accepted by the user. | 418 | * Return array of payments types accepted by the user. |
| 429 | - * | ||
| 430 | * @return ActiveQuery | 419 | * @return ActiveQuery |
| 431 | */ | 420 | */ |
| 432 | public function getPayments() | 421 | public function getPayments() |
| @@ -437,7 +426,6 @@ | @@ -437,7 +426,6 @@ | ||
| 437 | 426 | ||
| 438 | /** | 427 | /** |
| 439 | * Return array of Payment IDs, accepted by the user. | 428 | * Return array of Payment IDs, accepted by the user. |
| 440 | - * | ||
| 441 | * @return integer[] | 429 | * @return integer[] |
| 442 | */ | 430 | */ |
| 443 | public function getPaymentInput() | 431 | public function getPaymentInput() |
| @@ -459,7 +447,6 @@ | @@ -459,7 +447,6 @@ | ||
| 459 | 447 | ||
| 460 | /** | 448 | /** |
| 461 | * Return array of Specializations in which the User works. | 449 | * Return array of Specializations in which the User works. |
| 462 | - * | ||
| 463 | * @return ActiveQuery | 450 | * @return ActiveQuery |
| 464 | */ | 451 | */ |
| 465 | public function getSpecializations() | 452 | public function getSpecializations() |
| @@ -470,7 +457,6 @@ | @@ -470,7 +457,6 @@ | ||
| 470 | 457 | ||
| 471 | /** | 458 | /** |
| 472 | * Return array of User's blogs | 459 | * Return array of User's blogs |
| 473 | - * | ||
| 474 | * @return ActiveQuery | 460 | * @return ActiveQuery |
| 475 | */ | 461 | */ |
| 476 | public function getBlog() | 462 | public function getBlog() |
| @@ -480,7 +466,6 @@ | @@ -480,7 +466,6 @@ | ||
| 480 | 466 | ||
| 481 | /** | 467 | /** |
| 482 | * Return array of User's jobs. | 468 | * Return array of User's jobs. |
| 483 | - * | ||
| 484 | * @return ActiveQuery | 469 | * @return ActiveQuery |
| 485 | */ | 470 | */ |
| 486 | public function getJobs() | 471 | public function getJobs() |
| @@ -490,24 +475,23 @@ | @@ -490,24 +475,23 @@ | ||
| 490 | 475 | ||
| 491 | /** | 476 | /** |
| 492 | * Return ActiveRecord of current User's place of work. | 477 | * Return ActiveRecord of current User's place of work. |
| 493 | - * | ||
| 494 | * @return ActiveQuery | 478 | * @return ActiveQuery |
| 495 | */ | 479 | */ |
| 496 | public function getCurrentJob() | 480 | public function getCurrentJob() |
| 497 | { | 481 | { |
| 498 | - return $this->hasOne(Job::className(), ['user_id' => 'id'])->where(['current' => 1]); | 482 | + return $this->hasOne(Job::className(), [ 'user_id' => 'id' ]) |
| 483 | + ->where([ 'current' => 1 ]); | ||
| 499 | } | 484 | } |
| 500 | 485 | ||
| 501 | /** | 486 | /** |
| 502 | * Return array of User's specialization IDs | 487 | * Return array of User's specialization IDs |
| 503 | - * | ||
| 504 | * @return integer[] | 488 | * @return integer[] |
| 505 | */ | 489 | */ |
| 506 | public function getSpecializationInput() | 490 | public function getSpecializationInput() |
| 507 | { | 491 | { |
| 508 | return $this->getSpecializations() | 492 | return $this->getSpecializations() |
| 509 | ->asArray() | 493 | ->asArray() |
| 510 | - ->indexBy('specialization_id') | 494 | + ->indexBy('specialization_id') |
| 511 | ->column(); | 495 | ->column(); |
| 512 | } | 496 | } |
| 513 | 497 | ||
| @@ -523,7 +507,6 @@ | @@ -523,7 +507,6 @@ | ||
| 523 | 507 | ||
| 524 | /** | 508 | /** |
| 525 | * Return array of User's portfolios. | 509 | * Return array of User's portfolios. |
| 526 | - * | ||
| 527 | * @return ActiveQuery | 510 | * @return ActiveQuery |
| 528 | */ | 511 | */ |
| 529 | public function getPortfolios() | 512 | public function getPortfolios() |
| @@ -533,7 +516,6 @@ | @@ -533,7 +516,6 @@ | ||
| 533 | 516 | ||
| 534 | /** | 517 | /** |
| 535 | * Return array of User's projects. | 518 | * Return array of User's projects. |
| 536 | - * | ||
| 537 | * @return ActiveQuery | 519 | * @return ActiveQuery |
| 538 | */ | 520 | */ |
| 539 | public function getProjects() | 521 | public function getProjects() |
| @@ -543,7 +525,6 @@ | @@ -543,7 +525,6 @@ | ||
| 543 | 525 | ||
| 544 | /** | 526 | /** |
| 545 | * Return array of company's Team members. | 527 | * Return array of company's Team members. |
| 546 | - * | ||
| 547 | * @return ActiveQuery | 528 | * @return ActiveQuery |
| 548 | */ | 529 | */ |
| 549 | public function getTeams() | 530 | public function getTeams() |
| @@ -553,7 +534,6 @@ | @@ -553,7 +534,6 @@ | ||
| 553 | 534 | ||
| 554 | /** | 535 | /** |
| 555 | * Return array of company's Vacancies. | 536 | * Return array of company's Vacancies. |
| 556 | - * | ||
| 557 | * @return ActiveQuery | 537 | * @return ActiveQuery |
| 558 | */ | 538 | */ |
| 559 | public function getVacancies() | 539 | public function getVacancies() |
frontend/controllers/AccountsController.php
| @@ -115,8 +115,7 @@ | @@ -115,8 +115,7 @@ | ||
| 115 | $post = \Yii::$app->request->post(); | 115 | $post = \Yii::$app->request->post(); |
| 116 | if($blog->load($post) && $blog->save()) { | 116 | if($blog->load($post) && $blog->save()) { |
| 117 | return $this->redirect([ | 117 | return $this->redirect([ |
| 118 | - 'blog-update', | ||
| 119 | - 'id' => $blog->blog_id, | 118 | + 'blog', |
| 120 | ]); | 119 | ]); |
| 121 | } else { | 120 | } else { |
| 122 | return $this->render('_blog_form', [ 'blog' => $blog ]); | 121 | return $this->render('_blog_form', [ 'blog' => $blog ]); |
frontend/views/accounts/_projects_form.php
| @@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
| 62 | <?php if($child_first instanceof Specialization): ?> | 62 | <?php if($child_first instanceof Specialization): ?> |
| 63 | <li> | 63 | <li> |
| 64 | <a href="#"> | 64 | <a href="#"> |
| 65 | - <?= $form->field($project, "specializationInput[{$child_second->specialization_id}]")->checkbox(['value' => $child_second->specialization_id, 'label' => $child_second->specialization_name, 'uncheck' => null, 'checked' => 'checked']) ?> | 65 | + <?= $form->field($project, "specializationInput[{$child_second->specialization_id}]")->checkbox(['value' => $child_second->specialization_id, 'label' => $child_second->specialization_name, 'uncheck' => null,]) ?> |
| 66 | </a> | 66 | </a> |
| 67 | </li> | 67 | </li> |
| 68 | <?php endif;?> | 68 | <?php endif;?> |
frontend/views/accounts/blog.php
| @@ -8,6 +8,8 @@ | @@ -8,6 +8,8 @@ | ||
| 8 | use yii\grid\ActionColumn; | 8 | use yii\grid\ActionColumn; |
| 9 | use yii\grid\GridView; | 9 | use yii\grid\GridView; |
| 10 | use yii\helpers\Html; | 10 | use yii\helpers\Html; |
| 11 | + use yii\jui\DatePicker; | ||
| 12 | + use yii\widgets\ActiveField; | ||
| 11 | 13 | ||
| 12 | $this->title = 'Блог'; | 14 | $this->title = 'Блог'; |
| 13 | $this->params[ 'breadcrumbs' ][] = $this->title; | 15 | $this->params[ 'breadcrumbs' ][] = $this->title; |
| @@ -26,7 +28,39 @@ | @@ -26,7 +28,39 @@ | ||
| 26 | 'label' => 'ID', | 28 | 'label' => 'ID', |
| 27 | ], | 29 | ], |
| 28 | 'name', | 30 | 'name', |
| 29 | - 'date_add', | 31 | + [ |
| 32 | + 'attribute' => 'date_add', | ||
| 33 | + 'filter' => "<div class=\"input-group input-group-xs input-daterange\"> | ||
| 34 | +<span class='field-teamsearch-experience_from_from'>". | ||
| 35 | +DatePicker::widget([ | ||
| 36 | + 'model' => $searchModel, | ||
| 37 | + 'attribute' => 'date_add_from', | ||
| 38 | + 'language' => 'ru', | ||
| 39 | + 'dateFormat' => 'yyyy-MM-dd', | ||
| 40 | + 'clientOptions' => [ | ||
| 41 | + 'changeYear' => true, | ||
| 42 | + 'changeMonth' => true, | ||
| 43 | + ], | ||
| 44 | +]). | ||
| 45 | +"</span> | ||
| 46 | +<span class=\"input-group-addon kv-field-separator\"> | ||
| 47 | +<i class=\"glyphicon glyphicon-resize-horizontal\"></i> | ||
| 48 | +</span> | ||
| 49 | +<span class='field-teamsearch-experience_from_to'>". | ||
| 50 | + DatePicker::widget([ | ||
| 51 | + 'model' => $searchModel, | ||
| 52 | + 'attribute' => 'date_add_to', | ||
| 53 | + 'language' => 'ru', | ||
| 54 | + 'dateFormat' => 'yyyy-MM-dd', | ||
| 55 | + 'clientOptions' => [ | ||
| 56 | + 'changeYear' => true, | ||
| 57 | + 'changeMonth' => true, | ||
| 58 | + ], | ||
| 59 | + ]) | ||
| 60 | +."</span> | ||
| 61 | +</div>", | ||
| 62 | + 'format' => 'html', | ||
| 63 | + ], | ||
| 30 | 'view_count', | 64 | 'view_count', |
| 31 | [ | 65 | [ |
| 32 | 'class' => ActionColumn::className(), | 66 | 'class' => ActionColumn::className(), |
frontend/views/accounts/gallery.php
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | use yii\data\ActiveDataProvider; | 7 | use yii\data\ActiveDataProvider; |
| 8 | use yii\grid\GridView; | 8 | use yii\grid\GridView; |
| 9 | use yii\helpers\Html; | 9 | use yii\helpers\Html; |
| 10 | + use yii\jui\DatePicker; | ||
| 10 | 11 | ||
| 11 | $this->title = 'Галерея'; | 12 | $this->title = 'Галерея'; |
| 12 | $this->params[ 'breadcrumbs' ][] = $this->title; | 13 | $this->params[ 'breadcrumbs' ][] = $this->title; |
| @@ -27,24 +28,38 @@ | @@ -27,24 +28,38 @@ | ||
| 27 | 'filterOptions' => ['class' => 'text-center'] | 28 | 'filterOptions' => ['class' => 'text-center'] |
| 28 | ], | 29 | ], |
| 29 | 'name', | 30 | 'name', |
| 30 | - 'date_add', | ||
| 31 | [ | 31 | [ |
| 32 | - 'attribute' => 'type', | ||
| 33 | - 'value' => function($model, $key, $index, $column) { | ||
| 34 | - switch($model->type) { | ||
| 35 | - case 2: | ||
| 36 | - return 'Видео'; | ||
| 37 | - break; | ||
| 38 | - default: | ||
| 39 | - return 'Фото'; | ||
| 40 | - break; | ||
| 41 | - } | ||
| 42 | - }, | ||
| 43 | - 'label' => 'Фото или Видео', | ||
| 44 | - 'filter' => [ | ||
| 45 | - 1 => 'Фото', | ||
| 46 | - 2 => 'Видео', | ||
| 47 | - ] | 32 | + 'attribute' => 'date_add', |
| 33 | + 'filter' => "<div class=\"input-group input-group-xs input-daterange\"> | ||
| 34 | +<span class='field-teamsearch-experience_from_from'>". | ||
| 35 | + DatePicker::widget([ | ||
| 36 | + 'model' => $searchModel, | ||
| 37 | + 'attribute' => 'date_add_from', | ||
| 38 | + 'language' => 'ru', | ||
| 39 | + 'dateFormat' => 'yyyy-MM-dd', | ||
| 40 | + 'clientOptions' => [ | ||
| 41 | + 'changeYear' => true, | ||
| 42 | + 'changeMonth' => true, | ||
| 43 | + ], | ||
| 44 | + ]). | ||
| 45 | + "</span> | ||
| 46 | +<span class=\"input-group-addon kv-field-separator\"> | ||
| 47 | +<i class=\"glyphicon glyphicon-resize-horizontal\"></i> | ||
| 48 | +</span> | ||
| 49 | +<span class='field-teamsearch-experience_from_to'>". | ||
| 50 | + DatePicker::widget([ | ||
| 51 | + 'model' => $searchModel, | ||
| 52 | + 'attribute' => 'date_add_to', | ||
| 53 | + 'language' => 'ru', | ||
| 54 | + 'dateFormat' => 'yyyy-MM-dd', | ||
| 55 | + 'clientOptions' => [ | ||
| 56 | + 'changeYear' => true, | ||
| 57 | + 'changeMonth' => true, | ||
| 58 | + ], | ||
| 59 | + ]) | ||
| 60 | + ."</span> | ||
| 61 | +</div>", | ||
| 62 | + 'format' => 'html', | ||
| 48 | ], | 63 | ], |
| 49 | [ | 64 | [ |
| 50 | 'class' => 'yii\grid\ActionColumn', | 65 | 'class' => 'yii\grid\ActionColumn', |
frontend/views/accounts/portfolio.php
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | use yii\grid\ActionColumn; | 8 | use yii\grid\ActionColumn; |
| 9 | use yii\grid\GridView; | 9 | use yii\grid\GridView; |
| 10 | use yii\helpers\Html; | 10 | use yii\helpers\Html; |
| 11 | + use yii\jui\DatePicker; | ||
| 11 | 12 | ||
| 12 | $this->title = 'Портфолио'; | 13 | $this->title = 'Портфолио'; |
| 13 | $this->params[ 'breadcrumbs' ][] = $this->title; | 14 | $this->params[ 'breadcrumbs' ][] = $this->title; |
| @@ -26,7 +27,39 @@ | @@ -26,7 +27,39 @@ | ||
| 26 | 'label' => 'ID', | 27 | 'label' => 'ID', |
| 27 | ], | 28 | ], |
| 28 | 'name', | 29 | 'name', |
| 29 | - 'date_add', | 30 | + [ |
| 31 | + 'attribute' => 'date_add', | ||
| 32 | + 'filter' => "<div class=\"input-group input-group-xs input-daterange\"> | ||
| 33 | +<span class='field-teamsearch-experience_from_from'>". | ||
| 34 | + DatePicker::widget([ | ||
| 35 | + 'model' => $searchModel, | ||
| 36 | + 'attribute' => 'date_add_from', | ||
| 37 | + 'language' => 'ru', | ||
| 38 | + 'dateFormat' => 'yyyy-MM-dd', | ||
| 39 | + 'clientOptions' => [ | ||
| 40 | + 'changeYear' => true, | ||
| 41 | + 'changeMonth' => true, | ||
| 42 | + ], | ||
| 43 | + ]). | ||
| 44 | + "</span> | ||
| 45 | +<span class=\"input-group-addon kv-field-separator\"> | ||
| 46 | +<i class=\"glyphicon glyphicon-resize-horizontal\"></i> | ||
| 47 | +</span> | ||
| 48 | +<span class='field-teamsearch-experience_from_to'>". | ||
| 49 | + DatePicker::widget([ | ||
| 50 | + 'model' => $searchModel, | ||
| 51 | + 'attribute' => 'date_add_to', | ||
| 52 | + 'language' => 'ru', | ||
| 53 | + 'dateFormat' => 'yyyy-MM-dd', | ||
| 54 | + 'clientOptions' => [ | ||
| 55 | + 'changeYear' => true, | ||
| 56 | + 'changeMonth' => true, | ||
| 57 | + ], | ||
| 58 | + ]) | ||
| 59 | + ."</span> | ||
| 60 | +</div>", | ||
| 61 | + 'format' => 'html', | ||
| 62 | + ], | ||
| 30 | 'view_count', | 63 | 'view_count', |
| 31 | [ | 64 | [ |
| 32 | 'attribute' => 'specializationString', | 65 | 'attribute' => 'specializationString', |