From: marina Date: Fri, 9 Aug 2024 02:20:28 +0000 (+0300) Subject: ERP-102 Приёмник для эксель файла (корректировка) X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e12cff8ec6e778ecc9c0bb52a90ac245a461c73c;p=erp24_rep%2Fyii-erp24%2F.git ERP-102 Приёмник для эксель файла (корректировка) --- diff --git a/erp24/actions/motivation/IndexAction.php b/erp24/actions/motivation/IndexAction.php index ee91113d..e9d8ddfd 100644 --- a/erp24/actions/motivation/IndexAction.php +++ b/erp24/actions/motivation/IndexAction.php @@ -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('
', ['Вы не можете вносить корректировки']); - } + $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('
', $data['errors']); } else {