From bd52f703439de1f7f3dfda7f1f97963e014e1e85 Mon Sep 17 00:00:00 2001 From: 0x1026 <69076992+0x1026@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:17:20 +0100 Subject: [PATCH] refactor: update UI text to Spanish localization and remove unused color class in tailwind configuration --- .../Controllers/Admin/WorkOrderController.php | 17 +- app/src/app/Views/Admin/Contract/Create.php | 26 +-- app/src/app/Views/Admin/Contract/Edit.php | 29 ++-- app/src/app/Views/Admin/Contracts.php | 92 +++++----- app/src/app/Views/Admin/Dashboard.php | 32 ++-- app/src/app/Views/Admin/Element/Create.php | 36 ++-- app/src/app/Views/Admin/Element/Edit.php | 41 ++--- .../app/Views/Admin/ElementType/Create.php | 19 +- app/src/app/Views/Admin/ElementType/Edit.php | 26 +-- app/src/app/Views/Admin/ElementTypes.php | 46 ++--- app/src/app/Views/Admin/Elements.php | 44 +++-- app/src/app/Views/Admin/Inventory.php | 2 +- app/src/app/Views/Admin/TaskType/Create.php | 11 +- app/src/app/Views/Admin/TaskType/Edit.php | 13 +- app/src/app/Views/Admin/TaskTypes.php | 26 ++- app/src/app/Views/Admin/TreeType/Create.php | 28 ++- app/src/app/Views/Admin/TreeType/Edit.php | 30 ++-- app/src/app/Views/Admin/TreeTypes.php | 34 ++-- app/src/app/Views/Admin/User/Create.php | 34 +--- app/src/app/Views/Admin/User/Edit.php | 49 ++---- app/src/app/Views/Admin/Users.php | 46 +++-- app/src/app/Views/Admin/WorkOrder/Create.php | 163 +++++++----------- app/src/app/Views/Admin/WorkOrders.php | 60 +++---- app/src/app/Views/Admin/Zone/Create.php | 23 +-- app/src/app/Views/Admin/Zone/Edit.php | 24 +-- app/src/app/Views/Admin/Zones.php | 28 ++- app/src/public/assets/js/app.js | 24 +-- app/src/public/assets/js/tailwind.js | 1 - 28 files changed, 424 insertions(+), 580 deletions(-) diff --git a/app/src/app/Controllers/Admin/WorkOrderController.php b/app/src/app/Controllers/Admin/WorkOrderController.php index 7fd01bc..b6888ea 100644 --- a/app/src/app/Controllers/Admin/WorkOrderController.php +++ b/app/src/app/Controllers/Admin/WorkOrderController.php @@ -5,10 +5,8 @@ use App\Core\Session; use App\Core\View; use App\Models\WorkOrder; -use App\Models\Task; use App\Models\TaskType; use App\Models\Zone; -use App\Models\Contract; use App\Models\User; @@ -23,17 +21,24 @@ public function index($queryParams) 'layout' => 'Admin/AdminLayout', 'data' => ['work_orders' => $work_orders], ]); - Session::remove('success'); } public function create($queryParams) { - $work_order = WorkOrder::findAll(); + $task_types = array_map(function ($task_type) { + return $task_type->name; + }, TaskType::findAll()); + $users = array_map(function ($user) { + return $user->name . ' ' . $user->surname; + }, User::findAll(['role' => 1])); + $zones = array_map(function ($zone) { + return $zone->name; + }, Zone::findAll(['name' => 'not null'])); View::render([ 'view' => 'Admin/WorkOrder/Create', 'title' => 'Nueva Orden de Trabajo', 'layout' => 'Admin/AdminLayout', - 'data' => ['work_order' => $work_order], + 'data' => ['task_types' => $task_types, 'users' => $users, 'zones' => $zones], ]); } @@ -50,7 +55,7 @@ public function store($postData) else Session::set('error', 'La orden de trabajo no se pudo crear'); - header('Location: /work-orders'); + header('Location: /admin/work-orders'); exit; } diff --git a/app/src/app/Views/Admin/Contract/Create.php b/app/src/app/Views/Admin/Contract/Create.php index 1243416..b1ae515 100644 --- a/app/src/app/Views/Admin/Contract/Create.php +++ b/app/src/app/Views/Admin/Contract/Create.php @@ -3,62 +3,64 @@ - Return to contracts + Volver a contratos
Name | -Description | -Actions | +
---|