From e8236f4408c40a8a5f9a5c03612382d4ec962721 Mon Sep 17 00:00:00 2001 From: Yarik Date: Tue, 16 Feb 2016 18:01:40 +0200 Subject: [PATCH] test --- common/models/CompanyInfo.php | 14 ++++++++------ common/models/User.php | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- common/models/UserInfo.php | 292 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------- frontend/assets/AdminAsset.php | 2 +- frontend/controllers/AccountsController.php | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- frontend/controllers/PerformerController.php | 12 ++++++++++++ frontend/controllers/SiteController.php | 1 - frontend/views/accounts/_vacancy_form.php | 26 ++++++++++++++++++++++++-- frontend/views/accounts/general.php | 26 +++++++++++++++++--------- frontend/views/accounts/service.php | 48 +++++++++++++++++++++++++++++++++++------------- frontend/views/layouts/performer.php | 10 +++++----- frontend/views/performer/common.php | 2 +- 12 files changed, 586 insertions(+), 173 deletions(-) diff --git a/common/models/CompanyInfo.php b/common/models/CompanyInfo.php index e8f0b7b..33fc139 100755 --- a/common/models/CompanyInfo.php +++ b/common/models/CompanyInfo.php @@ -31,7 +31,9 @@ class CompanyInfo extends \yii\db\ActiveRecord { return [ [['name', 'street', 'house'], 'string'], - [['staff', 'hide_mail'], 'integer'] + [['hide_mail'], 'integer'], + [['staff'], 'default', 'value' => 1], + [['staff'], 'integer', 'min' => 1], ]; } @@ -42,11 +44,11 @@ class CompanyInfo extends \yii\db\ActiveRecord { return [ 'company_info_id' => Yii::t('app', 'Company Info ID'), - 'name' => Yii::t('app', 'Name'), - 'staff' => Yii::t('app', 'Staff'), - 'street' => Yii::t('app', 'Street'), - 'house' => Yii::t('app', 'House'), - 'hide_mail' => Yii::t('app', 'Hide Mail'), + 'name' => Yii::t('app', 'Название компании'), + 'staff' => Yii::t('app', 'Количество сотрудников'), + 'street' => Yii::t('app', 'Улица'), + 'house' => Yii::t('app', 'Дом'), + 'hide_mail' => Yii::t('app', 'не публиковать Email'), ]; } } diff --git a/common/models/User.php b/common/models/User.php index aed4313..37ad656 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -4,7 +4,10 @@ use Yii; use yii\base\NotSupportedException; use yii\behaviors\TimestampBehavior; + use yii\db\ActiveQuery; use yii\db\ActiveRecord; + use yii\rbac\ManagerInterface; + use yii\rbac\Role; use yii\web\IdentityInterface; use developeruz\db_rbac\interfaces\UserRbacInterface; @@ -23,11 +26,6 @@ */ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface { - - /** - * @var array EAuth attributes - */ - const STATUS_DELETED = 0; const STATUS_ACTIVE = 10; @@ -294,11 +292,21 @@ $this->password_reset_token = NULL; } + /** + * Returns name of the User + * + * @return string + */ public function getUserName() { return $this->username; } + /** + * Return array of all User's roles + * + * @return array + */ public function getRoles() { $auth = \Yii::$app->authManager; @@ -306,6 +314,13 @@ return $roles; } + /** + * @param Role[] $roles User roles returned by [ManagerInterface]->[getRolesByUser($id)] + * @param ManagerInterface $auth Auth manager + * @param array $result + * + * @return array + */ protected function getRoleChildrenRecursive($roles, $auth, $result = [ ]) { if(is_array($roles) && !empty( $roles )) { @@ -322,42 +337,74 @@ } } - // public function afterSave ($insert, $changedAttributes) - // { - // parent::afterSave ($insert, $changedAttributes); - // \Yii::$app->options->createOptions($this->id); - // } - + /** + * Return UserInfo for this User + * + * @return \yii\db\ActiveQuery + */ public function getUserInfo() { return $this->hasOne(UserInfo::className(), [ 'user_id' => 'id' ]); } + /** + * Check if User is Performer + * + * currently in development mode + * + * @return bool + */ public function getIsPerformer() { return true; } + /** + * Return CompanyInfo for this User + * + * @return \yii\db\ActiveQuery + */ public function getCompanyInfo() { return $this->hasOne(CompanyInfo::className(), [ 'user_id' => 'id' ]); } + /** + * Return array of User's phones + * + * @return array + */ public function getPhones() { return Fields::getData($this->id, self::className(), 'phone'); } + /** + * Return array of User's site + * + * @return array + */ public function getSite() { return Fields::getData($this->id, self::className(), 'site'); } + /** + * Return full address of User in view like: + * + * {country}, {city}, {street}, {house} + * @return string + */ public function getAddress() { return $this->userInfo->country . ', ' . $this->userInfo->city . ', ' . $this->companyInfo->street . ', ' . $this->companyInfo->house; } + /** + * Return relative interval of time from User registration date until now. + * + * @return string + */ public function getLiveTime() { $now = new \DateTime('now'); @@ -365,17 +412,34 @@ return \Yii::$app->formatter->asRelativeTime($date1->diff($now)); } + /** + * Check if User is Customer + * + * currently in development + * + * @return bool + */ public function getIsCustomer() { return true; } + /** + * Return array of payments types accepted by the user. + * + * @return ActiveQuery + */ public function getPayments() { return $this->hasMany(Payment::className(), [ 'payment_id' => 'payment_id' ]) ->viaTable('user_payment', [ 'user_id' => 'id' ]); } + /** + * Return array of Payment IDs, accepted by the user. + * + * @return integer[] + */ public function getPaymentInput() { return $this->getPayments() @@ -383,27 +447,62 @@ ->column(); } + /** + * Setter which allow to set User's payment ID's for further saving to the DB. + * + * @param integer[] $value + */ public function setPaymentInput($value) { $this->paymentInput = $value; } + /** + * Return array of Specializations in which the User works. + * + * @return ActiveQuery + */ public function getSpecializations() { return $this->hasMany(Specialization::className(), [ 'specialization_id' => 'specialization_id' ]) ->viaTable('user_specialization', [ 'user_id' => 'id' ]); } + /** + * Return array of User's blogs + * + * @return ActiveQuery + */ public function getBlog() { return $this->hasMany(Blog::className(), [ 'user_id' => 'id' ]); } + /** + * Return array of User's jobs. + * + * @return ActiveQuery + */ public function getJobs() { return $this->hasMany(Job::className(), [ 'user_id' => 'id' ]); } + /** + * Return ActiveRecord of current User's place of work. + * + * @return ActiveQuery + */ + public function getCurrentJob() + { + return $this->hasOne(Job::className(), ['user_id' => 'id'])->where(['current' => 1]); + } + + /** + * Return array of User's specialization IDs + * + * @return integer[] + */ public function getSpecializationInput() { return $this->getSpecializations() @@ -411,26 +510,51 @@ ->column(); } + /** + * Setter which allow to set User's specializations for further saving to the DB. + * + * @param integer[] $value + */ public function setSpecializationInput($value) { $this->specializationInput = $value; } + /** + * Return array of User's portfolios. + * + * @return ActiveQuery + */ public function getPortfolios() { return $this->hasMany(Portfolio::className(), [ 'user_id' => 'id' ]); } + /** + * Return array of User's projects. + * + * @return ActiveQuery + */ public function getProjects() { return $this->hasMany(Project::className(), [ 'user_id' => 'id' ]); } + /** + * Return array of company's Team members. + * + * @return ActiveQuery + */ public function getTeams() { return $this->hasMany(Team::className(), [ 'user_id' => 'id' ]); } + /** + * Return array of company's Vacancies. + * + * @return ActiveQuery + */ public function getVacancies() { return $this->hasMany(Vacancy::className(), [ 'user_id' => 'id' ]); diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index db8d8d3..81c4788 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -1,119 +1,191 @@ date('Y'), 'min' => 1950], - [['experience'], 'default', 'value' => date('Y')], - [['rank', 'location'], 'string', 'max' => 50], - [['salary', 'job'], 'string', 'max' => 255], - [['busy', 'member'], 'boolean'], - ]; - } - - - public function getBusyText(){ - return $this->busy ? 'Занят' : 'Свободный'; - } - - - public function getLastVisit(){ - return \Yii::$app->formatter->asRelativeTime(new \DateTime($this->date_visit)); - } - + namespace common\models; + use Yii; /** - * @inheritdoc + * This is the model class for table "user_info". + * @property integer $user_id + * @property integer $view_count + * @property string $busy + * @property string $date_visit + * @property string $experience + * @property string $rank + * @property string $salary + * @property string $job + * @property string $location + * @property string $soft + * @property integer $user_info_id + * @property string $guarantee + * @property integer $contract + * @property integer $estimate + * @property integer $purchase + * @property integer $delivery + * @property double $prepayment + * @property string $about + * @property integer $type */ - public function attributeLabels() + class UserInfo extends \yii\db\ActiveRecord { - return [ - 'user_id' => Yii::t('app', 'User ID'), - 'view_count' => Yii::t('app', 'View Count'), - 'busy' => Yii::t('app', 'Busy'), - 'date_visit' => Yii::t('app', 'Date Visit'), - 'experience' => Yii::t('app', 'Experience'), - 'rank' => Yii::t('app', 'Rank'), - 'salary' => Yii::t('app', 'Salary'), - 'job' => Yii::t('app', 'Job'), - 'location' => Yii::t('app', 'Location'), - 'soft' => Yii::t('app', 'Soft'), - 'user_info_id' => Yii::t('app', 'User Info ID'), - 'guarantee' => Yii::t('app', 'Guarantee'), - 'contract' => Yii::t('app', 'Contract'), - 'estimate' => Yii::t('app', 'Estimate'), - 'purchase' => Yii::t('app', 'Purchase'), - 'delivery' => Yii::t('app', 'Delivery'), - 'prepayment' => Yii::t('app', 'Prepayment'), - 'about' => Yii::t('app', 'About'), - 'type' => Yii::t('app', 'Is Default'), - 'alt_location' => 'Город не в списке', - 'is_customer' => '', - 'is_freelancer' => '', - ]; + // Константа обознащающая физическое лицо + const USER_TYPE_FIZ = 1; + + // Константа обозначающая компанию + const USER_TYPE_COMPANY = 2; + + // Константа обозначающая, что компания/физ.лицо свободно + const USER_STATUS_FREE = 1; + + // Константа обозначающая, что компания/физ.лицо занято + const USER_STATUS_BUSY = 2; + + // Константа обозначающая, что компания/физ.лицо хочет стать членом МФП + const USER_MEMBER_FALSE = 1; + + // Константа обозначающая, что компания/физ.лицо не хочет стать членом МФП + const USER_MEMBER_TRUE = 2; + + /** + * @inheritdoc + */ + public static function tableName() + { + return 'user_info'; + } + + /** + * @inheritdoc + */ + public function rules() + { + return [ + [ + [ + 'contract', + 'estimate', + 'purchase', + 'delivery', + 'is_customer', + 'is_freelancer', + ], + 'integer', + ], + [ + [ 'date_visit' ], + 'safe', + ], + [ + [ + 'soft', + 'guarantee', + 'about', + 'city', + 'country', + 'image', + 'poster', + 'social_vk', + 'social_fb', + 'social_in', + 'social_t', + ], + 'string', + ], + [ + [ 'prepayment' ], + 'number', + ], + [ + [ 'experience' ], + 'integer', + 'max' => date('Y'), + 'min' => 1950, + ], + [ + [ 'experience' ], + 'default', + 'value' => date('Y'), + ], + [ + [ + 'rank', + 'location', + ], + 'string', + 'max' => 50, + ], + [ + [ + 'salary', + 'job', + ], + 'string', + 'max' => 255, + ], + [ + [ + 'busy', + 'member', + ], + 'boolean', + ], + [ + [ 'view_count', 'busy', 'member' ], + 'default', + 'value' => 0, + ], + ]; + } + + public function getBusyText() + { + return $this->busy ? 'Занят' : 'Свободный'; + } + + public function getLastVisit() + { + return \Yii::$app->formatter->asRelativeTime(new \DateTime($this->date_visit)); + } + + /** + * @inheritdoc + */ + public function attributeLabels() + { + return [ + 'user_id' => Yii::t('app', 'User ID'), + 'view_count' => Yii::t('app', 'Количество просмотров'), + 'busy' => Yii::t('app', 'Статус'), + 'date_visit' => Yii::t('app', 'Дата визита'), + 'experience' => Yii::t('app', 'Опыт работы'), + 'rank' => Yii::t('app', 'Rank'), + 'salary' => Yii::t('app', 'Зарплата'), + 'job' => Yii::t('app', 'Место работы'), + 'location' => Yii::t('app', 'Место расположения'), + 'soft' => Yii::t('app', 'Работа с программами'), + 'user_info_id' => Yii::t('app', 'User Info ID'), + 'guarantee' => Yii::t('app', 'Гарантия качества работ'), + 'contract' => Yii::t('app', 'Работа по договору'), + 'estimate' => Yii::t('app', 'Предоставляете смету'), + 'purchase' => Yii::t('app', 'Делаете сами закупку материалов'), + 'delivery' => Yii::t('app', 'Занимаетесь сами доставкой материалов'), + 'prepayment' => Yii::t('app', 'Минимальная предоплата за работы'), + 'about' => Yii::t('app', 'О себе'), + 'type' => Yii::t('app', 'Is Default'), + 'member' => Yii::t('app', 'Членство в МФП'), + 'alt_location' => 'Город не в списке', + 'country' => Yii::t('app', 'Страна'), + 'city' => Yii::t('app', 'Город'), + 'image' => Yii::t('app', 'Аватар'), + 'poster' => Yii::t('app', 'Подложка'), + 'social_vk' => Yii::t('app', 'Vk.com'), + 'social_fb' => Yii::t('app', 'FaceBook.com'), + 'social_in' => Yii::t('app', 'LinkedIn.com'), + 'social_t' => Yii::t('app', 'Twitter.com'), + 'is_customer' => '', + 'is_freelancer' => '', + + ]; + } } -} diff --git a/frontend/assets/AdminAsset.php b/frontend/assets/AdminAsset.php index 338e73d..3b345b9 100755 --- a/frontend/assets/AdminAsset.php +++ b/frontend/assets/AdminAsset.php @@ -21,7 +21,7 @@ class AdminAsset extends AssetBundle 'css/style.css', 'css/art_box.css', '/admin/css/flags32.css', - 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', + //'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', ]; public $js = [ 'js/script.js', diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php index c1af09d..02f3862 100755 --- a/frontend/controllers/AccountsController.php +++ b/frontend/controllers/AccountsController.php @@ -275,6 +275,11 @@ ]); } + /** + * Page of User's image galleries + * + * @return string + */ public function actionGallery() { $searchModel = new GallerySearch(); @@ -286,6 +291,11 @@ ]); } + /** + * Page of User's videos + * + * @return string + */ public function actionGalleryVideo() { @@ -305,7 +315,11 @@ ]); } - + /** + * Page of creating a photo gallery + * + * @return string|\yii\web\Response + */ public function actionGalleryCreate() { $gallery = new Gallery(); @@ -325,6 +339,13 @@ } } + /** + * Page of updating existing photo gallery + * + * @param $id ID of Gallery + * + * @return string|\yii\web\Response + */ public function actionGalleryUpdate($id) { $gallery = Gallery::findOne($id); @@ -344,6 +365,13 @@ } } + /** + * Page of deleting existing photo gallery + * + * @param $id ID of Gallery + * + * @throws \Exception + */ public function actionGalleryDelete($id) { Gallery::findOne($id) @@ -415,11 +443,23 @@ ]); } + /** + * Renders form via ajax, using lastindex. + * + * @param integer $lastindex Last index of form input of current type + * + * @return string + */ public function actionGetForm($lastindex) { return $this->renderAjax('_job_form', [ 'index' => $lastindex + 1 ]); } + /** + * Page of User's portfolio + * + * @return string + */ public function actionPortfolio() { $searchModel = new PortfolioSearch(); @@ -431,6 +471,11 @@ ]); } + /** + * Page of creating User's portfolio records. + * + * @return string|\yii\web\Response + */ public function actionPortfolioCreate() { $portfolio = new Portfolio(); @@ -457,6 +502,14 @@ ]); } + /** + * Page of updating User's portfolio record. + * + * @param integer $id ID of User's portfolio record + * + * @return string|\yii\web\Response + * @throws NotFoundHttpException if record not found + */ public function actionPortfolioUpdate($id) { $user = \Yii::$app->user->identity; @@ -493,6 +546,14 @@ ]); } + /** + * Page of deleting User's portfolio record. + * + * @param integer $id ID of User's portfolio record + * + * @throws NotFoundHttpException + * @throws \Exception if record not found + */ public function actionPortfolioDelete($id) { $user = \Yii::$app->user->identity; @@ -506,6 +567,11 @@ $this->redirect('portfolio'); } + /** + * Page of User's projects. + * + * @return string + */ public function actionProjects() { $searchModel = new ProjectSearch(); @@ -517,6 +583,11 @@ ]); } + /** + * Page of creating User's project. + * + * @return string|\yii\web\Response + */ public function actionProjectsCreate() { $project = new Project(); @@ -585,6 +656,14 @@ ]); } + /** + * Page of updating User's project. + * + * @param integer $id ID of User's project + * + * @return string + * @throws NotFoundHttpException if record not found + */ public function actionProjectsUpdate($id) { $user = \Yii::$app->user->identity; @@ -658,6 +737,14 @@ ]); } + /** + * Page of deleting User's project + * + * @param integer $id ID of User's project + * + * @throws NotFoundHttpException + * @throws \Exception + */ public function actionProjectsDelete($id) { $user = \Yii::$app->user->identity; @@ -671,6 +758,21 @@ $this->redirect('projects'); } + /** + * Page of editting User's service info. Consist of: + * * cost of work; + * * service specializations; + * * work geography; + * * work guarantee; + * * work on contract; + * * providing estimates; + * * purchase of materials; + * * delivery of materials; + * * minimal prepayment; + * * payment types; + * + * @return string + */ public function actionService() { $user = \Yii::$app->user->identity; @@ -678,14 +780,7 @@ if(empty( $user_info )) { $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); } - $specialization = Specialization::find() - ->select([ - 'specialization_name', - 'specialization_id', - ]) - ->indexBy('specialization_id') - ->asArray() - ->column(); + $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); $payment = Payment::find() ->select([ 'name', @@ -714,13 +809,16 @@ return $this->render('service', [ 'user' => $user, 'user_info' => $user_info, - 'specialization' => $specialization, + 'specializations' => $specializations, 'payment' => $payment, ]); } /** - * $user User + * Page of account setting. Consist of: + * * changing password; + * + * @return string */ public function actionSetting() { @@ -757,6 +855,11 @@ return $this->render('setting', [ 'user' => $user ]); } + /** + * Page of company's team + * + * @return string + */ public function actionTeam() { $searchModel = new TeamSearch(); @@ -768,6 +871,11 @@ ]); } + /** + * Page of creating company's team member + * + * @return string|\yii\web\Response + */ public function actionTeamCreate() { $team = new Team(); @@ -799,6 +907,14 @@ } } + /** + * Page of updating company's team member info. + * + * @param integer $id ID of company's team member + * + * @return string|\yii\web\Response + * @throws NotFoundHttpException + */ public function actionTeamUpdate($id) { $user = \Yii::$app->user->identity; @@ -836,6 +952,14 @@ } } + /** + * Page of deleting company's team member. + * + * @param integer $id ID of company's team member + * + * @throws NotFoundHttpException + * @throws \Exception + */ public function actionTeamDelete($id) { $user = \Yii::$app->user->identity; @@ -850,6 +974,11 @@ $this->redirect('team'); } + /** + * Page of company's vacancies + * + * @return string + */ public function actionVacancy() { $searchModel = new VacancySearch(); @@ -861,6 +990,11 @@ ]); } + /** + * Page of creating company's vacancies. + * + * @return string|\yii\web\Response + */ public function actionVacancyCreate() { $vacancy = new Vacancy(); @@ -895,6 +1029,14 @@ ]); } + /** + * Page of updating company's vacancy. + * + * @param integer $id ID of company's vacancy. + * + * @return string|\yii\web\Response + * @throws NotFoundHttpException + */ public function actionVacancyUpdate($id) { $user = \Yii::$app->user->identity; @@ -935,6 +1077,14 @@ ]); } + /** + * Page of deleting company's vacancy. + * + * @param integer $id ID of company's vacancy + * + * @throws NotFoundHttpException + * @throws \Exception + */ public function actionVacancyDelete($id) { $user = \Yii::$app->user->identity; @@ -950,10 +1100,12 @@ } /** - * @param $id + * Used to find model of User and throws exception if not found. * - * @return User - * @throws NotFoundHttpException + * @param integer $id ID of User + * + * @return User if User with particular ID found + * @throws NotFoundHttpException if User with particular ID not found */ protected function findUser($id) { diff --git a/frontend/controllers/PerformerController.php b/frontend/controllers/PerformerController.php index 1afb825..849fae1 100755 --- a/frontend/controllers/PerformerController.php +++ b/frontend/controllers/PerformerController.php @@ -25,6 +25,18 @@ class PerformerController extends Controller public $user; public $defaultAction = 'common'; + public function afterAction($action, $result) + { + if(!empty($action->controller->actionParams['performer_id'])) { + $performer_id = $action->controller->actionParams['performer_id']; + $user = User::findOne($performer_id); + if(!empty($user->userInfo)) { + $user->userInfo->updateCounters(['view_count' => 1]); + } + } + return parent::afterAction($action, $result); + } + /** * @inheritdoc */ diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 36231a8..20e3968 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -104,7 +104,6 @@ class SiteController extends Controller public function actionIndex() { $specializations = Specialization::find()->where(['specialization_pid'=>0])->orderBy('specialization_id')->all(); - return $this->render('index',[ 'specializations' => $specializations, ]); diff --git a/frontend/views/accounts/_vacancy_form.php b/frontend/views/accounts/_vacancy_form.php index 20a6b7a..8e54aa4 100644 --- a/frontend/views/accounts/_vacancy_form.php +++ b/frontend/views/accounts/_vacancy_form.php @@ -7,8 +7,10 @@ use common\models\Vacancy; use common\widgets\FieldEditor; use common\widgets\ImageUploader; + use kartik\select2\Select2; use mihaildev\ckeditor\CKEditor; use yii\helpers\Html; + use yii\web\JsExpression; use yii\widgets\ActiveForm; $this->title = 'Вакансии'; @@ -29,8 +31,28 @@ field($vacancy, 'user_name') ->textInput() ?> -field($vacancy, 'city') - ->textInput() ?> +
+
+ field($vacancy, 'city')->widget(Select2::classname(), [ + 'options' => ['placeholder' => 'Выбор города ...'], + 'pluginOptions' => [ + 'allowClear' => true, + 'minimumInputLength' => 3, + 'ajax' => [ + 'url' => \yii\helpers\Url::to(['site/city']), + 'dataType' => 'json', + 'data' => new JsExpression('function(params) { return {q:params.term}; }') + ], + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), + 'templateResult' => new JsExpression('function(city) { return city.text; }'), + 'templateSelection' => new JsExpression('function (city) { return city.text; }'), + ], + ]); + ?> + +
+
field($vacancy, 'employmentInput') ->checkboxList($employment) ?> diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php index 8c638af..d7728c3 100755 --- a/frontend/views/accounts/general.php +++ b/frontend/views/accounts/general.php @@ -82,7 +82,6 @@
field ($company_info, 'name', ['options' => ['class' => 'form-group company_info']]) - ->label ('Название компании') ->textInput (['class'=> 'custom-input-2']); ?>
@@ -90,7 +89,6 @@
field ($company_info, 'staff', ['options' => ['class' => 'form-group company_info']]) - ->label ('Количество сотрудников') ->textInput (['class'=> 'custom-input-2','type'=>'number']); ?>
@@ -117,10 +115,23 @@
- field ($user_info, 'country') - ->label ('Ваша страна') - ->textInput (['class'=> 'custom-input-2']); - ?> + field($user_info, 'country')->widget(Select2::classname(), [ + 'options' => ['placeholder' => 'Выбор страны ...'], + 'pluginOptions' => [ + 'allowClear' => true, + 'minimumInputLength' => 3, + 'ajax' => [ + 'url' => \yii\helpers\Url::to(['site/country']), + 'dataType' => 'json', + 'data' => new JsExpression('function(params) { return {q:params.term}; }') + ], + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), + 'templateResult' => new JsExpression('function(country) { return country.text; }'), + 'templateSelection' => new JsExpression('function (country) { return country.text; }'), + ], + ]); + ?>
@@ -147,14 +158,12 @@
field ($company_info, 'street', ['options' => ['class' => 'form-group company_info']]) - ->label ('Улица') ->textInput (['class'=> 'custom-input-2']); ?>
field ($company_info, 'house', ['options' => ['class' => 'form-group company_info']]) - ->label ('Дом') ->textInput (['class'=> 'custom-input-2']); ?>
@@ -163,7 +172,6 @@
field ($user, 'email') - ->label ('Email') ->textInput (['class'=> 'custom-input-2']); ?>
diff --git a/frontend/views/accounts/service.php b/frontend/views/accounts/service.php index 64f9f2b..5ae9371 100755 --- a/frontend/views/accounts/service.php +++ b/frontend/views/accounts/service.php @@ -5,8 +5,10 @@ * @var string[] $specialization * @var string[] $payment */ + use common\models\Specialization; use common\models\User; use common\models\UserInfo; + use yii\helpers\ArrayHelper; use yii\helpers\Html; use yii\widgets\ActiveForm; @@ -40,11 +42,31 @@
-
- field($user, 'specializationInput') - ->label('Специализация услуг') - ->checkboxList($specialization) ?> -
+
@@ -67,8 +89,8 @@ field($user_info, 'contract', [ 'options' => [ 'class' => 'form-inline' ] ]) ->label('Работа по договору') ->radioList([ - 0 => 'Да', - 1 => 'Нет', + 1 => 'Да', + 0 => 'Нет', ], [ 'item' => function($index, $label, $name, $checked, $value) { @@ -89,8 +111,8 @@ field($user_info, 'estimate', [ 'options' => [ 'class' => 'form-inline' ] ]) ->label('Предоставляете смету') ->radioList([ - 0 => 'Да', - 1 => 'Нет', + 1 => 'Да', + 0 => 'Нет', ], [ 'item' => function($index, $label, $name, $checked, $value) { $return = '
'; @@ -110,8 +132,8 @@ field($user_info, 'purchase', [ 'options' => [ 'class' => 'form-inline' ] ]) ->label('Делаете сами закупку материалов') ->radioList([ - 0 => 'Да', - 1 => 'Нет', + 1 => 'Да', + 0 => 'Нет', ], [ 'item' => function($index, $label, $name, $checked, $value) { $return = '
'; @@ -130,8 +152,8 @@ field($user_info, 'delivery', [ 'options' => [ 'class' => 'form-inline' ] ]) ->label('Занимаетесь сами доставкой материалов') ->radioList([ - 0 => 'Да', - 1 => 'Нет', + 1 => 'Да', + 0 => 'Нет', ], [ 'item' => function($index, $label, $name, $checked, $value) { $return = '
'; diff --git a/frontend/views/layouts/performer.php b/frontend/views/layouts/performer.php index 2acc428..b6104de 100755 --- a/frontend/views/layouts/performer.php +++ b/frontend/views/layouts/performer.php @@ -101,16 +101,16 @@ $this->beginContent('@app/views/layouts/main.php');
  • - params['user']->userInfo->social_fb],['target'=>'_blank'])?> + params['user']->userInfo->social_fb}",['target'=>'_blank'])?>
  • - params['user']->userInfo->social_t],['target'=>'_blank'])?> + params['user']->userInfo->social_t}", ['target'=>'_blank'])?>
  • - params['user']->userInfo->social_in],['target'=>'_blank'])?> + params['user']->userInfo->social_in}",['target'=>'_blank'])?>
  • - params['user']->userInfo->social_vk],['target'=>'_blank'])?> + params['user']->userInfo->social_vk}",['target'=>'_blank'])?>
@@ -124,7 +124,7 @@ $this->beginContent('@app/views/layouts/main.php');
  • Звание в МФП:
    params['user']->userInfo->rank?>
  • Стоимость работ:
    params['user']->userInfo->salary?>
  • params['user']->payments,'name'))?>
  • -
  • Текущее место работы:
    params['user']->userInfo->job?>
  • +
  • Текущее место работы:
    params['user']->currentJob->name?>
  • diff --git a/frontend/views/performer/common.php b/frontend/views/performer/common.php index 4fb3e2e..c8b460e 100755 --- a/frontend/views/performer/common.php +++ b/frontend/views/performer/common.php @@ -145,7 +145,7 @@ $this->title = 'My Yii Application';
    - Сайт +
    -- libgit2 0.21.4