From c422bade05f132ae292668d9858a3f17407cbc76 Mon Sep 17 00:00:00 2001 From: wahyu Date: Wed, 27 Sep 2023 14:15:42 +0700 Subject: [PATCH] fix work area restriction --- app/Http/Controllers/PresenceController.php | 28 ++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/PresenceController.php b/app/Http/Controllers/PresenceController.php index f5309ac..49b9da1 100644 --- a/app/Http/Controllers/PresenceController.php +++ b/app/Http/Controllers/PresenceController.php @@ -345,6 +345,13 @@ class PresenceController extends Controller "status_assign" => true ); } + } else { + // bypass work area restriction + $temp[]=array( + "activity_id" => null, + "boundary" => true, + "status_assign" => true + ); } } // assign and not in boundary @@ -359,12 +366,21 @@ class PresenceController extends Controller } } else{ - // not assign - $temp[]=array( - "activity_id" => null, - "boundary" => false, - "status_assign" => false - ); + if ($user->status_boundary) { + // bypass work area restriction + $temp[]=array( + "activity_id" => null, + "boundary" => true, + "status_assign" => true + ); + } else { + // not assign + $temp[]=array( + "activity_id" => null, + "boundary" => false, + "status_assign" => false + ); + } } return $temp; }