mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
comprobado ancho y alto > ancho y alto impresion. modificacion listado
This commit is contained in:
@ -176,12 +176,26 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
//JJO: comprobar alto y ancho impresion < alto y ancho
|
||||
if($sanitizedData['alto'] < $sanitizedData['alto_impresion']){
|
||||
$successfulResult = false;
|
||||
$this->viewData['errorMessage'] = lang('Maquinas.validation.alto_menor_alto_impresion');;
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
}
|
||||
else if ($sanitizedData['ancho'] < $sanitizedData['ancho_impresion']){
|
||||
$successfulResult = false;
|
||||
$this->viewData['errorMessage'] = lang('Maquinas.validation.ancho_menor_ancho_impresion');;
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
}
|
||||
else{
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
}
|
||||
|
||||
else:
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Maquinas.maquina'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
@ -190,7 +204,7 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$maquina->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $maquina->id ?? $id;
|
||||
|
||||
Reference in New Issue
Block a user