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:
Jaime Jiménez
2023-07-12 14:42:21 +02:00
parent 1908290167
commit c4a7cfc799
28 changed files with 137 additions and 119 deletions

View File

@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
# APP # APP
#-------------------------------------------------------------------- #--------------------------------------------------------------------
#app.baseURL = 'https://sk-jjo.imnavajas.es' app.baseURL = 'https://sk-jjo.imnavajas.es'
app.baseURL = 'https://sk-imn.imnavajas.es' #app.baseURL = 'https://sk-imn.imnavajas.es'
# app.baseURL = "http://safekat.test/" # app.baseURL = "http://safekat.test/"
# app.forceGlobalSecureRequests = false # app.forceGlobalSecureRequests = false
@ -41,22 +41,22 @@ app.baseURL = 'https://sk-imn.imnavajas.es'
# DATABASE # DATABASE
#-------------------------------------------------------------------- #--------------------------------------------------------------------
database.default.hostname = localhost
database.default.database = sk_jjo
database.default.username = sk_jjo
database.default.password = 61tv&G1Zf^XY
database.default.DBDriver = MySQLi
database.default.DBPrefix =
database.default.dump =
# database.default.hostname = localhost # database.default.hostname = localhost
# database.default.database = sk_imn # database.default.database = sk_jjo
# database.default.username = sk_imn # database.default.username = sk_jjo
# database.default.password = Uyia19_87 # database.default.password = 61tv&G1Zf^XY
# database.default.DBDriver = MySQLi # database.default.DBDriver = MySQLi
# database.default.DBPrefix = # database.default.DBPrefix =
# database.default.dump = # database.default.dump =
database.default.hostname = localhost
database.default.database = sk_imn
database.default.username = sk_imn
database.default.password = Uyia19_87
database.default.DBDriver = MySQLi
database.default.DBPrefix =
database.default.dump =
# database.tests.hostname = localhost # database.tests.hostname = localhost
# database.tests.database = ci4 # database.tests.database = ci4
# database.tests.username = root # database.tests.username = root

View File

@ -266,7 +266,7 @@ $routes->group('maquinasdefecto', ['namespace' => 'App\Controllers\Configuracion
$routes->post('add', 'Maquinasdefecto::add', ['as' => 'createMaquinaPorDefecto']); $routes->post('add', 'Maquinasdefecto::add', ['as' => 'createMaquinaPorDefecto']);
$routes->post('create', 'Maquinasdefecto::create', ['as' => 'ajaxCreateMaquinaPorDefecto']); $routes->post('create', 'Maquinasdefecto::create', ['as' => 'ajaxCreateMaquinaPorDefecto']);
$routes->put('(:num)/update', 'Maquinasdefecto::update/$1', ['as' => 'ajaxUpdateMaquinaPorDefecto']); $routes->put('(:num)/update', 'Maquinasdefecto::update/$1', ['as' => 'ajaxUpdateMaquinaPorDefecto']);
$routes->post('(:num)/edit', 'Maquinasdefecto::edit/$1', ['as' => 'updateMaquinaPorDefecto']); $routes->post('edit/(:num)', 'Maquinasdefecto::edit/$1', ['as' => 'updateMaquinaPorDefecto']);
$routes->post('datatable', 'Maquinasdefecto::datatable', ['as' => 'dataTableOfMaquinasPorDefecto']); $routes->post('datatable', 'Maquinasdefecto::datatable', ['as' => 'dataTableOfMaquinasPorDefecto']);
$routes->post('allmenuitems', 'Maquinasdefecto::allItemsSelect', ['as' => 'select2ItemsOfMaquinasPorDefecto']); $routes->post('allmenuitems', 'Maquinasdefecto::allItemsSelect', ['as' => 'select2ItemsOfMaquinasPorDefecto']);
$routes->post('menuitems', 'Maquinasdefecto::menuItems', ['as' => 'menuItemsOfMaquinasPorDefecto']); $routes->post('menuitems', 'Maquinasdefecto::menuItems', ['as' => 'menuItemsOfMaquinasPorDefecto']);

View File

@ -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) { public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
$this->viewData['pageTitle'] = lang('MaquinasPorDefecto.moduleTitle'); $this->viewData['pageTitle'] = lang('MaquinasPorDefecto.moduleTitle');
$this->viewData['usingSweetAlert'] = true; $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); parent::initController($request, $response, $logger);
} }
@ -54,7 +60,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
public function add() { public function add() {
// JJO
$session = session();
$requestMethod = $this->request->getMethod(); $requestMethod = $this->request->getMethod();
@ -66,6 +73,9 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_created_id'] = $session->id_user;
$noException = true; $noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
@ -80,7 +90,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
} }
else: else:
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]); $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; endif;
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission $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(); $id = $this->model->db->insertID();
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]).'.'; $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)); $message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) : if ($thenRedirect) :
@ -121,6 +131,9 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
public function edit($requestedId = null) { public function edit($requestedId = null) {
// JJO
$session = session();
if ($requestedId == null) : if ($requestedId == null) :
return $this->redirect2listView(); return $this->redirect2listView();
endif; endif;
@ -142,7 +155,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_updated_id'] = $session->id_user;
$noException = true; $noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : 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['maquinaList'] = $this->getMaquinaListItems($maquinasDefectoEntity->maquina_id ?? null);
$this->viewData['tipoList'] = $this->getTipoOptions(); $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'); $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" }
} }

View File

@ -184,10 +184,9 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
$sanitizedData['user_update_id'] = $session->id_user; $sanitizedData['user_updated_id'] = $session->id_user;
if ($this->request->getPost('defecto') == null) { if ($this->request->getPost('defecto') == null) {
$sanitizedData['defecto'] = false; $sanitizedData['defecto'] = false;
} }

View File

@ -83,9 +83,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
if (isset($this->model->user_update_id)) { $sanitizedData['user_created_id'] = $session->id_user;
$sanitizedData['user_created_id'] = $session->id_user;
}
$noException = true; $noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : 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); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
if (isset($this->model->user_update_id)) { $sanitizedData['user_updated_id'] = $session->id_user;
$sanitizedData['user_update_id'] = $session->id_user;
}
$noException = true; $noException = true;
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) : if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :

View File

@ -136,8 +136,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
if(isset($this->model->user_update_id)){ if(isset($this->model->user_updated_id)){
$sanitizedData['user_update_id'] = $session->id_user; $sanitizedData['user_updated_id'] = $session->id_user;
} }
$noException = true; $noException = true;

View File

@ -80,7 +80,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
if(isset($this->model->user_update_id)){ if(isset($this->model->user_updated_id)){
$sanitizedData['user_created_id'] = $session->id_user; $sanitizedData['user_created_id'] = $session->id_user;
} }
@ -162,7 +162,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
$sanitizedData = $this->sanitized($postData, $nullIfEmpty); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
if(isset($this->model->user_update_id)){ if(isset($this->model->user_updated_id)){
$sanitizedData['user_updated_id'] = $session->id_user; $sanitizedData['user_updated_id'] = $session->id_user;
} }

View File

@ -10,14 +10,14 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
"id" => null, "id" => null,
"nombre" => null, "nombre" => null,
"user_created_id" => 0, "user_created_id" => 0,
"user_update_id" => 0, "user_updated_id" => 0,
"is_deleted" => 0, "is_deleted" => 0,
"created_at" => null, "created_at" => null,
"updated_at" => null, "updated_at" => null,
]; ];
protected $casts = [ protected $casts = [
"user_created_id" => "int", "user_created_id" => "int",
"user_update_id" => "int", "user_updated_id" => "int",
"is_deleted" => "int", "is_deleted" => "int",
]; ];
} }

View File

@ -9,14 +9,14 @@ class TarifaacabadoEntity extends \CodeIgniter\Entity\Entity
"id" => null, "id" => null,
"nombre" => null, "nombre" => null,
"user_created_id" => 0, "user_created_id" => 0,
"user_update_id" => 0, "user_updated_id" => 0,
"is_deleted" => 0, "is_deleted" => 0,
"created_at" => null, "created_at" => null,
"updated_at" => null, "updated_at" => null,
]; ];
protected $casts = [ protected $casts = [
"user_created_id" => "int", "user_created_id" => "int",
"user_update_id" => "int", "user_updated_id" => "int",
"is_deleted" => "int", "is_deleted" => "int",
]; ];
} }

View File

@ -10,7 +10,7 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
"nombre" => null, "nombre" => null,
"precio" => null, "precio" => null,
"user_created_id" => 1, "user_created_id" => 1,
"user_update_id" => 1, "user_updated_id" => 1,
"deleted_at" => null, "deleted_at" => null,
"is_deleted" => 0, "is_deleted" => 0,
"created_at" => null, "created_at" => null,
@ -19,6 +19,6 @@ class TarifapreimpresionEntity extends \CodeIgniter\Entity\Entity
protected $casts = [ protected $casts = [
"precio" => "float", "precio" => "float",
"user_created_id" => "int", "user_created_id" => "int",
"user_update_id" => "int", "user_updated_id" => "int",
]; ];
} }

View File

@ -18,7 +18,7 @@ return [
'maquinaId' => 'Machine', 'maquinaId' => 'Machine',
'maquinaPorDefecto' => 'Default Machine', 'maquinaPorDefecto' => 'Default Machine',
'maquinaPorDefectoList' => 'Default Machine List', 'maquinaPorDefectoList' => 'Default Machine List',
'maquinadefecto' => 'Default Machines', 'maquinadefecto' => 'Default Machine',
'maquinasPorDefecto' => 'Default Machines', 'maquinasPorDefecto' => 'Default Machines',
'maquinasdefecto' => 'Default Machines', 'maquinasdefecto' => 'Default Machines',
'moduleTitle' => 'Default Machines', 'moduleTitle' => 'Default Machines',

View File

@ -69,7 +69,7 @@ return [
], ],
'user_update_id' => [ 'user_updated_id' => [
'integer' => 'The {field} field must contain an integer.', 'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.', 'required' => 'The {field} field is required.',

View File

@ -76,7 +76,7 @@ return [
], ],
'user_update_id' => [ 'user_updated_id' => [
'integer' => 'The {field} field must contain an integer.', 'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.', 'required' => 'The {field} field is required.',

View File

@ -34,7 +34,7 @@ return [
], ],
'user_update_id' => [ 'user_updated_id' => [
'integer' => 'The {field} field must contain an integer.', 'integer' => 'The {field} field must contain an integer.',
'required' => 'The {field} field is required.', 'required' => 'The {field} field is required.',

View File

@ -91,7 +91,7 @@ return [
], ],
'validation' => [ 'validation' => [
'user_update_id' => [ 'user_updated_id' => [
'integer' => 'El campo {field} debe contener un número entero.', 'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.', 'required' => 'El campo {field} es obligatorio.',

View File

@ -76,7 +76,7 @@ return [
], ],
'user_update_id' => [ 'user_updated_id' => [
'integer' => 'El campo {field} debe contener un número entero.', 'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.', 'required' => 'El campo {field} es obligatorio.',

View File

@ -34,7 +34,7 @@ return [
], ],
'user_update_id' => [ 'user_updated_id' => [
'integer' => 'El campo {field} debe contener un número entero.', 'integer' => 'El campo {field} debe contener un número entero.',
'required' => 'El campo {field} es obligatorio.', 'required' => 'El campo {field} es obligatorio.',

View File

@ -32,8 +32,10 @@ class MaquinasDefectoModel extends \App\Models\GoBaseModel
"tirada_min", "tirada_min",
"tirada_max", "tirada_max",
"maquina_id", "maquina_id",
"deleted_at",
"is_deleted",
"user_created_id",
"user_updated_id"
]; ];
protected $returnType = "App\Entities\Configuracion\MaquinasDefectoEntity"; protected $returnType = "App\Entities\Configuracion\MaquinasDefectoEntity";
@ -48,63 +50,63 @@ class MaquinasDefectoModel extends \App\Models\GoBaseModel
protected $validationRules = [ protected $validationRules = [
"alto_max" => [ "alto_max" => [
"label" => "MaquinaPorDefectoes.altoMax", "label" => "MaquinasPorDefecto.altoMax",
"rules" => "required|decimal", "rules" => "required|decimal",
], ],
"alto_min" => [ "alto_min" => [
"label" => "MaquinaPorDefectoes.altoMin", "label" => "MaquinasPorDefecto.altoMin",
"rules" => "required|decimal", "rules" => "required|decimal",
], ],
"ancho_max" => [ "ancho_max" => [
"label" => "MaquinaPorDefectoes.anchoMax", "label" => "MaquinasPorDefecto.anchoMax",
"rules" => "required|decimal", "rules" => "required|decimal",
], ],
"ancho_min" => [ "ancho_min" => [
"label" => "MaquinaPorDefectoes.anchoMin", "label" => "MaquinasPorDefecto.anchoMin",
"rules" => "required|decimal", "rules" => "required|decimal",
], ],
"tipo" => [ "tipo" => [
"label" => "MaquinaPorDefectoes.tipo", "label" => "MaquinasPorDefecto.tipo",
"rules" => "required|in_list[bn,bnhq,color,portada,cubierta,rotativa]", "rules" => "required|in_list[bn,bnhq,color,portada,cubierta,rotativa]",
], ],
"tirada_max" => [ "tirada_max" => [
"label" => "MaquinaPorDefectoes.tiradaMax", "label" => "MaquinasPorDefecto.tiradaMax",
"rules" => "required|integer", "rules" => "required|integer",
], ],
"tirada_min" => [ "tirada_min" => [
"label" => "MaquinaPorDefectoes.tiradaMin", "label" => "MaquinasPorDefecto.tiradaMin",
"rules" => "required|integer", "rules" => "required|integer",
], ],
]; ];
protected $validationMessages = [ protected $validationMessages = [
"alto_max" => [ "alto_max" => [
"decimal" => "MaquinaPorDefectoes.validation.alto_max.decimal", "decimal" => "MaquinasPorDefecto.validation.alto_max.decimal",
"required" => "MaquinaPorDefectoes.validation.alto_max.required", "required" => "MaquinasPorDefecto.validation.alto_max.required",
], ],
"alto_min" => [ "alto_min" => [
"decimal" => "MaquinaPorDefectoes.validation.alto_min.decimal", "decimal" => "MaquinasPorDefecto.validation.alto_min.decimal",
"required" => "MaquinaPorDefectoes.validation.alto_min.required", "required" => "MaquinasPorDefecto.validation.alto_min.required",
], ],
"ancho_max" => [ "ancho_max" => [
"decimal" => "MaquinaPorDefectoes.validation.ancho_max.decimal", "decimal" => "MaquinasPorDefecto.validation.ancho_max.decimal",
"required" => "MaquinaPorDefectoes.validation.ancho_max.required", "required" => "MaquinasPorDefecto.validation.ancho_max.required",
], ],
"ancho_min" => [ "ancho_min" => [
"decimal" => "MaquinaPorDefectoes.validation.ancho_min.decimal", "decimal" => "MaquinasPorDefecto.validation.ancho_min.decimal",
"required" => "MaquinaPorDefectoes.validation.ancho_min.required", "required" => "MaquinasPorDefecto.validation.ancho_min.required",
], ],
"tipo" => [ "tipo" => [
"in_list" => "MaquinaPorDefectoes.validation.tipo.in_list", "in_list" => "MaquinasPorDefecto.validation.tipo.in_list",
"required" => "MaquinaPorDefectoes.validation.tipo.required", "required" => "MaquinasPorDefecto.validation.tipo.required",
], ],
"tirada_max" => [ "tirada_max" => [
"integer" => "MaquinaPorDefectoes.validation.tirada_max.integer", "integer" => "MaquinasPorDefecto.validation.tirada_max.integer",
"required" => "MaquinaPorDefectoes.validation.tirada_max.required", "required" => "MaquinasPorDefecto.validation.tirada_max.required",
], ],
"tirada_min" => [ "tirada_min" => [
"integer" => "MaquinaPorDefectoes.validation.tirada_min.integer", "integer" => "MaquinasPorDefecto.validation.tirada_min.integer",
"required" => "MaquinaPorDefectoes.validation.tirada_min.required", "required" => "MaquinasPorDefecto.validation.tirada_min.required",
], ],
]; ];

View File

@ -69,7 +69,7 @@ class PapelImpresionModel extends \App\Models\GoBaseModel
"isActivo", "isActivo",
"deleted_at", "deleted_at",
"is_deleted", "is_deleted",
"user_update_id", "user_updated_id",
]; ];
protected $returnType = "App\Entities\Configuracion\PapelImpresion"; protected $returnType = "App\Entities\Configuracion\PapelImpresion";

View File

@ -21,7 +21,7 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
"deleted_at", "deleted_at",
"is_deleted", "is_deleted",
"user_created_id", "user_created_id",
"user_update_id", "user_updated_id",
]; ];
protected $returnType = 'App\Entities\Tarifas\TarifaacabadoEntity'; protected $returnType = 'App\Entities\Tarifas\TarifaacabadoEntity';

View File

@ -18,7 +18,7 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
"deleted_at", "deleted_at",
"is_deleted", "is_deleted",
"user_created_id", "user_created_id",
"user_update_id"]; "user_updated_id"];
protected $returnType = "App\Entities\Tarifas\TarifapreimpresionEntity"; protected $returnType = "App\Entities\Tarifas\TarifapreimpresionEntity";
protected $useTimestamps = true; protected $useTimestamps = true;

View File

@ -4,7 +4,7 @@
<label for="tipo" class="form-label"> <label for="tipo" class="form-label">
<?=lang('MaquinasPorDefecto.tipo') ?>* <?=lang('MaquinasPorDefecto.tipo') ?>*
</label> </label>
<select id="tipo" name="tipo" required class="form-control select2bs" style="width: 100%;" > <select id="tipo" name="tipo" class="form-control select2bs" style="width: 100%;" >
<option value="" selected="selected"><?=lang('Basic.global.pleaseSelectOne') ?></option> <option value="" selected="selected"><?=lang('Basic.global.pleaseSelectOne') ?></option>
<option value="bn"<?=$maquinasDefectoEntity->tipo == 'bn' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bn') ?></option> <option value="bn"<?=$maquinasDefectoEntity->tipo == 'bn' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bn') ?></option>
<option value="bnhq"<?=$maquinasDefectoEntity->tipo == 'bnhq' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bnhq') ?></option> <option value="bnhq"<?=$maquinasDefectoEntity->tipo == 'bnhq' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bnhq') ?></option>
@ -19,43 +19,24 @@
<label for="anchoMin" class="form-label"> <label for="anchoMin" class="form-label">
<?=lang('MaquinasPorDefecto.anchoMin') ?>* <?=lang('MaquinasPorDefecto.anchoMin') ?>*
</label> </label>
<input type="number" id="anchoMin" name="ancho_min" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_min', $maquinasDefectoEntity->ancho_min) ?>"> <input type="number" id="anchoMin" name="ancho_min" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_min', $maquinasDefectoEntity->ancho_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="anchoMax" class="form-label">
<?=lang('MaquinasPorDefecto.anchoMax') ?>*
</label>
<input type="number" id="anchoMax" name="ancho_max" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_max', $maquinasDefectoEntity->ancho_max) ?>">
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
<div class="mb-3"> <div class="mb-3">
<label for="altoMin" class="form-label"> <label for="altoMin" class="form-label">
<?=lang('MaquinasPorDefecto.altoMin') ?>* <?=lang('MaquinasPorDefecto.altoMin') ?>*
</label> </label>
<input type="number" id="altoMin" name="alto_min" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_min', $maquinasDefectoEntity->alto_min) ?>"> <input type="number" id="altoMin" name="alto_min" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_min', $maquinasDefectoEntity->alto_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="altoMax" class="form-label">
<?=lang('MaquinasPorDefecto.altoMax') ?>*
</label>
<input type="number" id="altoMax" name="alto_max" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_max', $maquinasDefectoEntity->alto_max) ?>">
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
<div class="mb-3"> <div class="mb-3">
<label for="tiradaMin" class="form-label"> <label for="tiradaMin" class="form-label">
<?=lang('MaquinasPorDefecto.tiradaMin') ?>* <?=lang('MaquinasPorDefecto.tiradaMin') ?>*
</label> </label>
<input type="number" id="tiradaMin" name="tirada_min" required placeholder="1" maxLength="11" class="form-control" value="<?=old('tirada_min', $maquinasDefectoEntity->tirada_min) ?>"> <input type="number" id="tiradaMin" name="tirada_min" placeholder="1" maxLength="11" class="form-control" value="<?=old('tirada_min', $maquinasDefectoEntity->tirada_min) ?>">
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiradaMax" class="form-label">
<?=lang('MaquinasPorDefecto.tiradaMax') ?>*
</label>
<input type="number" id="tiradaMax" name="tirada_max" required placeholder="10000" maxLength="11" class="form-control" value="<?=old('tirada_max', $maquinasDefectoEntity->tirada_max) ?>">
</div><!--//.mb-3 -->
</div><!--//.col --> </div><!--//.col -->
<div class="col-md-12 col-lg-6 px-4"> <div class="col-md-12 col-lg-6 px-4">
@ -63,7 +44,7 @@
<label for="maquinaId" class="form-label"> <label for="maquinaId" class="form-label">
<?=lang('MaquinasPorDefecto.maquinaId') ?>* <?=lang('MaquinasPorDefecto.maquinaId') ?>*
</label> </label>
<select id="maquinaId" name="maquina_id" required class="form-control select2 form-select" style="width: 100%;" > <select id="maquinaId" name="maquina_id" class="form-control select2 form-select" style="width: 100%;" >
<?php if ( isset($maquinaList) && is_array($maquinaList) && !empty($maquinaList) ) : <?php if ( isset($maquinaList) && is_array($maquinaList) && !empty($maquinaList) ) :
foreach ($maquinaList as $k => $v) : ?> foreach ($maquinaList as $k => $v) : ?>
@ -75,6 +56,29 @@
</select> </select>
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
<div class="mb-3">
<label for="anchoMax" class="form-label">
<?=lang('MaquinasPorDefecto.anchoMax') ?>*
</label>
<input type="number" id="anchoMax" name="ancho_max" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_max', $maquinasDefectoEntity->ancho_max) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="altoMax" class="form-label">
<?=lang('MaquinasPorDefecto.altoMax') ?>*
</label>
<input type="number" id="altoMax" name="alto_max" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_max', $maquinasDefectoEntity->alto_max) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiradaMax" class="form-label">
<?=lang('MaquinasPorDefecto.tiradaMax') ?>*
</label>
<input type="number" id="tiradaMax" name="tirada_max" placeholder="10000" maxLength="11" class="form-control" value="<?=old('tirada_max', $maquinasDefectoEntity->tirada_max) ?>">
</div><!--//.mb-3 -->
</div><!--//.col --> </div><!--//.col -->
</div><!-- //.row --> </div><!-- //.row -->

View File

@ -287,9 +287,6 @@
yeniden(json.<?= csrf_token() ?>); yeniden(json.<?= csrf_token() ?>);
setTimeout(() => {
console.log("1 Segundo esperado")
}, 1000);
$.ajax({ $.ajax({
url: '<?= route_to('updateMaquinaPapelOnTarifasChange') ?>', url: '<?= route_to('updateMaquinaPapelOnTarifasChange') ?>',
data: { data: {

View File

@ -15,12 +15,15 @@
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?> <?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/maquinas/_maquinaPorDefectoFormItems") ?> <?= view("themes/backend/vuexy/form/configuracion/maquinas/_maquinaPorDefectoFormItems") ?>
</div><!-- /.card-body --> </div><!-- /.card-body -->
<div class="card-footer"> <div class="pt-4">
<?= anchor(route_to("maquinaPorDefectoList"), lang("Basic.global.Cancel"), [ <input
"class" => "btn btn-secondary float-start", type="submit"
]) ?> class="btn btn-primary float-start me-sm-3 me-1"
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>"> name="save"
</div><!-- /.card-footer --> value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("maquinaPorDefectoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
</div><!-- /.card-footer -->
</form> </form>
</div><!-- //.card --> </div><!-- //.card -->
</div><!--//.col --> </div><!--//.col -->
@ -32,7 +35,6 @@
$('#maquinaId').select2({ $('#maquinaId').select2({
theme: 'bootstrap-5',
allowClear: false, allowClear: false,
ajax: { ajax: {
url: '<?= route_to("menuItemsOfMaquinas") ?>', url: '<?= route_to("menuItemsOfMaquinas") ?>',

View File

@ -125,7 +125,7 @@ $(document).on('click', '.btn-edit', function(e) {
$(document).on('click', '.btn-delete', function(e) { $(document).on('click', '.btn-delete', function(e) {
Swal.fire({ Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('MaquinasPorDefecto.maquina por defecto'))]) ?>', title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('MaquinasPorDefecto.maquinadefecto'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>', text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning', icon: 'warning',
showCancelButton: true, showCancelButton: true,
@ -139,8 +139,10 @@ $(document).on('click', '.btn-delete', function(e) {
const row = $(this).closest('tr'); const row = $(this).closest('tr');
if (result.value) { if (result.value) {
$.ajax({ $.ajax({
url: `<?= route_to('maquinaPorDefectoList') ?>/${dataId}`, //url: `<?= route_to('maquinaPorDefectoList') ?>/${dataId}`,
method: 'DELETE', //method: 'DELETE',
url: `/configuracion/maquinasdefecto/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => { }).done((data, textStatus, jqXHR) => {
Toast.fire({ Toast.fire({
icon: 'success', icon: 'success',
@ -166,20 +168,18 @@ $(document).on('click', '.btn-delete', function(e) {
<?=$this->section('css') ?> <?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<?=$this->endSection() ?> <?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?> <?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.js"></script> <script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script> <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script> <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?> <?=$this->endSection() ?>

View File

@ -25,7 +25,7 @@
<label for="userUpdateId" class="form-label"> <label for="userUpdateId" class="form-label">
<?=lang('Tarifapreimpresion.userUpdateId') ?>* <?=lang('Tarifapreimpresion.userUpdateId') ?>*
</label> </label>
<input type="number" id="userUpdateId" name="user_update_id" required placeholder="1" maxLength="10" class="form-control" value="<?=old('user_update_id', $tarifapreimpresionEntity->user_update_id) ?>"> <input type="number" id="userUpdateId" name="user_updated_id" required placeholder="1" maxLength="10" class="form-control" value="<?=old('user_updated_id', $tarifapreimpresionEntity->user_updated_id) ?>">
</div><!--//.mb-3 --> </div><!--//.mb-3 -->
*/ ?> */ ?>
</div><!--//.col --> </div><!--//.col -->

View File

@ -48,7 +48,7 @@
<?= esc($item->user_created_id) ?> <?= esc($item->user_created_id) ?>
</td> </td>
<td class="align-middle"> <td class="align-middle">
<?= esc($item->user_update_id) ?> <?= esc($item->user_updated_id) ?>
</td> </td>
<td class="align-middle text-nowrap"> <td class="align-middle text-nowrap">
<?= empty($item->created_at) ? '' : date('d/m/Y H:m:s', strtotime($item->created_at)) ?> <?= empty($item->created_at) ? '' : date('d/m/Y H:m:s', strtotime($item->created_at)) ?>

View File

@ -51,8 +51,8 @@ Pasos para añadir el soft delete a una tabla
debajo de $sanitizedData = $this->sanitized($postData, $nullIfEmpty); debajo de $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO // JJO
if(isset($this->model->user_update_id)){ if(isset($this->model->user_updated_id)){
$sanitizedData['user_update_id'] = $session->id_user; $sanitizedData['user_updated_id'] = $session->id_user;
} }
5b.- Con lazy-tables: 5b.- Con lazy-tables: