From c3d38e29a4f390c91efce1b6fc1ebac904cd06b1 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sun, 20 Apr 2025 19:26:07 +0200 Subject: [PATCH] imposiciones --- ci4/app/Config/Routes.php | 18 +- .../Configuracion/Imposiciones.php | 368 +++++++----------- ...4-18-210000_AddTableImposicionEsquemas.php | 79 ++++ ...-04-18-213000_AddFkEsquemaImposiciones.php | 30 ++ ci4/app/Entities/Configuracion/Imposicion.php | 25 +- .../Configuracion/ImposicionEsquemaEntity.php | 26 ++ ci4/app/Language/en/Imposiciones.php | 7 + ci4/app/Language/en/Validation.php | 47 ++- ci4/app/Language/es/Imposiciones.php | 38 ++ ci4/app/Language/es/Validation.php | 47 ++- .../Configuracion/ImposicionEsquemaModel.php | 123 ++++++ .../Models/Configuracion/ImposicionModel.php | 38 +- .../components/modals/modalNewImposicion.php | 20 + .../tables/imposicion_esquema_table.php | 12 + .../_imposicionEsquemaFormItems.php | 64 +++ .../imposiciones/_imposicionFormItems.php | 116 +++--- .../viewImposicionEsquemaForm.php | 41 ++ .../imposiciones/viewImposicionForm.php | 46 ++- .../imposiciones/viewImposicionList.php | 209 +++------- .../imposiciones/viewImposicionNewForm.php | 40 ++ .../vuexy/main/menus/configuracion_menu.php | 7 + .../Views/themes/vuexy/pdfs/orden_trabajo.php | 32 +- .../datatables/ImposicionDatatable.js | 66 ++++ .../datatables/ImposicionEsquemaDatatable.js | 35 ++ .../components/forms/ImposicionEsquemaForm.js | 179 +++++++++ .../components/forms/ImposicionForm.js | 195 ++++++++++ .../components/imposicionEsquemaDrawing.js | 164 ++++++++ .../pages/configuracion/imposiciones/edit.js | 8 + .../imposiciones/edit_esquema.js | 8 + .../configuracion/imposiciones/imposicion.js | 56 +++ .../pages/configuracion/imposiciones/new.js | 8 + .../pages/configuracion/imposiciones/view.js | 8 + .../assets/js/safekat/pages/pdf/otDownload.js | 2 +- httpdocs/themes/vuexy/css/pdf.ot.css | 10 +- 34 files changed, 1676 insertions(+), 496 deletions(-) create mode 100644 ci4/app/Database/Migrations/2025-04-18-210000_AddTableImposicionEsquemas.php create mode 100644 ci4/app/Database/Migrations/2025-04-18-213000_AddFkEsquemaImposiciones.php create mode 100644 ci4/app/Entities/Configuracion/ImposicionEsquemaEntity.php create mode 100644 ci4/app/Language/en/Imposiciones.php create mode 100644 ci4/app/Language/es/Imposiciones.php create mode 100644 ci4/app/Models/Configuracion/ImposicionEsquemaModel.php create mode 100644 ci4/app/Views/themes/vuexy/components/modals/modalNewImposicion.php create mode 100644 ci4/app/Views/themes/vuexy/components/tables/imposicion_esquema_table.php create mode 100644 ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionEsquemaFormItems.php create mode 100644 ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionEsquemaForm.php create mode 100644 ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionNewForm.php create mode 100644 httpdocs/assets/js/safekat/components/datatables/ImposicionDatatable.js create mode 100644 httpdocs/assets/js/safekat/components/datatables/ImposicionEsquemaDatatable.js create mode 100644 httpdocs/assets/js/safekat/components/forms/ImposicionEsquemaForm.js create mode 100644 httpdocs/assets/js/safekat/components/forms/ImposicionForm.js create mode 100644 httpdocs/assets/js/safekat/components/imposicionEsquemaDrawing.js create mode 100644 httpdocs/assets/js/safekat/pages/configuracion/imposiciones/edit.js create mode 100644 httpdocs/assets/js/safekat/pages/configuracion/imposiciones/edit_esquema.js create mode 100644 httpdocs/assets/js/safekat/pages/configuracion/imposiciones/imposicion.js create mode 100644 httpdocs/assets/js/safekat/pages/configuracion/imposiciones/new.js create mode 100644 httpdocs/assets/js/safekat/pages/configuracion/imposiciones/view.js diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php index fb3beb7d..101f054e 100644 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -146,17 +146,25 @@ $routes->group('tipologiaslibros', ['namespace' => 'App\Controllers\Configuracio $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->get('add/esquema', 'Imposiciones::add_esquema', ['as' => 'newImposicionEsquema']); + $routes->get('find/(:num)', 'Imposiciones::find_imposicion/$1', ['as' => 'findImposicion']); + $routes->get('esquema/find/(:num)', 'Imposiciones::find_imposicion_esquema/$1', ['as' => 'findImposicionEsquema']); $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('esquema/create', 'Imposiciones::create_imposicion_esquema', ['as' => 'ajaxCreateImposicionEsquema']); + $routes->post('(:num)', 'Imposiciones::update/$1', ['as' => 'ajaxUpdateImposicion']); + $routes->post('esquema/(:num)', 'Imposiciones::update_imposicion_esquema/$1', ['as' => 'ajaxUpdateImposicionEsquema']); + $routes->delete('(:num)', 'Imposiciones::delete/$1', ['as' => 'deleteImposicion']); + $routes->delete('esquema/(:num)', 'Imposiciones::delete_imposicion_esquema/$1', ['as' => 'deleteImposicionEsquema']); + $routes->get('edit/(:num)', 'Imposiciones::edit/$1', ['as' => 'updateImposicionForm']); + $routes->get('esquema/edit/(:num)', 'Imposiciones::edit_imposicion_esquema/$1', ['as' => 'updateImposicionEsquemaForm']); + $routes->get('datatable', 'Imposiciones::datatable', ['as' => 'dataTableOfImposiciones']); + $routes->get('esquema/datatable', 'Imposiciones::datatable_imposicion_esquema', ['as' => 'dataTableOfEsquemaImposiciones']); $routes->post('allmenuitems', 'Imposiciones::allItemsSelect', ['as' => 'select2ItemsOfImposiciones']); $routes->post('menuitems', 'Imposiciones::menuItems', ['as' => 'menuItemsOfImposiciones']); $routes->get('select', 'Imposiciones::selectImposicion', ['as' => 'selectImposicion']); + $routes->get('esquema/select', 'Imposiciones::selectImposicionEsquema', ['as' => 'selectImposicionEsquema']); }); -$routes->resource('imposiciones', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Imposiciones', 'except' => 'show,new,create,update']); $routes->group('papelimpresiontipologias', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) { $routes->get('add', 'Papelimpresiontipologias::add', ['as' => 'newPapelImpresionTipologia']); diff --git a/ci4/app/Controllers/Configuracion/Imposiciones.php b/ci4/app/Controllers/Configuracion/Imposiciones.php index 58986982..83da4971 100755 --- a/ci4/app/Controllers/Configuracion/Imposiciones.php +++ b/ci4/app/Controllers/Configuracion/Imposiciones.php @@ -2,37 +2,41 @@ namespace App\Controllers\Configuracion; - +use App\Controllers\BaseController; use App\Controllers\BaseResourceController; - use App\Models\Collection; use App\Entities\Configuracion\Imposicion; - +use App\Models\Configuracion\ImposicionEsquemaModel; use App\Models\Configuracion\ImposicionModel; +use CodeIgniter\HTTP\RequestInterface; +use CodeIgniter\HTTP\ResponseInterface; +use CodeIgniter\Validation\Validation; +use Hermawan\DataTables\DataTable; +use Psr\Log\LoggerInterface; -class Imposiciones extends \App\Controllers\BaseResourceController +class Imposiciones extends BaseController { protected $modelName = ImposicionModel::class; - protected $format = 'json'; - - protected static $singularObjectName = 'Imposicion'; - protected static $singularObjectNameCc = 'imposicion'; - protected static $pluralObjectName = 'Imposiciones'; - protected static $pluralObjectNameCc = 'imposiciones'; - + protected ImposicionModel $model; + protected ImposicionEsquemaModel $imposicionEsquemaModel; protected static $controllerSlug = 'imposiciones'; + protected $format = 'json'; protected static $viewPath = 'themes/vuexy/form/configuracion/imposiciones/'; protected $indexRoute = 'imposicionList'; + protected array $viewData = []; + protected Validation $validation; - - public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) + public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { $this->viewData['pageTitle'] = lang('Imposiciones.moduleTitle'); $this->viewData['usingSweetAlert'] = true; + $this->model = model($this->modelName); + $this->validation = service("validation"); + $this->imposicionEsquemaModel = model(ImposicionEsquemaModel::class); parent::initController($request, $response, $logger); } @@ -47,7 +51,10 @@ class Imposiciones extends \App\Controllers\BaseResourceController 'usingServerSideDataTable' => true, ]; + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true], + ]; $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class return view(static::$viewPath . 'viewImposicionList', $viewData); @@ -56,234 +63,147 @@ class Imposiciones extends \App\Controllers\BaseResourceController public function add() { + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true], - - - - if ($this->request->getPost()) : - - $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', [lang('Basic.global.record')]); - $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', [lang('Basic.global.record')]) . '.'; - - 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['imposicion'] = isset($sanitizedData) ? new Imposicion($sanitizedData) : new Imposicion(); - $this->viewData['orientacionList'] = $this->getOrientacionOptions(); - - $this->viewData['formAction'] = route_to('createImposicion'); - - $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Imposiciones.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix'); - - - return $this->displayForm(__METHOD__); - } // end function add() - - public function edit($requestedId = null) + ]; + return view(static::$viewPath . 'viewImposicionNewForm', $this->viewData); + } + public function add_esquema() { + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => true], + ]; + $this->viewData["imposicion_esquema"] = null; - if ($requestedId == null) : - return $this->redirect2listView(); - endif; - $id = filter_var($requestedId, FILTER_SANITIZE_URL); - $imposicion = $this->model->find($id); + return view(static::$viewPath . 'viewImposicionEsquemaForm', $this->viewData); + } + public function edit($imposicion_id = null) + { + if ($imposicion_id) { + $this->viewData["imposicion"] = $this->model->find($imposicion_id); + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => false], + ['title' => $this->viewData["imposicion"]->full_name, 'route' => route_to("updateImposicionForm", $imposicion_id), 'active' => true], - if ($imposicion == false) : - $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Imposiciones.imposicion')), $id]); - return $this->redirect2listView('sweet-error', $message); - endif; + ]; + } + return view(static::$viewPath . 'viewImposicionForm', $this->viewData); + } + public function edit_imposicion_esquema($imposicion_esquema_id = null) + { + if ($imposicion_esquema_id) { + $this->viewData["imposicion_esquema"] = $this->imposicionEsquemaModel->find($imposicion_esquema_id); + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_imposiciones"), 'route' => route_to("imposicionList"), 'active' => false], + ['title' => $this->viewData["imposicion_esquema"]->name, 'route' => route_to("updateImposicionEsquemaForm", $imposicion_esquema_id), 'active' => true], - - - if ($this->request->getPost()) : - - $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)->update($id, $sanitizedData); - } catch (\Exception $e) { - $noException = false; - $this->dealWithException($e); - } - else: - $this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Imposiciones.imposicion'))]); - $this->session->setFlashdata('formErrors', $this->model->errors()); - - endif; - - $imposicion->fill($sanitizedData); - - $thenRedirect = false; - endif; - if ($noException && $successfulResult) : - $id = $imposicion->id ?? $id; - $message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.'; - - 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['imposicion'] = $imposicion; - $this->viewData['orientacionList'] = $this->getOrientacionOptions(); - - $this->viewData['formAction'] = route_to('updateImposicion', $id); - - $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Imposiciones.moduleTitle') . ' ' . lang('Basic.global.edit3'); - - - return $this->displayForm(__METHOD__, $id); - } // end function edit(...) + ]; + } + return view(static::$viewPath . 'viewImposicionEsquemaForm', $this->viewData); + } + public function update($imposicion_id = null) + { + if ($imposicion_id) { + $bodyData = $this->request->getPost(); + $status = $this->model->update($imposicion_id, $bodyData); + if ($status) { + $imposicionEntity = $this->model->find($imposicion_id); + } else { + return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->model->errors(), "status" => true])->setStatusCode(400); + } + return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $imposicionEntity]); + } else { + return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "message" => "", "status" => false])->setStatusCode(400); + } + } + public function update_imposicion_esquema($imposicion_esquema_id = null) + { + if ($imposicion_esquema_id) { + $bodyData = $this->request->getPost(); + $status = $this->imposicionEsquemaModel->update($imposicion_esquema_id, $bodyData); + if ($status) { + $imposicionEsquemaEntity = $this->imposicionEsquemaModel->find($imposicion_esquema_id); + } else { + return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->imposicionEsquemaModel->errors(), "status" => true])->setStatusCode(400); + } + return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status, "data" => $imposicionEsquemaEntity]); + } else { + return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "message" => "", "status" => false])->setStatusCode(400); + } + } + public function delete($imposicion_id = null) + { + $status = $this->model->delete($imposicion_id); + return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => true]); + } + public function delete_imposicion_esquema($imposicion_esquema_id = null) + { + $status = $this->imposicionEsquemaModel->delete($imposicion_esquema_id); + return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]); + } 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; - } - $start = $reqData['start'] ?? 0; - $length = $reqData['length'] ?? 5; - $search = $reqData['search']['value']; - $requestedOrder = $reqData['order']['0']['column'] ?? 1; - $order = ImposicionModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1]; - $dir = $reqData['order']['0']['dir'] ?? 'asc'; - - $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 { - return $this->failUnauthorized('Invalid request', 403); - } + $q = $this->model->queryDatatable(); + return DataTable::of($q) + ->add( + 'action', + fn($q) => "
". ImposicionModel::datatable_buttons($q->id)."
" + ) + ->toJson(true); } - - public function allItemsSelect() + public function datatable_imposicion_esquema() { - if ($this->request->isAJAX()) { - $onlyActiveOnes = true; - $reqVal = $this->request->getPost('val') ?? 'id'; - $menu = $this->model->getAllForMenu($reqVal . ', ancho', 'ancho', $onlyActiveOnes, false); - $nonItem = new \stdClass; - $nonItem->id = ''; - $nonItem->ancho = '- ' . 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 ?? 'ancho']; - $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); - } + $q = $this->imposicionEsquemaModel->queryDatatable(); + return DataTable::of($q) + ->add( + 'action', + fn($q) => "
". ImposicionEsquemaModel::datatable_buttons($q->id)."
" + ) + ->toJson(true); } - protected function getOrientacionOptions() - { - $orientacionOptions = [ - '' => lang('Basic.global.pleaseSelect'), - 'H' => 'H', - 'V' => 'V', - ]; - return $orientacionOptions; - } public function selectImposicion() { $data = $this->model->querySelect($this->request->getGet('q')); return $this->response->setJSON($data); } + public function selectImposicionEsquema() + { + $data = $this->imposicionEsquemaModel->querySelect($this->request->getGet('q')); + return $this->response->setJSON($data); + } + public function find_imposicion(int $imposicion_id) + { + $imposicionEntity = $this->model->find($imposicion_id)->withImposicionEsquema(); + return $this->response->setJSON($imposicionEntity); + } + public function find_imposicion_esquema(int $imposicion_esquema_id) + { + $imposicionEsquemaEntity = $this->imposicionEsquemaModel->find($imposicion_esquema_id); + return $this->response->setJSON($imposicionEsquemaEntity); + } + public function create() + { + $bodyData = $this->request->getPost(); + $createdId = $this->model->insert($bodyData); + if ($createdId) { + return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true]); + } else { + return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->model->errors(), "status" => true])->setStatusCode(400); + } + } + public function create_imposicion_esquema() + { + $bodyData = $this->request->getPost(); + $createdId = $this->imposicionEsquemaModel->insert($bodyData); + if ($createdId) { + return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => true]); + } else { + return $this->response->setJSON(["message" => lang("App.global_alert_save_error"), "errors" => $this->imposicionEsquemaModel->errors(), "status" => true])->setStatusCode(400); + } + } } diff --git a/ci4/app/Database/Migrations/2025-04-18-210000_AddTableImposicionEsquemas.php b/ci4/app/Database/Migrations/2025-04-18-210000_AddTableImposicionEsquemas.php new file mode 100644 index 00000000..bb738594 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-04-18-210000_AddTableImposicionEsquemas.php @@ -0,0 +1,79 @@ + [ + "type" => "INT", + "unsigned" => true, + "auto_increment" => true + ], + "name" => [ + "type" => "VARCHAR", + "constraint" => 255, + ], + "rows" => [ + "type" => "INT", + "unsigned" => true, + "default" => 0, + ], + "columns" => [ + "type" => "INT", + "unsigned" => true, + "default" => 0, + ], + "orientacion" => [ + "type" => "ENUM", + "constraint" => ["H","V"], + "default" => "H", + ], + "rotativa" => [ + "type" => "BOOLEAN", + "default" => false, + ], + "cosido" => [ + "type" => "BOOLEAN", + "default" => false, + ], + "svg_schema" => [ + "type" => "LONGTEXT", + "null" => true + ], + ]; + + public function up() + { + + $this->forge->addField($this->COLUMNS); + $currenttime = new RawSql("CURRENT_TIMESTAMP"); + $this->forge->addField([ + "created_at" => [ + "type" => "TIMESTAMP", + "default" => $currenttime, + + ], + "updated_at" => [ + "type" => "TIMESTAMP", + "null" => true, + + ], + "deleted_at" => [ + "type" => "TIMESTAMP", + "null" => true, + ], + ]); + $this->forge->addPrimaryKey("id"); + $this->forge->createTable("imposicion_esquemas"); + } + + public function down() + { + $this->forge->dropTable("imposicion_esquemas",true); + + } +} diff --git a/ci4/app/Database/Migrations/2025-04-18-213000_AddFkEsquemaImposiciones.php b/ci4/app/Database/Migrations/2025-04-18-213000_AddFkEsquemaImposiciones.php new file mode 100644 index 00000000..83fd8d30 --- /dev/null +++ b/ci4/app/Database/Migrations/2025-04-18-213000_AddFkEsquemaImposiciones.php @@ -0,0 +1,30 @@ +forge->addColumn("lg_imposiciones", [ + "imposicion_esquema_id" => [ + "type" => "INT", + "unsigned" => true, + ] + ]); + $this->forge->addForeignKey(["imposicion_esquema_id"],"imposicion_esquemas",["id"]); + $this->forge->processIndexes("lg_imposiciones"); + } + + public function down() + { + $this->forge->dropForeignKey("lg_imposiciones","lg_imposiciones_imposicion_esquema_id_foreign"); + $this->forge->dropColumn("lg_imposiciones","imposicion_esquema_id"); + + } +} diff --git a/ci4/app/Entities/Configuracion/Imposicion.php b/ci4/app/Entities/Configuracion/Imposicion.php index fcb0ddaa..9f6640db 100755 --- a/ci4/app/Entities/Configuracion/Imposicion.php +++ b/ci4/app/Entities/Configuracion/Imposicion.php @@ -1,6 +1,8 @@ null, "maquina" => null, "etiqueta" => null, + "imposicion_esquema_id" => null ]; protected $casts = [ "ancho" => "int", "alto" => "int", "unidades" => "?int", + "imposicion_esquema_id" => "?int" + ]; - public function getFullName() : string + public function getFullName(): string { - $ancho_x_alto = $this->attributes["ancho"] ."x". $this->attributes["alto"]; + $ancho_x_alto = $this->attributes["ancho"] . "x" . $this->attributes["alto"]; $unidades = $this->attributes["unidades"] ?? ""; $orientacion = $this->attributes["orientacion"] ?? ""; - return implode("_",[$ancho_x_alto,$unidades,$orientacion]); + return implode("_", [$ancho_x_alto, $unidades, $orientacion]); + } + public function withImposicionEsquema(): self + { + $this->attributes["imposicion_esquema"] = $this->imposicion_esquema(); + return $this; + } + public function imposicion_esquema(): ?ImposicionEsquemaEntity + { + $esquema = null; + if ($this->attributes["imposicion_esquema_id"]) { + $m = model(ImposicionEsquemaModel::class); + $esquema = $m->find($this->attributes["imposicion_esquema_id"]); + } + return $esquema; } } diff --git a/ci4/app/Entities/Configuracion/ImposicionEsquemaEntity.php b/ci4/app/Entities/Configuracion/ImposicionEsquemaEntity.php new file mode 100644 index 00000000..30723491 --- /dev/null +++ b/ci4/app/Entities/Configuracion/ImposicionEsquemaEntity.php @@ -0,0 +1,26 @@ + null, + "rows" => null, + "columns" => null, + "orientacion"=> null, + "rotativa"=> null, + "cosido"=> null, + "svg_schema"=> null + ]; + protected $dates = ['created_at', 'updated_at', 'deleted_at']; + protected $casts = [ + "name" => "string", + "rows" => "integer", + "columns" => "integer", + "rotativa"=> "boolean", + "cosido"=> "boolean", + ]; +} diff --git a/ci4/app/Language/en/Imposiciones.php b/ci4/app/Language/en/Imposiciones.php new file mode 100644 index 00000000..5d47a904 --- /dev/null +++ b/ci4/app/Language/en/Imposiciones.php @@ -0,0 +1,7 @@ + 'The {field} field may only contain alphabetical characters.', + 'alpha_dash' => 'The {field} field may only contain alphanumeric characters, underscores, and dashes.', + 'alpha_numeric' => 'The {field} field may only contain alphanumeric characters.', + 'alpha_numeric_punct' => 'The {field} field may only contain alphanumeric characters, spaces, and punctuation: ~!#$%&*-_+=|:.', + 'alpha_numeric_space' => 'The {field} field may only contain alphanumeric characters and spaces.', + 'alpha_space' => 'The {field} field may only contain alphabetical characters and spaces.', + 'decimal' => 'The {field} field must contain a decimal number.', + 'differs' => 'The {field} field must differ from the {param} field.', + 'exact_length' => 'The {field} field must be exactly {param} characters in length.', + 'field_exists' => 'The {field} field must exist.', + 'greater_than' => 'The {field} field must be greater than {param}.', + 'greater_than_equal_to' => 'The {field} field must be greater than or equal to {param}.', + 'hex' => 'The {field} field may only contain hexadecimal characters.', + 'if_exist' => 'The {field} field will be validated only if it exists.', + 'in_list' => 'The {field} field must be one of: {param}.', + 'integer' => 'The {field} field must contain an integer.', + 'is_natural' => 'The {field} field must only contain natural numbers.', + 'is_natural_no_zero' => 'The {field} field must only contain natural numbers greater than zero.', + 'is_not_unique' => 'The {field} field value already exists in the database.', + 'is_unique' => 'The {field} field value must be unique.', + 'less_than' => 'The {field} field must be less than {param}.', + 'less_than_equal_to' => 'The {field} field must be less than or equal to {param}.', + 'matches' => 'The {field} field does not match the {param} field.', + 'max_length' => 'The {field} field cannot exceed {param} characters in length.', + 'min_length' => 'The {field} field must be at least {param} characters in length.', + 'not_in_list' => 'The {field} field must not be one of: {param}.', + 'numeric' => 'The {field} field must contain only numeric characters.', + 'permit_empty' => 'The {field} field may be empty.', + 'regex_match' => 'The {field} field format is invalid.', + 'required' => 'The {field} field is required.', + 'required_with' => 'The {field} field is required when {param} is present.', + 'required_without' => 'The {field} field is required when {param} is absent.', + 'string' => 'The {field} field must be a string.', + 'timezone' => 'The {field} field must be a valid timezone.', + 'valid_base64' => 'The {field} field must contain a valid Base64 string.', + 'valid_cc_number' => 'The {field} must be a valid credit card number for the specified provider.', + 'valid_date' => 'The {field} field must contain a valid date in the format {param}.', + 'valid_email' => 'The {field} field must contain a valid email address.', + 'valid_emails' => 'All values in the {field} field must be valid email addresses.', + 'valid_ip' => 'The {field} field must contain a valid {param} IP address.', + 'valid_json' => 'The {field} field must contain a valid JSON string.', + 'valid_url' => 'The {field} field must contain a valid URL.', + 'valid_url_strict' => 'The {field} field must contain a valid URL using one of these schemas: {param}.', +]; diff --git a/ci4/app/Language/es/Imposiciones.php b/ci4/app/Language/es/Imposiciones.php new file mode 100644 index 00000000..a65e8f17 --- /dev/null +++ b/ci4/app/Language/es/Imposiciones.php @@ -0,0 +1,38 @@ + "Lista imposiciones", + "id" => "id", + "ancho" => "Ancho", + "alto" => "Alto", + "unidades" => "Unidades", + "orientacion" => "Orientación", + "maquina" => "Máquina", + "etiqueta" => "Etiqueta", + "imposicion" => "Imposición", + "btnNewImposicion" => "Nueva imposición", + "btnNewImposicionEsquema" => "Nuevo esquema", + "H" => "Horizontal", + "V" => "Vertical", + "imposicion_esquemas" => "Esquemas", + "imposicion_esquema" => "Esquema", + "imposicion_esquema_drawing" => "Esquema imposicion dibujo", + "imposicion_esquema_link" => "Imposicion esquema link", + + "validation" => [ + "alto" => [ + "required" => "Este campo es obligatorio", + ], + "ancho" => [ + "required" => "Este campo es obligatorio", + ] + ], + "esquema" => [ + "name" => "Nombre", + "rows" => "Filas", + "columns" => "Columnas", + "rotativa" => "Rotativa", + "cosido" => "Cosido/Grapado" + ] +]; diff --git a/ci4/app/Language/es/Validation.php b/ci4/app/Language/es/Validation.php index 54d1e7a4..e6871db2 100755 --- a/ci4/app/Language/es/Validation.php +++ b/ci4/app/Language/es/Validation.php @@ -1,4 +1,47 @@ 'El campo {field} solo puede contener caracteres alfabéticos.', + 'alpha_dash' => 'El campo {field} solo puede contener caracteres alfanuméricos, guiones y guiones bajos.', + 'alpha_numeric' => 'El campo {field} solo puede contener caracteres alfanuméricos.', + 'alpha_numeric_punct' => 'El campo {field} solo puede contener caracteres alfanuméricos, espacios y los siguientes signos de puntuación: ~!#$%&*-_+=|:.', + 'alpha_numeric_space' => 'El campo {field} solo puede contener caracteres alfanuméricos y espacios.', + 'alpha_space' => 'El campo {field} solo puede contener caracteres alfabéticos y espacios.', + 'decimal' => 'El campo {field} debe contener un número decimal.', + 'differs' => 'El campo {field} debe ser diferente al campo {param}.', + 'exact_length' => 'El campo {field} debe tener exactamente {param} caracteres.', + 'field_exists' => 'El campo {field} debe existir.', + 'greater_than' => 'El campo {field} debe ser mayor que {param}.', + 'greater_than_equal_to' => 'El campo {field} debe ser mayor o igual que {param}.', + 'hex' => 'El campo {field} solo puede contener caracteres hexadecimales.', + 'if_exist' => 'El campo {field} se validará solo si existe.', + 'in_list' => 'El campo {field} debe ser uno de los siguientes: {param}.', + 'integer' => 'El campo {field} debe contener un número entero.', + 'is_natural' => 'El campo {field} solo puede contener números naturales.', + 'is_natural_no_zero' => 'El campo {field} solo puede contener números naturales mayores que cero.', + 'is_not_unique' => 'El valor del campo {field} ya existe en la base de datos.', + 'is_unique' => 'El valor del campo {field} debe ser único.', + 'less_than' => 'El campo {field} debe ser menor que {param}.', + 'less_than_equal_to' => 'El campo {field} debe ser menor o igual que {param}.', + 'matches' => 'El campo {field} no coincide con el campo {param}.', + 'max_length' => 'El campo {field} no puede superar los {param} caracteres.', + 'min_length' => 'El campo {field} debe tener al menos {param} caracteres.', + 'not_in_list' => 'El campo {field} no debe ser uno de los siguientes: {param}.', + 'numeric' => 'El campo {field} solo puede contener caracteres numéricos.', + 'permit_empty' => 'El campo {field} puede estar vacío.', + 'regex_match' => 'El campo {field} no tiene el formato correcto.', + 'required' => 'El campo {field} es obligatorio.', + 'required_with' => 'El campo {field} es obligatorio cuando {param} está presente.', + 'required_without' => 'El campo {field} es obligatorio cuando {param} no está presente.', + 'string' => 'El campo {field} debe ser una cadena de texto.', + 'timezone' => 'El campo {field} debe contener una zona horaria válida.', + 'valid_base64' => 'El campo {field} debe contener una cadena Base64 válida.', + 'valid_cc_number' => 'El campo {field} debe contener un número de tarjeta de crédito válido para el proveedor especificado.', + 'valid_date' => 'El campo {field} debe contener una fecha válida con el formato {param}.', + 'valid_email' => 'El campo {field} debe contener una dirección de correo electrónico válida.', + 'valid_emails' => 'Todos los valores del campo {field} deben ser direcciones de correo electrónico válidas.', + 'valid_ip' => 'El campo {field} debe contener una dirección IP válida del tipo {param}.', + 'valid_json' => 'El campo {field} debe contener una cadena JSON válida.', + 'valid_url' => 'El campo {field} debe contener una URL válida.', + 'valid_url_strict' => 'El campo {field} debe contener una URL válida con el esquema: {param}.', +]; diff --git a/ci4/app/Models/Configuracion/ImposicionEsquemaModel.php b/ci4/app/Models/Configuracion/ImposicionEsquemaModel.php new file mode 100644 index 00000000..448054dd --- /dev/null +++ b/ci4/app/Models/Configuracion/ImposicionEsquemaModel.php @@ -0,0 +1,123 @@ + [ + "label" => "Imposiciones.esquema.name", + "rules" => "required|alpha_numeric_punct", + ], + "rows" => [ + "label" => "Imposiciones.esquema.rows", + "rules" => "required|integer" + ], + "columns" => [ + "label" => "Imposiciones.esquema.columns", + "rules" => "required|integer" + ], + "orientacion" => [ + "label" => "Imposiciones.esquema.orientacion", + "rules" => "required|in_list[V,H]" + ], + + ]; + protected $validationMessages = [ + "name" => [ + "required" => "Validation.required", + ], + "rows" => [ + "required" => "Validation.required", + "integer" => "Validation.integer", + ], + "columns" => [ + "required" => "Validation.required", + "integer" => "Validation.integer", + ], + "orientacion" => [ + "required" => "Validation.required", + "in_list" => "Validation.in_liust", + ], + ]; + protected $skipValidation = false; + protected $cleanValidationRules = true; + + // Callbacks + protected $allowCallbacks = true; + protected $beforeInsert = []; + protected $afterInsert = []; + protected $beforeUpdate = []; + protected $afterUpdate = []; + protected $beforeFind = []; + protected $afterFind = []; + protected $beforeDelete = []; + protected $afterDelete = []; + + public function querySelect(?string $q) + { + $query = $this->builder()->select([ + "id", + "name", + "svg_schema as description" + ]); + if ($q) { + $query->orLike("name", $q); + } + return $query + ->orderBy('id', 'ASC') + ->get()->getResultArray(); + } + public function queryDatatable() + { + return $this->builder() + ->select([ + "id", + "name", + "svg_schema" + + ])->where('deleted_at', null); + } + public static function datatable_buttons(int $id) + { + $btn = ""; + if (auth()->user()->inGroup("admin")) { + $btn .= ""; + $btn .= ""; + } + return $btn; + } +} diff --git a/ci4/app/Models/Configuracion/ImposicionModel.php b/ci4/app/Models/Configuracion/ImposicionModel.php index b21def73..02af0411 100755 --- a/ci4/app/Models/Configuracion/ImposicionModel.php +++ b/ci4/app/Models/Configuracion/ImposicionModel.php @@ -2,7 +2,10 @@ namespace App\Models\Configuracion; -class ImposicionModel extends \App\Models\BaseModel +use App\Entities\Configuracion\Imposicion; +use App\Models\BaseModel; + +class ImposicionModel extends BaseModel { protected $table = "lg_imposiciones"; @@ -23,8 +26,8 @@ class ImposicionModel extends \App\Models\BaseModel 7 => "t1.etiqueta", ]; - protected $allowedFields = ["ancho", "alto", "unidades", "orientacion", "maquina", "etiqueta"]; - protected $returnType = "App\Entities\Configuracion\Imposicion"; + protected $allowedFields = ["ancho", "alto", "unidades", "orientacion", "maquina", "etiqueta","imposicion_esquema_id"]; + protected $returnType = Imposicion::class; public static $labelField = "ancho"; @@ -53,6 +56,10 @@ class ImposicionModel extends \App\Models\BaseModel "label" => "Imposiciones.unidades", "rules" => "integer|permit_empty", ], + "imposicion_esquema_id" => [ + "label" => "Imposiciones.imposicion_esquema", + "rules" => "integer|permit_empty", + ], ]; protected $validationMessages = [ @@ -76,6 +83,9 @@ class ImposicionModel extends \App\Models\BaseModel "unidades" => [ "integer" => "Imposiciones.validation.unidades.integer", ], + "imposicion_esquema_id" => [ + "integer" => "Imposiciones.validation.unidades.integer", + ], ]; /** @@ -129,4 +139,26 @@ class ImposicionModel extends \App\Models\BaseModel ->orderBy('id', 'ASC') ->get()->getResultArray(); } + public function queryDatatable() + { + return $this->builder() + ->select([ + "id", + "ancho", + "alto", + "unidades", + "maquina", + "orientacion", + "etiqueta" + ])->where('deleted_at', null); + } + public static function datatable_buttons(int $id) + { + $btn = ""; + if(auth()->user()->inGroup("admin")){ + $btn.=""; + $btn.=""; + } + return $btn; + } } diff --git a/ci4/app/Views/themes/vuexy/components/modals/modalNewImposicion.php b/ci4/app/Views/themes/vuexy/components/modals/modalNewImposicion.php new file mode 100644 index 00000000..40fadd11 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/components/modals/modalNewImposicion.php @@ -0,0 +1,20 @@ + + \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/components/tables/imposicion_esquema_table.php b/ci4/app/Views/themes/vuexy/components/tables/imposicion_esquema_table.php new file mode 100644 index 00000000..5c285994 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/components/tables/imposicion_esquema_table.php @@ -0,0 +1,12 @@ + + + + + + + + + + + +
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionEsquemaFormItems.php b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionEsquemaFormItems.php new file mode 100644 index 00000000..53cb5a46 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionEsquemaFormItems.php @@ -0,0 +1,64 @@ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ +
+
+
+
+
+ +
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionFormItems.php b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionFormItems.php index 6ffe399c..5556a088 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/_imposicionFormItems.php @@ -1,64 +1,64 @@
-
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
+
+ + +
+
+ + +
-
- - -
- -
- - -
- -
- -
- -
- - -
- -
-
-
- - -
- -
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionEsquemaForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionEsquemaForm.php new file mode 100644 index 00000000..73ad8f27 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionEsquemaForm.php @@ -0,0 +1,41 @@ +include("themes/_commonPartialsBs/select2bs5") ?> +include("themes/_commonPartialsBs/sweetalert") ?> +extend('themes/vuexy/main/defaultlayout') ?> +section("content") ?> +
+
+
+
+

+
+
+
+ + +
+ +
+
+
+
+endSection() ?> + +section('css') ?> +" /> + + + +endSection() ?> + + +section('additionalExternalJs') ?> + + + + +endSection() ?> \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionForm.php index b1ebaed4..1175e877 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionForm.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionForm.php @@ -1,26 +1,40 @@ include("themes/_commonPartialsBs/select2bs5") ?> include("themes/_commonPartialsBs/sweetalert") ?> -extend('themes/vuexy/main/defaultlayout') ?> +extend('themes/vuexy/main/defaultlayout') ?> section("content") ?>
-
+
-

+

-
- -
- - getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?> - -
- + +
+ + +
+
-
-
+
+
endSection() ?> + +section('css') ?> +" /> + + + +endSection() ?> + + +section('additionalExternalJs') ?> + + + +endSection() ?> \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionList.php b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionList.php index 260e963b..b1e233f9 100644 --- a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionList.php +++ b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionList.php @@ -1,168 +1,83 @@ -include('themes/_commonPartialsBs/datatables') ?> -include('themes/_commonPartialsBs/sweetalert') ?> -extend('themes/vuexy/main/defaultlayout') ?> -section('content'); ?> +include('themes/_commonPartialsBs/datatables') ?> +include('themes/_commonPartialsBs/sweetalert') ?> +extend('themes/vuexy/main/defaultlayout') ?> +section('content'); ?> +
+ - -endSection() ?> + endSection() ?> -section('additionalInlineJs') ?> - - const lastColNr = $('#tableOfImposiciones').find("tr:first th").length - 1; - const actionBtns = function(data) { - return ` -
- - -
- `; - }; - theTable = $('#tableOfImposiciones').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: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json" - }, - ajax : $.fn.dataTable.pipeline( { - url: '', - method: 'POST', - headers: {'X-Requested-With': 'XMLHttpRequest'}, - async: true, - }), - columnDefs: [ - { - orderable: false, - searchable: false, - targets: [lastColNr] - } - ], - columns : [ - //{ 'data': actionBtns }, - { 'data': 'id' }, - { 'data': 'ancho' }, - { 'data': 'alto' }, - { 'data': 'unidades' }, - { 'data': 'orientacion' }, - { 'data': 'maquina' }, - { 'data': 'etiqueta' }, - { 'data': actionBtns } - ] - }); - - - - -$(document).on('click', '.btn-edit', function(e) { - window.location.href = `/${$(this).attr('data-id')}/edit`; - }); - -$(document).on('click', '.btn-delete', function(e) { - Swal.fire({ - title: '', - text: '', - icon: 'warning', - showCancelButton: true, - confirmButtonColor: '#3085d6', - confirmButtonText: '', - cancelButtonText: '', - cancelButtonColor: '#d33' - }) - .then((result) => { - const dataId = $(this).data('id'); - const row = $(this).closest('tr'); - if (result.value) { - $.ajax({ - url: `/${dataId}`, - method: 'DELETE', - }).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, - }); - }) - } - }); - }); - -endSection() ?> -section('css') ?> + section('css') ?> + " /> + + + "> -endSection() ?> + endSection() ?> -section('additionalExternalJs') ?> + section('additionalExternalJs') ?> - - + + -endSection() ?> + + endSection() ?> \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionNewForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionNewForm.php new file mode 100644 index 00000000..57c5d09f --- /dev/null +++ b/ci4/app/Views/themes/vuexy/form/configuracion/imposiciones/viewImposicionNewForm.php @@ -0,0 +1,40 @@ +include("themes/_commonPartialsBs/select2bs5") ?> +include("themes/_commonPartialsBs/sweetalert") ?> +extend('themes/vuexy/main/defaultlayout') ?> +section("content") ?> +
+
+
+
+

+
+
+
+ + +
+ +
+
+
+
+endSection() ?> + +section('css') ?> +" /> + + + +endSection() ?> + + +section('additionalExternalJs') ?> + + + +endSection() ?> \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/main/menus/configuracion_menu.php b/ci4/app/Views/themes/vuexy/main/menus/configuracion_menu.php index bc04b2ed..ed70b71a 100644 --- a/ci4/app/Views/themes/vuexy/main/menus/configuracion_menu.php +++ b/ci4/app/Views/themes/vuexy/main/menus/configuracion_menu.php @@ -70,6 +70,13 @@ if ( + user()->inGroup('admin')) { ?> + + user()->can('usuarios.menu')) { ?>