From a1e78d8d373ccec610196ba1f34eee81ef639be5 Mon Sep 17 00:00:00 2001 From: marina Date: Fri, 9 Aug 2024 11:12:27 +0300 Subject: [PATCH] =?utf8?q?=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=BD?= =?utf8?q?=D0=B0=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B9=20=D1=81?= =?utf8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D1=84=D0=B0=D0=BA?= =?utf8?q?=D1=82=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=87=D0=B8=D1=81?= =?utf8?q?=D1=82=D0=BA=D0=B8=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B5=D0=B9=20?= =?utf8?q?=D0=BF=D0=BE=D0=B4=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8?= =?utf8?q?=D0=BA=D0=BE=D0=B2=20=D0=B8=D0=B7=20=D0=B2=D0=BE=D1=80=D0=BA=20?= =?utf8?q?=D0=B1=D0=BE=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/TimetableFactController.php | 19 +++++++++++++++++++ erp24/views/timetable-fact/index.php | 10 ++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/erp24/controllers/TimetableFactController.php b/erp24/controllers/TimetableFactController.php index a2341a93..133edfb3 100644 --- a/erp24/controllers/TimetableFactController.php +++ b/erp24/controllers/TimetableFactController.php @@ -452,4 +452,23 @@ class TimetableFactController extends Controller 'action' => $action ]); } + + /** + * 09-08-2024 + * Удаление дублей фактов при нескольких кликах в ворк боте + */ + + public function actionCleanShiftsWorkers() + { + $deletedRows = TimetableFactModel::deleteAll([ + 'admin_group_id' => AdminGroup::GROUP_WORKERS, + 'is_opening' => false, + 'is_close' => true, + 'date_end' => null, + 'time_end' => null, + 'status' => AdminCheckin::TYPE_START, + ]); + + return $this->redirect(Yii::$app->request->referrer); + } } diff --git a/erp24/views/timetable-fact/index.php b/erp24/views/timetable-fact/index.php index 498dd9f2..8932883f 100644 --- a/erp24/views/timetable-fact/index.php +++ b/erp24/views/timetable-fact/index.php @@ -5,7 +5,7 @@ use kartik\select2\Select2; use yii\widgets\ActiveForm; use yii\helpers\Html; use yii\grid\ActionColumn; -use yii\grid\GridView; +use yii\grid\GridView;use yii_app\records\AdminCheckin;use yii_app\records\AdminGroup;use yii_app\records\TimetableFactModel; /** @var yii\web\View $this */ /** @var yii\data\ActiveDataProvider $dataProvider */ @@ -94,10 +94,16 @@ $this->params['breadcrumbs'][] = $this->title;
field($model, 'autoclosed')->checkbox([0 => 'unchecked', 1 => 'checked'], [])->label(false) ?>
'btn btn-secondary btn-sm'])?>
-
'btn btn-link btn-sm'])?>
+
'btn btn-link btn-sm'])?>
+ +
+
user->id)->group_id, array(\yii_app\records\AdminGroup::GROUP_IT, \yii_app\records\AdminGroup::GROUP_OPERATIONAL_DIRECTOR)) ? + Html::a('Почистить смены подработчиков', '/timetable-fact/clean-shifts-workers', ['class' => 'btn btn-link btn-sm']) : '' ?>
+
+