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
-

Create new contract

+

Creando nuevo contrato

- +
- +
- +
- +
- +
- +
- +
+ +
\ No newline at end of file diff --git a/app/src/app/Views/Admin/Contract/Edit.php b/app/src/app/Views/Admin/Contract/Edit.php index dd6a9bf..4ac0bbf 100644 --- a/app/src/app/Views/Admin/Contract/Edit.php +++ b/app/src/app/Views/Admin/Contract/Edit.php @@ -3,12 +3,12 @@ - Return to Contracts + Volver a contratos
-

Edit Contract

+

Editando contrato

@@ -16,47 +16,48 @@ class="space-y-6"> class="hidden bg-red-100 border border-red-400 text-red700 px-4 py-3 rounded relative mb-6">
- +
- +
- +
- +
- +
- +
- - +
+ +
- \ No newline at end of file + diff --git a/app/src/app/Views/Admin/Contracts.php b/app/src/app/Views/Admin/Contracts.php index d369784..4a03e17 100644 --- a/app/src/app/Views/Admin/Contracts.php +++ b/app/src/app/Views/Admin/Contracts.php @@ -1,70 +1,66 @@
- New contract + Nuevo contrato
-
- +
+
+ - - - - - - - - + + + + + + + - - + + - - - - - - -
NameStart DateEnd DateInvoice ProposedInvoice AgreedInvoice PaidCreated AtActionsNombreFecha de inicioFecha de finFactura propuestaFactura aceptadaFactura pagadaAcciones
+
name; ?> + + start_date)); ?> - start_date; ?> + + end_date)); ?> - end_date; ?> + + invoice_proposed; ?> € - invoice_proposed; ?> + + invoice_agreed; ?> € - invoice_agreed; ?> + + invoice_paid; ?> € - invoice_paid; ?> - - getCreatedAt(); ?> - - + + + + + + + + + + + +
-
\ No newline at end of file + diff --git a/app/src/app/Views/Admin/Dashboard.php b/app/src/app/Views/Admin/Dashboard.php index 5eb48c9..0b6ff07 100644 --- a/app/src/app/Views/Admin/Dashboard.php +++ b/app/src/app/Views/Admin/Dashboard.php @@ -1,10 +1,10 @@
-

Dashboard

-

Welcome back, - - to your dashboard. Here's a quick overview of your data. +

Tablero

+

¡Le damos nuevamente la bienvenida, + , + a su tablero! A continuación te ofrecemos una rápida visión general de tus datos.

@@ -14,30 +14,30 @@
-

Users

-

-

+0% since last week

+

Usuarios

+

+

+0% que el anterior periodo

-

Contracts

-

-

+0% since week

+

Contratos

+

+

+0% que el anterior periodo

-

Elements

-

-

+0% since last week

+

Elementos

+

+

+0% que el anterior periodo

-

Work Orders

-

-

+0% since week

+

Órdenes de trabajo

+

+

+0% que el anterior periodo

diff --git a/app/src/app/Views/Admin/Element/Create.php b/app/src/app/Views/Admin/Element/Create.php index 17306c0..7d7eb42 100644 --- a/app/src/app/Views/Admin/Element/Create.php +++ b/app/src/app/Views/Admin/Element/Create.php @@ -1,68 +1,60 @@
- - Return to Elements + Volver a elementos
-

Create new Element

+

Creando nuevo elemento

- -
- +
-
- +
- -
- +
-
- +
- - -
-
\ No newline at end of file + diff --git a/app/src/app/Views/Admin/Element/Edit.php b/app/src/app/Views/Admin/Element/Edit.php index 6935d64..1f39de7 100644 --- a/app/src/app/Views/Admin/Element/Edit.php +++ b/app/src/app/Views/Admin/Element/Edit.php @@ -1,19 +1,27 @@
- - Return to Elements + Volver a elementos
-

Edit Element

+

Editando elemento

-
- + + +
+
+
-
- +
- -
- +
- -
- - -
-
-
\ No newline at end of file + diff --git a/app/src/app/Views/Admin/ElementType/Create.php b/app/src/app/Views/Admin/ElementType/Create.php index f98af12..d1c7d82 100644 --- a/app/src/app/Views/Admin/ElementType/Create.php +++ b/app/src/app/Views/Admin/ElementType/Create.php @@ -1,39 +1,32 @@
- - Return to Element-Types + Volver a tipos de elemento
-

Create new Element Type

+

Creando nuevo tipo de elemento

- -
- +
- -
- +
- -
-
\ No newline at end of file + diff --git a/app/src/app/Views/Admin/ElementType/Edit.php b/app/src/app/Views/Admin/ElementType/Edit.php index b4d2e71..1b0506a 100644 --- a/app/src/app/Views/Admin/ElementType/Edit.php +++ b/app/src/app/Views/Admin/ElementType/Edit.php @@ -1,40 +1,32 @@
- - Return to Elements + Volver a tipos de elemento
-

Edit Element Type

-
Editando tipo de elemento + - -
- - Nombre +
- -
- +
- - -
-
\ No newline at end of file + diff --git a/app/src/app/Views/Admin/ElementTypes.php b/app/src/app/Views/Admin/ElementTypes.php index 3a6876e..7d8f608 100644 --- a/app/src/app/Views/Admin/ElementTypes.php +++ b/app/src/app/Views/Admin/ElementTypes.php @@ -1,41 +1,43 @@
- New element type + Nuevo tipo de elemento
-
- - - - - - +
+
NameDescriptionActions
+ + + + + + - - - + + - -
NombreDescripciónRequiere tipo de árbolAcciones
- name; ?> + +
+ name; ?> + + description; ?> - description; ?> + + requires_tree_type ? "Sí" : "No"; ?> - - + + - - + - New element + Nuevo elemento -
- +
+
- - - - - + + + + + - - + - - -
Element typeContractZoneTree typeActionsTipo de elementoContratoZonaTipo de árbolAcciones
+
elementType()->name; ?> - - + + contract()->name; ?> - zone()->name ?? 'Not on a predefined zone'; ?> + + zone()->name ?? 'No se encuentra en una zona predefinida'; ?> - treeType()->species ?? 'Not a tree'; ?> + + treeType()->species ?? '--'; ?> - + + class="text-lime-600 hover:scale-110" title="Edit"> - - + - - Return to Task Types + Volver a tipos de tarea
-

Create new TaskType

+

Creando nuevo tipo de tarea

-
- +
-
diff --git a/app/src/app/Views/Admin/TaskType/Edit.php b/app/src/app/Views/Admin/TaskType/Edit.php index 64bb4b2..27fe260 100644 --- a/app/src/app/Views/Admin/TaskType/Edit.php +++ b/app/src/app/Views/Admin/TaskType/Edit.php @@ -1,30 +1,25 @@
-

Edit TaskType

+

Editando tipo de tarea

- -
- +
- -
diff --git a/app/src/app/Views/Admin/TaskTypes.php b/app/src/app/Views/Admin/TaskTypes.php index e9b1005..70e5304 100644 --- a/app/src/app/Views/Admin/TaskTypes.php +++ b/app/src/app/Views/Admin/TaskTypes.php @@ -1,37 +1,35 @@ -
- +
+
- - + + - - +
NameActionsNombreAcciones
+
name; ?> - - - + + + class="text-lime-600 hover:scale-110" title="Editar"> - + onclick="return confirm('¿Desea eliminar el tipo de tarea name); ?>');" + class="text-red-600 hover:scale-110" title="Eliminar"> - - Return to Tree Types + Volver a tipos de árbol
-

Create new Tree Type

+

Creando nuevo tipo de árbol

- -
- +
- -
- +
- -
- +
- - +
+ +
\ No newline at end of file diff --git a/app/src/app/Views/Admin/TreeType/Edit.php b/app/src/app/Views/Admin/TreeType/Edit.php index ee841dc..b416960 100644 --- a/app/src/app/Views/Admin/TreeType/Edit.php +++ b/app/src/app/Views/Admin/TreeType/Edit.php @@ -1,47 +1,39 @@
-

Edit Tree Type

+

Editando tipo de árbol

- -
- +
- -
- +
- -
- +
- - - - +
+ +
\ No newline at end of file diff --git a/app/src/app/Views/Admin/TreeTypes.php b/app/src/app/Views/Admin/TreeTypes.php index 429bf2d..ab8dd0b 100644 --- a/app/src/app/Views/Admin/TreeTypes.php +++ b/app/src/app/Views/Admin/TreeTypes.php @@ -1,45 +1,43 @@ -
- +
+
- - - - + + + + - - + - -
FamilyGenusSpeciesActionsFamiliaGéneroEspecieAcciones
+
family; ?> - - + + genus; ?> + species; ?> - + + class="text-lime-600 hover:scale-110" title="Editar"> - + onclick="return confirm('¿Desea eliminar el tipo de árbol species); ?>');" + class="text-red-600 hover:scale-110" title="Eliminar"> - - + - Return to Zones + Volver a usuarios
-

Create new Zone

-
- - +

Creando nuevo usuario

+
- +
- -
- +
- - -
- - -
- -
diff --git a/app/src/app/Views/Admin/User/Edit.php b/app/src/app/Views/Admin/User/Edit.php index 3a1d62f..b2a609c 100644 --- a/app/src/app/Views/Admin/User/Edit.php +++ b/app/src/app/Views/Admin/User/Edit.php @@ -1,72 +1,57 @@
-

Edit User

+

Editando usuario

- -
- +
- -
- +
- -
- +
- -
- +
- -
- +
- -
- - Contraseña +
- -
-
\ No newline at end of file +
diff --git a/app/src/app/Views/Admin/Users.php b/app/src/app/Views/Admin/Users.php index e3d7c58..0a95fa5 100644 --- a/app/src/app/Views/Admin/Users.php +++ b/app/src/app/Views/Admin/Users.php @@ -1,53 +1,47 @@ -
- +
+
- - - - - - + + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - - -
CompanyNameDNIEmailRole NameActionsNombreCompañíaCorreo electrónicoFunciónAcciones
- company); ?> - +
name . ' ' . $user->surname); ?> + + company); ?> - dni); ?> - + email); ?> - role); ?> + + role_name($user->role)); ?> - + + class="text-lime-600 hover:scale-110" title="Editar"> - + onclick="return confirm('¿Desea eliminar el usuario name . ' ' . $user->surname); ?>?');" + class="text-red-600 hover:scale-110" title="Eliminar"> tasks() as $task) { - foreach ($task->zones() as $zone) { - $zones[] = $zone->name; - } - foreach ($task->taskTypes() as $task_type) { - $tasks[] = $task_type->name; - } - foreach ($task->workers() as $worker) { - $workers[] = $worker->name; - } - } -} - -$zones = array_unique($zones); -$tasks = array_unique($tasks); -$workers = array_unique($workers); -?> -
-

Create new Work Order

+

Crear nueva órden de trabajo

-
- - -
- -
- +
- -
ZonesTasquesWorkersNotesAction
- - - - - - - - - -
+
+ + + + + + + + + + + + + + + + + + + +
ZonasTareasOperariosNotasAcciones
+ + + + + + + + + +
+
- - - -
- \ No newline at end of file + + + \ No newline at end of file diff --git a/app/src/app/Views/Admin/WorkOrders.php b/app/src/app/Views/Admin/WorkOrders.php index 4e515a0..b2b9f7f 100644 --- a/app/src/app/Views/Admin/WorkOrders.php +++ b/app/src/app/Views/Admin/WorkOrders.php @@ -1,44 +1,40 @@ -
- +
+
- - - - - - - + + + + + + - - tasks() as $task) { ?> - - - - + + - - - - - - - - - `; } diff --git a/app/src/public/assets/js/tailwind.js b/app/src/public/assets/js/tailwind.js index 72451a3..1c7bed0 100644 --- a/app/src/public/assets/js/tailwind.js +++ b/app/src/public/assets/js/tailwind.js @@ -5,7 +5,6 @@ tailwind.config = { darkGreen: "#008037", lightGreen: "#7FD959", black: "#222222", - red: "#FF0000", }, fontFamily: { sans: ["Poppins", "sans-serif"],
ContracteDataZonesTascaOperarisNotesActionsFechaZonasTareasOperariosNotasAcciones
- contract()->name; ?> - - getCreatedAt(); ?> - + + tasks() as $task) { ?> +
+ getCreatedAt(); ?> + zones() as $zone) - $zoneNames[] = $zone->predefined()->name ?? 'Not on a predefined zone'; + $zoneNames[] = $zone->name ?? 'No se encuentra en una zona predefinida'; echo implode(', ', $zoneNames); ?> + taskType()->name; ?> + users() as $user) @@ -46,23 +42,21 @@ echo implode(', ', $users); ?> notes; ?> + + notes; ?> - - + + - - + - - Return to Zones + Volver a zonas
-

Create new Zone

+

Creando nueva zona

- -
- +
- -
- +
- - -
+ +
-->
diff --git a/app/src/app/Views/Admin/Zone/Edit.php b/app/src/app/Views/Admin/Zone/Edit.php index 96ea491..5ac2be7 100644 --- a/app/src/app/Views/Admin/Zone/Edit.php +++ b/app/src/app/Views/Admin/Zone/Edit.php @@ -1,42 +1,34 @@
-

Edit Zone

+

Editando zona

- -
- +
- -
- +
- -
+ +
-->
-
\ No newline at end of file +
diff --git a/app/src/app/Views/Admin/Zones.php b/app/src/app/Views/Admin/Zones.php index b6f46b2..798f837 100644 --- a/app/src/app/Views/Admin/Zones.php +++ b/app/src/app/Views/Admin/Zones.php @@ -1,37 +1,35 @@ - \ No newline at end of file + diff --git a/app/src/public/assets/js/app.js b/app/src/public/assets/js/app.js index fce150c..0774651 100644 --- a/app/src/public/assets/js/app.js +++ b/app/src/public/assets/js/app.js @@ -275,34 +275,38 @@ document.getElementById("addRow").addEventListener("click", addRow); function addRow(event) { event.preventDefault(); - const table = document - .getElementById("workOrderTable") - .getElementsByTagName("tbody")[0]; + const table = document.getElementById("workOrderTable"); const newRow = table.insertRow(); rowIndex++; newRow.innerHTML = ` -
+ + + + - + +