From 717b268f76c8c684a715dc8373902436244f3939 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Wed, 23 Apr 2025 11:45:01 +0330 Subject: [PATCH] add permission --- .../V3/Dashboard/SafetyAndPrivacyController.php | 4 ++-- .../Cartables/SafetyAndPrivacyTableService.php | 4 ++-- .../SafetyAndPrivacy/OperatorCartableReport.blade.php | 10 ---------- routes/v3.php | 11 ++++++----- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacyController.php b/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacyController.php index 89d9324c..06f215fd 100644 --- a/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacyController.php +++ b/app/Http/Controllers/V3/Dashboard/SafetyAndPrivacyController.php @@ -212,7 +212,7 @@ class SafetyAndPrivacyController extends Controller $status_id = SafetyAndPrivacyStatus::CONFIRM->value; $safetyAndPrivacy->update([ - 'status' => SafetyAndPrivacyStatus::CONFIRM->value, + 'status' => $status_id, 'status_fa' => SafetyAndPrivacyStatus::name($status_id), ]); @@ -239,7 +239,7 @@ class SafetyAndPrivacyController extends Controller $safetyAndPrivacy->update([ 'is_finished' => 1, 'final_description' => $request->final_description, - 'status' => SafetyAndPrivacyStatus::PENDING->value, + 'status' => $status_id, 'status_fa' => SafetyAndPrivacyStatus::name($status_id), ]); diff --git a/app/Services/Cartables/SafetyAndPrivacyTableService.php b/app/Services/Cartables/SafetyAndPrivacyTableService.php index 40f70cc4..4e651ef4 100644 --- a/app/Services/Cartables/SafetyAndPrivacyTableService.php +++ b/app/Services/Cartables/SafetyAndPrivacyTableService.php @@ -22,8 +22,8 @@ class SafetyAndPrivacyTableService { $user = auth()->user(); - $fields = ['id','lat','lon', 'province_fa', 'edare_shahri_name', - 'recognize_picture','action_picture','created_at','step', 'final_description', + $fields = [ + 'id','lat','lon', 'recognize_picture','action_picture','created_at','step', 'final_description', 'info_fa', 'activity_date_time', 'action_picture_document_upload_date', 'judiciary_document_upload_date', 'step_fa', 'axis_type_id', 'axis_type_name', 'action_date', 'is_finished', 'status_fa', 'supervisor_description' ]; diff --git a/resources/views/v3/Reports/SafetyAndPrivacy/OperatorCartableReport.blade.php b/resources/views/v3/Reports/SafetyAndPrivacy/OperatorCartableReport.blade.php index c1065678..043a3f4d 100644 --- a/resources/views/v3/Reports/SafetyAndPrivacy/OperatorCartableReport.blade.php +++ b/resources/views/v3/Reports/SafetyAndPrivacy/OperatorCartableReport.blade.php @@ -42,14 +42,6 @@ style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;"> کد یکتا - - استان - - - اداره - مورد مشاهده شده @@ -85,8 +77,6 @@ @foreach ($data as $item) {{ $item['id'] ?? '-' }} - {{ $item['province_fa'] ?? '-' }} - {{ $item['edare_shahri_name'] ?? '-' }} {{ $item['info_fa'] ?? '-' }} {{ $item['axis_type_name'] ?? '-' }} {{ $item['created_at'] ? verta($item['created_at'])->format('Y/n/j H:i:s') : '-' }} diff --git a/routes/v3.php b/routes/v3.php index 9bb08728..7d6b2e8f 100644 --- a/routes/v3.php +++ b/routes/v3.php @@ -338,14 +338,15 @@ Route::prefix('safety_and_privacy') ->controller(SafetyAndPrivacyController::class) ->group(function () { Route::get('/operator_index', 'operatorIndex')->name('operatorIndex') - ->middleware('permission:show-safety-and-privacy-operator-cartable|show-safety-and-privacy-operator-cartable-province|show-safety-and-privacy-operator-cartable-edarate-shahri'); + ->middleware('permission:show-safety-and-privacy-operator-cartable-edarate-shahri'); Route::get('/supervisor_index', 'supervisorIndex')->name('supervisorIndex') - ->middleware('permission:show-safety-and-privacy-operator-cartable|show-safety-and-privacy-operator-cartable-province|show-safety-and-privacy-operator-cartable-edarate-shahri'); + ->middleware('permission:show-safety-and-privacy-operator-cartable|show-safety-and-privacy-operator-cartable-province'); Route::get('/operator_excel_report', 'operatorExcelReport')->name('operatorExcelReport') - ->middleware('permission:show-safety-and-privacy-operator-cartable|show-safety-and-privacy-operator-cartable-province|show-safety-and-privacy-operator-cartable-edarate-shahri'); - Route::post('/first_step_store', 'firstStepStore')->name('firstStepStore') - ->middleware(['validate-store-access', 'permission:add-safety-and-privacy']); + ->middleware('permission:show-safety-and-privacy-operator-cartable-edarate-shahri'); + Route::get('/supervisor_excel_report', 'supervisorExcelReport')->name('supervisorExcelReport') + ->middleware('permission:show-safety-and-privacy-operator-cartable|show-safety-and-privacy-operator-cartable-province'); + Route::post('/first_step_store', 'firstStepStore')->name('firstStepStore')->middleware(['validate-store-access', 'permission:add-safety-and-privacy']); Route::get('/sub_items', 'subItems')->name('subItems'); Route::get('/map', 'map')->name('map'); Route::post('/second_step_store/{safetyAndPrivacy}', 'secondStepStore')->name('secondStepStore')->middleware(['validate-store-access','permission:add-safety-and-privacy']);