]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Merge branch 'develop' into mmm
authormarina <m.zozirova@gmail.com>
Mon, 13 Jan 2025 06:56:11 +0000 (09:56 +0300)
committermarina <m.zozirova@gmail.com>
Mon, 13 Jan 2025 06:56:11 +0000 (09:56 +0300)
# Conflicts:
# erp24/records/TimetableFactModel.php

1  2 
erp24/actions/timetable/StartShiftStepTwoAction.php

index 693d5ad2e6212b4c3ca52bda97beb2780c0e9f67,80246ad02b1471df170150658c0c8725d8c9e761..fc2b6975f25be3cef44192ac76c55e571ab8b276
@@@ -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', [