From 40439b532fe589965873a1cb68d01dcf952ffe55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Tue, 3 Jun 2025 13:41:52 +0200 Subject: [PATCH] =?UTF-8?q?arreglada=20la=20comprobaci=C3=B3n=20de=20p?= =?UTF-8?q?=C3=A1ginas=20y=20tirada=20cuando=20se=20a=C3=B1ade=20un=20pres?= =?UTF-8?q?upuesto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci4/app/Language/es/Presupuestos.php | 1 + ci4/app/Models/Presupuestos/PresupuestoModel.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index ac209861..dde98be6 100755 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -395,6 +395,7 @@ return [ 'gramaje_interior' => 'Seleccione el gramaje', 'pais' => 'Debe seleccionar un país', 'integer_greatherThan_0' => 'Número entero > 0 requerido', + 'greater_than_0' => 'El campo {field} debe ser mayor que 0', 'tirada_no_valida' => "Tirada no valida", 'sin_gramaje' => "Seleccione gramaje", 'tipo_cubierta' => 'Seleccione tipo de cubierta', diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php index dc594bae..69c2a034 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php @@ -151,6 +151,14 @@ class PresupuestoModel extends \App\Models\BaseModel public static $labelField = "titulo"; protected $validationRulesAdd = [ + "tirada" => [ + "label" => "Presupuestos.tirada", + "rules" => "required|integer|greater_than[0]", + ], + "paginas" => [ + "label" => "Presupuestos.paginas", + "rules" => "required|integer|greater_than[0]", + ], "autor" => [ "label" => "Presupuestos.autor", "rules" => "trim|max_length[150]", @@ -190,6 +198,12 @@ class PresupuestoModel extends \App\Models\BaseModel ]; protected $validationMessagesAdd = [ + "tirada" => [ + "greater_than" => "Presupuestos.validation.greater_than_0", + ], + "paginas" => [ + "greater_than" => "Presupuestos.validation.greater_than_0", + ], "autor" => [ "max_length" => "Presupuestos.validation.max_length", "required" => "Presupuestos.validation.requerido",