mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Aplicar estilos papel_impresion, papel_generico, tarifas_acabado, tarifas_impresion, tarifas_manipulado y arreglos varios
This commit is contained in:
@ -27,8 +27,7 @@ class Activity extends BaseController
|
|||||||
];
|
];
|
||||||
|
|
||||||
$data['breadcrumb'] = [
|
$data['breadcrumb'] = [
|
||||||
['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false],
|
['title' => lang("App.menu_activity"), 'route' => site_url('activity'), 'active' => true]
|
||||||
['title' => lang("App.activity_title"), 'route' => "", 'active' => true]
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$data['logs'] = $this->activity_model->select('SUM( IF( os LIKE "%Windows%", 1, 0 ) ) AS windows,
|
$data['logs'] = $this->activity_model->select('SUM( IF( os LIKE "%Windows%", 1, 0 ) ) AS windows,
|
||||||
|
|||||||
@ -40,6 +40,12 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController
|
|||||||
// Se indica el flag para los ficheros borrados
|
// Se indica el flag para los ficheros borrados
|
||||||
$this->delete_flag = 1;
|
$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);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -63,6 +63,12 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$this->tpModel = new PapelImpresionTipologiaModel();
|
$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);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,8 +50,7 @@ class Settings extends BaseController
|
|||||||
];
|
];
|
||||||
|
|
||||||
$data['breadcrumb'] = [
|
$data['breadcrumb'] = [
|
||||||
['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false],
|
['title' => lang("App.menu_settings"), 'route' => site_url('settings'), 'active' => true]
|
||||||
['title' => lang("App.menu_settings"), 'route' => "", 'active' => true]
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$data['obj'] = $this->settings_model->first();
|
$data['obj'] = $this->settings_model->first();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?php namespace App\Controllers\tarifas;
|
<?php namespace App\Controllers\tarifas;
|
||||||
|
|
||||||
|
|
||||||
use App\Controllers\GoBaseResourceController;
|
use App\Controllers\GoBaseResourceController;
|
||||||
@ -9,10 +9,11 @@ use App\Entities\Tarifas\TarifaacabadoEntity;
|
|||||||
|
|
||||||
use App\Models\Tarifas\TarifaacabadoModel;
|
use App\Models\Tarifas\TarifaacabadoModel;
|
||||||
|
|
||||||
class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = TarifaacabadoModel::class;
|
protected $modelName = TarifaacabadoModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
|
|
||||||
protected static $singularObjectName = 'Tarifa Acabado';
|
protected static $singularObjectName = 'Tarifa Acabado';
|
||||||
protected static $singularObjectNameCc = 'tarifaAcabado';
|
protected static $singularObjectNameCc = 'tarifaAcabado';
|
||||||
@ -25,9 +26,9 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
protected $indexRoute = 'tarifaAcabadoList';
|
protected $indexRoute = 'tarifaAcabadoList';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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('Tarifaacabado.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Tarifaacabado.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
@ -37,28 +38,37 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->delete_flag = 1;
|
$this->delete_flag = 1;
|
||||||
|
|
||||||
$this->viewData = ['usingServerSideDataTable' => true];
|
$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);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Tarifaacabado.tarifaacabado')]),
|
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Tarifaacabado.tarifaacabado')]),
|
||||||
'tarifaacabadoEntity' => new TarifaacabadoEntity(),
|
'tarifaacabadoEntity' => new TarifaacabadoEntity(),
|
||||||
'usingServerSideDataTable' => true,
|
'usingServerSideDataTable' => true,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
$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
|
// JJO
|
||||||
$session = session();
|
$session = session();
|
||||||
|
|
||||||
@ -69,44 +79,44 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
if(isset($this->model->user_update_id)){
|
if (isset($this->model->user_update_id)) {
|
||||||
$sanitizedData['user_created_id'] = $session->id_user;
|
$sanitizedData['user_created_id'] = $session->id_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
|
|
||||||
if ($this->canValidate()) :
|
if ($this->canValidate()) :
|
||||||
try {
|
try {
|
||||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$noException = false;
|
$noException = false;
|
||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]) . '.';
|
||||||
$message .= anchor( "tarifasacabado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
$message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
$message = ucfirst(str_replace("'", "\'", $message));
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
return redirect()->to(route_to('tarifas/tarifaacabado/edit/'.$id))->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);
|
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||||
else:
|
else:
|
||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
@ -122,17 +132,18 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$this->viewData['formAction'] = route_to('createTarifaAcabado');
|
$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__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$session = session();
|
$session = session();
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
endif;
|
endif;
|
||||||
@ -149,43 +160,42 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
if ($requestMethod === 'post') :
|
if ($requestMethod === 'post') :
|
||||||
|
|
||||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
if(isset($this->model->user_update_id)){
|
if (isset($this->model->user_update_id)) {
|
||||||
$sanitizedData['user_update_id'] = $session->id_user;
|
$sanitizedData['user_update_id'] = $session->id_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
endif;
|
||||||
|
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaacabadoEntity->id ?? $id;
|
$id = $tarifaacabadoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaacabado.tarifaacabado'))]) . '.';
|
||||||
$message .= anchor( "tarifasacabado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
$message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
$message = ucfirst(str_replace("'", "\'", $message));
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
@ -197,7 +207,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
else:
|
else:
|
||||||
$this->session->setFlashData('sweet-success', $message);
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
@ -205,20 +215,20 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updateTarifaAcabado', $id);
|
$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);
|
return $this->displayForm(__METHOD__, $id);
|
||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function datatable() {
|
public function datatable()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
$reqData = $this->request->getPost();
|
$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.';
|
$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;
|
return $response;
|
||||||
}
|
}
|
||||||
$start = $reqData['start'] ?? 0;
|
$start = $reqData['start'] ?? 0;
|
||||||
@ -240,15 +250,16 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function allItemsSelect() {
|
public function allItemsSelect()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
$onlyActiveOnes = true;
|
$onlyActiveOnes = true;
|
||||||
$reqVal = $this->request->getPost('val') ?? 'id';
|
$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 = new \stdClass;
|
||||||
$nonItem->id = '';
|
$nonItem->id = '';
|
||||||
$nonItem->nombre = '- '.lang('Basic.global.None').' -';
|
$nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
|
||||||
array_unshift($menu , $nonItem);
|
array_unshift($menu, $nonItem);
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
@ -262,7 +273,8 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function menuItems() {
|
public function menuItems()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||||
$reqId = goSanitize($this->request->getPost('id'))[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);
|
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||||
$nonItem = new \stdClass;
|
$nonItem = new \stdClass;
|
||||||
$nonItem->id = '';
|
$nonItem->id = '';
|
||||||
$nonItem->text = '- '.lang('Basic.global.None').' -';
|
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
|
||||||
array_unshift($menu , $nonItem);
|
array_unshift($menu, $nonItem);
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
|
|||||||
@ -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) {
|
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
|
// Se indica que este controlador trabaja con soft_delete
|
||||||
$this->soft_delete = true;
|
$this->soft_delete = true;
|
||||||
// Se indica el flag para los ficheros borrados
|
// Se indica el flag para los ficheros borrados
|
||||||
$this->delete_flag = 1;
|
$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);
|
parent::initController($request, $response, $logger);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -34,7 +41,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$this->viewData['usingClientSideDataTable'] = true;
|
$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();
|
parent::index();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -65,7 +72,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
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());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -75,7 +82,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$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 .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?');
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
$message = ucfirst(str_replace("'", "\'", $message));
|
||||||
|
|
||||||
@ -97,7 +104,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$this->viewData['formAction'] = route_to('createTarifapreimpresion');
|
$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__);
|
return $this->displayForm(__METHOD__);
|
||||||
@ -115,7 +122,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
$tarifapreimpresionEntity = $this->model->find($id);
|
$tarifapreimpresionEntity = $this->model->find($id);
|
||||||
|
|
||||||
if ($tarifapreimpresionEntity == false) :
|
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);
|
return $this->redirect2listView('errorMessage', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -146,7 +153,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
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());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@ -157,7 +164,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifapreimpresionEntity->id ?? $id;
|
$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 .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?');
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
$message = ucfirst(str_replace("'", "\'", $message));
|
||||||
|
|
||||||
@ -178,7 +185,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updateTarifapreimpresion', $id);
|
$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);
|
return $this->displayForm(__METHOD__, $id);
|
||||||
|
|||||||
@ -37,6 +37,13 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->delete_flag = 1;
|
$this->delete_flag = 1;
|
||||||
|
|
||||||
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
|
$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);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,313 +0,0 @@
|
|||||||
<?php namespace App\Controllers\Usuarios;
|
|
||||||
|
|
||||||
use App\Entities\Usuarios\UserGroupEntity;
|
|
||||||
|
|
||||||
use App\Controllers\GoBaseResourceController;
|
|
||||||
use App\Models\Usuarios\UserGroupModel;
|
|
||||||
use App\Models\Usuarios\GroupUserModel;
|
|
||||||
|
|
||||||
class Groupold extends \App\Controllers\GoBaseController
|
|
||||||
{
|
|
||||||
use \CodeIgniter\API\ResponseTrait;
|
|
||||||
|
|
||||||
protected static $primaryModelName = 'App\Models\Usuarios\UserGroupModel';
|
|
||||||
protected $modelName = UserGroupModel::class;
|
|
||||||
|
|
||||||
protected static $singularObjectNameCc = 'userGroup';
|
|
||||||
protected static $singularObjectName = 'Group';
|
|
||||||
protected static $pluralObjectName = 'Groups';
|
|
||||||
protected static $controllerSlug = 'groups';
|
|
||||||
|
|
||||||
static $viewPath = '';
|
|
||||||
|
|
||||||
protected $indexRoute = 'userGroupList';
|
|
||||||
|
|
||||||
private $group_user_model;
|
|
||||||
|
|
||||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
|
||||||
$this->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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,310 +0,0 @@
|
|||||||
<?php namespace App\Controllers\Usuarios;
|
|
||||||
|
|
||||||
|
|
||||||
use App\Entities\Usuarios\UserEntity;
|
|
||||||
|
|
||||||
use App\Models\Usuarios\UserGroupModel;
|
|
||||||
use App\Models\Usuarios\GroupUserModel;
|
|
||||||
use App\Models\Usuarios\UserModel;
|
|
||||||
|
|
||||||
use App\Libraries\PasswordHash;
|
|
||||||
|
|
||||||
class Usersold extends \App\Controllers\GoBaseController {
|
|
||||||
|
|
||||||
private $group_model;
|
|
||||||
private $group_user_model;
|
|
||||||
private $user_model;
|
|
||||||
|
|
||||||
|
|
||||||
use \CodeIgniter\API\ResponseTrait;
|
|
||||||
|
|
||||||
protected static $primaryModelName = 'App\Models\Usuarios\UserModel';
|
|
||||||
|
|
||||||
protected static $singularObjectNameCc = 'user';
|
|
||||||
protected static $singularObjectName = 'User';
|
|
||||||
protected static $pluralObjectName = 'Users';
|
|
||||||
protected static $controllerSlug = 'users';
|
|
||||||
|
|
||||||
protected static $viewPath = 'themes/backend/vuexy/form/user/';
|
|
||||||
|
|
||||||
protected $indexRoute = 'userList';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
|
||||||
|
|
||||||
$this->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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Entities\Tarifas;
|
namespace App\Entities\Tarifas;
|
||||||
|
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
@ -117,7 +117,6 @@ class LoginAuthFilter implements FilterInterface
|
|||||||
'Proveedores',
|
'Proveedores',
|
||||||
'Servicios',
|
'Servicios',
|
||||||
'Tarifas',
|
'Tarifas',
|
||||||
'Usuarios',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ return [
|
|||||||
'papelesGenericos' => 'Generic Paper',
|
'papelesGenericos' => 'Generic Paper',
|
||||||
'showInClient' => 'Show in Client',
|
'showInClient' => 'Show in Client',
|
||||||
'updatedAt' => 'Updated At',
|
'updatedAt' => 'Updated At',
|
||||||
|
'form_acordion_title' => 'Generic Paper Properties',
|
||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'code' => [
|
'code' => [
|
||||||
|
|||||||
@ -675,7 +675,7 @@ return [
|
|||||||
"menu_clientes_nuevo" => "Nuevo",
|
"menu_clientes_nuevo" => "Nuevo",
|
||||||
"menu_tarifacliente" => "Tarifas",
|
"menu_tarifacliente" => "Tarifas",
|
||||||
|
|
||||||
"menu_configuration" => "Configuracion",
|
"menu_configuration" => "Configuración",
|
||||||
"menu_calendario" => "Calendario",
|
"menu_calendario" => "Calendario",
|
||||||
"menu_paises" => "Paises",
|
"menu_paises" => "Paises",
|
||||||
"menu_correo" => "Correo",
|
"menu_correo" => "Correo",
|
||||||
|
|||||||
@ -17,6 +17,7 @@ return [
|
|||||||
'papelesGenericos' => 'Papeles Genéricos',
|
'papelesGenericos' => 'Papeles Genéricos',
|
||||||
'showInClient' => 'Mostrar en cliente',
|
'showInClient' => 'Mostrar en cliente',
|
||||||
'updatedAt' => 'Updated At',
|
'updatedAt' => 'Updated At',
|
||||||
|
'form_acordion_title' => 'Propiedades Papel Genérico',
|
||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'code' => [
|
'code' => [
|
||||||
|
|||||||
@ -9,13 +9,13 @@ return [
|
|||||||
'deletedAt' => 'Borrado en',
|
'deletedAt' => 'Borrado en',
|
||||||
'formulaPrice' => 'Fórmula precio',
|
'formulaPrice' => 'Fórmula precio',
|
||||||
'id' => 'ID',
|
'id' => 'ID',
|
||||||
'moduleTitle' => 'Tarifas manipulado',
|
'moduleTitle' => 'Tarifas Manipulado',
|
||||||
'nombre' => 'Nombre',
|
'nombre' => 'Nombre',
|
||||||
'precioMax' => 'Precio Max',
|
'precioMax' => 'Precio Max',
|
||||||
'precioMin' => 'Precio Min',
|
'precioMin' => 'Precio Min',
|
||||||
'tarifamanipulado' => 'Tarifa manipulado',
|
'tarifamanipulado' => 'Tarifa Manipulado',
|
||||||
'tarifamanipuladoList' => 'Lista Tarifas manipulado',
|
'tarifamanipuladoList' => 'Lista Tarifas Manipulado',
|
||||||
'tarifasmanipulado' => 'Tarifas manipulado',
|
'tarifasmanipulado' => 'Tarifas Manipulado',
|
||||||
'tiradaMax' => 'Tirada Max',
|
'tiradaMax' => 'Tirada Max',
|
||||||
'tiradaMin' => 'Tirada Min',
|
'tiradaMin' => 'Tirada Min',
|
||||||
'updatedAt' => 'Actualizado en',
|
'updatedAt' => 'Actualizado en',
|
||||||
|
|||||||
@ -0,0 +1,107 @@
|
|||||||
|
const lastColNr = $('#tableOfPapelesgenericos').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 = $('#tableOfPapelesgenericos').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('dataTableOfPapelesGenericos') ?>',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
|
async: true,
|
||||||
|
}),
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columns : [
|
||||||
|
{ 'data': 'nombre' },
|
||||||
|
{ 'data': 'code' },
|
||||||
|
{ 'data': 'code_ot' },
|
||||||
|
{ 'data': 'show_in_client' },
|
||||||
|
{ 'data': actionBtns }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
theTable.on( 'draw.dt', function () {
|
||||||
|
const boolCols = [3];
|
||||||
|
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('papelGenericoList') ?>/edit/${$(this).attr('data-id')}`;
|
||||||
|
window.location.href = `/configuracion/papelesgenericos/edit/${$(this).attr('data-id')}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
Swal.fire({
|
||||||
|
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('PapelGenerico.papel generico'))]) ?>',
|
||||||
|
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('papelGenericoList') ?>/${dataId}`,
|
||||||
|
//method: 'DELETE',
|
||||||
|
url: `/configuracion/papelesgenericos/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,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -23,19 +23,20 @@
|
|||||||
/>
|
/>
|
||||||
<?= anchor(route_to("papelGenericoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
<?= anchor(route_to("papelGenericoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||||
</div><!-- /.card-footer -->
|
</div><!-- /.card-footer -->
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
</div><!-- //.card -->
|
||||||
|
</div><!--//.col -->
|
||||||
|
|
||||||
<?php if(str_contains($formAction,'edit')): ?>
|
<?php if(str_contains($formAction,'edit')): ?>
|
||||||
<div class="accordion mt-3" id="accordionExample">
|
<div class="accordion mt-3" id="accordionExample">
|
||||||
<div class="card accordion-item active">
|
<div class="card accordion-item active">
|
||||||
<h2 class="accordion-header" id="headingOne">
|
<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">
|
<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") ?>
|
<?= lang("PapelGenerico.form_acordion_title") ?>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div id="accordionOne" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
|
<div id="accordionOne" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
|
|
||||||
@ -57,8 +58,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div> <!-- //.accordion -->
|
</div> <!-- //.accordion -->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div><!-- //.card -->
|
|
||||||
</div><!--//.col -->
|
|
||||||
</div><!--//.row -->
|
</div><!--//.row -->
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
@ -76,10 +75,11 @@
|
|||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `<td class="text-right py-0 align-middle">
|
return `<td class="text-right py-0 align-middle">
|
||||||
<div class="btn-group btn-group-sm">
|
<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>
|
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
};
|
};
|
||||||
|
|
||||||
theTable = $('#tableOfPapelesimpresion').DataTable({
|
theTable = $('#tableOfPapelesimpresion').DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
@ -89,9 +89,8 @@
|
|||||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||||
pageLength: 10,
|
pageLength: 10,
|
||||||
lengthChange: true,
|
lengthChange: true,
|
||||||
//"dom": 'lfBrtip', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
|
"dom": '<"mt-4">lfrt<"mb-3"ip>', // '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
|
stateSave: true,
|
||||||
stateSave: true,
|
|
||||||
order: [[1, 'asc']],
|
order: [[1, 'asc']],
|
||||||
language: {
|
language: {
|
||||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
@ -135,9 +134,7 @@
|
|||||||
//window.location.href = `<?= route_to('papelImpresionList') ?>/${$(this).attr('data-id')}/edit`;
|
//window.location.href = `<?= route_to('papelImpresionList') ?>/${$(this).attr('data-id')}/edit`;
|
||||||
window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
@ -151,11 +148,8 @@
|
|||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
|||||||
@ -39,78 +39,77 @@
|
|||||||
|
|
||||||
|
|
||||||
<?=$this->section('additionalInlineJs') ?>
|
<?=$this->section('additionalInlineJs') ?>
|
||||||
|
const lastColNr = $('#tableOfPapelesgenericos').find("tr:first th").length - 1;
|
||||||
const lastColNr = $('#tableOfPapelesgenericos').find("tr:first th").length - 1;
|
const actionBtns = function(data) {
|
||||||
const actionBtns = function(data) {
|
return `<td class="text-right py-0 align-middle">
|
||||||
return `<td class="text-right py-0 align-middle">
|
<div class="btn-group btn-group-sm">
|
||||||
<div class="btn-group btn-group-sm">
|
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
|
||||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
|
||||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
</div>
|
||||||
</div>
|
</td>`;
|
||||||
</td>`;
|
};
|
||||||
};
|
theTable = $('#tableOfPapelesgenericos').DataTable({
|
||||||
theTable = $('#tableOfPapelesgenericos').DataTable({
|
processing: true,
|
||||||
processing: true,
|
serverSide: true,
|
||||||
serverSide: true,
|
autoWidth: true,
|
||||||
autoWidth: true,
|
responsive: true,
|
||||||
responsive: true,
|
scrollX: true,
|
||||||
scrollX: true,
|
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
pageLength: 10,
|
||||||
pageLength: 10,
|
lengthChange: true,
|
||||||
lengthChange: true,
|
"dom": 'lfBrtip', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
|
||||||
"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
|
||||||
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
|
"buttons": [
|
||||||
"buttons": [
|
'copy', 'csv', 'excel', 'print', {
|
||||||
'copy', 'csv', 'excel', 'print', {
|
extend: 'pdfHtml5',
|
||||||
extend: 'pdfHtml5',
|
orientation: 'landscape',
|
||||||
orientation: 'landscape',
|
pageSize: 'A4'
|
||||||
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('dataTableOfPapelesGenericos') ?>',
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
|
||||||
async: true,
|
|
||||||
}),
|
|
||||||
columnDefs: [
|
|
||||||
{
|
|
||||||
orderable: false,
|
|
||||||
searchable: false,
|
|
||||||
targets: [lastColNr]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
columns : [
|
|
||||||
{ 'data': 'nombre' },
|
|
||||||
{ 'data': 'code' },
|
|
||||||
{ 'data': 'code_ot' },
|
|
||||||
{ 'data': 'show_in_client' },
|
|
||||||
{ 'data': actionBtns }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
theTable.on( 'draw.dt', function () {
|
|
||||||
const boolCols = [3];
|
|
||||||
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>' : '';
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
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('dataTableOfPapelesGenericos') ?>',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
|
async: true,
|
||||||
|
}),
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columns : [
|
||||||
|
{ 'data': 'nombre' },
|
||||||
|
{ 'data': 'code' },
|
||||||
|
{ 'data': 'code_ot' },
|
||||||
|
{ 'data': 'show_in_client' },
|
||||||
|
{ 'data': actionBtns }
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-edit', function(e) {
|
|
||||||
|
theTable.on( 'draw.dt', function () {
|
||||||
|
const boolCols = [3];
|
||||||
|
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('papelGenericoList') ?>/edit/${$(this).attr('data-id')}`;
|
//window.location.href = `<?= route_to('papelGenericoList') ?>/edit/${$(this).attr('data-id')}`;
|
||||||
window.location.href = `/configuracion/papelesgenericos/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/configuracion/papelesgenericos/edit/${$(this).attr('data-id')}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-delete', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('PapelGenerico.papel generico'))]) ?>',
|
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('PapelGenerico.papel generico'))]) ?>',
|
||||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||||
@ -121,36 +120,32 @@ $(document).on('click', '.btn-delete', function(e) {
|
|||||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||||
cancelButtonColor: '#d33'
|
cancelButtonColor: '#d33'
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
const dataId = $(this).data('id');
|
const dataId = $(this).data('id');
|
||||||
const row = $(this).closest('tr');
|
const row = $(this).closest('tr');
|
||||||
if (result.value) {
|
if (result.value) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
//url: `<?= route_to('papelGenericoList') ?>/${dataId}`,
|
//url: `<?= route_to('papelGenericoList') ?>/${dataId}`,
|
||||||
//method: 'DELETE',
|
//method: 'DELETE',
|
||||||
url: `/configuracion/papelesgenericos/delete/${dataId}`,
|
url: `/configuracion/papelesgenericos/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
Toast.fire({
|
Toast.fire({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: data.msg ?? jqXHR.statusText,
|
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,
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
theTable.clearPipeline();
|
||||||
|
theTable.row($(row)).invalidate().draw();
|
||||||
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
|
Toast.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: jqXHR.responseJSON.messages.error,
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,16 +14,15 @@
|
|||||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||||
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelImpresionFormItems") ?>
|
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelImpresionFormItems") ?>
|
||||||
</div><!-- /.card-body -->
|
<div class="pt-4">
|
||||||
<div class="card-footer">
|
<input type="submit"
|
||||||
<input type="submit"
|
class="btn btn-primary float-start me-sm-3 me-1"
|
||||||
class="btn btn-primary float-start me-sm-3 me-1"
|
name="save"
|
||||||
name="save"
|
value="<?= lang("Basic.global.Save") ?>"
|
||||||
value="<?= lang("Basic.global.Save") ?>"
|
/>
|
||||||
/>
|
<?= anchor(route_to("papelImpresionList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||||
<?= anchor(route_to("papelImpresionList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
|
||||||
|
</div><!-- /.card-footer -->
|
||||||
</div><!-- /.card-footer -->
|
|
||||||
</form>
|
</form>
|
||||||
</div><!-- //.card -->
|
</div><!-- //.card -->
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<div class="card accordion-item active">
|
<div class="card accordion-item active">
|
||||||
<h2 class="accordion-header" id="headingOne">
|
<h2 class="accordion-header" id="headingOne">
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||||
<?= lang("TarifaAcabadoLineas.moduleTitle") ?>
|
<h3><?= lang("TarifaAcabadoLineas.moduleTitle") ?></h3>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
|||||||
@ -1,101 +1,100 @@
|
|||||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||||
<?=$this->section('content'); ?>
|
<?= $this->section('content'); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<div class="card card-info">
|
<div class="card card-info">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?=lang('Tarifaacabado.tarifaacabadoList') ?></h3>
|
<h3 class="card-title"><?= lang('Tarifaacabado.tarifaacabadoList') ?></h3>
|
||||||
<?=anchor(route_to('newTarifaAcabado'), lang('Basic.global.addNew').' '.lang('Tarifaacabado.tarifaacabado'), ['class'=>'btn btn-primary float-end']); ?>
|
<?= anchor(route_to('newTarifaAcabado'), lang('Basic.global.addNew') . ' ' . lang('Tarifaacabado.tarifaacabado'), ['class' => 'btn btn-primary float-end']); ?>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
|
|
||||||
<table id="tableOfTarifasacabado" class="table table-striped table-hover" style="width: 100%;">
|
<table id="tableOfTarifasacabado" class="table table-striped table-hover" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div><!--//.card-body -->
|
</div><!--//.card-body -->
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
|
|
||||||
</div><!--//.card-footer -->
|
</div><!--//.card-footer -->
|
||||||
</div><!--//.card -->
|
</div><!--//.card -->
|
||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
</div><!--//.row -->
|
</div><!--//.row -->
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
<?=$this->section('additionalInlineJs') ?>
|
<?= $this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
const lastColNr = $('#tableOfTarifasacabado').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">
|
|
||||||
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
|
|
||||||
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
|
|
||||||
</div>
|
|
||||||
</td>`;
|
|
||||||
};
|
|
||||||
theTable = $('#tableOfTarifasacabado').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',
|
|
||||||
"buttons": [
|
|
||||||
'copy', 'csv', 'excel', 'print', {
|
|
||||||
extend: 'pdfHtml5',
|
|
||||||
orientation: 'landscape',
|
|
||||||
pageSize: 'A4'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
stateSave: true,
|
|
||||||
order: [[0, 'asc']],
|
|
||||||
language: {
|
|
||||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
|
||||||
},
|
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
|
||||||
url: '<?= route_to('dataTableOfTarifasAcabado') ?>',
|
|
||||||
method: 'POST',
|
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
|
||||||
async: true,
|
|
||||||
}),
|
|
||||||
columnDefs: [
|
|
||||||
{
|
|
||||||
orderable: false,
|
|
||||||
searchable: false,
|
|
||||||
targets: [lastColNr]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
columns : [
|
|
||||||
{ 'data': 'nombre' },
|
|
||||||
{ 'data': actionBtns }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const lastColNr = $('#tableOfTarifasacabado').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">
|
||||||
|
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
|
||||||
|
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
|
||||||
|
</div>
|
||||||
|
</td>`;
|
||||||
|
};
|
||||||
|
theTable = $('#tableOfTarifasacabado').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',
|
||||||
|
"buttons": [
|
||||||
|
'copy', 'csv', 'excel', 'print', {
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
stateSave: true,
|
||||||
|
order: [[0, 'asc']],
|
||||||
|
language: {
|
||||||
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
|
},
|
||||||
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
|
url: '<?= route_to('dataTableOfTarifasAcabado') ?>',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
|
async: true,
|
||||||
|
}),
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columns : [
|
||||||
|
{ 'data': 'nombre' },
|
||||||
|
{ 'data': actionBtns }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-edit', function(e) {
|
|
||||||
|
$(document).on('click', '.btn-edit', function(e) {
|
||||||
//window.location.href = `<?= route_to('tarifaAcabadoList') ?>/edit/${$(this).attr('data-id')}`;
|
//window.location.href = `<?= route_to('tarifaAcabadoList') ?>/edit/${$(this).attr('data-id')}`;
|
||||||
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-delete', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Tarifaacabado.tarifa acabado'))]) ?>',
|
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Tarifaacabado.tarifa acabado'))]) ?>',
|
||||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||||
@ -106,48 +105,54 @@ $(document).on('click', '.btn-delete', function(e) {
|
|||||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||||
cancelButtonColor: '#d33'
|
cancelButtonColor: '#d33'
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
const dataId = $(this).data('id');
|
const dataId = $(this).data('id');
|
||||||
const row = $(this).closest('tr');
|
const row = $(this).closest('tr');
|
||||||
if (result.value) {
|
if (result.value) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
//url: `<?= route_to('tarifaAcabadoList') ?>/${dataId}`,
|
//url: `<?= route_to('tarifaAcabadoList') ?>/${dataId}`,
|
||||||
//method: 'DELETE',
|
//method: 'DELETE',
|
||||||
url: `/tarifas/tarifaacabado/delete/${dataId}`,
|
url: `/tarifas/tarifaacabado/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
Toast.fire({
|
Toast.fire({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: data.msg ?? jqXHR.statusText,
|
title: data.msg ?? jqXHR.statusText,
|
||||||
});
|
});
|
||||||
|
|
||||||
theTable.clearPipeline();
|
theTable.clearPipeline();
|
||||||
theTable.row($(row)).invalidate().draw();
|
theTable.row($(row)).invalidate().draw();
|
||||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
Toast.fire({
|
Toast.fire({
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
title: jqXHR.responseJSON.messages.error,
|
title: jqXHR.responseJSON.messages.error,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
<?=$this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
|
||||||
<?=$this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js"
|
||||||
<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>
|
integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw=="
|
||||||
<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>
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<?=$this->endSection() ?>
|
<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() ?>
|
||||||
|
|
||||||
|
|||||||
@ -9,14 +9,12 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<form id="tarifaManipuladoForm" method="post" action="<?= $formAction ?>">
|
<form id="tarifaManipuladoForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<div class="card-body">
|
|
||||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||||
<?= view("themes/backend/vuexy/form/tarifas/manipulado/_tarifaManipuladoFormItems") ?>
|
<?= view("themes/backend/vuexy/form/tarifas/manipulado/_tarifaManipuladoFormItems") ?>
|
||||||
</div><!-- /.card-body -->
|
<div class="pt-4">
|
||||||
<div class="card-footer">
|
|
||||||
<input type="submit"
|
<input type="submit"
|
||||||
class="btn btn-primary float-start me-sm-3 me-1"
|
class="btn btn-primary float-start me-sm-3 me-1"
|
||||||
name="save"
|
name="save"
|
||||||
@ -37,7 +35,7 @@
|
|||||||
<div class="card accordion-item active">
|
<div class="card accordion-item active">
|
||||||
<h2 class="accordion-header" id="headingOne">
|
<h2 class="accordion-header" id="headingOne">
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||||
<p><?= lang("TarifaManipuladoLineas.moduleTitle") ?></p>
|
<h3><?= lang("TarifaManipuladoLineas.moduleTitle") ?></h3>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</h2>
|
</h2>
|
||||||
@ -57,15 +55,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- //.accordion -->
|
</div> <!-- //.accordion -->
|
||||||
|
|
||||||
|
|
||||||
</div><!--//.row -->
|
</div><!--//.row -->
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
@ -159,7 +154,7 @@
|
|||||||
searching: false,
|
searching: false,
|
||||||
paging: true,
|
paging: true,
|
||||||
info: false,
|
info: false,
|
||||||
dom: "Bltp",
|
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfTarifaManipuladoLineas') ?>',
|
url: '<?= route_to('dataTableOfTarifaManipuladoLineas') ?>',
|
||||||
data: {
|
data: {
|
||||||
@ -247,34 +242,21 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?=$this->section('css') ?>
|
<?=$this->section('css') ?>
|
||||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.<?=config('Basics')->theme['name'] == 'Bootstrap5' ? 'bootstrap5' : 'bootstrap4' ?>.min.css">
|
||||||
|
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/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.bootstrap5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
||||||
|
|
||||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
<div class="card card-info">
|
<div class="card card-info">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?=lang('Tarifamanipulado.tarifamanipuladoList') ?></h3>
|
<h3 class="card-title"><?=lang('Tarifamanipulado.tarifamanipuladoList') ?></h3>
|
||||||
<?=anchor(route_to('newTarifaManipulado'), lang('Basic.global.addNew').' '.lang('Tarifamanipulado.tarifamanipulado'), ['class'=>'btn btn-primary float-end']); ?>
|
<?=anchor(route_to('newTarifaManipulado'), lang('Basic.global.addNew') . ' ' .lang('Tarifamanipulado.tarifamanipulado'), ['class'=>'btn btn-primary float-end']); ?>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
@ -274,7 +274,9 @@ if (!empty($token) && $tfa == false) {
|
|||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
|
|
||||||
<div class="container-xxl flex-grow-1 container-p-y">
|
<div class="container-xxl flex-grow-1 container-p-y">
|
||||||
<h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Activities /</span> Access</h4>
|
<h5 class="py-3 mb-4">
|
||||||
|
<?php include "breadcrumbs.php" ?>
|
||||||
|
</h5>
|
||||||
|
|
||||||
<?= $this->renderSection('content') ?>
|
<?= $this->renderSection('content') ?>
|
||||||
|
|
||||||
|
|||||||
@ -451,7 +451,7 @@
|
|||||||
* MENU CONFIGURACION
|
* MENU CONFIGURACION
|
||||||
*/
|
*/
|
||||||
if (allowMenuSection($menus,
|
if (allowMenuSection($menus,
|
||||||
['Calendario', 'Paises', 'Users', 'Group', 'Papelesgenericos', 'Papelesimpresion'], 'index')): ?>
|
['Calendario', 'Paises', 'Users', 'Group', 'Papelesgenericos', 'Papelesimpresion', 'Maquina'], 'index')): ?>
|
||||||
<li class="menu-item">
|
<li class="menu-item">
|
||||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
||||||
@ -512,6 +512,15 @@
|
|||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if (count($temp = getArrayItem($menus, 'name', 'Maquina')) > 0): ?>
|
||||||
|
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/maquina") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_maquina") ?>"><?= lang("App.menu_maquina") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user