mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
papel generico terminado. papel impresion a falta de maquinas y tipologias
This commit is contained in:
@ -11,6 +11,27 @@ if (file_exists(SYSTEMPATH . 'Config/Routes.php')) {
|
||||
require SYSTEMPATH . 'Config/Routes.php';
|
||||
}
|
||||
|
||||
|
||||
//WEB ROUTER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('/', 'Home::index');
|
||||
$routes->get('lang/{locale}', 'Language::index');
|
||||
|
||||
//API ROUTER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('api/', 'Api::index');
|
||||
$routes->get('api/status', 'Api::status');
|
||||
$routes->post('api/signIn', 'Api::signIn');
|
||||
|
||||
//API ROUTER USER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('api/user/', 'Api::user/all');
|
||||
$routes->get('api/user/(:segment)', 'Api::user/id/$1');
|
||||
$routes->post('api/user/', 'Api::user/add');
|
||||
$routes->put('api/user/(:segment)', 'Api::user/edit/$1');
|
||||
$routes->delete('api/user/(:segment)', 'Api::user/delete/$1');
|
||||
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
* Router Setup
|
||||
@ -32,144 +53,141 @@ $routes->setAutoRoute(true);
|
||||
// We get a performance increase by specifying the default
|
||||
// route since we don't have to scan directories.
|
||||
|
||||
$routes->group('', [], function($routes) {
|
||||
|
||||
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Paises::index', ['as' => 'paisList']);
|
||||
$routes->get('index', 'Paises::index', ['as' => 'paisIndex']);
|
||||
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
|
||||
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
|
||||
$routes->get('edit/(:num)', 'Paises::edit/$1', ['as' => 'editPais']);
|
||||
$routes->post('edit/(:num)', 'Paises::edit/$1', ['as' => 'updatePais']);
|
||||
$routes->get('delete/(:num)', 'Paises::delete/$1', ['as' => 'deletePais']);
|
||||
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
|
||||
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
|
||||
});
|
||||
|
||||
$routes->group('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifaacabado::index', ['as' => 'tarifaacabadoList']);
|
||||
$routes->get('index', 'Tarifaacabado::index', ['as' => 'tarifaacabadoIndex']);
|
||||
$routes->get('list', 'Tarifaacabado::index', ['as' => 'tarifaacabadoList2']);
|
||||
$routes->get('add', 'Tarifaacabado::add', ['as' => 'newTarifaacabado']);
|
||||
$routes->post('add', 'Tarifaacabado::add', ['as' => 'createTarifaacabado']);
|
||||
$routes->get('edit/(:num)', 'Tarifaacabado::edit/$1', ['as' => 'editTarifaacabado']);
|
||||
$routes->post('edit/(:num)', 'Tarifaacabado::edit/$1', ['as' => 'updateTarifaacabado']);
|
||||
$routes->get('delete/(:num)', 'Tarifaacabado::delete/$1', ['as' => 'deleteTarifaacabado']);
|
||||
$routes->post('allmenuitems', 'Tarifaacabado::allItemsSelect', ['as' => 'select2ItemsOfTarifasacabado']);
|
||||
$routes->post('menuitems', 'Tarifaacabado::menuItems', ['as' => 'menuItemsOfTarifasacabado']);
|
||||
});
|
||||
|
||||
$routes->group('users', ['namespace' => 'App\Controllers\Usuarios'], function ($routes) {
|
||||
$routes->get('', 'Users::index', ['as' => 'userList']);
|
||||
$routes->get('index', 'Users::index', ['as' => 'userIndex']);
|
||||
$routes->get('list', 'Users::index', ['as' => 'userList2']);
|
||||
$routes->get('add', 'Users::add', ['as' => 'newUser']);
|
||||
$routes->post('add', 'Users::add', ['as' => 'createUser']);
|
||||
$routes->get('edit/(:num)', 'Users::edit/$1', ['as' => 'editUser']);
|
||||
$routes->post('edit/(:num)', 'Users::edit/$1', ['as' => 'updateUser']);
|
||||
$routes->get('delete/(:num)', 'Users::delete/$1', ['as' => 'deleteUser']);
|
||||
$routes->post('allmenuitems', 'Users::allItemsSelect', ['as' => 'select2ItemsOfUsers']);
|
||||
$routes->post('menuitems', 'Users::menuItems', ['as' => 'menuItemsOfUsers']);
|
||||
});
|
||||
|
||||
$routes->group('group', ['namespace' => 'App\Controllers\Usuarios'], function ($routes) {
|
||||
$routes->get('', 'Group::index', ['as' => 'userGroupList']);
|
||||
$routes->get('index', 'Group::index', ['as' => 'groupIndex']);
|
||||
$routes->post('edit/(:num)', 'Group::edit/$1', ['as' => 'updateGroup']);
|
||||
$routes->get('edit/(:num)', 'Group::edit/$1', ['as' => 'editGroup']);
|
||||
$routes->get('delete/(:num)', 'Group::delete/$1', ['as' => 'deleteGroup']);
|
||||
$routes->get('add', 'Group::add', ['as' => 'newGroup']);
|
||||
$routes->post('add', 'Group::add', ['as' => 'createGroup']);
|
||||
});
|
||||
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Paises::index', ['as' => 'paisList']);
|
||||
$routes->get('index', 'Paises::index', ['as' => 'paisIndex']);
|
||||
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
|
||||
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
|
||||
$routes->get('edit/(:num)', 'Paises::edit/$1', ['as' => 'editPais']);
|
||||
$routes->post('edit/(:num)', 'Paises::edit/$1', ['as' => 'updatePais']);
|
||||
$routes->get('delete/(:num)', 'Paises::delete/$1', ['as' => 'deletePais']);
|
||||
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
|
||||
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
|
||||
});
|
||||
|
||||
$routes->group('tarifapreimpresion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList']);
|
||||
$routes->get('index', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionIndex']);
|
||||
$routes->get('list', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList2']);
|
||||
$routes->get('add', 'Tarifapreimpresion::add', ['as' => 'newTarifapreimpresion']);
|
||||
$routes->post('add', 'Tarifapreimpresion::add', ['as' => 'createTarifapreimpresion']);
|
||||
$routes->get('edit/(:num)', 'Tarifapreimpresion::edit/$1', ['as' => 'editTarifapreimpresion']);
|
||||
$routes->post('edit/(:num)', 'Tarifapreimpresion::edit/$1', ['as' => 'updateTarifapreimpresion']);
|
||||
$routes->get('delete/(:num)', 'Tarifapreimpresion::delete/$1', ['as' => 'deleteTarifapreimpresion']);
|
||||
$routes->post('allmenuitems', 'Tarifapreimpresion::allItemsSelect', ['as' => 'select2ItemsOfTarifaspreimpresion']);
|
||||
$routes->post('menuitems', 'Tarifapreimpresion::menuItems', ['as' => 'menuItemsOfTarifaspreimpresion']);
|
||||
});
|
||||
|
||||
|
||||
$routes->group('tarifamanipulado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifamanipulado::index', ['as' => 'tarifamanipuladoList']);
|
||||
$routes->get('index', 'Tarifamanipulado::index', ['as' => 'tarifamanipuladoIndex']);
|
||||
$routes->get('list', 'Tarifamanipulado::index', ['as' => 'tarifamanipuladoList2']);
|
||||
$routes->get('add', 'Tarifamanipulado::add', ['as' => 'newTarifamanipulado']);
|
||||
$routes->post('add', 'Tarifamanipulado::add', ['as' => 'createTarifamanipulado']);
|
||||
$routes->get('edit/(:num)', 'Tarifamanipulado::edit/$1', ['as' => 'editTarifamanipulado']);
|
||||
$routes->post('edit/(:num)', 'Tarifamanipulado::edit/$1', ['as' => 'updateTarifamanipulado']);
|
||||
$routes->get('delete/(:num)', 'Tarifamanipulado::delete/$1', ['as' => 'deleteTarifamanipulado']);
|
||||
$routes->post('allmenuitems', 'Tarifamanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasmanipulado']);
|
||||
$routes->post('menuitems', 'Tarifamanipulado::menuItems', ['as' => 'menuItemsOfTarifasmanipulado']);
|
||||
});
|
||||
|
||||
|
||||
$routes->group('tipologiaslibros', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Tipologias::index', ['as' => 'tipologiaLibrosList']);
|
||||
$routes->get('index', 'Tipologias::index', ['as' => 'tipologiaLibrosIndex']);
|
||||
$routes->get('list', 'Tipologias::index', ['as' => 'tipologiaLibrosList2']);
|
||||
$routes->get('add', 'Tipologias::add', ['as' => 'newTipologiaLibros']);
|
||||
$routes->post('add', 'Tipologias::add', ['as' => 'createTipologiaLibros']);
|
||||
$routes->get('edit/(:num)', 'Tipologias::edit/$1', ['as' => 'editTipologiaLibros']);
|
||||
$routes->post('edit/(:num)', 'Tipologias::edit/$1', ['as' => 'updateTipologiaLibros']);
|
||||
$routes->get('delete/(:num)', 'Tipologias::delete/$1', ['as' => 'deleteTipologiaLibros']);
|
||||
$routes->post('allmenuitems', 'Tipologias::allItemsSelect', ['as' => 'select2ItemsOfTipologiasLibros']);
|
||||
$routes->post('menuitems', 'Tipologias::menuItems', ['as' => 'menuItemsOfTipologiasLibros']);
|
||||
});
|
||||
$routes->group('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifaacabado::index', ['as' => 'tarifaacabadoList']);
|
||||
$routes->get('index', 'Tarifaacabado::index', ['as' => 'tarifaacabadoIndex']);
|
||||
$routes->get('list', 'Tarifaacabado::index', ['as' => 'tarifaacabadoList2']);
|
||||
$routes->get('add', 'Tarifaacabado::add', ['as' => 'newTarifaacabado']);
|
||||
$routes->post('add', 'Tarifaacabado::add', ['as' => 'createTarifaacabado']);
|
||||
$routes->get('edit/(:num)', 'Tarifaacabado::edit/$1', ['as' => 'editTarifaacabado']);
|
||||
$routes->post('edit/(:num)', 'Tarifaacabado::edit/$1', ['as' => 'updateTarifaacabado']);
|
||||
$routes->get('delete/(:num)', 'Tarifaacabado::delete/$1', ['as' => 'deleteTarifaacabado']);
|
||||
$routes->post('allmenuitems', 'Tarifaacabado::allItemsSelect', ['as' => 'select2ItemsOfTarifasacabado']);
|
||||
$routes->post('menuitems', 'Tarifaacabado::menuItems', ['as' => 'menuItemsOfTarifasacabado']);
|
||||
});
|
||||
|
||||
$routes->group('users', ['namespace' => 'App\Controllers\Usuarios'], function ($routes) {
|
||||
$routes->get('', 'Users::index', ['as' => 'userList']);
|
||||
$routes->get('index', 'Users::index', ['as' => 'userIndex']);
|
||||
$routes->get('list', 'Users::index', ['as' => 'userList2']);
|
||||
$routes->get('add', 'Users::add', ['as' => 'newUser']);
|
||||
$routes->post('add', 'Users::add', ['as' => 'createUser']);
|
||||
$routes->get('edit/(:num)', 'Users::edit/$1', ['as' => 'editUser']);
|
||||
$routes->post('edit/(:num)', 'Users::edit/$1', ['as' => 'updateUser']);
|
||||
$routes->get('delete/(:num)', 'Users::delete/$1', ['as' => 'deleteUser']);
|
||||
$routes->post('allmenuitems', 'Users::allItemsSelect', ['as' => 'select2ItemsOfUsers']);
|
||||
$routes->post('menuitems', 'Users::menuItems', ['as' => 'menuItemsOfUsers']);
|
||||
});
|
||||
|
||||
$routes->group('group', ['namespace' => 'App\Controllers\Usuarios'], function ($routes) {
|
||||
$routes->get('', 'Group::index', ['as' => 'userGroupList']);
|
||||
$routes->get('index', 'Group::index', ['as' => 'groupIndex']);
|
||||
$routes->post('edit/(:num)', 'Group::edit/$1', ['as' => 'updateGroup']);
|
||||
$routes->get('edit/(:num)', 'Group::edit/$1', ['as' => 'editGroup']);
|
||||
$routes->get('delete/(:num)', 'Group::delete/$1', ['as' => 'deleteGroup']);
|
||||
$routes->get('add', 'Group::add', ['as' => 'newGroup']);
|
||||
$routes->post('add', 'Group::add', ['as' => 'createGroup']);
|
||||
});
|
||||
|
||||
$routes->group('tarifapreimpresion', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList']);
|
||||
$routes->get('index', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionIndex']);
|
||||
$routes->get('list', 'Tarifapreimpresion::index', ['as' => 'tarifapreimpresionList2']);
|
||||
$routes->get('add', 'Tarifapreimpresion::add', ['as' => 'newTarifapreimpresion']);
|
||||
$routes->post('add', 'Tarifapreimpresion::add', ['as' => 'createTarifapreimpresion']);
|
||||
$routes->get('edit/(:num)', 'Tarifapreimpresion::edit/$1', ['as' => 'editTarifapreimpresion']);
|
||||
$routes->post('edit/(:num)', 'Tarifapreimpresion::edit/$1', ['as' => 'updateTarifapreimpresion']);
|
||||
$routes->get('delete/(:num)', 'Tarifapreimpresion::delete/$1', ['as' => 'deleteTarifapreimpresion']);
|
||||
$routes->post('allmenuitems', 'Tarifapreimpresion::allItemsSelect', ['as' => 'select2ItemsOfTarifaspreimpresion']);
|
||||
$routes->post('menuitems', 'Tarifapreimpresion::menuItems', ['as' => 'menuItemsOfTarifaspreimpresion']);
|
||||
});
|
||||
|
||||
|
||||
$routes->group('tarifamanipulado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifamanipulado::index', ['as' => 'tarifamanipuladoList']);
|
||||
$routes->get('index', 'Tarifamanipulado::index', ['as' => 'tarifamanipuladoIndex']);
|
||||
$routes->get('list', 'Tarifamanipulado::index', ['as' => 'tarifamanipuladoList2']);
|
||||
$routes->get('add', 'Tarifamanipulado::add', ['as' => 'newTarifamanipulado']);
|
||||
$routes->post('add', 'Tarifamanipulado::add', ['as' => 'createTarifamanipulado']);
|
||||
$routes->get('edit/(:num)', 'Tarifamanipulado::edit/$1', ['as' => 'editTarifamanipulado']);
|
||||
$routes->post('edit/(:num)', 'Tarifamanipulado::edit/$1', ['as' => 'updateTarifamanipulado']);
|
||||
$routes->get('delete/(:num)', 'Tarifamanipulado::delete/$1', ['as' => 'deleteTarifamanipulado']);
|
||||
$routes->post('allmenuitems', 'Tarifamanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasmanipulado']);
|
||||
$routes->post('menuitems', 'Tarifamanipulado::menuItems', ['as' => 'menuItemsOfTarifasmanipulado']);
|
||||
});
|
||||
|
||||
|
||||
$routes->group('tipologiaslibros', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Tipologias::index', ['as' => 'tipologiaLibrosList']);
|
||||
$routes->get('index', 'Tipologias::index', ['as' => 'tipologiaLibrosIndex']);
|
||||
$routes->get('list', 'Tipologias::index', ['as' => 'tipologiaLibrosList2']);
|
||||
$routes->get('add', 'Tipologias::add', ['as' => 'newTipologiaLibros']);
|
||||
$routes->post('add', 'Tipologias::add', ['as' => 'createTipologiaLibros']);
|
||||
$routes->get('edit/(:num)', 'Tipologias::edit/$1', ['as' => 'editTipologiaLibros']);
|
||||
$routes->post('edit/(:num)', 'Tipologias::edit/$1', ['as' => 'updateTipologiaLibros']);
|
||||
$routes->get('delete/(:num)', 'Tipologias::delete/$1', ['as' => 'deleteTipologiaLibros']);
|
||||
$routes->post('allmenuitems', 'Tipologias::allItemsSelect', ['as' => 'select2ItemsOfTipologiasLibros']);
|
||||
$routes->post('menuitems', 'Tipologias::menuItems', ['as' => 'menuItemsOfTipologiasLibros']);
|
||||
});
|
||||
|
||||
$routes->group('imposiciones', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Imposiciones::index', ['as' => 'imposicionList']);
|
||||
$routes->get('add', 'Imposiciones::add', ['as' => 'newImposicion']);
|
||||
$routes->post('add', 'Imposiciones::add', ['as' => 'createImposicion']);
|
||||
$routes->post('create', 'Imposiciones::create', ['as' => 'ajaxCreateImposicion']);
|
||||
$routes->put('(:num)/update', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
|
||||
$routes->post('(:num)/edit', 'Imposiciones::edit/$1', ['as' => 'updateImposicion']);
|
||||
$routes->post('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
|
||||
$routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']);
|
||||
$routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']);
|
||||
});
|
||||
$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Papelesgenericos::index', ['as' => 'papelGenericoList']);
|
||||
$routes->delete('', 'Papelesgenericos::index', ['as' => 'papelGenericoList2']);
|
||||
$routes->get('add', 'Papelesgenericos::add', ['as' => 'newPapelGenerico']);
|
||||
$routes->post('add', 'Papelesgenericos::add', ['as' => 'createPapelGenerico']);
|
||||
$routes->post('create', 'Papelesgenericos::create', ['as' => 'ajaxCreatePapelGenerico']);
|
||||
$routes->put('(:num)/update', 'Papelesgenericos::update/$1', ['as' => 'ajaxUpdatePapelGenerico']);
|
||||
$routes->post('edit/(:num)', 'Papelesgenericos::edit/$1', ['as' => 'updatePapelGenerico']);
|
||||
$routes->post('datatable', 'Papelesgenericos::datatable', ['as' => 'dataTableOfPapelesGenericos']);
|
||||
$routes->post('allmenuitems', 'Papelesgenericos::allItemsSelect', ['as' => 'select2ItemsOfPapelesGenericos']);
|
||||
$routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
|
||||
});
|
||||
$routes->resource('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesgenericos', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Papelesimpresion::index', ['as' => 'papelImpresionList']);
|
||||
$routes->get('add', 'Papelesimpresion::add', ['as' => 'newPapelImpresion']);
|
||||
$routes->post('add', 'Papelesimpresion::add', ['as' => 'createPapelImpresion']);
|
||||
$routes->post('create', 'Papelesimpresion::create', ['as' => 'ajaxCreatePapelImpresion']);
|
||||
$routes->put('(:num)/update', 'Papelesimpresion::update/$1', ['as' => 'ajaxUpdatePapelImpresion']);
|
||||
$routes->post('edit/(:num)', 'Papelesimpresion::edit/$1', ['as' => 'updatePapelImpresion']);
|
||||
$routes->post('datatable', 'Papelesimpresion::datatable', ['as' => 'dataTableOfPapelesImpresion']);
|
||||
$routes->post('datatablePG', 'Papelesimpresion::datatablePG', ['as' => 'dataTableOfPapelesImpresionPG']);
|
||||
$routes->post('allmenuitems', 'Papelesimpresion::allItemsSelect', ['as' => 'select2ItemsOfPapelesImpresion']);
|
||||
$routes->post('menuitems', 'Papelesimpresion::menuItems', ['as' => 'menuItemsOfPapelesImpresion']);
|
||||
});
|
||||
$routes->resource('papelesimpresion', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesimpresion', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('imposiciones', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Imposiciones::index', ['as' => 'imposicionList']);
|
||||
$routes->get('add', 'Imposiciones::add', ['as' => 'newImposicion']);
|
||||
$routes->post('add', 'Imposiciones::add', ['as' => 'createImposicion']);
|
||||
$routes->post('create', 'Imposiciones::create', ['as' => 'ajaxCreateImposicion']);
|
||||
$routes->put('(:num)/update', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']);
|
||||
$routes->post('(:num)/edit', 'Imposiciones::edit/$1', ['as' => 'updateImposicion']);
|
||||
$routes->post('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']);
|
||||
$routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']);
|
||||
$routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']);
|
||||
});
|
||||
$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Papelesgenericos::index', ['as' => 'papelGenericoList']);
|
||||
$routes->get('add', 'Papelesgenericos::add', ['as' => 'newPapelGenerico']);
|
||||
$routes->post('add', 'Papelesgenericos::add', ['as' => 'createPapelGenerico']);
|
||||
$routes->post('create', 'Papelesgenericos::create', ['as' => 'ajaxCreatePapelGenerico']);
|
||||
$routes->put('(:num)/update', 'Papelesgenericos::update/$1', ['as' => 'ajaxUpdatePapelGenerico']);
|
||||
$routes->post('(:num)/edit', 'Papelesgenericos::edit/$1', ['as' => 'updatePapelGenerico']);
|
||||
$routes->post('datatable', 'Papelesgenericos::datatable', ['as' => 'dataTableOfPapelesGenericos']);
|
||||
$routes->post('allmenuitems', 'Papelesgenericos::allItemsSelect', ['as' => 'select2ItemsOfPapelesGenericos']);
|
||||
$routes->post('menuitems', 'Papelesgenericos::menuItems', ['as' => 'menuItemsOfPapelesGenericos']);
|
||||
});
|
||||
$routes->resource('papelesgenericos', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Papelesgenericos', 'except' => 'show,new,create,update']);
|
||||
|
||||
});
|
||||
|
||||
|
||||
//WEB ROUTER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('/', 'Home::index');
|
||||
$routes->get('lang/{locale}', 'Language::index');
|
||||
|
||||
//API ROUTER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('api/','Api::index');
|
||||
$routes->get('api/status','Api::status');
|
||||
$routes->post('api/signIn','Api::signIn');
|
||||
|
||||
//API ROUTER USER ------------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
$routes->get('api/user/','Api::user/all');
|
||||
$routes->get('api/user/(:segment)','Api::user/id/$1');
|
||||
$routes->post('api/user/','Api::user/add');
|
||||
$routes->put('api/user/(:segment)','Api::user/edit/$1');
|
||||
$routes->delete('api/user/(:segment)','Api::user/delete/$1');
|
||||
|
||||
|
||||
/*
|
||||
@ -188,5 +206,3 @@ $routes->delete('api/user/(:segment)','Api::user/delete/$1');
|
||||
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
|
||||
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
<?php namespace App\Controllers\Configuracion;
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
|
||||
use App\Controllers\GoBaseResourceController;
|
||||
@ -9,7 +11,8 @@ use App\Entities\Configuracion\PapelGenerico;
|
||||
|
||||
use App\Models\Configuracion\PapelGenericoModel;
|
||||
|
||||
class Papelesgenericos extends \App\Controllers\GoBaseResourceController {
|
||||
class Papelesgenericos extends \App\Controllers\GoBaseResourceController
|
||||
{
|
||||
|
||||
protected $modelName = PapelGenericoModel::class;
|
||||
protected $format = 'json';
|
||||
@ -19,40 +22,49 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController {
|
||||
protected static $pluralObjectName = 'Papeles Genericos';
|
||||
protected static $pluralObjectNameCc = 'papelesGenericos';
|
||||
|
||||
protected static $controllerSlug = 'papeles-genericos';
|
||||
protected static $controllerSlug = 'papelesgenericos';
|
||||
|
||||
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/papel/';
|
||||
|
||||
protected $indexRoute = 'papelGenericoList';
|
||||
|
||||
|
||||
|
||||
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('PapelGenerico.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);
|
||||
}
|
||||
|
||||
|
||||
public function index() {
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('PapelGenerico.papelGenerico')]),
|
||||
'papelGenerico' => new PapelGenerico(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('PapelGenerico.papelGenerico')]),
|
||||
'papelGenerico' => new PapelGenerico(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath.'viewPapelGenericoList', $viewData);
|
||||
return view(static::$viewPath . 'viewPapelGenericoList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function add() {
|
||||
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
@ -61,43 +73,43 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController {
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]);
|
||||
$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
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else :
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]);
|
||||
$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
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]).'.';
|
||||
$message .= anchor( "papeles-genericos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]) . '.';
|
||||
$message .= anchor("papelesgenericos/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
else :
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
else :
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
@ -109,14 +121,14 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController {
|
||||
|
||||
$this->viewData['formAction'] = route_to('createPapelGenerico');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('PapelGenerico.moduleTitle').' '.lang('Basic.global.addNewSuffix');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('PapelGenerico.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||
|
||||
return $this->displayForm(__METHOD__);
|
||||
} // end function add()
|
||||
|
||||
public function edit($requestedId = null) {
|
||||
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
@ -133,84 +145,84 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController {
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
if ($this->request->getPost('show_in_client') == null ) {
|
||||
$sanitizedData['show_in_client'] = false;
|
||||
}
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
if ($this->request->getPost('show_in_client') == null) {
|
||||
$sanitizedData['show_in_client'] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$noException = true;
|
||||
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);
|
||||
}
|
||||
else:
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
|
||||
endif;
|
||||
|
||||
$papelGenerico->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
|
||||
if ($this->canValidate()) :
|
||||
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('PapelGenerico.papelGenerico'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
|
||||
endif;
|
||||
|
||||
$papelGenerico->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $papelGenerico->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]).'.';
|
||||
$message .= anchor( "papeles-genericos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]) . '.';
|
||||
$message .= anchor("papelesgenericos/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else:
|
||||
else :
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else:
|
||||
else :
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['papelGenerico'] = $papelGenerico;
|
||||
|
||||
$this->viewData['formAction'] = route_to('updatePapelGenerico', $id);
|
||||
$this->viewData['formAction'] = route_to('updatePapelGenerico', $id);
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('PapelGenerico.moduleTitle').' '.lang('Basic.global.edit3');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('PapelGenerico.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||
|
||||
$this->viewData['usingServerSideDataTable'] = true;
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
} // end function edit(...)
|
||||
|
||||
|
||||
|
||||
public function datatable() {
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns']) ) {
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||
$errstr = 'No data available in response to this specific request.';
|
||||
$response = $this->respond(Collection::datatable( [], 0, 0, $errstr ), 400, $errstr);
|
||||
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
|
||||
return $response;
|
||||
}
|
||||
var_dump($reqData);
|
||||
dd();
|
||||
$start = $reqData['start'] ?? 0;
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
|
||||
$order = PapelGenericoModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||
$order = PapelGenericoModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
@ -225,15 +237,16 @@ if ($this->request->getPost('show_in_client') == null ) {
|
||||
}
|
||||
}
|
||||
|
||||
public function allItemsSelect() {
|
||||
public function allItemsSelect()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$onlyActiveOnes = true;
|
||||
$reqVal = $this->request->getPost('val') ?? 'id';
|
||||
$menu = $this->model->getAllForMenu($reqVal.', nombre', 'nombre', $onlyActiveOnes, false);
|
||||
$menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
$nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
|
||||
array_unshift($menu, $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
@ -247,7 +260,8 @@ if ($this->request->getPost('show_in_client') == null ) {
|
||||
}
|
||||
}
|
||||
|
||||
public function menuItems() {
|
||||
public function menuItems()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||
$reqId = goSanitize($this->request->getPost('id'))[0];
|
||||
@ -258,8 +272,8 @@ if ($this->request->getPost('show_in_client') == null ) {
|
||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->text = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
|
||||
array_unshift($menu, $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
@ -272,5 +286,4 @@ if ($this->request->getPost('show_in_client') == null ) {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
372
ci4/app/Controllers/Configuracion/Papelesimpresion.php
Normal file
372
ci4/app/Controllers/Configuracion/Papelesimpresion.php
Normal file
@ -0,0 +1,372 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Configuracion;
|
||||
|
||||
|
||||
use App\Controllers\GoBaseResourceController;
|
||||
|
||||
use App\Models\Collection;
|
||||
|
||||
use App\Entities\Configuracion\PapelImpresion;
|
||||
|
||||
use App\Models\Configuracion\PapelImpresionModel;
|
||||
|
||||
use App\Models\Configuracion\PapelGenericoModel;
|
||||
|
||||
class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
||||
{
|
||||
|
||||
protected $modelName = PapelImpresionModel::class;
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Papel Impresion';
|
||||
protected static $singularObjectNameCc = 'papelImpresion';
|
||||
protected static $pluralObjectName = 'Papeles Impresion';
|
||||
protected static $pluralObjectNameCc = 'papelesImpresion';
|
||||
|
||||
protected static $controllerSlug = 'papelesimpresion';
|
||||
|
||||
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/papel/';
|
||||
|
||||
protected $indexRoute = 'papelImpresionList';
|
||||
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
$this->viewData['pageTitle'] = lang('PapelImpresion.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);
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('PapelImpresion.papelImpresion')]),
|
||||
'papelImpresion' => new PapelImpresion(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewPapelImpresionList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else :
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]);
|
||||
$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
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]) . '.';
|
||||
$message .= anchor("papelesimpresion/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else :
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else :
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['papelImpresion'] = isset($sanitizedData) ? new PapelImpresion($sanitizedData) : new PapelImpresion();
|
||||
$this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($papelImpresion->papel_generico_id ?? null);
|
||||
|
||||
$this->viewData['formAction'] = route_to('createPapelImpresion');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('PapelImpresion.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__);
|
||||
} // end function add()
|
||||
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$papelImpresion = $this->model->find($id);
|
||||
|
||||
if ($papelImpresion == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('PapelImpresion.papelImpresion')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_update_id'] = $session->id_user;
|
||||
|
||||
|
||||
|
||||
if ($this->request->getPost('defecto') == null) {
|
||||
$sanitizedData['defecto'] = false;
|
||||
}
|
||||
if ($this->request->getPost('bn') == null) {
|
||||
$sanitizedData['bn'] = false;
|
||||
}
|
||||
if ($this->request->getPost('color') == null) {
|
||||
$sanitizedData['color'] = false;
|
||||
}
|
||||
if ($this->request->getPost('portada') == null) {
|
||||
$sanitizedData['portada'] = false;
|
||||
}
|
||||
if ($this->request->getPost('cubierta') == null) {
|
||||
$sanitizedData['cubierta'] = false;
|
||||
}
|
||||
if ($this->request->getPost('rotativa') == null) {
|
||||
$sanitizedData['rotativa'] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$noException = true;
|
||||
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);
|
||||
}
|
||||
else :
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
|
||||
endif;
|
||||
|
||||
$papelImpresion->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $papelImpresion->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]) . '.';
|
||||
$message .= anchor("papelesimpresion/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else :
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
endif;
|
||||
else :
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['papelImpresion'] = $papelImpresion;
|
||||
$this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($papelImpresion->papel_generico_id ?? null);
|
||||
|
||||
$this->viewData['formAction'] = route_to('updatePapelImpresion', $id);
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('PapelImpresion.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
} // end function edit(...)
|
||||
|
||||
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||
$errstr = 'No data available in response to this specific request.';
|
||||
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
|
||||
return $response;
|
||||
}
|
||||
$id_PG = $reqData['id_PG'] ?? -1;
|
||||
$start = $reqData['start'] ?? 0;
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||
$order = PapelImpresionModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
if($id_PG<0){
|
||||
|
||||
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource($search)->countAllResults()
|
||||
));
|
||||
}else{
|
||||
$resourceData = $this->model->getResource($search, $id_PG)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource("", $id_PG)->countAllResults(),
|
||||
$this->model->getResource($search, $id_PG)->countAllResults()
|
||||
));
|
||||
}
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function datatablePG()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||
$errstr = 'No data available in response to this specific request.';
|
||||
$response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
|
||||
return $response;
|
||||
}
|
||||
$generico_id = $reqData['id'] ?? null;
|
||||
$start = $reqData['start'] ?? 0;
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||
$order = PapelImpresionModel::SORTABLE2[$requestedOrder >= 0 ? $requestedOrder : 1];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$resourceData = $this->model->getResource($search, $generico_id)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource("", $generico_id)->countAllResults(),
|
||||
$this->model->getResource($search, $generico_id)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function allItemsSelect()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$onlyActiveOnes = true;
|
||||
$reqVal = $this->request->getPost('val') ?? 'id';
|
||||
$menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
|
||||
array_unshift($menu, $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function menuItems()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||
$reqId = goSanitize($this->request->getPost('id'))[0];
|
||||
$reqText = goSanitize($this->request->getPost('text'))[0];
|
||||
$onlyActiveOnes = false;
|
||||
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
|
||||
$onlyActiveOnes = false;
|
||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
|
||||
array_unshift($menu, $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelGenericoListItems($selId = null)
|
||||
{
|
||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenerico.papelGenerico'))])];
|
||||
if (!empty($selId)) :
|
||||
$papelGenericoModel = model('App\Models\Configuracion\PapelGenericoModel');
|
||||
|
||||
$selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
|
||||
if (!empty($selOption)) :
|
||||
$data[$selId] = $selOption[0];
|
||||
endif;
|
||||
endif;
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@ -50,6 +50,25 @@ abstract class GoBaseResourceController extends \CodeIgniter\RESTful\ResourceCon
|
||||
*/
|
||||
protected static $viewPath;
|
||||
|
||||
|
||||
/**
|
||||
* JJO: Variable para indicar si el controlador hace soft_delete o no
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $soft_delete = false;
|
||||
/**
|
||||
* JJO: Variable quién puede ver los registros borrados
|
||||
*
|
||||
* 0 -> Not Deleted
|
||||
* 1 -> Soft Deleted, shows up in lists of deleted items for management users
|
||||
* 2 -> Soft Deleted, does not show up for any user except admin users
|
||||
* 3 -> Only shows up for developers.
|
||||
* @var int
|
||||
*/
|
||||
public $delete_flag = 0;
|
||||
|
||||
|
||||
/**
|
||||
* An array of helpers to be loaded automatically upon
|
||||
* class instantiation. These helpers will be available
|
||||
@ -197,8 +216,22 @@ abstract class GoBaseResourceController extends \CodeIgniter\RESTful\ResourceCon
|
||||
$objName = lang('Basic.global.record');
|
||||
}
|
||||
|
||||
if (!$this->model->delete($id)) {
|
||||
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||
if (!$this->soft_delete){
|
||||
|
||||
if (!$this->model->delete($id)) {
|
||||
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||
}
|
||||
}
|
||||
else{
|
||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||
$rawResult = $this->model->where('id',$id)
|
||||
->set(['deleted_at' => $datetime->format('Y-m-d H:i:s'),
|
||||
'is_deleted' => $this->delete_flag])
|
||||
->update();
|
||||
if (!$rawResult) {
|
||||
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$message = lang('Basic.global.deleteSuccess', [$objName]);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\Configuracion\PapelGenerico;
|
||||
use App\Controllers\Configuracion\Papelesimpresion;
|
||||
|
||||
class Test extends BaseController
|
||||
{
|
||||
@ -15,8 +15,8 @@ class Test extends BaseController
|
||||
|
||||
public function index()
|
||||
{
|
||||
$papel = new PapelGenerico();
|
||||
var_dump($papel->datatable());
|
||||
$papel = new Papelesimpresion();
|
||||
var_dump($papel->datatablePG());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,95 +0,0 @@
|
||||
Version 4
|
||||
SHEET 1 2680 680
|
||||
WIRE -496 -752 -608 -752
|
||||
WIRE -608 -736 -608 -752
|
||||
WIRE -496 -736 -496 -752
|
||||
WIRE -608 -640 -608 -656
|
||||
WIRE -176 -624 -352 -624
|
||||
WIRE 0 -624 -96 -624
|
||||
WIRE 176 -624 0 -624
|
||||
WIRE 352 -624 256 -624
|
||||
WIRE -496 -592 -496 -656
|
||||
WIRE -432 -592 -496 -592
|
||||
WIRE -496 -576 -496 -592
|
||||
WIRE 48 -560 48 -576
|
||||
WIRE 0 -544 0 -624
|
||||
WIRE 16 -544 0 -544
|
||||
WIRE 352 -528 352 -624
|
||||
WIRE 352 -528 80 -528
|
||||
WIRE 368 -528 352 -528
|
||||
WIRE 16 -512 0 -512
|
||||
WIRE -496 -480 -496 -496
|
||||
WIRE -432 -480 -352 -624
|
||||
WIRE -432 -480 -496 -480
|
||||
WIRE 48 -480 48 -496
|
||||
WIRE -608 -464 -608 -480
|
||||
WIRE -496 -464 -496 -480
|
||||
WIRE -352 -448 -432 -592
|
||||
WIRE -336 -448 -352 -448
|
||||
WIRE -176 -448 -256 -448
|
||||
WIRE 0 -448 0 -512
|
||||
WIRE 0 -448 -96 -448
|
||||
WIRE 0 -432 0 -448
|
||||
WIRE 0 -336 0 -352
|
||||
FLAG 0 -336 0
|
||||
FLAG 368 -528 Out
|
||||
FLAG -608 -464 0
|
||||
FLAG -608 -640 0
|
||||
FLAG -608 -752 Vcc
|
||||
FLAG -608 -560 Vee
|
||||
FLAG 48 -576 Vcc
|
||||
FLAG 48 -480 Vee
|
||||
FLAG -496 -464 0
|
||||
SYMBOL res -192 -432 R270
|
||||
WINDOW 0 32 56 VTop 2
|
||||
WINDOW 3 0 56 VBottom 2
|
||||
SYMATTR InstName R1
|
||||
SYMATTR Value {wc(22.5k,tola,1)}
|
||||
SYMBOL res -16 -448 R0
|
||||
SYMATTR InstName R4
|
||||
SYMATTR Value {wc(22.5k,tolb,0)}
|
||||
SYMBOL res 272 -640 R90
|
||||
WINDOW 0 0 56 VBottom 2
|
||||
WINDOW 3 32 56 VTop 2
|
||||
SYMATTR InstName R3
|
||||
SYMATTR Value {wc(22.5k,tolb,3)}
|
||||
SYMBOL res -192 -608 R270
|
||||
WINDOW 0 32 56 VTop 2
|
||||
WINDOW 3 0 56 VBottom 2
|
||||
SYMATTR InstName R2
|
||||
SYMATTR Value {wc(22.5k,tola,2)}
|
||||
SYMBOL Opamps\\LT6015 48 -528 R0
|
||||
SYMATTR InstName U2
|
||||
SYMBOL voltage -608 -752 R0
|
||||
WINDOW 123 0 0 Left 2
|
||||
WINDOW 39 0 0 Left 2
|
||||
SYMATTR InstName V1
|
||||
SYMATTR Value 15
|
||||
SYMBOL voltage -608 -576 R0
|
||||
WINDOW 123 0 0 Left 2
|
||||
WINDOW 39 0 0 Left 2
|
||||
SYMATTR InstName V2
|
||||
SYMATTR Value -15
|
||||
SYMBOL current -496 -736 R0
|
||||
SYMATTR InstName I1
|
||||
SYMATTR Value PWL(.1m 0 .2m .25)
|
||||
SYMBOL res -512 -592 R0
|
||||
SYMATTR InstName R5
|
||||
SYMATTR Value 1
|
||||
SYMBOL res -240 -464 R90
|
||||
WINDOW 0 0 56 VBottom 2
|
||||
WINDOW 3 32 56 VTop 2
|
||||
SYMATTR InstName R6
|
||||
SYMATTR Value 1
|
||||
TEXT -616 -200 Left 2 !.param tola=.01
|
||||
TEXT -616 -168 Left 2 !.param tolb=.05
|
||||
TEXT 328 -352 Left 2 !.tran .5m
|
||||
TEXT -96 -168 Left 2 !.step param run 0 16 1
|
||||
TEXT -616 -280 Left 2 !.func binary(run,index) floor(run/(2**index))-2*floor(run/(2**(index+1)))
|
||||
TEXT -616 -240 Left 2 !.func wc(nom,tol,index) if(run==numruns,nom,if(binary(run,index),nom*(1+tol),nom*(1-tol)))
|
||||
TEXT -96 -200 Left 2 !.param numruns=16
|
||||
TEXT 80 -408 Left 2 ;5% Resistor
|
||||
TEXT 208 -672 Bottom 2 ;5% Resistor
|
||||
TEXT -136 -672 Bottom 2 ;1% Resistor
|
||||
TEXT -136 -496 Bottom 2 ;1% Resistor
|
||||
TEXT 416 -528 Left 2 ;<3B>1mV/mA
|
||||
50
ci4/app/Entities/Configuracion/PapelImpresion.php
Normal file
50
ci4/app/Entities/Configuracion/PapelImpresion.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace App\Entities\Configuracion;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class PapelImpresion extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"papel_generico_id" => null,
|
||||
"nombre" => null,
|
||||
"defecto" => false,
|
||||
"referencia" => null,
|
||||
"ancho" => null,
|
||||
"alto" => null,
|
||||
"mano" => null,
|
||||
"espesor" => 0.0,
|
||||
"gramaje" => null,
|
||||
"precio_tonelada" => null,
|
||||
"margen" => null,
|
||||
"peso_por_pliego" => null,
|
||||
"precio_pliego" => null,
|
||||
"bn" => true,
|
||||
"color" => true,
|
||||
"portada" => false,
|
||||
"cubierta" => false,
|
||||
"rotativa" => false,
|
||||
"is_deleted" => 0,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"papel_generico_id" => "int",
|
||||
"defecto" => "boolean",
|
||||
"ancho" => "float",
|
||||
"alto" => "float",
|
||||
"mano" => "float",
|
||||
"espesor" => "float",
|
||||
"gramaje" => "float",
|
||||
"precio_tonelada" => "float",
|
||||
"peso_por_pliego" => "float",
|
||||
"precio_pliego" => "float",
|
||||
"bn" => "boolean",
|
||||
"color" => "boolean",
|
||||
"portada" => "boolean",
|
||||
"cubierta" => "boolean",
|
||||
"rotativa" => "boolean",
|
||||
"is_deleted" => "int",
|
||||
];
|
||||
}
|
||||
@ -177,6 +177,7 @@ class LoginAuthFilter implements FilterInterface
|
||||
'allItemsSelect',
|
||||
'menuItems',
|
||||
'datatable',
|
||||
'datatablePG',
|
||||
'collect',
|
||||
'cast',
|
||||
];
|
||||
|
||||
@ -140,6 +140,21 @@ if (!function_exists('convertToSnakeCase')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('convertToCamelCase')) {
|
||||
function convertToCamelCase($string, $capitalizeFirstCharacter = false)
|
||||
{
|
||||
$str = str_replace('-', '', ucwords($string, '-'));
|
||||
|
||||
if (!$capitalizeFirstCharacter) {
|
||||
$str = lcfirst($str);
|
||||
}
|
||||
|
||||
$str = str_replace(' ', '', $str);
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('newUUID')) {
|
||||
|
||||
function newUUID() {
|
||||
|
||||
@ -682,6 +682,7 @@ return [
|
||||
"menu_imposiciones" => "Impositions",
|
||||
"menu_maquina" => "Machines",
|
||||
"menu_papelgenerico" => "Generic paper",
|
||||
"menu_papelimpresion" => "Printing paper",
|
||||
"menu_seriefactura" => "Billing series",
|
||||
"menu_serviciocliente" => "Customer service",
|
||||
"menu_tamanioformatos" => "Format size",
|
||||
|
||||
@ -17,6 +17,9 @@ return [
|
||||
'papelesGenericos' => 'Generic Paper',
|
||||
'showInClient' => 'Show in Client',
|
||||
'updatedAt' => 'Updated At',
|
||||
|
||||
'Form_acordion_title' => 'Print papers associated',
|
||||
|
||||
'validation' => [
|
||||
'code' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
117
ci4/app/Language/en/PapelImpresion.php
Normal file
117
ci4/app/Language/en/PapelImpresion.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'alto' => 'Height',
|
||||
'ancho' => 'Width',
|
||||
'bn' => 'B/N',
|
||||
'color' => 'Colour',
|
||||
'createdAt' => 'Created At',
|
||||
'cubierta' => 'Cover',
|
||||
'defecto' => 'Default',
|
||||
'deletedAt' => 'Deleted At',
|
||||
'espesor' => 'Thickness',
|
||||
'gramaje' => 'Grammage',
|
||||
'id' => 'ID',
|
||||
'isDeleted' => 'Is Deleted',
|
||||
'mano' => 'Hand',
|
||||
'margen' => 'Margin',
|
||||
'moduleTitle' => 'Print papers',
|
||||
'nombre' => 'Name',
|
||||
'papelGenericoId' => 'Generic paper',
|
||||
'papelImpresion' => 'Print paper',
|
||||
'papelImpresionList' => 'Print Paper List',
|
||||
'papelesImpresion' => 'Print papers',
|
||||
'papelesimpresion' => 'Print papers',
|
||||
'pesoPorPliego' => 'Weight per sheet',
|
||||
'portada' => 'Cover',
|
||||
'precioPliego' => 'Sheet price',
|
||||
'precioTonelada' => 'Ton price',
|
||||
'referencia' => 'Reference',
|
||||
'rotativa' => 'Rotary',
|
||||
'updatedAt' => 'Updated At',
|
||||
'userUpdateId' => 'User Update ID',
|
||||
'validation' => [
|
||||
'espesor_update' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
'alto' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'ancho' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'espesor' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'gramaje' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'mano' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'margen' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'nombre' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'papel_generico_id' => [
|
||||
'integer' => 'The {field} field must contain an integer.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'peso_por_pliego' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'precio_pliego' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'precio_tonelada' => [
|
||||
'decimal' => 'The {field} field must contain a decimal number.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'referencia' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
@ -682,6 +682,7 @@ return [
|
||||
"menu_imposiciones" => "Imposiciones",
|
||||
"menu_maquina" => "Maquinas",
|
||||
"menu_papelgenerico" => "Papel generico",
|
||||
"menu_papelimpresion" => "Papel impresión",
|
||||
"menu_seriefactura" => "Series facturas",
|
||||
"menu_serviciocliente" => "Servicio cliente",
|
||||
"menu_tamanioformatos" => "Tamaño formatos",
|
||||
|
||||
@ -17,6 +17,9 @@ return [
|
||||
'papelesGenericos' => 'Papeles Genéricos',
|
||||
'showInClient' => 'Mostrar en cliente',
|
||||
'updatedAt' => 'Updated At',
|
||||
|
||||
'Form_acordion_title' => 'Papeles impresion asociados',
|
||||
|
||||
'validation' => [
|
||||
'code' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
|
||||
117
ci4/app/Language/es/PapelImpresion.php
Normal file
117
ci4/app/Language/es/PapelImpresion.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'alto' => 'Alto',
|
||||
'ancho' => 'Ancho',
|
||||
'bn' => 'B/N',
|
||||
'color' => 'Color',
|
||||
'createdAt' => 'Creado en',
|
||||
'cubierta' => 'Cubierta',
|
||||
'defecto' => 'Por defecto',
|
||||
'deletedAt' => 'Borrado en',
|
||||
'espesor' => 'Espesor',
|
||||
'gramaje' => 'Gramaje',
|
||||
'id' => 'ID',
|
||||
'isDeleted' => 'Borrado',
|
||||
'mano' => 'Mano',
|
||||
'margen' => 'Margen',
|
||||
'moduleTitle' => 'Papeles Impresion',
|
||||
'nombre' => 'Nombre',
|
||||
'papelGenericoId' => 'Papel Generico',
|
||||
'papelImpresion' => 'Papel Impresion',
|
||||
'papelImpresionList' => 'Lista Papel Impresion',
|
||||
'papelesImpresion' => 'Papeles Impresion',
|
||||
'papelesimpresion' => 'Papeles Impresion',
|
||||
'pesoPorPliego' => 'Peso Por Pliego',
|
||||
'portada' => 'Portada',
|
||||
'precioPliego' => 'Precio Pliego',
|
||||
'precioTonelada' => 'Precio Tonelada',
|
||||
'referencia' => 'Referencia',
|
||||
'rotativa' => 'Rotativa',
|
||||
'updatedAt' => 'Actualizado en',
|
||||
'userUpdateId' => 'ID usuario actualización',
|
||||
'validation' => [
|
||||
'espesor_update' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
|
||||
],
|
||||
|
||||
'alto' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'ancho' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'espesor' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'gramaje' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'mano' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'margen' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'nombre' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'papel_generico_id' => [
|
||||
'integer' => 'The {field} field must contain an integer.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'peso_por_pliego' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'precio_pliego' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'precio_tonelada' => [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
'referencia' => [
|
||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||
'required' => 'El campo {field} es obligatorio.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
@ -13,14 +13,14 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.id",
|
||||
1 => "t1.nombre",
|
||||
2 => "t1.code",
|
||||
3 => "t1.code_ot",
|
||||
4 => "t1.show_in_client",
|
||||
//0 => "t1.id",
|
||||
0 => "t1.nombre",
|
||||
1 => "t1.code",
|
||||
2 => "t1.code_ot",
|
||||
3 => "t1.show_in_client",
|
||||
];
|
||||
|
||||
protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client"];
|
||||
protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client","deleted_at","is_deleted"];
|
||||
protected $returnType = "App\Entities\Configuracion\PapelGenerico";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
@ -34,29 +34,29 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
|
||||
protected $validationRules = [
|
||||
"code" => [
|
||||
"label" => "PapelGenerico.code",
|
||||
"label" => "PapelGenericoes.code",
|
||||
"rules" => "trim|max_length[5]",
|
||||
],
|
||||
"code_ot" => [
|
||||
"label" => "PapelGenerico.codeOt",
|
||||
"label" => "PapelGenericoes.codeOt",
|
||||
"rules" => "trim|max_length[5]",
|
||||
],
|
||||
"nombre" => [
|
||||
"label" => "PapelGenerico.nombre",
|
||||
"label" => "PapelGenericoes.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"code" => [
|
||||
"max_length" => "PapelGenerico.validation.code.max_length",
|
||||
"max_length" => "PapelGenericoes.validation.code.max_length",
|
||||
],
|
||||
"code_ot" => [
|
||||
"max_length" => "PapelGenerico.validation.code_ot.max_length",
|
||||
"max_length" => "PapelGenericoes.validation.code_ot.max_length",
|
||||
],
|
||||
"nombre" => [
|
||||
"max_length" => "PapelGenerico.validation.nombre.max_length",
|
||||
"required" => "PapelGenerico.validation.nombre.required",
|
||||
"max_length" => "PapelGenericoes.validation.nombre.max_length",
|
||||
"required" => "PapelGenericoes.validation.nombre.required",
|
||||
],
|
||||
];
|
||||
|
||||
@ -73,7 +73,8 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, t1.show_in_client AS show_in_client"
|
||||
);
|
||||
)
|
||||
->where("is_deleted", 0);
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
|
||||
231
ci4/app/Models/Configuracion/PapelImpresionModel.php
Normal file
231
ci4/app/Models/Configuracion/PapelImpresionModel.php
Normal file
@ -0,0 +1,231 @@
|
||||
<?php
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class PapelImpresionModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "lg_papel_impresion";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.nombre",
|
||||
1 => "t1.papel_generico_id",
|
||||
2 => "t1.gramaje",
|
||||
3 => "t2.nombre",
|
||||
|
||||
/*1 => "t1.id",
|
||||
2 => "t1.papel_generico_id",
|
||||
3 => "t1.nombre",
|
||||
4 => "t1.defecto",
|
||||
5 => "t1.referencia",
|
||||
6 => "t1.ancho",
|
||||
7 => "t1.alto",
|
||||
8 => "t1.mano",
|
||||
9 => "t1.espesor",
|
||||
10 => "t1.gramaje",
|
||||
11 => "t1.precio_tonelada",
|
||||
12 => "t1.margen",
|
||||
13 => "t1.peso_por_pliego",
|
||||
14 => "t1.precio_pliego",
|
||||
15 => "t1.bn",
|
||||
16 => "t1.color",
|
||||
17 => "t1.portada",
|
||||
18 => "t1.cubierta",
|
||||
19 => "t1.rotativa",
|
||||
20 => "t2.nombre",*/
|
||||
];
|
||||
|
||||
const SORTABLE2 = [
|
||||
0 => "t1.defecto",
|
||||
1 => "t1.nombre",
|
||||
2 => "t1.gramaje",
|
||||
];
|
||||
|
||||
|
||||
protected $allowedFields = [
|
||||
"papel_generico_id",
|
||||
"nombre",
|
||||
"defecto",
|
||||
"referencia",
|
||||
"ancho",
|
||||
"alto",
|
||||
"mano",
|
||||
"espesor",
|
||||
"gramaje",
|
||||
"precio_tonelada",
|
||||
"margen",
|
||||
"peso_por_pliego",
|
||||
"precio_pliego",
|
||||
"bn",
|
||||
"color",
|
||||
"portada",
|
||||
"cubierta",
|
||||
"rotativa",
|
||||
"deleted_at",
|
||||
"is_deleted",
|
||||
"user_update_id",
|
||||
];
|
||||
protected $returnType = "App\Entities\Configuracion\PapelImpresion";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "nombre";
|
||||
|
||||
protected $validationRules = [
|
||||
"alto" => [
|
||||
"label" => "PapelImpresions.alto",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"ancho" => [
|
||||
"label" => "PapelImpresions.ancho",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"espesor" => [
|
||||
"label" => "PapelImpresions.espesor",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"gramaje" => [
|
||||
"label" => "PapelImpresions.gramaje",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"mano" => [
|
||||
"label" => "PapelImpresions.mano",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "PapelImpresions.margen",
|
||||
"rules" => "required|max_length[31]",
|
||||
],
|
||||
"nombre" => [
|
||||
"label" => "PapelImpresions.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
"peso_por_pliego" => [
|
||||
"label" => "PapelImpresions.pesoPorPliego",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"precio_pliego" => [
|
||||
"label" => "PapelImpresions.precioPliego",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"precio_tonelada" => [
|
||||
"label" => "PapelImpresions.precioTonelada",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"referencia" => [
|
||||
"label" => "PapelImpresions.referencia",
|
||||
"rules" => "trim|required|max_length[13]",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"alto" => [
|
||||
"decimal" => "PapelImpresions.validation.alto.decimal",
|
||||
"required" => "PapelImpresions.validation.alto.required",
|
||||
],
|
||||
"ancho" => [
|
||||
"decimal" => "PapelImpresions.validation.ancho.decimal",
|
||||
"required" => "PapelImpresions.validation.ancho.required",
|
||||
],
|
||||
"espesor" => [
|
||||
"decimal" => "PapelImpresions.validation.espesor.decimal",
|
||||
"required" => "PapelImpresions.validation.espesor.required",
|
||||
],
|
||||
"gramaje" => [
|
||||
"decimal" => "PapelImpresions.validation.gramaje.decimal",
|
||||
"required" => "PapelImpresions.validation.gramaje.required",
|
||||
],
|
||||
"mano" => [
|
||||
"decimal" => "PapelImpresions.validation.mano.decimal",
|
||||
"required" => "PapelImpresions.validation.mano.required",
|
||||
],
|
||||
"margen" => [
|
||||
"max_length" => "PapelImpresions.validation.margen.max_length",
|
||||
"required" => "PapelImpresions.validation.margen.required",
|
||||
],
|
||||
"nombre" => [
|
||||
"max_length" => "PapelImpresions.validation.nombre.max_length",
|
||||
"required" => "PapelImpresions.validation.nombre.required",
|
||||
],
|
||||
"peso_por_pliego" => [
|
||||
"decimal" => "PapelImpresions.validation.peso_por_pliego.decimal",
|
||||
"required" => "PapelImpresions.validation.peso_por_pliego.required",
|
||||
],
|
||||
"precio_pliego" => [
|
||||
"decimal" => "PapelImpresions.validation.precio_pliego.decimal",
|
||||
"required" => "PapelImpresions.validation.precio_pliego.required",
|
||||
],
|
||||
"precio_tonelada" => [
|
||||
"decimal" => "PapelImpresions.validation.precio_tonelada.decimal",
|
||||
"required" => "PapelImpresions.validation.precio_tonelada.required",
|
||||
],
|
||||
"referencia" => [
|
||||
"max_length" => "PapelImpresions.validation.referencia.max_length",
|
||||
"required" => "PapelImpresions.validation.referencia.required",
|
||||
],
|
||||
];
|
||||
|
||||
public function findAllWithPapelGenerico(string $selcols = "*", int $limit = null, int $offset = 0)
|
||||
{
|
||||
$sql =
|
||||
"SELECT t1." .
|
||||
$selcols .
|
||||
", t2.nombre AS papel_generico_id FROM " .
|
||||
$this->table .
|
||||
" t1 LEFT JOIN lg_papel_generico t2 ON t1.papel_generico_id = t2.id";
|
||||
if (!is_null($limit) && intval($limit) > 0) {
|
||||
$sql .= " LIMIT " . $limit;
|
||||
}
|
||||
|
||||
if (!is_null($offset) && intval($offset) > 0) {
|
||||
$sql .= " OFFSET " . $offset;
|
||||
}
|
||||
|
||||
$query = $this->db->query($sql);
|
||||
$result = $query->getResultObject();
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resource data.
|
||||
*
|
||||
* @param string $search
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getResource(string $search = "", $generico_id=-1)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.defecto AS defecto, t1.referencia AS referencia, t1.ancho AS ancho, t1.alto AS alto, t1.mano AS mano, t1.espesor AS espesor, t1.gramaje AS gramaje, t1.precio_tonelada AS precio_tonelada, t1.margen AS margen, t1.peso_por_pliego AS peso_por_pliego, t1.precio_pliego AS precio_pliego, t1.bn AS bn, t1.color AS color, t1.portada AS portada, t1.cubierta AS cubierta, t1.rotativa AS rotativa, t2.nombre AS papel_generico_id"
|
||||
);
|
||||
|
||||
$builder->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left");
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
if($generico_id>0){
|
||||
$builder->where("t1.papel_generico_id", $generico_id);
|
||||
}
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.nombre", $search)
|
||||
->orLike("t1.gramaje", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t1.gramaje", $search)
|
||||
->orLike("t2.nombre", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
<?php if (config('Basics')->theme['name'] == 'Bootstrap5') { ?>
|
||||
<div class="modal fade" id="confirm2delete" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="confirm2deleteLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
@ -15,3 +16,24 @@
|
||||
</div><!--//.modal-content -->
|
||||
</div><!--//.modal-dialog -->
|
||||
</div><!--//.modal -->
|
||||
<?php } else { ?>
|
||||
<div id="confirm2delete" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="confirm2deleteLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="confirm2deleteLabel">Confirm to delete record</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Are you sure you want to delete this record?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<a class="btn btn-danger btn-confirm"> Yes, Delete It! </a>
|
||||
</div><!--//.modal-footer -->
|
||||
</div><!--//.modal-content -->
|
||||
</div><!--//.modal-dialog -->
|
||||
</div><!--//.modal -->
|
||||
<?php } ?>
|
||||
@ -1,3 +1,4 @@
|
||||
<?php if (config('Basics')->theme['name'] == 'Bootstrap5') { ?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
||||
<symbol id="exclamation-triangle-fill" fill="currentColor" viewBox="0 0 16 16">
|
||||
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
||||
@ -17,3 +18,18 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-dismissible alert-warning">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fas fa-exclamation-triangle"></i> Please correct the errors below:</h4>
|
||||
<ul>
|
||||
<?php foreach ($errors as $error) : ?>
|
||||
<li><?= esc($error) ?></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div><!--//.alert-->
|
||||
</div><!--//.col-->
|
||||
</div><!--//.row -->
|
||||
<?php } ?>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.7 KiB |
@ -1,18 +1,17 @@
|
||||
<!-- Push section css -->
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.4/css/dataTables.bootstrap5.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/dataTables.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('footerAdditions') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!-- Push additional js -->
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/min/moment-with-locales.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.12.1/js/dataTables.bootstrap5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.12.1/js/dataTables.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.js"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
@ -160,7 +159,7 @@
|
||||
"scrollX": true,
|
||||
"stateSave": true,
|
||||
"language": {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
url: "//cdn.datatables.net/plug-ins/1.10.25/i18n/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
|
||||
},
|
||||
"columnDefs": [
|
||||
{
|
||||
|
||||
@ -1,27 +1,19 @@
|
||||
<!-- Push section css -->
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/select2/select2.css') ?>"/>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.1.1/dist/select2-bootstrap-5-theme.min.css" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!-- Push additional js -->
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/select2/select2.js') ?>"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.full.min.js"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
const select2 = $('.select2');
|
||||
|
||||
// Select2
|
||||
// --------------------------------------------------------------------
|
||||
if (select2.length) {
|
||||
select2.each(function () {
|
||||
var $this = $(this);
|
||||
$this.wrap('<div class="position-relative"></div>').select2({
|
||||
placeholder: 'Select value',
|
||||
dropdownParent: $this.parent()
|
||||
});
|
||||
|
||||
$('.select2bs').select2({
|
||||
theme: "bootstrap-5",
|
||||
allowClear: false,
|
||||
});
|
||||
}
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,26 +1,66 @@
|
||||
<!-- Push section css -->
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@9.7.2/dist/sweetalert2.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css">
|
||||
|
||||
<style>
|
||||
/* Toastr */
|
||||
.colored-toast.swal2-icon-success {
|
||||
background-color: #478921 !important;
|
||||
}
|
||||
|
||||
.colored-toast.swal2-icon-error {
|
||||
background-color: #c42a2a !important;
|
||||
}
|
||||
|
||||
.colored-toast.swal2-icon-warning {
|
||||
background-color: #f8bb86 !important;
|
||||
}
|
||||
|
||||
.colored-toast.swal2-icon-info {
|
||||
background-color: #3fc3ee !important;
|
||||
}
|
||||
|
||||
.colored-toast.swal2-icon-question {
|
||||
background-color: #87adbd !important;
|
||||
}
|
||||
|
||||
.colored-toast .swal2-title {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.colored-toast .swal2-close {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.colored-toast .swal2-html-container {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<!-- Push section js -->
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9.7.2/dist/sweetalert2.all.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
var Toast = Swal.mixin({
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
position: 'top-right',
|
||||
iconColor: 'white',
|
||||
customClass: {
|
||||
popup: 'colored-toast'
|
||||
},
|
||||
showConfirmButton: false,
|
||||
timer: 6000,
|
||||
timerProgressBar: true,
|
||||
onOpen: (toast) => {
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
|
||||
@ -0,0 +1,165 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('PapelImpresion.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?= old('nombre', $papelImpresion->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="referencia" class="form-label">
|
||||
<?= lang('PapelImpresion.referencia') ?>*
|
||||
</label>
|
||||
<input type="text" id="referencia" name="referencia" required maxLength="13" class="form-control" value="<?= old('referencia', $papelImpresion->referencia) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="ancho" class="form-label">
|
||||
<?= lang('PapelImpresion.ancho') ?>*
|
||||
</label>
|
||||
<input type="number" id="ancho" name="ancho" required maxLength="8" step="0.01" class="form-control" value="<?= old('ancho', $papelImpresion->ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mano" class="form-label">
|
||||
<?= lang('PapelImpresion.mano') ?>*
|
||||
</label>
|
||||
<input type="number" id="mano" name="mano" required maxLength="8" step="0.01" class="form-control" value="<?= old('mano', $papelImpresion->mano) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="pesoPorPliego" class="form-label">
|
||||
<?= lang('PapelImpresion.pesoPorPliego') ?>*
|
||||
</label>
|
||||
<input type="number" id="pesoPorPliego" name="peso_por_pliego" required maxLength="31" step="0.01" class="form-control" value="<?= old('peso_por_pliego', $papelImpresion->peso_por_pliego) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="margen" class="form-label">
|
||||
<?= lang('PapelImpresion.margen') ?>*
|
||||
</label>
|
||||
<input type="number" id="margen" name="margen" required placeholder="0" maxLength="31" step="0.01" class="form-control" value="<?= old('margen', $papelImpresion->margen) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="bn" class="form-check-label">
|
||||
<input type="checkbox" id="bn" name="bn" value="1" class="form-check-input" <?= $papelImpresion->bn == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.bn') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="portada" class="form-check-label">
|
||||
<input type="checkbox" id="portada" name="portada" value="1" class="form-check-input" <?= $papelImpresion->portada == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.portada') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="rotativa" class="form-check-label">
|
||||
<input type="checkbox" id="rotativa" name="rotativa" value="1" class="form-check-input" <?= $papelImpresion->rotativa == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.rotativa') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="papelGenericoId" class="form-label">
|
||||
<?= lang('PapelImpresion.papelGenericoId') ?>*
|
||||
</label>
|
||||
<select id="papelGenericoId" name="papel_generico_id" required class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($papelGenericoList) && is_array($papelGenericoList) && !empty($papelGenericoList)) :
|
||||
foreach ($papelGenericoList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $papelImpresion->papel_generico_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="gramaje" class="form-label">
|
||||
<?= lang('PapelImpresion.gramaje') ?>*
|
||||
</label>
|
||||
<input type="number" id="gramaje" name="gramaje" required maxLength="31" step="0.01" class="form-control" value="<?= old('gramaje', $papelImpresion->gramaje) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="alto" class="form-label">
|
||||
<?= lang('PapelImpresion.alto') ?>*
|
||||
</label>
|
||||
<input type="number" id="alto" name="alto" required maxLength="8" step="0.01" class="form-control" value="<?= old('alto', $papelImpresion->alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="espesor" class="form-label">
|
||||
<?= lang('PapelImpresion.espesor') ?>*
|
||||
</label>
|
||||
<input type="number" id="espesor" name="espesor" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?= old('espesor', $papelImpresion->espesor) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="precioPliego" class="form-label">
|
||||
<?= lang('PapelImpresion.precioPliego') ?>*
|
||||
</label>
|
||||
<input type="number" id="precioPliego" name="precio_pliego" required maxLength="31" step="0.01" class="form-control" value="<?= old('precio_pliego', $papelImpresion->precio_pliego) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="precioTonelada" class="form-label">
|
||||
<?= lang('PapelImpresion.precioTonelada') ?>*
|
||||
</label>
|
||||
<input type="number" id="precioTonelada" name="precio_tonelada" required maxLength="31" step="0.01" class="form-control" value="<?= old('precio_tonelada', $papelImpresion->precio_tonelada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="color" class="form-check-label">
|
||||
<input type="checkbox" id="color" name="color" value="1" class="form-check-input" <?= $papelImpresion->color == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.color') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="cubierta" class="form-check-label">
|
||||
<input type="checkbox" id="cubierta" name="cubierta" value="1" class="form-check-input" <?= $papelImpresion->cubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.cubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="defecto" class="form-check-label">
|
||||
<input type="checkbox" id="defecto" name="defecto" value="1" class="form-check-input" <?= $papelImpresion->defecto == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.defecto') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -1,26 +1,158 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section("content") ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<form id="papelGenericoForm" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelGenericoFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("papelGenericoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
|
||||
</div><!-- /.card-footer -->
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelGenericoFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("papelGenericoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
|
||||
</div><!-- /.card-footer -->
|
||||
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<div class="accordion mt-3" id="accordionExample">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOne" aria-expanded="flase" aria-controls="accordionOne">
|
||||
<?= lang("PapelGenerico.Form_acordion_title") ?>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOne" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
|
||||
<div class="accordion-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPapelesimpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('PapelImpresion.defecto') ?></th>
|
||||
<th><?= lang('PapelImpresion.nombre') ?></th>
|
||||
<th><?= lang('PapelImpresion.gramaje') ?></th>
|
||||
<th class="text-nowrap"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
// JJO
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
else
|
||||
id = -1;
|
||||
const lastColNr = $('#tableOfPapelesimpresion').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfPapelesimpresion').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
//"dom": 'lfBrtip', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
|
||||
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesImpresion') ?>',
|
||||
data: {
|
||||
id_PG: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr] //JJO añadidas bool cols
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'defecto' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'gramaje' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [0];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
//window.location.href = `<?= route_to('papelImpresionList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$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">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $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/buttons.html5.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/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>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
@ -106,7 +106,8 @@
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('papelGenericoList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
//window.location.href = `<?= route_to('papelGenericoList') ?>/edit/${$(this).attr('data-id')}`;
|
||||
window.location.href = `/configuracion/papelesgenericos/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
@ -122,11 +123,13 @@ $(document).on('click', '.btn-delete', function(e) {
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('papelGenericoList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
//url: `<?= route_to('papelGenericoList') ?>/${dataId}`,
|
||||
//method: 'DELETE',
|
||||
url: `/configuracion/papelesgenericos/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section("content") ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<form id="papelImpresionForm" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelImpresionFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("papelImpresionList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#papelGenericoId').select2({
|
||||
theme: 'bootstrap-5',
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfPapelesGenericos") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,183 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('PapelImpresion.papelImpresionList') ?></h3>
|
||||
<?=anchor(route_to('newPapelImpresion'), lang('Basic.global.addNew').' '.lang('PapelImpresion.papelImpresion'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPapelesimpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('PapelImpresion.nombre') ?></th>
|
||||
<th><?= lang('PapelGenerico.papelGenerico') ?></th>
|
||||
<th><?= lang('PapelImpresion.gramaje') ?></th>
|
||||
<th><?= lang('PapelImpresion.bn') ?></th>
|
||||
<th><?= lang('PapelImpresion.color') ?></th>
|
||||
<th><?= lang('PapelImpresion.portada') ?></th>
|
||||
<th><?= lang('PapelImpresion.cubierta') ?></th>
|
||||
<th><?= lang('PapelImpresion.rotativa') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfPapelesimpresion').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfPapelesimpresion').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
|
||||
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesImpresion') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [3, 4, 5, 6, 7, lastColNr] //JJO añadidas bool cols
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'papel_generico_id' },
|
||||
{ 'data': 'gramaje' },
|
||||
{ 'data': 'bn' },
|
||||
{ 'data': 'color' },
|
||||
{ 'data': 'portada' },
|
||||
{ 'data': 'cubierta' },
|
||||
{ 'data': 'rotativa' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3, 4, 5, 6, 7];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
//window.location.href = `<?= route_to('papelImpresionList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('PapelImpresion.papel impresion'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
//url: `<?= route_to('papelImpresionList') ?>/${dataId}`,
|
||||
//method: 'DELETE',
|
||||
url: `/configuracion/papelesimpresion/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$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">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $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/buttons.html5.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/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>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
<?php if (allowMenuSection($menus,
|
||||
['Calendario', 'Correo', 'Formaspago', 'Imposiciones', 'Tipologias',
|
||||
'Maquina', 'Papelgenerico', 'Seriefactura', 'Serviciocliente',
|
||||
'Maquina', 'Papelesgenerico', 'Papelesimpresion', 'Seriefactura', 'Serviciocliente',
|
||||
'Tamanioformatos', 'Tamaniolibros', 'Tareaservicio', 'Tiposimpresion', 'Trabajo'
|
||||
],
|
||||
'index')): ?>
|
||||
@ -130,6 +130,15 @@
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Papelesimpresion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesimpresion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_papelimpresion") ?>"><?= lang("App.menu_papelimpresion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Seriefactura')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
|
||||
@ -35,7 +35,10 @@ Pasos para añadir el soft delete a una tabla
|
||||
"deleted_at",
|
||||
"is_deleted",
|
||||
También añadir la variable protected $deletedField = 'deleted_at';
|
||||
5.- En el controlador:
|
||||
|
||||
|
||||
5a.- Sin lazy tables:
|
||||
En el controlador:
|
||||
En el index añadir debajo de $this->view..
|
||||
// Se indica que este controlador trabaja con soft_delete
|
||||
$this->soft_delete = true;
|
||||
@ -50,4 +53,19 @@ Pasos para añadir el soft delete a una tabla
|
||||
// JJO
|
||||
if(isset($this->model->user_update_id)){
|
||||
$sanitizedData['user_update_id'] = $session->id_user;
|
||||
}
|
||||
}
|
||||
|
||||
5b.- Con lazy-tables:
|
||||
En el modelo cambiar:
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, t1.show_in_client AS show_in_client"
|
||||
);
|
||||
por
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, t1.show_in_client AS show_in_client"
|
||||
)
|
||||
->where("is_deleted", 0);
|
||||
Reference in New Issue
Block a user