Commit b3ef6f91e58ea60d2da49a99fa26476700926b34
1 parent
c1040009
test
Showing
5 changed files
with
48 additions
and
7 deletions
Show diff stats
common/models/CompanyInfo.php
| @@ -11,7 +11,6 @@ | @@ -11,7 +11,6 @@ | ||
| 11 | * @property integer $staff | 11 | * @property integer $staff |
| 12 | * @property string $street | 12 | * @property string $street |
| 13 | * @property string $house | 13 | * @property string $house |
| 14 | - * @property integer $hide_mail | ||
| 15 | */ | 14 | */ |
| 16 | class CompanyInfo extends \yii\db\ActiveRecord | 15 | class CompanyInfo extends \yii\db\ActiveRecord |
| 17 | { | 16 | { |
| @@ -45,10 +44,6 @@ | @@ -45,10 +44,6 @@ | ||
| 45 | 'string', | 44 | 'string', |
| 46 | ], | 45 | ], |
| 47 | [ | 46 | [ |
| 48 | - [ 'hide_mail' ], | ||
| 49 | - 'integer', | ||
| 50 | - ], | ||
| 51 | - [ | ||
| 52 | [ 'staff' ], | 47 | [ 'staff' ], |
| 53 | 'default', | 48 | 'default', |
| 54 | 'value' => 1, | 49 | 'value' => 1, |
| @@ -72,7 +67,6 @@ | @@ -72,7 +67,6 @@ | ||
| 72 | 'staff' => Yii::t('app', 'Количество сотрудников'), | 67 | 'staff' => Yii::t('app', 'Количество сотрудников'), |
| 73 | 'street' => Yii::t('app', 'Улица'), | 68 | 'street' => Yii::t('app', 'Улица'), |
| 74 | 'house' => Yii::t('app', 'Дом'), | 69 | 'house' => Yii::t('app', 'Дом'), |
| 75 | - 'hide_mail' => Yii::t('app', 'не публиковать Email'), | ||
| 76 | ]; | 70 | ]; |
| 77 | } | 71 | } |
| 78 | } | 72 | } |
common/models/UserInfo.php
| @@ -30,6 +30,7 @@ | @@ -30,6 +30,7 @@ | ||
| 30 | * @property string $geography | 30 | * @property string $geography |
| 31 | * @property integer $salary_currency | 31 | * @property integer $salary_currency |
| 32 | * @property string $email | 32 | * @property string $email |
| 33 | + * @property integer $hide_mail | ||
| 33 | */ | 34 | */ |
| 34 | class UserInfo extends \yii\db\ActiveRecord | 35 | class UserInfo extends \yii\db\ActiveRecord |
| 35 | { | 36 | { |
| @@ -215,6 +216,17 @@ | @@ -215,6 +216,17 @@ | ||
| 215 | ], | 216 | ], |
| 216 | 'email', | 217 | 'email', |
| 217 | ], | 218 | ], |
| 219 | + [ | ||
| 220 | + [ 'hide_mail' ], | ||
| 221 | + 'integer', | ||
| 222 | + 'min' => 0, | ||
| 223 | + 'max' => 1, | ||
| 224 | + ], | ||
| 225 | + [ | ||
| 226 | + ['hide_mail'], | ||
| 227 | + 'default', | ||
| 228 | + 'value' => 0, | ||
| 229 | + ] | ||
| 218 | ]; | 230 | ]; |
| 219 | } | 231 | } |
| 220 | 232 | ||
| @@ -268,6 +280,7 @@ | @@ -268,6 +280,7 @@ | ||
| 268 | 'salary_currency' => Yii::t('app', 'Валюта'), | 280 | 'salary_currency' => Yii::t('app', 'Валюта'), |
| 269 | 'is_customer' => '', | 281 | 'is_customer' => '', |
| 270 | 'is_freelancer' => '', | 282 | 'is_freelancer' => '', |
| 283 | + 'hide_mail' => Yii::t('app', 'не публиковать Email'), | ||
| 271 | 284 | ||
| 272 | ]; | 285 | ]; |
| 273 | } | 286 | } |
console/migrations/m160309_124241_add_vacancy_status.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +class m160309_124241_add_vacancy_status extends Migration | ||
| 6 | +{ | ||
| 7 | + public function up() | ||
| 8 | + { | ||
| 9 | + $this->addColumn('{{%vacancy}}', 'status', $this->integer()->defaultValue(1)); | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + public function down() | ||
| 13 | + { | ||
| 14 | + $this->dropColumn('{{%vacancy}}', 'status'); | ||
| 15 | + } | ||
| 16 | +} |
console/migrations/m160310_080610_hide_email_to_user_info.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +class m160310_080610_hide_email_to_user_info extends Migration | ||
| 6 | +{ | ||
| 7 | + public function up() | ||
| 8 | + { | ||
| 9 | + $this->dropColumn('{{%company_info}}', 'hide_mail'); | ||
| 10 | + $this->addColumn('{{%user_info}}', 'hide_mail', $this->smallInteger()->defaultValue(0)); | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + public function down() | ||
| 14 | + { | ||
| 15 | + $this->dropColumn('{{%user_info}}', 'hide_mail'); | ||
| 16 | + $this->addColumn('{{%company_info}}', 'hide_mail', $this->smallInteger()->defaultValue(0)); | ||
| 17 | + } | ||
| 18 | +} |
frontend/views/accounts/general.php
| @@ -176,7 +176,7 @@ | @@ -176,7 +176,7 @@ | ||
| 176 | ?> | 176 | ?> |
| 177 | </div> | 177 | </div> |
| 178 | <div class="input-blocks hide-mail-check"> | 178 | <div class="input-blocks hide-mail-check"> |
| 179 | - <?= $form->field ($company_info, 'hide_mail', ['options' => ['class' => 'form-group', ], 'template' => "{input}{label}\n{hint}\n{error}"]) | 179 | + <?= $form->field ($user_info, 'hide_mail', ['options' => ['class' => 'form-group', ], 'template' => "{input}{label}\n{hint}\n{error}"]) |
| 180 | ->label ('<span></span>не публиковать Email') | 180 | ->label ('<span></span>не публиковать Email') |
| 181 | ->checkbox (['checked'=>'checked', 'class'=> 'custom-check'], false); | 181 | ->checkbox (['checked'=>'checked', 'class'=> 'custom-check'], false); |
| 182 | ?> | 182 | ?> |