From 0e15540d2c94caf096f93d293abb7a39c91d0fa1 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 13 Jan 2025 14:45:51 +0300 Subject: [PATCH] =?utf8?q?[ERP-279]=20=D1=83=D0=BD=D0=B8=D0=BA=D0=B0=D0=BB?= =?utf8?q?=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BC=D0=BE=D0=B1=D0=B8=D0=BB=D1=8C?= =?utf8?q?=D0=BD=D1=8B=D0=B9,=20=D1=83=D0=B1=D0=BE=D1=80=D0=BA=D0=B0=20?= =?utf8?q?=D0=BE=D0=BA=D1=80=D0=B0=D0=BC=D0=BB=D1=8F=D1=8E=D1=89=D0=B8?= =?utf8?q?=D1=85=20=D0=BF=D1=80=D0=BE=D0=B1=D0=B5=D0=BB=D0=BE=D0=B2=20?= =?utf8?q?=D0=B2=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/actions/grade/AdminUpdateAction.php | 1 + erp24/records/Admin.php | 1 + 2 files changed, 2 insertions(+) diff --git a/erp24/actions/grade/AdminUpdateAction.php b/erp24/actions/grade/AdminUpdateAction.php index c4db7f36..428b67ba 100644 --- a/erp24/actions/grade/AdminUpdateAction.php +++ b/erp24/actions/grade/AdminUpdateAction.php @@ -24,6 +24,7 @@ class AdminUpdateAction extends Action if (Yii::$app->user->can("updateAdminSettings", ['id' => $model->id])) { if (Yii::$app->request->isPost) { $attributes = Yii::$app->request->post()['Admin']; + $attributes['name'] = trim($attributes['name']); foreach (['parent_admin_id', 'org_id'] as $fieldName) { if (empty($attributes[$fieldName])) { $attributes[$fieldName] = 0; diff --git a/erp24/records/Admin.php b/erp24/records/Admin.php index a9cab097..dc292360 100755 --- a/erp24/records/Admin.php +++ b/erp24/records/Admin.php @@ -119,6 +119,7 @@ class Admin extends ActiveRecord implements IdentityInterface [['login_user'], 'string', 'max' => 29], [['mobile', 'photo', 'snils'], 'string', 'max' => 25], ['mobile', PhoneValidator::class], + ['mobile', 'unique'], [['description', 'adress_fakt'], 'string', 'max' => 255], [['avatarka'], 'string', 'max' => 125], [['passport_nomer'], 'string', 'max' => 12], -- 2.39.5