diff --git a/common/models/TeamSearch.php b/common/models/TeamSearch.php
index 0af2c4c..6d480d1 100644
--- a/common/models/TeamSearch.php
+++ b/common/models/TeamSearch.php
@@ -202,31 +202,31 @@
])
->andFilterWhere([
'like',
- 'country_id',
- $this->country_id,
+ 'LOWER(country_id)',
+ mb_strtolower($this->country_id),
])
->andFilterWhere([
'or',
[
'like',
- 'lastname',
- $this->user,
+ 'LOWER(lastname)',
+ mb_strtolower($this->user),
],
[
'like',
- 'firstname',
- $this->user,
+ 'LOWER(firstname)',
+ mb_strtolower($this->user),
],
[
'like',
- 'middlename',
- $this->user,
+ 'LOWER(middlename)',
+ mb_strtolower($this->user),
],
])
->andFilterWhere([
'like',
- 'department.name',
- $this->department,
+ 'LOWER(department.name)',
+ mb_strtolower($this->department),
]);
return $dataProvider;
diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php
index 8a20518..7cacbb5 100755
--- a/frontend/controllers/AccountsController.php
+++ b/frontend/controllers/AccountsController.php
@@ -183,7 +183,7 @@
$user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]);
}
if(!empty( \Yii::$app->request->post() )) {
- if(!empty(Yii::$app->request->post('Fields'))) {
+ if(!empty( Yii::$app->request->post('Fields') )) {
Fields::saveFieldData(Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(), 'ru');
}
$user_info->load(\Yii::$app->request->post());
@@ -519,7 +519,7 @@
$portfolio->save();
$portfolio->unlinkAll('specializations', true);
foreach($portfolio->specializationInput as $one_specialization) {
- $portfolio->link('specializations', Specialization::findOne($one_specialization));
+ $portfolio->link('specializations', Specialization::findOne($one_specialization));
}
return $this->redirect('portfolio');
}
@@ -843,10 +843,19 @@
{
$searchModel = new TeamSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
+ $departments = Department::find()
+ ->select([
+ 'name',
+ 'department_id',
+ ])
+ ->indexBy('department_id')
+ ->asArray()
+ ->column();
return $this->render('team', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
+ 'departments' => $departments,
]);
}
@@ -873,8 +882,7 @@
$post = \Yii::$app->request->post();
if($team->load($post) && $team->save()) {
return $this->redirect([
- 'team-update',
- 'id' => $team->team_id,
+ 'team',
]);
} else {
return $this->render('_team_form', [
@@ -918,8 +926,7 @@
$post = \Yii::$app->request->post();
if($team->load($post) && $team->save()) {
return $this->redirect([
- 'team-update',
- 'id' => $team->team_id,
+ 'team',
]);
} else {
return $this->render('_team_form', [
@@ -991,7 +998,7 @@
if(!empty( $post )) {
$vacancy->load($post);
$vacancy->validate();
- if(empty($vacancy->specializationInput)) {
+ if(empty( $vacancy->specializationInput )) {
$vacancy->addError('specializationInput', 'Cannot be blank');
} else {
$vacancy->clearErrors('specializationInput');
@@ -1055,7 +1062,7 @@
if(!empty( $post )) {
$vacancy->load($post);
$vacancy->validate();
- if(empty($vacancy->specializationInput)) {
+ if(empty( $vacancy->specializationInput )) {
$vacancy->addError('specializationInput', 'Cannot be blank');
} else {
$vacancy->clearErrors('specializationInput');
diff --git a/frontend/views/accounts/_portfolio_form.php b/frontend/views/accounts/_portfolio_form.php
index eaf7c8c..7fd0873 100644
--- a/frontend/views/accounts/_portfolio_form.php
+++ b/frontend/views/accounts/_portfolio_form.php
@@ -5,15 +5,15 @@
*/
use common\models\Option;
use common\models\Portfolio;
-use common\models\Specialization;
-use common\widgets\ImageUploader;
+ use common\models\Specialization;
+ use common\widgets\ImageUploader;
use mihaildev\ckeditor\CKEditor;
-use yii\helpers\ArrayHelper;
-use yii\helpers\Html;
+ use yii\helpers\ArrayHelper;
+ use yii\helpers\Html;
use yii\widgets\ActiveForm;
use \common\widgets\MultiLangForm;
-use kartik\select2\Select2;
-use yii\web\JsExpression;
+ use kartik\select2\Select2;
+ use yii\web\JsExpression;
$this->title = 'Портфолио';
$this->params[ 'breadcrumbs' ][] = $this->title;
@@ -24,7 +24,7 @@ use yii\web\JsExpression;
$form = ActiveForm::begin();
?>
- = !empty($portfolio->date_add) ? "Дата создания: $portfolio->date_add" :""?>
+ = !empty( $portfolio->date_add ) ? "Дата создания: $portfolio->date_add" : "" ?>
@@ -32,14 +32,14 @@ use yii\web\JsExpression;
@@ -62,13 +62,13 @@ use yii\web\JsExpression;
= $form->field($portfolio, "specializationInput[{$child_second->specialization_id}]", [
'template' => '{input}{label}{hint}{error}',
])
- ->label('
' . $child_second->specialization_name)
- ->checkbox([
- 'value' => $child_second->specialization_id,
- 'label' => NULL,
- 'uncheck' => NULL,
- 'class' => 'custom-check',
- ], false) ?>
+ ->label('
' . $child_second->specialization_name)
+ ->checkbox([
+ 'value' => $child_second->specialization_id,
+ 'label' => NULL,
+ 'uncheck' => NULL,
+ 'class' => 'custom-check',
+ ], false) ?>
@@ -85,65 +85,60 @@ use yii\web\JsExpression;
-
- =
- $form->field($portfolio, 'city')->widget(Select2::classname(), [
- 'options' => ['class' => 'Выбор города ...'],
- '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; }'),
- ],
- ]);
- ?>
+ = $form->field($portfolio, 'city')
+ ->widget(Select2::classname(), [
+ 'options' => [ 'class' => 'Выбор города ...' ],
+ '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; }'),
+ ],
+ ]); ?>
- = $form->field ($portfolio, 'street', ['options' => ['class' => 'form-group company_info']])
- ->label ('Улица')
- ->textInput (['class'=> 'custom-input-2']);
- ?>
+ = $form->field($portfolio, 'street', [ 'options' => [ 'class' => 'form-group company_info' ] ])
+ ->label('Улица')
+ ->textInput([ 'class' => 'custom-input-2' ]); ?>
- = $form->field ($portfolio, 'house', ['options' => ['class' => 'form-group company_info']])
- ->label ('Дом')
- ->textInput (['class'=> 'custom-input-2']);
- ?>
+ = $form->field($portfolio, 'house', [ 'options' => [ 'class' => 'form-group company_info' ] ])
+ ->label('Дом')
+ ->textInput([ 'class' => 'custom-input-2' ]); ?>
-
@@ -151,21 +146,21 @@ use yii\web\JsExpression;
- = Html::submitButton($portfolio->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
+ = Html::submitButton($portfolio->isNewRecord ? 'Добавить' : 'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?>
isNewRecord) {
- echo Html::a('Удалить', [
- 'accounts/portfolio-delete',
- 'id' => $portfolio->portfolio_id,
- ], [
- 'title' => 'Удалить',
- 'aria-label' => 'Удалить',
- 'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
- 'data-method' => 'post',
- 'data-pjax' => 0,
- ]);
- }
+ if(!$portfolio->isNewRecord) {
+ echo Html::a('Удалить', [
+ 'accounts/portfolio-delete',
+ 'id' => $portfolio->portfolio_id,
+ ], [
+ 'title' => 'Удалить',
+ 'aria-label' => 'Удалить',
+ 'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
+ 'data-method' => 'post',
+ 'data-pjax' => 0,
+ ]);
+ }
?>
@@ -178,7 +173,10 @@ use yii\web\JsExpression;
$form->end();
?>
diff --git a/frontend/views/accounts/team.php b/frontend/views/accounts/team.php
index 292423a..642f140 100644
--- a/frontend/views/accounts/team.php
+++ b/frontend/views/accounts/team.php
@@ -2,6 +2,7 @@
/**
* @var TeamSearch $searchModel
* @var ActiveDataProvider $dataProvider
+ * @var string[] $departments
*/
use common\models\TeamSearch;
use yii\data\ActiveDataProvider;
@@ -19,7 +20,7 @@
= GridView::widget([
- 'options' => ['class'=>'style admin-all-pages-wr'],
+ 'options' => [ 'class' => 'style admin-all-pages-wr' ],
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
@@ -44,7 +45,9 @@
'attribute' => 'department',
'value' => 'department.name',
'label' => 'Отдел компании',
+ 'filter' => $departments,
],
+ 'position',
[
'attribute' => 'experience_from',
'value' => function($model, $key, $index, $column) {
@@ -53,40 +56,43 @@
'label' => 'Опыт, лет',
'filter' => "
-
+
-
+
",
],
- 'position',
'country_id',
[
- 'class' => 'yii\grid\ActionColumn',
- 'buttons' => [
+ 'class' => 'yii\grid\ActionColumn',
+ 'buttons' => [
'update' => function($url, $model, $key) {
return Html::a('

', [
- 'team-update', 'id' => $model->team_id
- ],[
- 'title' => 'Редактировать',
+ 'team-update',
+ 'id' => $model->team_id,
+ ], [
+ 'title' => 'Редактировать',
]);
},
'delete' => function($url, $model, $key) {
- return Html::a('

', ['team-delete', 'id' => $model->team_id], [
- 'title' => 'Удалить',
- 'aria-label' => 'Удалить',
+ return Html::a('

', [
+ 'team-delete',
+ 'id' => $model->team_id,
+ ], [
+ 'title' => 'Удалить',
+ 'aria-label' => 'Удалить',
'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
- 'data-method' => 'post',
- 'data-pjax' => '0',
+ 'data-method' => 'post',
+ 'data-pjax' => '0',
]);
},
],
- 'template' => '{update} {delete}'
+ 'template' => '{update} {delete}',
],
],
]); ?>
diff --git a/frontend/web/js/fieldWidget.js b/frontend/web/js/fieldWidget.js
index fb16b34..83d2067 100755
--- a/frontend/web/js/fieldWidget.js
+++ b/frontend/web/js/fieldWidget.js
@@ -1,4 +1,5 @@
$(function(){
+
$(document).on('click', '.delete-field-item', function(){
var container = $(this).parents('.field_list').first();
$(this).parent('.form-group').remove();
--
libgit2 0.21.4