]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-102 Приёмник для эксель файла (корректировка)
authormarina <m.zozirova@gmail.com>
Fri, 9 Aug 2024 02:20:28 +0000 (05:20 +0300)
committermarina <m.zozirova@gmail.com>
Fri, 9 Aug 2024 02:20:28 +0000 (05:20 +0300)
erp24/actions/motivation/IndexAction.php

index ee91113d133f890b6fc491ce08ffc59b0ac6d09b..e9d8ddfde62fe5a9d3180a327cd374a0b4a1a67f 100644 (file)
@@ -30,16 +30,12 @@ class IndexAction extends Action
         if (Yii::$app->request->isPost) {
             $file = UploadedFile::getInstanceByName('myfile');
             if ($file) {
-                $adjustment = (boolean) Yii::$app->request->post('adjustment');
-                if ($adjustment && in_array(Admin::findOne(Yii::$app->user->id)->group_id, Motivation::getAdjustmentEditors())) {
-                    $fileName = $adjustment ? '/template_adjustment_temp.xlsx' : '/template_plan_temp.xlsx';
-                    $path1 = Yii::getAlias('@uploads') . $fileName;
-                    $file->saveAs($path1);
-
-                    $data = MotivationService::uploadTemplatePlan($path1, !$adjustment);
-                } else {
-                    return implode('<br>', ['Вы не можете вносить корректировки']);
-                }
+                $adjustment = (boolean)Yii::$app->request->post('adjustment');
+                $fileName = $adjustment ? '/template_adjustment_temp.xlsx' : '/template_plan_temp.xlsx';
+                $path1 = Yii::getAlias('@uploads') . $fileName;
+                $file->saveAs($path1);
+
+                $data = MotivationService::uploadTemplatePlan($path1, !$adjustment);
 
                 return implode('<br>', $data['errors']);
             } else {