mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
falta el checkear que no se solapen intervalos. corregido error en varios sitios (ponia user_update_id en lugar de user_updated_id; también en BBDD)
This commit is contained in:
@ -32,6 +32,12 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
||||
$this->viewData['pageTitle'] = lang('MaquinasPorDefecto.moduleTitle');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Se indica que este controlador trabaja con soft_delete
|
||||
$this->soft_delete = true;
|
||||
// Se indica el flag para los ficheros borrados
|
||||
$this->delete_flag = 1;
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
@ -54,7 +60,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
public function add() {
|
||||
|
||||
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
@ -66,6 +73,9 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
@ -80,7 +90,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
}
|
||||
else:
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
endif;
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
@ -90,7 +100,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]).'.';
|
||||
$message .= anchor( "maquinasdefecto/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
$message .= anchor( "configuracion/maquinasdefecto/edit/{$id}" , lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
@ -121,6 +131,9 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
public function edit($requestedId = null) {
|
||||
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
@ -142,7 +155,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
@ -189,7 +203,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
$this->viewData['maquinaList'] = $this->getMaquinaListItems($maquinasDefectoEntity->maquina_id ?? null);
|
||||
$this->viewData['tipoList'] = $this->getTipoOptions();
|
||||
|
||||
$this->viewData['formAction'] = route_to('updateMaquinaPorDefecto', $id);
|
||||
$this->viewData['formAction'] = route_to('updateMaquinaPorDefecto', $id);
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('MaquinasPorDefecto.moduleTitle').' '.lang('Basic.global.edit3');
|
||||
|
||||
@ -306,4 +320,6 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
||||
}
|
||||
|
||||
|
||||
//sanitiezdata
|
||||
//array(10) { ["tipo"]=> string(2) "bn" ["ancho_min"]=> string(3) "100" ["alto_min"]=> string(3) "180" ["tirada_min"]=> string(2) "31" ["maquina_id"]=> string(2) "80" ["ancho_max"]=> string(3) "477" ["alto_max"]=> string(3) "316" ["tirada_max"]=> string(5) "10000" ["save"]=> string(7) "Guardar" ["user_updated_id"]=> string(1) "1" }
|
||||
}
|
||||
|
||||
@ -184,10 +184,9 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_update_id'] = $session->id_user;
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost('defecto') == null) {
|
||||
$sanitizedData['defecto'] = false;
|
||||
}
|
||||
|
||||
@ -83,9 +83,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if (isset($this->model->user_update_id)) {
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
}
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
@ -166,9 +165,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if (isset($this->model->user_update_id)) {
|
||||
$sanitizedData['user_update_id'] = $session->id_user;
|
||||
}
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
@ -136,8 +136,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if(isset($this->model->user_update_id)){
|
||||
$sanitizedData['user_update_id'] = $session->id_user;
|
||||
if(isset($this->model->user_updated_id)){
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
}
|
||||
|
||||
$noException = true;
|
||||
|
||||
@ -80,7 +80,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if(isset($this->model->user_update_id)){
|
||||
if(isset($this->model->user_updated_id)){
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
if(isset($this->model->user_update_id)){
|
||||
if(isset($this->model->user_updated_id)){
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user