diff --git a/common/models/Team.php b/common/models/Team.php
index abaac71..48ac79e 100644
--- a/common/models/Team.php
+++ b/common/models/Team.php
@@ -34,11 +34,6 @@
return 'team';
}
-
-
-
-
-
/**
* @inheritdoc
*/
diff --git a/common/models/TeamSearch.php b/common/models/TeamSearch.php
index b4dff71..b577a08 100644
--- a/common/models/TeamSearch.php
+++ b/common/models/TeamSearch.php
@@ -170,7 +170,7 @@
0,
]);
}
-
+
$query->andFilterWhere([
'like',
'firstname',
@@ -188,8 +188,8 @@
])
->andFilterWhere([
'like',
- 'position',
- $this->position,
+ 'LOWER(position)',
+ mb_strtolower($this->position),
])
->andFilterWhere([
'like',
diff --git a/common/widgets/ImageUploader.php b/common/widgets/ImageUploader.php
index 8b751ef..c9cad75 100755
--- a/common/widgets/ImageUploader.php
+++ b/common/widgets/ImageUploader.php
@@ -21,6 +21,7 @@ class ImageUploader extends Widget
public $gallery;
public $size;
public $name = 'Add file...';
+ public $remover = false;
public function init(){
@@ -40,7 +41,8 @@ class ImageUploader extends Widget
'height' => $this->height,
'width' => $this->width,
'multi' => $this->multi,
- 'name' => $this->name
+ 'name' => $this->name,
+ 'remover' => $this->remover
]);
}
diff --git a/common/widgets/views/image_sizer.php b/common/widgets/views/image_sizer.php
index 332fda6..66909a3 100755
--- a/common/widgets/views/image_sizer.php
+++ b/common/widgets/views/image_sizer.php
@@ -21,6 +21,13 @@ $id = $model::tableName().'_id';
+ $field) {
+ ?>
+

+
= $model->$field ? Html::img($model->$field): '' ?>
@@ -34,67 +41,93 @@ $id = $model::tableName().'_id';
diff --git a/console/migrations/m160208_101449_team.php b/console/migrations/m160208_101449_team.php
index fbf7e62..f3b81d1 100644
--- a/console/migrations/m160208_101449_team.php
+++ b/console/migrations/m160208_101449_team.php
@@ -16,7 +16,7 @@ class m160208_101449_team extends Migration
'middlename' => $this->string(255),
'link' => $this->string(255),
'position' => $this->string(255)->notNull(),
- 'department_id' => $this->integer()->notNull(),
+ 'department_id' => $this->integer(),
'experience_from' => $this->integer(),
'date_add' => $this->timestamp()->notNull(),
'user_add_id' => $this->integer(),
diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php
index 4832b15..119bc63 100755
--- a/frontend/controllers/AccountsController.php
+++ b/frontend/controllers/AccountsController.php
@@ -952,9 +952,14 @@
->column();
$post = \Yii::$app->request->post();
if($team->load($post) && $team->save()) {
- return $this->redirect([
- 'team',
+ return $this->render('_team_form', [
+ 'team' => $team,
+ 'department' => $department,
+ 'country' => $country,
]);
+// return $this->redirect([
+// 'team',
+// ]);
} else {
return $this->render('_team_form', [
'team' => $team,
diff --git a/frontend/views/accounts/_team_form.php b/frontend/views/accounts/_team_form.php
index a1b22ef..69b72f5 100644
--- a/frontend/views/accounts/_team_form.php
+++ b/frontend/views/accounts/_team_form.php
@@ -8,9 +8,7 @@
use common\models\Team;
use common\widgets\ImageUploader;
use kartik\select2\Select2;
- use mihaildev\ckeditor\CKEditor;
use yii\helpers\Html;
- use yii\jui\DatePicker;
use yii\web\JsExpression;
use yii\widgets\ActiveForm;
@@ -20,13 +18,9 @@
= $this->title ?>
Редактирование:
-
+