From: marina Date: Mon, 13 Jan 2025 06:56:11 +0000 (+0300) Subject: Merge branch 'develop' into mmm X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=7b48f27e3bd280b5276f208ec61a9070cfb4abca;p=erp24_rep%2Fyii-erp24%2F.git Merge branch 'develop' into mmm # Conflicts: # erp24/records/TimetableFactModel.php --- 7b48f27e3bd280b5276f208ec61a9070cfb4abca diff --cc erp24/actions/timetable/StartShiftStepTwoAction.php index 693d5ad2,80246ad0..fc2b6975 --- a/erp24/actions/timetable/StartShiftStepTwoAction.php +++ b/erp24/actions/timetable/StartShiftStepTwoAction.php @@@ -165,10 -165,19 +165,22 @@@ class StartShiftStepTwoAction extends A 'device' => $device, 'planSlots' => $planSlots, ]); + } else { + if ($this->controller->request->isAjax) { + $errors = $model->errors; + if (!$twoMinutes) $errors['two_minutes'] = ['После открытия смены не прошло 2 минуты!']; + $response = [ + 'success' => false, + 'errors' => implode(', ', array_merge(...array_values($errors))), + 'model' => $model, + ]; + Yii::$app->response->format = Response::FORMAT_JSON; + return $response; + } } +// else { +// var_dump($model->errors);die(); +// } } return $this->controller->render('/timetable/start_shift_step_two.php', [