diff --git a/mirzaev/skillparts/system/config/web.php.example b/mirzaev/skillparts/system/config/web.php.example index cfe88cc..2c56453 100644 --- a/mirzaev/skillparts/system/config/web.php.example +++ b/mirzaev/skillparts/system/config/web.php.example @@ -111,7 +111,8 @@ $config = [ 'invoices/' => 'invoice/index', 'invoices//' => 'invoice/', 'verify/send' => 'verify/send', - 'verify/' => 'verify/index' + 'verify/' => 'verify/index', + 'terminals/' => 'terminal/' ], ], diff --git a/mirzaev/skillparts/system/models/Account.php b/mirzaev/skillparts/system/models/Account.php index 86a6b34..a4c7435 100644 --- a/mirzaev/skillparts/system/models/Account.php +++ b/mirzaev/skillparts/system/models/Account.php @@ -967,4 +967,14 @@ class Account extends Document implements IdentityInterface, PartnerInterface return false; } + + /** + * Проверка на то, что аккаунт имеет минимальный доступ + * + * @param static|null $account Аккаунт + */ + public static function isMinimalAuthorized($account = null): bool + { + return self::isModer($account) || self::isAdmin($account); + } } diff --git a/mirzaev/skillparts/system/models/AccountForm.php b/mirzaev/skillparts/system/models/AccountForm.php index 77205f5..c2e0c26 100644 --- a/mirzaev/skillparts/system/models/AccountForm.php +++ b/mirzaev/skillparts/system/models/AccountForm.php @@ -103,6 +103,16 @@ class AccountForm extends Model ]; } + public function attributeLabels() + { + return [ + 'mail' => 'Почта', + 'pswd' => 'Пароль', + 'auto' => '', + 'pols' => 'Политика конфедециальности' + ]; + } + public function validateMail($attribute, $params) { if (!$this->hasErrors()) { diff --git a/mirzaev/skillparts/system/models/Product.php b/mirzaev/skillparts/system/models/Product.php index 5ff6b96..0ed56c7 100644 --- a/mirzaev/skillparts/system/models/Product.php +++ b/mirzaev/skillparts/system/models/Product.php @@ -47,10 +47,19 @@ class Product extends Document */ const SCENARIO_WRITE = 'write'; + /** + * Аккаунт + * + * Используется для управления администратором от лица пользователя + */ + public Account|string|null $account = null; + /** * Файл .excel для импорта товаров */ public Excel|string|array|null $file_excel = null; + public Excel|string|array|null $file_excel_1 = null; + public Excel|string|array|null $file_excel_2 = null; /** * Изображение для импорта @@ -108,8 +117,11 @@ class Product extends Document 'time' => 'Срок доставки (time)', 'bffr' => 'Буфер', 'file_excel' => 'Документ (file_excel)', + 'file_excel_1' => 'Документ (file_excel)', + 'file_excel_2' => 'Документ (file_excel)', 'file_image' => 'Изображение (file_image)', - 'group' => 'Группа (group)' + 'group' => 'Группа (group)', + 'account' => 'Аккаунт' ] ); } @@ -366,6 +378,9 @@ class Product extends Document // Поиск всех артикулов (каталожных номеров) $products = explode(',', $doc['catn'], 300); + // Поиск количества товаров + $amount = $doc['amnt'] ?? 1; + foreach ($products as $_product) { // Перебор продуктов (если catn перечислены через запятую) @@ -385,7 +400,6 @@ class Product extends Document if (($_product = $product->validateForUniqueness()) instanceof static) { // Найден документ с такими параметрами - // Инициализация буфера с параметрами загружаемого товара $vars = $product->getAttributes(); diff --git a/mirzaev/skillparts/system/views/profile/supplies.php b/mirzaev/skillparts/system/views/profile/supplies.php index aee3e9d..9447ba6 100644 --- a/mirzaev/skillparts/system/views/profile/supplies.php +++ b/mirzaev/skillparts/system/views/profile/supplies.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use app\models\Account; use yii; use yii\bootstrap\ActiveForm; @@ -51,7 +52,32 @@ $panel ?? $panel = 'profile_panel_supplies_input_import'; ]); ?> - field($model, 'file_excel', ['enableLabel' => false])->fileInput(['multiple' => true, 'class' => 'mb-2', 'onChange' => 'page_profile_supplies_import_excel(this.parentElement.parentElement, \'profile_panel_supplies_input_import\')']) ?> + + field($model, 'account', ['options' => ['class' => "mb-4 col-4"]])->input('text', ['placeholder' => yii::$app->user->identity->_key]); ?> + + +
+
1.
+
+ Тест импорта.xlsx +
+ + +
+ +
+
2.
+
+ field($model, 'file_excel_1', ['enableLabel' => false])->fileInput(['multiple' => true, 'onChange' => 'page_profile_supplies_import_excel(this.parentElement.parentElement, \'profile_panel_supplies_input_import\')']) ?> +
+
+ +
+
3.
+
+ field($model, 'file_excel_2', ['enableLabel' => false])->fileInput(['multiple' => true, 'onChange' => 'page_profile_supplies_import_excel(this.parentElement.parentElement, \'profile_panel_supplies_input_import\')']) ?> +
+
errorSummary($model, ['header' => 'В документе были допущены ошибки:' /*, 'footer' => 'Исправьте их и попробуйте снова'*/]); ?> @@ -70,4 +96,4 @@ $panel ?? $panel = 'profile_panel_supplies_input_import'; || yii::$app->user->identity->type === 'moderator') ) : ?> - \ No newline at end of file + diff --git a/mirzaev/skillparts/system/web/img/logos/1с.png b/mirzaev/skillparts/system/web/img/logos/1с.png new file mode 100644 index 0000000..db835bd Binary files /dev/null and b/mirzaev/skillparts/system/web/img/logos/1с.png differ diff --git a/mirzaev/skillparts/system/web/img/logos/h50px/compressed/1с.png b/mirzaev/skillparts/system/web/img/logos/h50px/compressed/1с.png new file mode 100644 index 0000000..5e11134 Binary files /dev/null and b/mirzaev/skillparts/system/web/img/logos/h50px/compressed/1с.png differ