# Conflicts:
# erp24/records/TimetableFactModel.php
'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', [