diff --git a/common/models/Fields.php b/common/models/Fields.php index 243ed4b..e7083aa 100755 --- a/common/models/Fields.php +++ b/common/models/Fields.php @@ -68,7 +68,7 @@ class Fields extends \yii\db\ActiveRecord public static function saveFieldData($post,$table_id,$table_name, $language){ - self::deleteAll(['table_id'=>$table_id, 'table_name'=>$table_name, 'language' => $language]); + self::deleteAll(['table_id'=>$table_id, 'table_name'=>$table_name, 'language' => $language, 'field_type' => array_keys($post)]); if($post){ diff --git a/common/widgets/FieldEditor.php b/common/widgets/FieldEditor.php index 6fe7066..34824c5 100755 --- a/common/widgets/FieldEditor.php +++ b/common/widgets/FieldEditor.php @@ -33,13 +33,13 @@ class FieldEditor extends Widget protected function findModel() { - if (($model = Fields::find()->where([ 'table_id'=>$this->item_id, 'table_name'=>$this->model, 'field_type'=>$this->template, 'language'=>$this->language, ])->all())) { + return $model; } else { diff --git a/common/widgets/views/courses_field.php b/common/widgets/views/courses_field.php new file mode 100644 index 0000000..8c1aa78 --- /dev/null +++ b/common/widgets/views/courses_field.php @@ -0,0 +1,58 @@ + +
+ + Пройденные курсы, тренинги + +

Добавить поле

+ + + + + 'form-group', + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, + ]) ?> + + + + + + + + +
+ + + diff --git a/common/widgets/views/development_field.php b/common/widgets/views/development_field.php new file mode 100644 index 0000000..7d4d642 --- /dev/null +++ b/common/widgets/views/development_field.php @@ -0,0 +1,58 @@ + +
+ + Собственные разработки, патенты + +

Добавить поле

+ + + + + 'form-group', + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, + ]) ?> + + + + + + + + +
+ + + diff --git a/common/widgets/views/education_field.php b/common/widgets/views/education_field.php index 446b16a..1a48418 100755 --- a/common/widgets/views/education_field.php +++ b/common/widgets/views/education_field.php @@ -1,49 +1,60 @@
Образование -

Добавить поле

+

Добавить поле

- - - 'form-group','id'=>isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ])?> - - - - - - - + ?> + 'form-group', + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, + ]) ?> + + + + + + +
diff --git a/common/widgets/views/soft_field.php b/common/widgets/views/soft_field.php new file mode 100644 index 0000000..0d97168 --- /dev/null +++ b/common/widgets/views/soft_field.php @@ -0,0 +1,56 @@ + +
+ + Работа с программами + +

Добавить поле

+ + + + + 'form-group', + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, + ]) ?> + + + + + + + +
+ + + diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php index 7b7a9b4..c7d1d82 100755 --- a/frontend/controllers/AccountsController.php +++ b/frontend/controllers/AccountsController.php @@ -233,7 +233,11 @@ public function actionAddSkills() { - return $this->render('add-skills'); + $user = \Yii::$app->user->identity; + if(!empty(\Yii::$app->request->post())) { + Fields::saveFieldData(Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(), 'ru'); + } + return $this->render('add-skills', ['user' => $user]); } public function actionDescription() diff --git a/frontend/views/accounts/add-skills.php b/frontend/views/accounts/add-skills.php index b6bb1c4..846cd44 100755 --- a/frontend/views/accounts/add-skills.php +++ b/frontend/views/accounts/add-skills.php @@ -1,6 +1,11 @@ - + 'soft', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', + ] +); ?> + 'education', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', + ] +); ?> + 'development', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', + ] +); ?> + 'courses', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', + ] +); ?> + end(); ?> \ No newline at end of file diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php index 3babd7c..6aa0193 100755 --- a/frontend/views/accounts/general.php +++ b/frontend/views/accounts/general.php @@ -14,41 +14,22 @@ use \common\widgets\MultiLangForm; $this->title = 'Учетные данные'; - $this->params['breadcrumbs'][] = $this->title; + $this->params[ 'breadcrumbs' ][] = $this->title; ?>
title ?>
- - - - - - - - - - - - - - - - - - - - - - +
- field ($user, 'isPerformer', ['template' => "{input}\n{label}\n{error}"]) - ->label ('Я - исполнитель') - ->checkbox (['class'=> 'custom-check disabled admin-check', 'disabled'=>'disabled'], false); - ?> + field($user, 'isPerformer', [ 'template' => "{input}\n{label}\n{error}" ]) + ->label('Я - исполнитель') + ->checkbox([ + 'class' => 'custom-check disabled admin-check', + 'disabled' => 'disabled', + ], false); ?>
Обязательно должны быть указаны специализации услуг, что бы вы попали в рейтинг исполнителей
@@ -57,10 +38,12 @@
- field ($user, 'isCustomer', ['template' => "{input}\n{label}\n{error}"]) - ->label ('Я - заказчик') - ->checkbox (['class'=> 'custom-check disabled admin-check', 'disabled'=>'disabled'], false); - ?> + field($user, 'isCustomer', [ 'template' => "{input}\n{label}\n{error}" ]) + ->label('Я - заказчик') + ->checkbox([ + 'class' => 'custom-check disabled admin-check', + 'disabled' => 'disabled', + ], false); ?>
Обязательно должны быть созданы проекты вами, что бы вы попали в рейтинг исполнителей
@@ -71,105 +54,97 @@
Кто вы:
- field ($user, 'type') - ->label (false) - ->radioList ( - [1 => 'Частное лицо', 2 => 'Компания'], - [ - 'item' => function($index, $label, $name, $checked, $value) { - $return = ''; + field($user, 'type') + ->label(false) + ->radioList([ + 1 => 'Частное лицо', + 2 => 'Компания', + ], [ + 'item' => function($index, $label, $name, $checked, $value) { + $return = ''; - return $return; - } - ] - ); - ?> + return $return; + }, + ]); ?>
- field ($company_info, 'name', ['options' => ['class' => 'form-group company_info']]) - ->label ('Название компании') - ->textInput (); - ?> - field ($company_info, 'staff', ['options' => ['class' => 'form-group company_info']]) - ->label ('Количество сотрудников') - ->input ('number'); - ?> - Контакты представителя
'; - ?> + field($company_info, 'name', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Название компании') + ->textInput(); ?> + field($company_info, 'staff', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Количество сотрудников') + ->input('number'); ?> + Контакты представителя
'; ?>
- field ($user, 'firstname') - ->label ('Имя') - ->textInput (); - ?> + field($user, 'firstname') + ->label('Имя') + ->textInput(); ?>
- field ($user, 'lastname') - ->label ('Фамилия') - ->textInput (); - ?> - field ($user_info, 'country') - ->label ('Ваша страна') - ->textInput (); - ?> - field ($user_info, 'city') - ->label ('Ваш город') - ->textInput (); - ?> - field ($company_info, 'street', ['options' => ['class' => 'form-group company_info']]) - ->label ('Улица') - ->textInput (); - ?> - field ($company_info, 'house', ['options' => ['class' => 'form-group company_info']]) - ->label ('Дом') - ->textInput (); - ?> - field ($user, 'email') - ->label ('Email') - ->textInput (['disabled' => 'disabled']); - ?> - field ($company_info, 'hide_mail', ['options' => ['class' => 'form-group company_info'], 'template' => "{input}{label}\n{hint}\n{error}"]) - ->label ('Не публиковать Email') - ->checkbox (['checked'=>'checked'], false); - ?> - field ($user_info, 'busy') - ->label ('Статус') - ->radioList ([0 => 'Свободен', 1 => 'Занят']); - ?> - field ($user_info, 'member') - ->label ('Членство в МФП') - ->hint ('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.') - ->radioList ([0 => 'Не хочу', 1 => 'Хочу стать']); - ?> - $user_info, - 'field'=>'image', - 'width'=>100, - 'height'=>100, - 'multi'=>false, - 'gallery' =>$user_info->image, - 'name' => 'Загрузить аватар' - ]); - ?> - $user_info, - 'field'=>'poster', - 'width'=>1200, - 'height'=>600, - 'multi'=>false, - 'gallery' =>$user_info->poster, - 'name' => 'Загрузить постер' - ]); - ?> - 'btn btn-primary']); - $form->end (); - ?> + field($user, 'lastname') + ->label('Фамилия') + ->textInput(); ?> + field($user_info, 'country') + ->label('Ваша страна') + ->textInput(); ?> + field($user_info, 'city') + ->label('Ваш город') + ->textInput(); ?> + field($company_info, 'street', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Улица') + ->textInput(); ?> + field($company_info, 'house', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Дом') + ->textInput(); ?> + field($user, 'email') + ->label('Email') + ->textInput([ 'disabled' => 'disabled' ]); ?> + field($company_info, 'hide_mail', [ + 'options' => [ 'class' => 'form-group company_info' ], + 'template' => "{input}{label}\n{hint}\n{error}", + ]) + ->label('Не публиковать Email') + ->checkbox([ 'checked' => 'checked' ], false); ?> + field($user_info, 'busy') + ->label('Статус') + ->radioList([ + 0 => 'Свободен', + 1 => 'Занят', + ]); ?> + field($user_info, 'member') + ->label('Членство в МФП') + ->hint('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.') + ->radioList([ + 0 => 'Не хочу', + 1 => 'Хочу стать', + ]); ?> + $user_info, + 'field' => 'image', + 'width' => 100, + 'height' => 100, + 'multi' => false, + 'gallery' => $user_info->image, + 'name' => 'Загрузить аватар', + ]); ?> + $user_info, + 'field' => 'poster', + 'width' => 1200, + 'height' => 600, + 'multi' => false, + 'gallery' => $user_info->poster, + 'name' => 'Загрузить постер', + ]); ?> + 'btn btn-primary' ]); + $form->end(); ?>
-- libgit2 0.21.4