diff --git a/ci4/app/Controllers/Activity.php b/ci4/app/Controllers/Activity.php index 41c49144..1e909bcf 100644 --- a/ci4/app/Controllers/Activity.php +++ b/ci4/app/Controllers/Activity.php @@ -27,8 +27,7 @@ class Activity extends BaseController ]; $data['breadcrumb'] = [ - ['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false], - ['title' => lang("App.activity_title"), 'route' => "", 'active' => true] + ['title' => lang("App.menu_activity"), 'route' => site_url('activity'), 'active' => true] ]; $data['logs'] = $this->activity_model->select('SUM( IF( os LIKE "%Windows%", 1, 0 ) ) AS windows, diff --git a/ci4/app/Controllers/Configuracion/Papelesgenericos.php b/ci4/app/Controllers/Configuracion/Papelesgenericos.php index 52678da8..975cac76 100644 --- a/ci4/app/Controllers/Configuracion/Papelesgenericos.php +++ b/ci4/app/Controllers/Configuracion/Papelesgenericos.php @@ -40,6 +40,12 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController // Se indica el flag para los ficheros borrados $this->delete_flag = 1; + // Breadcrumbs + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_configuration"), 'route' => "", 'active' => false], + ['title' => lang("App.menu_papelgenerico"), 'route' => site_url('configuracion/papelesgenericos'), 'active' => true] + ]; + parent::initController($request, $response, $logger); } diff --git a/ci4/app/Controllers/Configuracion/Papelesimpresion.php b/ci4/app/Controllers/Configuracion/Papelesimpresion.php index e8bfdbea..a1c693c3 100644 --- a/ci4/app/Controllers/Configuracion/Papelesimpresion.php +++ b/ci4/app/Controllers/Configuracion/Papelesimpresion.php @@ -63,6 +63,12 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController $this->tpModel = new PapelImpresionTipologiaModel(); + // Breadcrumbs + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_configuration"), 'route' => "", 'active' => false], + ['title' => lang("App.menu_papelimpresion"), 'route' => site_url('configuracion/papelesimpresion'), 'active' => true] + ]; + parent::initController($request, $response, $logger); } diff --git a/ci4/app/Controllers/Settings.php b/ci4/app/Controllers/Settings.php index 25033d98..506eaca0 100644 --- a/ci4/app/Controllers/Settings.php +++ b/ci4/app/Controllers/Settings.php @@ -50,8 +50,7 @@ class Settings extends BaseController ]; $data['breadcrumb'] = [ - ['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false], - ['title' => lang("App.menu_settings"), 'route' => "", 'active' => true] + ['title' => lang("App.menu_settings"), 'route' => site_url('settings'), 'active' => true] ]; $data['obj'] = $this->settings_model->first(); diff --git a/ci4/app/Controllers/Tarifas/Tarifaacabado.php b/ci4/app/Controllers/Tarifas/Tarifaacabado.php index 6e6efd6c..12ccaf84 100644 --- a/ci4/app/Controllers/Tarifas/Tarifaacabado.php +++ b/ci4/app/Controllers/Tarifas/Tarifaacabado.php @@ -1,4 +1,4 @@ -viewData['pageTitle'] = lang('Tarifaacabado.moduleTitle'); $this->viewData['usingSweetAlert'] = true; @@ -37,28 +38,37 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { $this->delete_flag = 1; $this->viewData = ['usingServerSideDataTable' => true]; + + // Breadcrumbs + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_tarifas"), 'route' => "", 'active' => false], + ['title' => lang("App.menu_tarifaacabado"), 'route' => site_url('tarifas/tarifaacabado'), 'active' => true] + ]; + parent::initController($request, $response, $logger); } - public function index() { - + public function index() + { + $viewData = [ - 'currentModule' => static::$controllerSlug, - 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Tarifaacabado.tarifaacabado')]), - 'tarifaacabadoEntity' => new TarifaacabadoEntity(), - 'usingServerSideDataTable' => true, - - ]; + 'currentModule' => static::$controllerSlug, + 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Tarifaacabado.tarifaacabado')]), + 'tarifaacabadoEntity' => new TarifaacabadoEntity(), + 'usingServerSideDataTable' => true, + + ]; $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class - return view(static::$viewPath.'viewTarifaAcabadoList', $viewData); + return view(static::$viewPath . 'viewTarifaAcabadoList', $viewData); } - public function add() { - + public function add() + { + // JJO $session = session(); @@ -69,44 +79,44 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { $nullIfEmpty = true; // !(phpversion() >= '8.1'); $postData = $this->request->getPost(); - - $sanitizedData = $this->sanitized($postData, $nullIfEmpty); + + $sanitizedData = $this->sanitized($postData, $nullIfEmpty); // JJO - if(isset($this->model->user_update_id)){ - $sanitizedData['user_created_id'] = $session->id_user; + if (isset($this->model->user_update_id)) { + $sanitizedData['user_created_id'] = $session->id_user; } $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('Tarifaacabado.tarifaacabado'))]); - $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('Tarifaacabado.tarifaacabado'))]); + $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('Tarifaacabado.tarifaacabado'))]).'.'; - $message .= anchor( "tarifasacabado/{$id}/edit" , lang('Basic.global.continueEditing').'?'); + $message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]) . '.'; + $message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?'); $message = ucfirst(str_replace("'", "\'", $message)); if ($thenRedirect) : if (!empty($this->indexRoute)) : - return redirect()->to(route_to('tarifas/tarifaacabado/edit/'.$id))->with('sweet-success', $message); - //return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message); + return redirect()->to(route_to('tarifas/tarifaacabado/edit/' . $id))->with('sweet-success', $message); + //return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message); else: return $this->redirect2listView('sweet-success', $message); endif; @@ -122,17 +132,18 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { $this->viewData['formAction'] = route_to('createTarifaAcabado'); - $this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Tarifaacabado.moduleTitle').' '.lang('Basic.global.addNewSuffix'); - + $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Tarifaacabado.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix'); + return $this->displayForm(__METHOD__); } // end function add() - public function edit($requestedId = null) { + public function edit($requestedId = null) + { // JJO $session = session(); - + if ($requestedId == null) : return $this->redirect2listView(); endif; @@ -149,43 +160,42 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { if ($requestMethod === 'post') : $nullIfEmpty = true; // !(phpversion() >= '8.1'); - + $postData = $this->request->getPost(); - + $sanitizedData = $this->sanitized($postData, $nullIfEmpty); - + // JJO - if(isset($this->model->user_update_id)){ - $sanitizedData['user_update_id'] = $session->id_user; + if (isset($this->model->user_update_id)) { + $sanitizedData['user_update_id'] = $session->id_user; } - + $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('Tarifaacabado.tarifaacabado'))]); - $this->session->setFlashdata('formErrors', $this->model->errors()); - - endif; - - $tarifaacabadoEntity->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('Tarifaacabado.tarifaacabado'))]); + $this->session->setFlashdata('formErrors', $this->model->errors()); + + endif; + + $tarifaacabadoEntity->fill($sanitizedData); + + $thenRedirect = true; endif; - + if ($noException && $successfulResult) : $id = $tarifaacabadoEntity->id ?? $id; - $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]).'.'; - $message .= anchor( "tarifasacabado/{$id}/edit" , lang('Basic.global.continueEditing').'?'); + $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]) . '.'; + $message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?'); $message = ucfirst(str_replace("'", "\'", $message)); if ($thenRedirect) : @@ -197,7 +207,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { else: $this->session->setFlashData('sweet-success', $message); endif; - + endif; // $noException && $successfulResult endif; // ($requestMethod === 'post') @@ -205,20 +215,20 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { $this->viewData['formAction'] = route_to('updateTarifaAcabado', $id); - $this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Tarifaacabado.moduleTitle').' '.lang('Basic.global.edit3'); - - + $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Tarifaacabado.moduleTitle') . ' ' . lang('Basic.global.edit3'); + + 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; } $start = $reqData['start'] ?? 0; @@ -240,15 +250,16 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { } } - 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(); @@ -262,7 +273,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { } } - public function menuItems() { + public function menuItems() + { if ($this->request->isAJAX()) { $searchStr = goSanitize($this->request->getPost('searchTerm'))[0]; $reqId = goSanitize($this->request->getPost('id'))[0]; @@ -273,8 +285,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController { $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(); diff --git a/ci4/app/Controllers/Tarifas/Tarifapreimpresion.php b/ci4/app/Controllers/Tarifas/Tarifapreimpresion.php index 000066c4..1d515568 100644 --- a/ci4/app/Controllers/Tarifas/Tarifapreimpresion.php +++ b/ci4/app/Controllers/Tarifas/Tarifapreimpresion.php @@ -21,11 +21,18 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) { - $this->viewData['pageTitle'] = lang('Preimpresions.moduleTitle'); + $this->viewData['pageTitle'] = lang('Tarifapreimpresion.moduleTitle'); // 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; + + // Breadcrumbs + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_tarifas"), 'route' => "", 'active' => false], + ['title' => lang("App.menu_tarifapreimpresion"), 'route' => site_url('tarifas/tarifapreimpresion'), 'active' => true] + ]; + parent::initController($request, $response, $logger); } @@ -34,7 +41,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $this->viewData['usingClientSideDataTable'] = true; - $this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Preimpresions.tarifapreimpresion')]); + $this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Tarifapreimpresion.tarifapreimpresion')]); parent::index(); } @@ -65,7 +72,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $this->dealWithException($e); } else: - $this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Preimpresions.tarifapreimpresion'))]); + $this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifapreimpresion.tarifapreimpresion'))]); $this->session->setFlashdata('formErrors', $this->model->errors()); endif; @@ -75,7 +82,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $id = $this->model->db->insertID(); - $message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Preimpresions.tarifapreimpresion'))]).'.'; + $message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifapreimpresion.tarifapreimpresion'))]).'.'; $message .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?'); $message = ucfirst(str_replace("'", "\'", $message)); @@ -97,7 +104,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $this->viewData['formAction'] = route_to('createTarifapreimpresion'); - $this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Preimpresions.tarifapreimpresion').' '.lang('Basic.global.addNewSuffix'); + $this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Tarifapreimpresion.tarifapreimpresion').' '.lang('Basic.global.addNewSuffix'); return $this->displayForm(__METHOD__); @@ -115,7 +122,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $tarifapreimpresionEntity = $this->model->find($id); if ($tarifapreimpresionEntity == false) : - $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Preimpresions.tarifapreimpresion')), $id]); + $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tarifapreimpresion.tarifapreimpresion')), $id]); return $this->redirect2listView('errorMessage', $message); endif; @@ -146,7 +153,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $this->dealWithException($e); } else: - $this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Preimpresions.tarifapreimpresion'))]); + $this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifapreimpresion.tarifapreimpresion'))]); $this->session->setFlashdata('formErrors', $this->model->errors()); endif; @@ -157,7 +164,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { endif; if ($noException && $successfulResult) : $id = $tarifapreimpresionEntity->id ?? $id; - $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Preimpresions.tarifapreimpresion'))]).'.'; + $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifapreimpresion.tarifapreimpresion'))]).'.'; $message .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?'); $message = ucfirst(str_replace("'", "\'", $message)); @@ -178,7 +185,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController { $this->viewData['formAction'] = route_to('updateTarifapreimpresion', $id); - $this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Preimpresions.tarifapreimpresion').' '.lang('Basic.global.edit3'); + $this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Tarifapreimpresion.tarifapreimpresion').' '.lang('Basic.global.edit3'); return $this->displayForm(__METHOD__, $id); diff --git a/ci4/app/Controllers/Tarifas/Tarifasmanipulado.php b/ci4/app/Controllers/Tarifas/Tarifasmanipulado.php index 560173de..3a4184a1 100644 --- a/ci4/app/Controllers/Tarifas/Tarifasmanipulado.php +++ b/ci4/app/Controllers/Tarifas/Tarifasmanipulado.php @@ -37,6 +37,13 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController { $this->delete_flag = 1; $this->viewData = ['usingServerSideDataTable' => true]; // JJO + + // Breadcrumbs + $this->viewData['breadcrumb'] = [ + ['title' => lang("App.menu_tarifas"), 'route' => "", 'active' => false], + ['title' => lang("App.menu_tarifamanipulado"), 'route' => site_url('tarifas/tarifamanipulado'), 'active' => true] + ]; + parent::initController($request, $response, $logger); } diff --git a/ci4/app/Controllers/Usuarios/Groupold.php b/ci4/app/Controllers/Usuarios/Groupold.php deleted file mode 100644 index 263733b0..00000000 --- a/ci4/app/Controllers/Usuarios/Groupold.php +++ /dev/null @@ -1,313 +0,0 @@ -viewData['pageTitle'] = lang('Group.moduleTitle'); - self::$viewPath = getenv('theme.path').'form/group/'; - - parent::initController($request, $response, $logger); - - } - - public function index() - { - $this->viewData['usingClientSideDataTable'] = true; - $this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Groups.group')]); - // IMN - $this->group_user_model = new GroupUserModel(); - $this->viewData['model'] = $this->group_user_model; - - parent::index(); - } - - public function add() - { - - $requestMethod = $this->request->getMethod(); - - if ($requestMethod === 'post') : - - $nullIfEmpty = true; // !(phpversion() >= '8.1'); - - $postData = $this->request->getPost(); - - - - $title = $postData['title']; - $dashboard = $postData['dashboard']; - unset($postData['title']); - unset($postData['dashboard']); - unset($postData['id_group']); - unset($postData['save']); - - $controller = null; - $rules_access = null; - - foreach ($postData as $key=>$value){ - $exp = explode('_',$key); - $controller[] = $exp[0]; - } - - if($controller != null){ - foreach (array_unique($controller) as $item){ - $rules_access[$item] = []; - - foreach ($postData as $key=>$value){ - $exp = explode('_',$key); - if($exp[0] == $item){ - array_push($rules_access[$item],str_replace($exp[0].'_','',$key)) ; - } - } - } - } - - - - $temp_data['rules'] = json_encode($rules_access??'{}'); - $temp_data['token'] = md5(uniqid(rand(), true));; - $temp_data['title'] = $title; - $temp_data['dashboard'] = $dashboard; - - $sanitizedData = $this->sanitized($temp_data, $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('Group.userGroup'))]); - $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('Group.userGroup'))]).'.'; - $message .= anchor( "admin/user-groups/{$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->viewData['successMessage'] = $message; - endif; - - endif; // $noException && $successfulResult - - endif; // ($requestMethod === 'post') - - $this->viewData['group'] = isset($sanitizedData) ? new UserGroupModel($sanitizedData) : new UserGroupModel(); - - $this->viewData['formAction'] = route_to('createGroup'); - - $this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Group.moduleTitle').' '.lang('Basic.global.addNewSuffix'); - - - return $this->displayForm(__METHOD__); - } - - - public function edit($requestedId = null) { - - helper('general'); - $session = session(); - - if ($requestedId == null) : - return $this->redirect2listView(); - endif; - $id = filter_var($requestedId, FILTER_SANITIZE_URL); - $groupEntity = $this->model->find($id); - - if ($groupEntity == false) : - $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Group.userGroup')), $id]); - return $this->redirect2listView('errorMessage', $message); - endif; - - $requestMethod = $this->request->getMethod(); - - if ($requestMethod === 'post') : - - $nullIfEmpty = true; // !(phpversion() >= '8.1'); - - $postData = $this->request->getPost(); - - $id_group = $groupEntity->id_group; - $token = $groupEntity->token; - $title = $postData['title']; - $dashboard = $postData['dashboard']; - - unset($postData['id_group']); - unset($postData['title']); - unset($postData['dashboard']); - - $controller = null; - $rules_access = null; - - foreach ($postData as $key=>$value){ - $exp = explode('_',$key); - $controller[] = $exp[0]; - } - - if($controller != null){ - foreach (array_unique($controller) as $item){ - $rules_access[$item] = []; - - foreach ($postData as $key=>$value){ - $exp = explode('_',$key); - if($exp[0] == $item){ - array_push($rules_access[$item],str_replace($exp[0].'_','',$key)) ; - } - } - } - } - - $temp_data['id_group'] = $id_group; - $temp_data['rules'] = json_encode($rules_access??'{}'); - $temp_data['token'] = $token; - $temp_data['title'] = $title; - $temp_data['dashboard'] = $dashboard; - - $sanitizedData = $this->sanitized($temp_data, $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('Group.userGroup'))]); - $this->session->setFlashdata('formErrors', $this->model->errors()); - - endif; - - $groupEntity->fill($sanitizedData); - - $thenRedirect = true; - endif; - if ($noException && $successfulResult) : - $id = $groupEntity->id ?? $id; - $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Group.userGroup'))]).'.'; - $message .= anchor(route_to('editGroup', $id), lang('Basic.global.continueEditing').'?'); - $message = ucfirst(str_replace("'", "\'", $message)); - - if($session->get('group') == $this->request->getPost('token')){ - $session->set('rules', $temp_data['rules']); - } - if ($thenRedirect) : - if (!empty($this->indexRoute)) : - return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message); - else: - return $this->redirect2listView('successMessage', $message); - endif; - else: - $this->viewData['successMessage'] = $message; - endif; - - endif; // $noException && $successfulResult - endif; // ($requestMethod === 'post') - - $this->viewData['group'] = $groupEntity; - - $this->viewData['formAction'] = route_to('updateGroup', $id); - - $this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Group.userGroup').' '.lang('Basic.global.edit3'); - - - return $this->displayForm(__METHOD__, $id); - } // end function edit(...) - - - - 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); - } - } -} diff --git a/ci4/app/Controllers/Usuarios/Usersold.php b/ci4/app/Controllers/Usuarios/Usersold.php deleted file mode 100644 index 49a3d83b..00000000 --- a/ci4/app/Controllers/Usuarios/Usersold.php +++ /dev/null @@ -1,310 +0,0 @@ -group_model = new UserGroupModel(); - $this->group_user_model = new GroupUserModel(); - $this->user_model = new UserModel(); - - $this->viewData['pageTitle'] = lang('Users.moduleTitle'); - parent::initController($request, $response, $logger); - - } - - public function index() { - - $this->viewData['usingClientSideDataTable'] = true; - - $this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]); - - $this->viewData['user_model'] = $this->user_model; - - parent::index(); - - } - - public function add() { - - $requestMethod = $this->request->getMethod(); - - if ($requestMethod === 'post') : - - $nullIfEmpty = true; // !(phpversion() >= '8.1'); - - $postData = $this->request->getPost(); - - if(!empty($postData['password'])){ - $phpass = new PasswordHash(8, true); - $postData['password'] = $phpass->HashPassword($this->request->getPost('password')); - } - - $currentGroups = $postData['group']; - unset($postData['group']); - - $sanitizedData = $this->sanitized($postData, $nullIfEmpty); - - if ($this->request->getPost('last_ip') == null ) { - $sanitizedData['last_ip'] = '::1'; - } - - $sanitizedData['token'] = md5(uniqid(rand(), true)); - - $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('Users.user'))]); - $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(); - foreach($currentGroups as $group){ - $group_user_data = [ - 'token_user' => $sanitizedData['token'], - 'token_group' => $group - ]; - $this->group_user_model->insert($group_user_data); - } - - $message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads'; - $message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?'); - $message = ucfirst(str_replace("'", "\'", $message)); - - if ($thenRedirect) : - if (!empty($this->indexRoute)) : - return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message); - else: - return $this->redirect2listView('successMessage', $message); - endif; - else: - $this->viewData['successMessage'] = $message; - endif; - - endif; // $noException && $successfulResult - - endif; // ($requestMethod === 'post') - - $this->viewData['user'] = isset($sanitizedData) ? new UserEntity($sanitizedData) : new UserEntity(); - $this->viewData['paisList'] = $this->getPaisListItems(); - - $this->viewData['formAction'] = route_to('createUser'); - $this->viewData['groups'] = $this->group_model->select('token,title')->findAll(); - - $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' Users.php' .lang('Users.user').' '.lang('Basic.global.addNewSuffix'); - - - return $this->displayForm(__METHOD__); - } // end function add() - - public function edit($requestedId = null) { - - if ($requestedId == null) : - return $this->redirect2listView(); - endif; - $id = filter_var($requestedId, FILTER_SANITIZE_URL); - $user = $this->model->find($id); - - if ($user == false) : - $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Users.user')), $id]); - return $this->redirect2listView('errorMessage', $message); - endif; - - $requestMethod = $this->request->getMethod(); - - if ($requestMethod === 'post') : - - $nullIfEmpty = true; // !(phpversion() >= '8.1'); - - $postData = $this->request->getPost(); - $currentGroups = $postData['group']; - unset($postData['group']); - - if(!empty($postData['password'])){ - $phpass = new PasswordHash(8, true); - $postData['password'] = $phpass->HashPassword($this->request->getPost('password')); - } - - $sanitizedData = $this->sanitized($postData, $nullIfEmpty); - if ($this->request->getPost('tfa') == null ) { - $sanitizedData['tfa'] = false; - } - if ($this->request->getPost('blocked') == null ) { - $sanitizedData['blocked'] = false; - } - if ($this->request->getPost('last_ip') == null ) { - $sanitizedData['last_ip'] = '::1'; - } - - $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('Users.user'))]); - $this->session->setFlashdata('formErrors', $this->model->errors()); - - endif; - - - $user->fill($sanitizedData); - - - - $thenRedirect = true; - endif; - if ($noException && $successfulResult) : - $postData = $this->request->getPost(); - - $this->group_user_model->where('token_user', $user->token)->delete(); - foreach($currentGroups as $group){ - $group_user_data = [ - 'token_user' => $user->token, - 'token_group' => $group - ]; - $this->group_user_model->insert($group_user_data); - } - - $id = $user->id_user ?? $id; - $message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads'; - $message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?'); - $message = ucfirst(str_replace("'", "\'", $message)); - - if ($thenRedirect) : - if (!empty($this->indexRoute)) : - return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message); - else: - return $this->redirect2listView('successMessage', $message); - endif; - else: - $this->viewData['successMessage'] = $message; - endif; - - endif; // $noException && $successfulResult - endif; // ($requestMethod === 'post') - - $this->viewData['user'] = $user; - $this->viewData['paisList'] = $this->getPaisListItems(); - - $this->viewData['formAction'] = route_to('updateUser', $id); - - $this->viewData['selectedGroups'] = $this->group_user_model->select('token_group')->where('token_user', $user->token)->findAll(); - $this->viewData['groups'] = $this->group_model->select('token,title')->findAll(); - - $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' Users.php' .lang('Users.user').' '.lang('Basic.global.edit3'); - - - return $this->displayForm(__METHOD__, $id); - } // end function edit(...) - - - - public function allItemsSelect() { - if ($this->request->isAJAX()) { - $onlyActiveOnes = true; - $reqVal = $this->request->getPost('val') ?? 'id_user'; - $menu = $this->model->getAllForMenu($reqVal.', first_name', 'first_name', $onlyActiveOnes, false); - $nonItem = new \stdClass; - $nonItem->id_user = ''; - $nonItem->first_name = '- '.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_user', $reqText ?? 'first_name']; - $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 getPaisListItems() { - $data = [''=>lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Pais.pais'))])]; - $paisModel = model('App\Models\Configuracion\PaisModel'); - - $registers = $paisModel->findAll(); - - return $registers; - } - -} diff --git a/ci4/app/Entities/Tarifas/TarifamanipuladoEntity.php b/ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php similarity index 99% rename from ci4/app/Entities/Tarifas/TarifamanipuladoEntity.php rename to ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php index 3f2476cd..0bea4ac9 100644 --- a/ci4/app/Entities/Tarifas/TarifamanipuladoEntity.php +++ b/ci4/app/Entities/Tarifas/TarifaManipuladoEntity.php @@ -1,4 +1,5 @@ 'Generic Paper', 'showInClient' => 'Show in Client', 'updatedAt' => 'Updated At', + 'form_acordion_title' => 'Generic Paper Properties', 'validation' => [ 'code' => [ diff --git a/ci4/app/Language/es/App.php b/ci4/app/Language/es/App.php index 1f9758e3..49fa285a 100644 --- a/ci4/app/Language/es/App.php +++ b/ci4/app/Language/es/App.php @@ -675,7 +675,7 @@ return [ "menu_clientes_nuevo" => "Nuevo", "menu_tarifacliente" => "Tarifas", - "menu_configuration" => "Configuracion", + "menu_configuration" => "Configuración", "menu_calendario" => "Calendario", "menu_paises" => "Paises", "menu_correo" => "Correo", diff --git a/ci4/app/Language/es/PapelGenerico.php b/ci4/app/Language/es/PapelGenerico.php index 65381d56..b585cc48 100644 --- a/ci4/app/Language/es/PapelGenerico.php +++ b/ci4/app/Language/es/PapelGenerico.php @@ -17,6 +17,7 @@ return [ 'papelesGenericos' => 'Papeles Genéricos', 'showInClient' => 'Mostrar en cliente', 'updatedAt' => 'Updated At', + 'form_acordion_title' => 'Propiedades Papel Genérico', 'validation' => [ 'code' => [ diff --git a/ci4/app/Language/es/Tarifamanipulado.php b/ci4/app/Language/es/Tarifamanipulado.php index 9b9bc6ec..f383deb9 100644 --- a/ci4/app/Language/es/Tarifamanipulado.php +++ b/ci4/app/Language/es/Tarifamanipulado.php @@ -9,13 +9,13 @@ return [ 'deletedAt' => 'Borrado en', 'formulaPrice' => 'Fórmula precio', 'id' => 'ID', - 'moduleTitle' => 'Tarifas manipulado', + 'moduleTitle' => 'Tarifas Manipulado', 'nombre' => 'Nombre', 'precioMax' => 'Precio Max', 'precioMin' => 'Precio Min', - 'tarifamanipulado' => 'Tarifa manipulado', - 'tarifamanipuladoList' => 'Lista Tarifas manipulado', - 'tarifasmanipulado' => 'Tarifas manipulado', + 'tarifamanipulado' => 'Tarifa Manipulado', + 'tarifamanipuladoList' => 'Lista Tarifas Manipulado', + 'tarifasmanipulado' => 'Tarifas Manipulado', 'tiradaMax' => 'Tirada Max', 'tiradaMin' => 'Tirada Min', 'updatedAt' => 'Actualizado en', diff --git a/ci4/app/Models/Tarifas/TarifamanipuladoModel.php b/ci4/app/Models/Tarifas/TarifaManipuladoModel.php similarity index 100% rename from ci4/app/Models/Tarifas/TarifamanipuladoModel.php rename to ci4/app/Models/Tarifas/TarifaManipuladoModel.php diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/format.js b/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/format.js new file mode 100644 index 00000000..98639cf7 --- /dev/null +++ b/ci4/app/Views/themes/backend/vuexy/form/configuracion/papel/format.js @@ -0,0 +1,107 @@ +const lastColNr = $('#tableOfPapelesgenericos').find("tr:first th").length - 1; +const actionBtns = function(data) { + return `
| = lang('Tarifaacabado.nombre') ?> | -= lang('Basic.global.Action') ?> | -
|---|
| = lang('Tarifaacabado.nombre') ?> | += lang('Basic.global.Action') ?> | +
|---|
Sample page.
diff --git a/ci4/app/Views/themes/backend/vuexy/main/breadcrumbs.php b/ci4/app/Views/themes/backend/vuexy/main/breadcrumbs.php index cfe94588..b05a8562 100644 --- a/ci4/app/Views/themes/backend/vuexy/main/breadcrumbs.php +++ b/ci4/app/Views/themes/backend/vuexy/main/breadcrumbs.php @@ -1,11 +1,24 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php b/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php index 815502a8..991f9015 100644 --- a/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php +++ b/ci4/app/Views/themes/backend/vuexy/main/defaultlayout.php @@ -165,14 +165,16 @@ if (!empty($token) && $tfa == false) { Vista - vista_impresion); ?>" class="stretched-link">Impresión + vista_impresion); ?>" + class="stretched-link">Impresión- = $this->renderSection('content') ?> -
+