mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/form-validation-ui' into 'main'
Creado mecanismo de generacion de alertas tipo Boostrap (defecto) y ToastR.... See merge request jjimenez/safekat!42
This commit is contained in:
@ -19,7 +19,8 @@ use App\Models\Configuracion\FormaPagoModel;
|
|||||||
|
|
||||||
use App\Models\Configuracion\PaisModel;
|
use App\Models\Configuracion\PaisModel;
|
||||||
|
|
||||||
class Cliente extends \App\Controllers\GoBaseResourceController {
|
class Cliente extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = ClienteModel::class;
|
protected $modelName = ClienteModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -36,8 +37,8 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'clienteList';
|
protected $indexRoute = 'clienteList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Clientes.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Clientes.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
@ -57,7 +58,8 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
@ -73,7 +75,8 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -99,7 +102,7 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Clientes.cliente'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -109,9 +112,7 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Clientes.cliente'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/cliente/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -143,7 +144,8 @@ class Cliente extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -185,12 +187,10 @@ if ($this->request->getPost('lineasEnvioFactura') == null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -206,13 +206,11 @@ if ($this->request->getPost('lineasEnvioFactura') == null ) {
|
|||||||
|
|
||||||
$clienteEntity->fill($sanitizedData);
|
$clienteEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $clienteEntity->id ?? $id;
|
$id = $clienteEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Clientes.cliente'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/cliente/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -246,8 +244,8 @@ if ($this->request->getPost('lineasEnvioFactura') == null ) {
|
|||||||
} // 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'])) {
|
||||||
@ -266,11 +264,14 @@ if ($this->request->getPost('lineasEnvioFactura') == null ) {
|
|||||||
foreach ($resourceData as $item) :
|
foreach ($resourceData as $item) :
|
||||||
if (isset($item->direccion) && strlen($item->direccion) > 100) :
|
if (isset($item->direccion) && strlen($item->direccion) > 100) :
|
||||||
$item->direccion = character_limiter($item->direccion, 100);
|
$item->direccion = character_limiter($item->direccion, 100);
|
||||||
endif;if (isset($item->comentarios_tirada_flexible) && strlen($item->comentarios_tirada_flexible) > 100) :
|
endif;
|
||||||
|
if (isset($item->comentarios_tirada_flexible) && strlen($item->comentarios_tirada_flexible) > 100) :
|
||||||
$item->comentarios_tirada_flexible = character_limiter($item->comentarios_tirada_flexible, 100);
|
$item->comentarios_tirada_flexible = character_limiter($item->comentarios_tirada_flexible, 100);
|
||||||
endif;if (isset($item->comentarios_produccion) && strlen($item->comentarios_produccion) > 100) :
|
endif;
|
||||||
|
if (isset($item->comentarios_produccion) && strlen($item->comentarios_produccion) > 100) :
|
||||||
$item->comentarios_produccion = character_limiter($item->comentarios_produccion, 100);
|
$item->comentarios_produccion = character_limiter($item->comentarios_produccion, 100);
|
||||||
endif;if (isset($item->comentarios) && strlen($item->comentarios) > 100) :
|
endif;
|
||||||
|
if (isset($item->comentarios) && strlen($item->comentarios) > 100) :
|
||||||
$item->comentarios = character_limiter($item->comentarios, 100);
|
$item->comentarios = character_limiter($item->comentarios, 100);
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
@ -285,7 +286,8 @@ endif;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
||||||
@ -307,7 +309,8 @@ endif;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
@ -334,7 +337,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getPaisListItems($selId = null) {
|
protected function getPaisListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$paisModel = model('App\Models\Configuracion\PaisModel');
|
$paisModel = model('App\Models\Configuracion\PaisModel');
|
||||||
@ -348,7 +352,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getUserListItems($selId = null) {
|
protected function getUserListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$userModel = model('App\Models\Usuarios\UserModel');
|
$userModel = model('App\Models\Usuarios\UserModel');
|
||||||
@ -362,7 +367,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getComunidadAutonomaListItems($selId = null) {
|
protected function getComunidadAutonomaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
|
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
|
||||||
@ -376,7 +382,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getUserListItems2($selId = null) {
|
protected function getUserListItems2($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$userModel = model('App\Models\Configuracion\UserModel');
|
$userModel = model('App\Models\Configuracion\UserModel');
|
||||||
@ -390,7 +397,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getFormaDePagoListItems($selId = null) {
|
protected function getFormaDePagoListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('FormasPagoes.formaDePago'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('FormasPagoes.formaDePago'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$formaPagoModel = model('App\Models\Configuracion\FormaPagoModel');
|
$formaPagoModel = model('App\Models\Configuracion\FormaPagoModel');
|
||||||
@ -404,7 +412,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getProvinciaListItems($selId = null) {
|
protected function getProvinciaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Provincias.provincia'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Provincias.provincia'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$provinciaModel = model('App\Models\Configuracion\ProvinciaModel');
|
$provinciaModel = model('App\Models\Configuracion\ProvinciaModel');
|
||||||
|
|||||||
@ -11,7 +11,8 @@ use App\Models\Clientes\ClienteModel;
|
|||||||
|
|
||||||
use App\Models\Clientes\ClienteContactoModel;
|
use App\Models\Clientes\ClienteContactoModel;
|
||||||
|
|
||||||
class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
class Clientecontactos extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = ClienteContactoModel::class;
|
protected $modelName = ClienteContactoModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -28,15 +29,16 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'contactoDeClienteList';
|
protected $indexRoute = 'contactoDeClienteList';
|
||||||
|
|
||||||
|
|
||||||
|
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('ClienteContactos.moduleTitle');
|
$this->viewData['pageTitle'] = lang('ClienteContactos.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -52,8 +54,8 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -79,7 +81,7 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ClienteContactos.contactoDeCliente'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -89,9 +91,7 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('ClienteContactos.contactoDeCliente'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/cliente-contactos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -118,7 +118,8 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -142,12 +143,10 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -163,13 +162,11 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$clienteContactoEntity->fill($sanitizedData);
|
$clienteContactoEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $clienteContactoEntity->id ?? $id;
|
$id = $clienteContactoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('ClienteContactos.contactoDeCliente'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/cliente-contactos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -196,8 +193,8 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -229,7 +226,8 @@ endif;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
||||||
@ -251,7 +249,8 @@ endif;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
@ -278,7 +277,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getClienteListItems($selId = null) {
|
protected function getClienteListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Clientes.cliente'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Clientes.cliente'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$clienteModel = model('App\Models\Clientes\ClienteModel');
|
$clienteModel = model('App\Models\Clientes\ClienteModel');
|
||||||
|
|||||||
@ -15,7 +15,8 @@ use App\Models\Configuracion\ProvinciaModel;
|
|||||||
|
|
||||||
use App\Models\Configuracion\ComunidadAutonomaModel;
|
use App\Models\Configuracion\ComunidadAutonomaModel;
|
||||||
|
|
||||||
class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
class Clientedistribuidores extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = ClienteDistribuidorModel::class;
|
protected $modelName = ClienteDistribuidorModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -32,15 +33,16 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'distribuidorDeClienteList';
|
protected $indexRoute = 'distribuidorDeClienteList';
|
||||||
|
|
||||||
|
|
||||||
|
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('ClienteDistribuidores.moduleTitle');
|
$this->viewData['pageTitle'] = lang('ClienteDistribuidores.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -56,8 +58,8 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -83,7 +85,7 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ClienteDistribuidores.distribuidorDeCliente'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -93,9 +95,7 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('ClienteDistribuidores.distribuidorDeCliente'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/cliente-distribuidores/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -124,7 +124,8 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -148,12 +149,10 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -169,13 +168,11 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$clienteDistribuidorEntity->fill($sanitizedData);
|
$clienteDistribuidorEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $clienteDistribuidorEntity->id ?? $id;
|
$id = $clienteDistribuidorEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('ClienteDistribuidores.distribuidorDeCliente'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/cliente-distribuidores/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -204,8 +201,8 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -224,7 +221,8 @@ class Clientedistribuidores extends \App\Controllers\GoBaseResourceController {
|
|||||||
foreach ($resourceData as $item) :
|
foreach ($resourceData as $item) :
|
||||||
if (isset($item->direccion) && strlen($item->direccion) > 100) :
|
if (isset($item->direccion) && strlen($item->direccion) > 100) :
|
||||||
$item->direccion = character_limiter($item->direccion, 100);
|
$item->direccion = character_limiter($item->direccion, 100);
|
||||||
endif;if (isset($item->horarios_entrega) && strlen($item->horarios_entrega) > 100) :
|
endif;
|
||||||
|
if (isset($item->horarios_entrega) && strlen($item->horarios_entrega) > 100) :
|
||||||
$item->horarios_entrega = character_limiter($item->horarios_entrega, 100);
|
$item->horarios_entrega = character_limiter($item->horarios_entrega, 100);
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
@ -239,7 +237,8 @@ endif;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
||||||
@ -261,7 +260,8 @@ endif;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
@ -288,7 +288,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getComunidadAutonomaListItems($selId = null) {
|
protected function getComunidadAutonomaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
|
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
|
||||||
@ -302,7 +303,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getPaisListItems($selId = null) {
|
protected function getPaisListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$paisModel = model('App\Models\Configuracion\PaisModel');
|
$paisModel = model('App\Models\Configuracion\PaisModel');
|
||||||
@ -316,7 +318,8 @@ endif;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getProvinciaListItems($selId = null) {
|
protected function getProvinciaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Provincias.provincia'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Provincias.provincia'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$provinciaModel = model('App\Models\Configuracion\ProvinciaModel');
|
$provinciaModel = model('App\Models\Configuracion\ProvinciaModel');
|
||||||
|
|||||||
@ -11,7 +11,8 @@ use App\Models\Configuracion\PaisModel;
|
|||||||
|
|
||||||
use App\Models\Configuracion\ComunidadAutonomaModel;
|
use App\Models\Configuracion\ComunidadAutonomaModel;
|
||||||
|
|
||||||
class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = ComunidadAutonomaModel::class;
|
protected $modelName = ComunidadAutonomaModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -28,15 +29,16 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'comunidadAutonomaList';
|
protected $indexRoute = 'comunidadAutonomaList';
|
||||||
|
|
||||||
|
|
||||||
|
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('ComunidadesAutonomas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('ComunidadesAutonomas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -52,8 +54,8 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -79,7 +81,7 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -89,9 +91,7 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/comunidades-autonomas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -118,7 +118,8 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -142,12 +143,10 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -163,13 +162,11 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$comunidadAutonomaEntity->fill($sanitizedData);
|
$comunidadAutonomaEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $comunidadAutonomaEntity->id ?? $id;
|
$id = $comunidadAutonomaEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('ComunidadesAutonomas.comunidadAutonoma'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/comunidades-autonomas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -196,8 +193,8 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -224,7 +221,8 @@ class Comunidadesautonomas 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';
|
||||||
@ -246,7 +244,8 @@ class Comunidadesautonomas 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,7 +272,8 @@ class Comunidadesautonomas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getPaisListItems($selId = null) {
|
protected function getPaisListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$paisModel = model('App\Models\Configuracion\PaisModel');
|
$paisModel = model('App\Models\Configuracion\PaisModel');
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
use App\Entities\Configuracion\FormasPagoEntity;
|
use App\Entities\Configuracion\FormasPagoEntity;
|
||||||
|
|
||||||
class Formaspago extends \App\Controllers\GoBaseController {
|
class Formaspago extends \App\Controllers\GoBaseController
|
||||||
|
{
|
||||||
|
|
||||||
use \CodeIgniter\API\ResponseTrait;
|
use \CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
@ -19,8 +20,8 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
protected $indexRoute = 'formaPagoList';
|
protected $indexRoute = 'formaPagoList';
|
||||||
|
|
||||||
|
|
||||||
|
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('FormasPagoes.moduleTitle');
|
$this->viewData['pageTitle'] = lang('FormasPagoes.moduleTitle');
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
@ -33,7 +34,8 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$this->viewData['usingClientSideDataTable'] = true;
|
$this->viewData['usingClientSideDataTable'] = true;
|
||||||
|
|
||||||
@ -42,7 +44,8 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -67,7 +70,7 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('FormasPagoes.formaPago'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -77,9 +80,7 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('FormasPagoes.formaPago'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor(route_to('editFormaPago', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -105,7 +106,8 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -128,7 +130,6 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
@ -148,13 +149,11 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$formasPagoEntity->fill($sanitizedData);
|
$formasPagoEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $formasPagoEntity->id ?? $id;
|
$id = $formasPagoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('FormasPagoes.formaPago'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor(route_to('editFormaPago', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -180,8 +179,8 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
|
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';
|
||||||
@ -203,7 +202,8 @@ class Formaspago extends \App\Controllers\GoBaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
|
|||||||
@ -9,7 +9,8 @@ use App\Entities\Configuracion\FormaPagoEntity;
|
|||||||
|
|
||||||
use App\Models\Configuracion\FormaPagoModel;
|
use App\Models\Configuracion\FormaPagoModel;
|
||||||
|
|
||||||
class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
class Formaspagos extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = FormaPagoModel::class;
|
protected $modelName = FormaPagoModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -26,15 +27,16 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'formaDePagoList';
|
protected $indexRoute = 'formaDePagoList';
|
||||||
|
|
||||||
|
|
||||||
|
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('FormasPagoes.moduleTitle');
|
$this->viewData['pageTitle'] = lang('FormasPagoes.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -50,8 +52,8 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -77,7 +79,7 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('FormasPagoes.formaDePago'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -87,9 +89,7 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('FormasPagoes.formaDePago'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/formas-pagos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -115,7 +115,8 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -139,12 +140,10 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -160,13 +159,11 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$formaPagoEntity->fill($sanitizedData);
|
$formaPagoEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $formaPagoEntity->id ?? $id;
|
$id = $formaPagoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('FormasPagoes.formaDePago'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/formas-pagos/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -192,8 +189,8 @@ class Formaspagos extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -220,7 +217,8 @@ class Formaspagos 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';
|
||||||
@ -242,7 +240,8 @@ class Formaspagos 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];
|
||||||
|
|||||||
@ -24,7 +24,8 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
|
|
||||||
private $group_user_model;
|
private $group_user_model;
|
||||||
|
|
||||||
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('Group.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Group.moduleTitle');
|
||||||
self::$viewPath = getenv('theme.path') . 'form/group/';
|
self::$viewPath = getenv('theme.path') . 'form/group/';
|
||||||
|
|
||||||
@ -55,7 +56,6 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$title = $postData['title'];
|
$title = $postData['title'];
|
||||||
$dashboard = $postData['dashboard'];
|
$dashboard = $postData['dashboard'];
|
||||||
unset($postData['title']);
|
unset($postData['title']);
|
||||||
@ -85,7 +85,6 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$temp_data['rules'] = json_encode($rules_access ?? '{}');
|
$temp_data['rules'] = json_encode($rules_access ?? '{}');
|
||||||
$temp_data['token'] = md5(uniqid(rand(), true));;
|
$temp_data['token'] = md5(uniqid(rand(), true));;
|
||||||
$temp_data['title'] = $title;
|
$temp_data['title'] = $title;
|
||||||
@ -105,7 +104,7 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Group.userGroup'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -115,9 +114,7 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Group.userGroup'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/user-groups/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -144,7 +141,8 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
helper('general');
|
helper('general');
|
||||||
$session = session();
|
$session = session();
|
||||||
@ -211,7 +209,6 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -227,13 +224,11 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
|
|
||||||
$groupEntity->fill($sanitizedData);
|
$groupEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $groupEntity->id ?? $id;
|
$id = $groupEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Group.userGroup'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor(route_to('editGroup', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($session->get('group') == $this->request->getPost('token')) {
|
if ($session->get('group') == $this->request->getPost('token')) {
|
||||||
$session->set('rules', $temp_data['rules']);
|
$session->set('rules', $temp_data['rules']);
|
||||||
@ -262,8 +257,8 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
|
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';
|
||||||
@ -285,7 +280,8 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
|
|||||||
@ -9,7 +9,8 @@ use App\Entities\Configuracion\Imposicion;
|
|||||||
|
|
||||||
use App\Models\Configuracion\ImposicionModel;
|
use App\Models\Configuracion\ImposicionModel;
|
||||||
|
|
||||||
class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
class Imposiciones extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = ImposicionModel::class;
|
protected $modelName = ImposicionModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -26,15 +27,16 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'imposicionList';
|
protected $indexRoute = 'imposicionList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Imposiciones.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Imposiciones.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -50,8 +52,8 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -77,7 +79,7 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Imposiciones.imposicion'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -87,9 +89,7 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Imposiciones.imposicion'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/imposiciones/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -116,7 +116,8 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -140,12 +141,10 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -161,13 +160,11 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$imposicion->fill($sanitizedData);
|
$imposicion->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $imposicion->id ?? $id;
|
$id = $imposicion->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Imposiciones.imposicion'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/imposiciones/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -194,8 +191,8 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -222,7 +219,8 @@ class Imposiciones 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';
|
||||||
@ -244,7 +242,8 @@ class Imposiciones 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];
|
||||||
@ -271,7 +270,8 @@ class Imposiciones extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getOrientacionOptions() {
|
protected function getOrientacionOptions()
|
||||||
|
{
|
||||||
$orientacionOptions = [
|
$orientacionOptions = [
|
||||||
'' => lang('Basic.global.pleaseSelect'),
|
'' => lang('Basic.global.pleaseSelect'),
|
||||||
'H' => 'H',
|
'H' => 'H',
|
||||||
|
|||||||
@ -9,7 +9,8 @@ use App\Entities\Configuracion\Maquina;
|
|||||||
|
|
||||||
use App\Models\Configuracion\MaquinaModel;
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
|
|
||||||
class Maquinas extends \App\Controllers\GoBaseResourceController {
|
class Maquinas extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = MaquinaModel::class;
|
protected $modelName = MaquinaModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -26,8 +27,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'maquinaList';
|
protected $indexRoute = 'maquinaList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Maquinas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Maquinas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
@ -48,7 +49,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
@ -64,7 +66,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$session = session();
|
$session = session();
|
||||||
@ -94,7 +97,7 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Maquinas.maquina'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -104,9 +107,7 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Maquinas.maquina'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "maquinas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -135,7 +136,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
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();
|
||||||
@ -181,13 +183,11 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$successfulResult = false;
|
$successfulResult = false;
|
||||||
$this->viewData['errorMessage'] = lang('Maquinas.validation.alto_menor_alto_impresion');;
|
$this->viewData['errorMessage'] = lang('Maquinas.validation.alto_menor_alto_impresion');;
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
}
|
} else if ($sanitizedData['ancho'] < $sanitizedData['ancho_impresion']) {
|
||||||
else if ($sanitizedData['ancho'] < $sanitizedData['ancho_impresion']){
|
|
||||||
$successfulResult = false;
|
$successfulResult = false;
|
||||||
$this->viewData['errorMessage'] = lang('Maquinas.validation.ancho_menor_ancho_impresion');;
|
$this->viewData['errorMessage'] = lang('Maquinas.validation.ancho_menor_ancho_impresion');;
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
try {
|
try {
|
||||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -208,9 +208,7 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $maquina->id ?? $id;
|
$id = $maquina->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Maquinas.maquina'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "maquinas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -238,8 +236,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -271,7 +269,8 @@ class Maquinas 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';
|
||||||
@ -293,7 +292,8 @@ class Maquinas 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];
|
||||||
@ -320,7 +320,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getMaquinaListItems($selId = null) {
|
protected function getMaquinaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
||||||
@ -334,7 +335,8 @@ class Maquinas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getTipoOptions() {
|
protected function getTipoOptions()
|
||||||
|
{
|
||||||
$tipoOptions = [
|
$tipoOptions = [
|
||||||
'' => lang('Basic.global.pleaseSelect'),
|
'' => lang('Basic.global.pleaseSelect'),
|
||||||
'impresion' => 'impresion',
|
'impresion' => 'impresion',
|
||||||
|
|||||||
@ -11,7 +11,8 @@ use App\Models\Configuracion\MaquinaModel;
|
|||||||
|
|
||||||
use App\Models\Configuracion\MaquinasDefectoModel;
|
use App\Models\Configuracion\MaquinasDefectoModel;
|
||||||
|
|
||||||
class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
class Maquinasdefecto extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = MaquinasDefectoModel::class;
|
protected $modelName = MaquinasDefectoModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -28,8 +29,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'maquinaPorDefectoList';
|
protected $indexRoute = 'maquinaPorDefectoList';
|
||||||
|
|
||||||
|
|
||||||
|
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
{
|
||||||
$this->viewData['pageTitle'] = lang('MaquinasPorDefecto.moduleTitle');
|
$this->viewData['pageTitle'] = lang('MaquinasPorDefecto.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
@ -42,7 +43,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
@ -58,7 +60,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$session = session();
|
$session = session();
|
||||||
@ -86,8 +89,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
$error = $this->model->checkIntervals($sanitizedData);
|
$error = $this->model->checkIntervals($sanitizedData);
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$successfulResult = false;
|
$successfulResult = false;
|
||||||
$this->viewData['errorMessage'] = $error;
|
$this->viewData['errorMessage'] = $error;
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
@ -97,7 +99,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -107,9 +109,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "configuracion/maquinasdefecto/edit/{$id}" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -137,7 +137,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
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();
|
||||||
@ -176,8 +177,7 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
$error = $this->model->checkIntervals($sanitizedData, $id);
|
$error = $this->model->checkIntervals($sanitizedData, $id);
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$successfulResult = false;
|
$successfulResult = false;
|
||||||
$this->viewData['errorMessage'] = $error;
|
$this->viewData['errorMessage'] = $error;
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
@ -194,13 +194,11 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$maquinasDefectoEntity->fill($sanitizedData);
|
$maquinasDefectoEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $maquinasDefectoEntity->id ?? $id;
|
$id = $maquinasDefectoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('MaquinasPorDefecto.maquinaPorDefecto'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "maquinasdefecto/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -228,8 +226,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -259,7 +257,8 @@ class Maquinasdefecto 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';
|
||||||
@ -281,7 +280,8 @@ class Maquinasdefecto 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];
|
||||||
@ -308,7 +308,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getMaquinaListItems($selId = null) {
|
protected function getMaquinaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
||||||
@ -322,7 +323,8 @@ class Maquinasdefecto extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getTipoOptions() {
|
protected function getTipoOptions()
|
||||||
|
{
|
||||||
$tipoOptions = [
|
$tipoOptions = [
|
||||||
'' => lang('Basic.global.pleaseSelect'),
|
'' => lang('Basic.global.pleaseSelect'),
|
||||||
'bn' => 'bn',
|
'bn' => 'bn',
|
||||||
|
|||||||
@ -22,7 +22,8 @@ use
|
|||||||
DataTables\Editor\Validate,
|
DataTables\Editor\Validate,
|
||||||
DataTables\Editor\ValidateOptions;
|
DataTables\Editor\ValidateOptions;
|
||||||
|
|
||||||
class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController {
|
class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = MaquinasTarifasImpresionModel::class;
|
protected $modelName = MaquinasTarifasImpresionModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -39,15 +40,16 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
protected $indexRoute = 'maquinasTarifaImpresionList';
|
protected $indexRoute = 'maquinasTarifaImpresionList';
|
||||||
|
|
||||||
|
|
||||||
|
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('MaquinasTarifasImpresions.moduleTitle');
|
$this->viewData['pageTitle'] = lang('MaquinasTarifasImpresions.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -63,8 +65,8 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -90,7 +92,7 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifaImpresion'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -100,9 +102,7 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifaImpresion'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "maquinastarifasimpresion/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -130,7 +130,8 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -157,12 +158,10 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -178,13 +177,11 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
|
|
||||||
$maquinasTarifasImpresion->fill($sanitizedData);
|
$maquinasTarifasImpresion->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $maquinasTarifasImpresion->id ?? $id;
|
$id = $maquinasTarifasImpresion->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifaImpresion'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "maquinastarifasimpresion/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -212,7 +209,8 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
public function datatable_editor() {
|
public function datatable_editor()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
||||||
@ -248,8 +246,7 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
||||||
foreach ($data['data'] as $pkey => $values) {
|
foreach ($data['data'] as $pkey => $values) {
|
||||||
// Si no se quiere borrar...
|
// Si no se quiere borrar...
|
||||||
if($data['data'][$pkey]['is_deleted'] != 1)
|
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
||||||
{
|
|
||||||
// Cubierta y sobrecubierta sólo pueden ser en color
|
// Cubierta y sobrecubierta sólo pueden ser en color
|
||||||
if ($values['uso'] != 'interior' && $values['tipo'] != 'color') {
|
if ($values['uso'] != 'interior' && $values['tipo'] != 'color') {
|
||||||
return lang('MaquinasTarifasImpresions.validation.cubierta_sobrecubierta_color');
|
return lang('MaquinasTarifasImpresions.validation.cubierta_sobrecubierta_color');
|
||||||
@ -318,7 +315,8 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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'])) {
|
||||||
@ -347,7 +345,8 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
||||||
@ -369,7 +368,8 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
@ -396,7 +396,8 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getMaquinaListItems($selId = null) {
|
protected function getMaquinaListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
$maquinaModel = model('App\Models\Configuracion\MaquinaModel');
|
||||||
@ -410,7 +411,8 @@ if ($this->request->getPost('predeterminado') == null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getTipoOptions() {
|
protected function getTipoOptions()
|
||||||
|
{
|
||||||
$tipoOptions = [
|
$tipoOptions = [
|
||||||
'' => lang('Basic.global.pleaseSelect'),
|
'' => lang('Basic.global.pleaseSelect'),
|
||||||
'negro' => 'negro',
|
'negro' => 'negro',
|
||||||
|
|||||||
@ -9,7 +9,8 @@ use App\Entities\Configuracion\PaisEntity;
|
|||||||
|
|
||||||
use App\Models\Configuracion\PaisModel;
|
use App\Models\Configuracion\PaisModel;
|
||||||
|
|
||||||
class Paises extends \App\Controllers\GoBaseResourceController {
|
class Paises extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = PaisModel::class;
|
protected $modelName = PaisModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -26,15 +27,16 @@ class Paises extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'paisList';
|
protected $indexRoute = 'paisList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Paises.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Paises.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -50,8 +52,8 @@ class Paises extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -77,7 +79,7 @@ class Paises extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Paises.pais'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -87,9 +89,7 @@ class Paises extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Paises.pais'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/paises/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -115,7 +115,8 @@ class Paises extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -142,12 +143,10 @@ if ($this->request->getPost('show_erp') == null ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -163,13 +162,11 @@ if ($this->request->getPost('show_erp') == null ) {
|
|||||||
|
|
||||||
$paisEntity->fill($sanitizedData);
|
$paisEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $paisEntity->id ?? $id;
|
$id = $paisEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Paises.pais'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/paises/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -195,8 +192,8 @@ if ($this->request->getPost('show_erp') == null ) {
|
|||||||
} // 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'])) {
|
||||||
@ -223,7 +220,8 @@ if ($this->request->getPost('show_erp') == null ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
||||||
@ -245,7 +243,8 @@ if ($this->request->getPost('show_erp') == null ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
|
|||||||
@ -95,7 +95,7 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else :
|
else :
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -105,9 +105,7 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]) . '.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor("papelesgenericos/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -181,13 +179,11 @@ class Papelesgenericos extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$papelGenerico->fill($sanitizedData);
|
$papelGenerico->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $papelGenerico->id ?? $id;
|
$id = $papelGenerico->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('PapelGenerico.papelGenerico'))]) . '.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]).'.';
|
||||||
$message .= anchor("papelesgenericos/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
|
|||||||
@ -118,7 +118,7 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else :
|
else :
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -128,9 +128,7 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]) . '.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor("papelesimpresion/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -228,13 +226,11 @@ class Papelesimpresion extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$papelImpresion->fill($sanitizedData);
|
$papelImpresion->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $papelImpresion->id ?? $id;
|
$id = $papelImpresion->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('PapelImpresion.papelImpresion'))]) . '.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]).'.';
|
||||||
$message .= anchor("papelesimpresion/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class Papelimpresiontipologias extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('ImpresionTipologias.papelImpresionTipologia'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -88,9 +88,7 @@ class Papelimpresiontipologias extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('ImpresionTipologias.papelImpresionTipologia'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "papelimpresiontipologias/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -177,9 +175,7 @@ class Papelimpresiontipologias extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $papelImpresionTipologia->id ?? $id;
|
$id = $papelImpresionTipologia->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('ImpresionTipologias.papelImpresionTipologia'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]).'.';
|
||||||
$message .= anchor( "papelimpresiontipologias/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
|
|||||||
@ -11,7 +11,8 @@ use App\Models\Configuracion\PaisModel;
|
|||||||
|
|
||||||
use App\Models\Configuracion\ProvinciaModel;
|
use App\Models\Configuracion\ProvinciaModel;
|
||||||
|
|
||||||
class Provincias extends \App\Controllers\GoBaseResourceController {
|
class Provincias extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = ProvinciaModel::class;
|
protected $modelName = ProvinciaModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -28,15 +29,16 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'provinciaList';
|
protected $indexRoute = 'provinciaList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Provincias.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Provincias.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -52,8 +54,8 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -79,7 +81,7 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Provincias.provincia'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -89,9 +91,7 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Provincias.provincia'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/provincias/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -118,7 +118,8 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -142,12 +143,10 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -163,13 +162,11 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$provinciaEntity->fill($sanitizedData);
|
$provinciaEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $provinciaEntity->id ?? $id;
|
$id = $provinciaEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Provincias.provincia'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "admin/provincias/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -196,8 +193,8 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -224,7 +221,8 @@ class Provincias 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';
|
||||||
@ -246,7 +244,8 @@ class Provincias 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,7 +272,8 @@ class Provincias extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getPaisListItems($selId = null) {
|
protected function getPaisListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Paises.pais'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$paisModel = model('App\Models\Configuracion\PaisModel');
|
$paisModel = model('App\Models\Configuracion\PaisModel');
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
use App\Entities\Configuracion\TipologiasEntity;
|
use App\Entities\Configuracion\TipologiasEntity;
|
||||||
|
|
||||||
class Tipologias extends \App\Controllers\GoBaseController {
|
class Tipologias extends \App\Controllers\GoBaseController
|
||||||
|
{
|
||||||
|
|
||||||
use \CodeIgniter\API\ResponseTrait;
|
use \CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
@ -19,14 +20,15 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
protected $indexRoute = 'tipologiaLibrosList';
|
protected $indexRoute = 'tipologiaLibrosList';
|
||||||
|
|
||||||
|
|
||||||
|
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('TipologiasLibros.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TipologiasLibros.moduleTitle');
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$this->viewData['usingClientSideDataTable'] = true;
|
$this->viewData['usingClientSideDataTable'] = true;
|
||||||
|
|
||||||
@ -35,8 +37,8 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -61,7 +63,7 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('TipologiasLibros.tipologiaLibros'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -71,9 +73,7 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('TipologiasLibros.tipologiaLibros'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor(route_to('editTipologiaLibros', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -99,7 +99,8 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -122,12 +123,10 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -143,13 +142,11 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
$tipologiasEntity->fill($sanitizedData);
|
$tipologiasEntity->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tipologiasEntity->id ?? $id;
|
$id = $tipologiasEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('TipologiasLibros.tipologiaLibros'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor(route_to('editTipologiaLibros', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -158,7 +155,7 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
return $this->redirect2listView('successMessage', $message);
|
return $this->redirect2listView('successMessage', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
$this->viewData['successMessage'] = $message;
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -175,8 +172,8 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
|
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';
|
||||||
@ -198,7 +195,8 @@ class Tipologias extends \App\Controllers\GoBaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
|
|||||||
@ -196,12 +196,9 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
||||||
$user->fill($sanitizedData);
|
$user->fill($sanitizedData);
|
||||||
|
|
||||||
|
$thenRedirect = false;
|
||||||
|
|
||||||
$thenRedirect = true;
|
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
@ -227,7 +224,7 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
return $this->redirect2listView('successMessage', $message);
|
return $this->redirect2listView('successMessage', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
$this->viewData['successMessage'] = $message;
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
|
|||||||
@ -68,6 +68,15 @@ abstract class GoBaseResourceController extends \CodeIgniter\RESTful\ResourceCon
|
|||||||
*/
|
*/
|
||||||
public $delete_flag = 0;
|
public $delete_flag = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMN: Variable para seleccionar el tipo de mensajeria que usa una clase
|
||||||
|
*
|
||||||
|
* 'alerts' -> Boostrap 5 default alerts
|
||||||
|
* 'toastr' -> Javascript ToastR library
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $alertStyle = 'alerts';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of helpers to be loaded automatically upon
|
* An array of helpers to be loaded automatically upon
|
||||||
@ -116,6 +125,9 @@ abstract class GoBaseResourceController extends \CodeIgniter\RESTful\ResourceCon
|
|||||||
$this->viewData['viewPath'] = static::$viewPath;
|
$this->viewData['viewPath'] = static::$viewPath;
|
||||||
|
|
||||||
$this->viewData['currentLocale'] = $this->request->getLocale();
|
$this->viewData['currentLocale'] = $this->request->getLocale();
|
||||||
|
|
||||||
|
/* IMN */
|
||||||
|
$this->viewData['alertStyle'] = $this->alertStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -98,7 +98,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
$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', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -108,21 +108,17 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
$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', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
return redirect()->to(site_url('/tarifas/tarifaacabado/edit/' . $id))->with('sweet-success', $message);
|
return redirect()->to(site_url('/tarifas/tarifaacabado/edit/' . $id))->with('message', $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;
|
||||||
else:
|
else:
|
||||||
//JJO
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
$this->viewData['successMessage'] = $message;
|
|
||||||
//$this->session->setFlashData('sweet-success', $message);
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -194,9 +190,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
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', [lang('Basic.global.record')]).'.';
|
||||||
//$message .= anchor("tarifasacabado/{$id}/edit", lang('Basic.global.continueEditing') . '?');
|
|
||||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -205,8 +199,7 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
//JJO
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
$this->viewData['successMessage'] = $message;
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
|
|||||||
@ -24,7 +24,8 @@ use
|
|||||||
|
|
||||||
use function PHPUnit\Framework\isEmpty;
|
use function PHPUnit\Framework\isEmpty;
|
||||||
|
|
||||||
class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = TarifaAcabadoLineaModel::class;
|
protected $modelName = TarifaAcabadoLineaModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -41,15 +42,16 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'tarifaAcabadoLineaList';
|
protected $indexRoute = 'tarifaAcabadoLineaList';
|
||||||
|
|
||||||
|
|
||||||
|
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('TarifaAcabadoLineas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TarifaAcabadoLineas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -65,8 +67,8 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -92,7 +94,7 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('TarifaAcabadoLineas.tarifaAcabadoLinea'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -102,9 +104,7 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('TarifaAcabadoLineas.tarifaAcabadoLinea'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifa-acabado-lineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -131,7 +131,8 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -155,12 +156,10 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -176,13 +175,11 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$tarifaAcabadoLinea->fill($sanitizedData);
|
$tarifaAcabadoLinea->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaAcabadoLinea->id ?? $id;
|
$id = $tarifaAcabadoLinea->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('TarifaAcabadoLineas.tarifaAcabadoLinea'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifa-acabado-lineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -209,8 +206,8 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -242,7 +239,8 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function datatable_editor() {
|
public function datatable_editor()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
||||||
@ -354,7 +352,8 @@ class Tarifaacabadolineas 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';
|
||||||
@ -376,7 +375,8 @@ class Tarifaacabadolineas 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];
|
||||||
@ -403,7 +403,8 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getTarifaAcabadoListItems($selId = null) {
|
protected function getTarifaAcabadoListItems($selId = null)
|
||||||
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Tarifaacabado.tarifaAcabado'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Tarifaacabado.tarifaAcabado'))])];
|
||||||
if (!empty($selId)) :
|
if (!empty($selId)) :
|
||||||
$tarifaacabadoModel = model('App\Models\tarifas\TarifaacabadoModel');
|
$tarifaacabadoModel = model('App\Models\tarifas\TarifaacabadoModel');
|
||||||
|
|||||||
@ -21,7 +21,8 @@ use
|
|||||||
DataTables\Editor\ValidateOptions;
|
DataTables\Editor\ValidateOptions;
|
||||||
|
|
||||||
|
|
||||||
class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceController {
|
class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = TarifaEncuadernacionLineaModel::class;
|
protected $modelName = TarifaEncuadernacionLineaModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -38,15 +39,16 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
protected $indexRoute = 'tarifaEncuadernacionLineaList';
|
protected $indexRoute = 'tarifaEncuadernacionLineaList';
|
||||||
|
|
||||||
|
|
||||||
|
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('TarifaEncuadernacionLineas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TarifaEncuadernacionLineas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -62,8 +64,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -89,7 +91,7 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -99,9 +101,7 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifaencuadernacionlineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -127,7 +127,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -151,12 +152,10 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -172,13 +171,11 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
|
|
||||||
$tarifaEncuadernacionLinea->fill($sanitizedData);
|
$tarifaEncuadernacionLinea->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaEncuadernacionLinea->id ?? $id;
|
$id = $tarifaEncuadernacionLinea->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('TarifaEncuadernacionLineas.tarifaencuadernacionLinea'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifaencuadernacionlineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -204,7 +201,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
public function datatable_editor() {
|
public function datatable_editor()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
||||||
@ -260,8 +258,7 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
||||||
foreach ($data['data'] as $pkey => $values) {
|
foreach ($data['data'] as $pkey => $values) {
|
||||||
// Si no se quiere borrar...
|
// Si no se quiere borrar...
|
||||||
if($data['data'][$pkey]['is_deleted'] != 1)
|
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
||||||
{
|
|
||||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
||||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
||||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_encuadernacion_id']);
|
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_encuadernacion_id']);
|
||||||
@ -309,7 +306,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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'])) {
|
||||||
@ -338,7 +336,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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';
|
||||||
@ -360,7 +359,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
|
|||||||
@ -21,7 +21,8 @@ use
|
|||||||
DataTables\Editor\ValidateOptions;
|
DataTables\Editor\ValidateOptions;
|
||||||
|
|
||||||
|
|
||||||
class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = TarifaManipuladoLineaModel::class;
|
protected $modelName = TarifaManipuladoLineaModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -38,15 +39,16 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'tarifaManipuladoLineaList';
|
protected $indexRoute = 'tarifaManipuladoLineaList';
|
||||||
|
|
||||||
|
|
||||||
|
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('TarifaManipuladoLineas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TarifaManipuladoLineas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = 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,
|
||||||
@ -62,8 +64,8 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -89,7 +91,7 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('TarifaManipuladoLineas.tarifamanipuladoLinea'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -99,9 +101,7 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('TarifaManipuladoLineas.tarifamanipuladoLinea'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifamanipuladolineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -127,7 +127,8 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->displayForm(__METHOD__);
|
return $this->displayForm(__METHOD__);
|
||||||
} // end function add()
|
} // end function add()
|
||||||
|
|
||||||
public function edit($requestedId = null) {
|
public function edit($requestedId = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
@ -151,12 +152,10 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$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)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
@ -172,13 +171,11 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$tarifaManipuladoLinea->fill($sanitizedData);
|
$tarifaManipuladoLinea->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = true;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaManipuladoLinea->id ?? $id;
|
$id = $tarifaManipuladoLinea->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('TarifaManipuladoLineas.tarifamanipuladoLinea'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifamanipuladolineas/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -204,7 +201,8 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
public function datatable_editor() {
|
public function datatable_editor()
|
||||||
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
||||||
@ -260,8 +258,7 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
||||||
foreach ($data['data'] as $pkey => $values) {
|
foreach ($data['data'] as $pkey => $values) {
|
||||||
// Si no se quiere borrar...
|
// Si no se quiere borrar...
|
||||||
if($data['data'][$pkey]['is_deleted'] != 1)
|
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
||||||
{
|
|
||||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
||||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
||||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_manipulado_id']);
|
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_manipulado_id']);
|
||||||
@ -309,7 +306,8 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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'])) {
|
||||||
@ -338,7 +336,8 @@ class Tarifamanipuladolineas 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';
|
||||||
@ -360,7 +359,8 @@ class Tarifamanipuladolineas 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];
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
||||||
|
|
||||||
class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
class Tarifapreimpresion extends \App\Controllers\GoBaseController
|
||||||
|
{
|
||||||
|
|
||||||
use \CodeIgniter\API\ResponseTrait;
|
use \CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
@ -19,8 +20,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
protected $indexRoute = 'tarifapreimpresionList';
|
protected $indexRoute = 'tarifapreimpresionList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Tarifapreimpresion.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;
|
||||||
@ -37,7 +38,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$this->viewData['usingClientSideDataTable'] = true;
|
$this->viewData['usingClientSideDataTable'] = true;
|
||||||
|
|
||||||
@ -46,8 +48,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
$requestMethod = $this->request->getMethod();
|
$requestMethod = $this->request->getMethod();
|
||||||
@ -72,7 +74,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('Tarifapreimpresion.tarifapreimpresion'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -82,9 +84,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('Tarifapreimpresion.tarifapreimpresion'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -93,7 +93,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
return $this->redirect2listView('successMessage', $message);
|
return $this->redirect2listView('successMessage', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
$this->viewData['successMessage'] = $message;
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -110,7 +110,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
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();
|
||||||
@ -161,9 +162,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('Tarifapreimpresion.tarifapreimpresion'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
//$message .= anchor(route_to('editTarifapreimpresion', $id), lang('Basic.global.continueEditing').'?');
|
|
||||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -172,8 +171,7 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
return $this->redirect2listView('successMessage', $message);
|
return $this->redirect2listView('successMessage', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
//JJO
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
$this->viewData['successMessage'] = $message;
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -190,8 +188,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
|
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';
|
||||||
@ -213,7 +211,8 @@ class Tarifapreimpresion extends \App\Controllers\GoBaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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];
|
||||||
|
|||||||
@ -9,7 +9,8 @@ use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
|||||||
|
|
||||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||||
|
|
||||||
class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = TarifaEncuadernacionModel::class;
|
protected $modelName = TarifaEncuadernacionModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -26,8 +27,8 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'tarifaEncuadernacionList';
|
protected $indexRoute = 'tarifaEncuadernacionList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Tarifaencuadernacion.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Tarifaencuadernacion.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
@ -48,7 +49,8 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
@ -64,7 +66,8 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$session = session();
|
$session = session();
|
||||||
@ -96,7 +99,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -106,9 +109,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
//$message .= anchor( "tarifaencuadernacion/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -118,9 +119,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
//JJO
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
$this->viewData['successMessage'] = $message;
|
|
||||||
//$this->session->setFlashData('sweet-success', $message);
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -137,7 +136,8 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
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();
|
||||||
@ -149,7 +149,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
$tarifaEncuadernacionEntity = $this->model->find($id);
|
$tarifaEncuadernacionEntity = $this->model->find($id);
|
||||||
|
|
||||||
if ($tarifaEncuadernacionEntity == false) :
|
if ($tarifaEncuadernacionEntity == false) :
|
||||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion')), $id]);
|
$message = lang('Basic.global.notFoundWithIdErr', [lang('Basic.global.record'), $id]);
|
||||||
return $this->redirect2listView('sweet-error', $message);
|
return $this->redirect2listView('sweet-error', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]);
|
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
@ -189,9 +189,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaEncuadernacionEntity->id ?? $id;
|
$id = $tarifaEncuadernacionEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifaencuadernacion.tarifaencuadernacion'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
//$message .= anchor( "tarifa ulado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -200,7 +198,7 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
$this->viewData['successMessage'] = $message;
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -217,8 +215,8 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -245,7 +243,8 @@ class Tarifasencuadernacion 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';
|
||||||
@ -267,7 +266,8 @@ class Tarifasencuadernacion 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];
|
||||||
|
|||||||
@ -9,7 +9,8 @@ use App\Entities\Tarifas\TarifaManipuladoEntity;
|
|||||||
|
|
||||||
use App\Models\Tarifas\TarifaManipuladoModel;
|
use App\Models\Tarifas\TarifaManipuladoModel;
|
||||||
|
|
||||||
class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController
|
||||||
|
{
|
||||||
|
|
||||||
protected $modelName = TarifaManipuladoModel::class;
|
protected $modelName = TarifaManipuladoModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
@ -26,8 +27,8 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
protected $indexRoute = 'tarifaManipuladoList';
|
protected $indexRoute = 'tarifaManipuladoList';
|
||||||
|
|
||||||
|
|
||||||
|
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('Tarifamanipulado.moduleTitle');
|
$this->viewData['pageTitle'] = lang('Tarifamanipulado.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
@ -48,7 +49,8 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
|
|
||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
@ -64,7 +66,8 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add() {
|
public function add()
|
||||||
|
{
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$session = session();
|
$session = session();
|
||||||
@ -96,7 +99,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado'))]);
|
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
|
||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
@ -106,9 +109,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado'))]).'.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
$message .= anchor( "tarifamanipulado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -118,9 +119,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
//JJO
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
$this->viewData['successMessage'] = $message;
|
|
||||||
//$this->session->setFlashData('sweet-success', $message);
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -137,7 +136,8 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
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();
|
||||||
@ -189,9 +189,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaManipuladoEntity->id ?? $id;
|
$id = $tarifaManipuladoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado'))]).'.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
//$message .= anchor( "tarifamanipulado/{$id}/edit" , lang('Basic.global.continueEditing').'?');
|
|
||||||
//$message = ucfirst(str_replace("'", "\'", $message));
|
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -200,7 +198,7 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
else:
|
else:
|
||||||
$this->viewData['successMessage'] = $message;
|
$this->session->setFlashData('sweet-success', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
@ -217,8 +215,8 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController {
|
|||||||
} // 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'])) {
|
||||||
@ -245,7 +243,8 @@ class Tarifasmanipulado 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';
|
||||||
@ -267,7 +266,8 @@ class Tarifasmanipulado 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];
|
||||||
|
|||||||
@ -63,7 +63,7 @@ return [
|
|||||||
'pleaseSelect' => 'Por favor seleccione...',
|
'pleaseSelect' => 'Por favor seleccione...',
|
||||||
'pleaseSelectA' => 'Por favor seleccione un {0}... ',
|
'pleaseSelectA' => 'Por favor seleccione un {0}... ',
|
||||||
'pleaseSelectOne' => 'Por favor seleccione un...',
|
'pleaseSelectOne' => 'Por favor seleccione un...',
|
||||||
'record' => 'el registro',
|
'record' => 'registro',
|
||||||
'saveSuccess' => 'El {0} se ha guardado satisfactoriamente',
|
'saveSuccess' => 'El {0} se ha guardado satisfactoriamente',
|
||||||
'saveSuccess1' => 'El {0} ',
|
'saveSuccess1' => 'El {0} ',
|
||||||
'saveSuccess2' => ' se ha guardado satisfactoriamente',
|
'saveSuccess2' => ' se ha guardado satisfactoriamente',
|
||||||
|
|||||||
@ -17,65 +17,24 @@ return [
|
|||||||
'updatedAt' => 'Actualizado en',
|
'updatedAt' => 'Actualizado en',
|
||||||
'userCreatedId' => 'ID Usuario "Creado en"',
|
'userCreatedId' => 'ID Usuario "Creado en"',
|
||||||
'userUpdateId' => 'ID Usuario "Actualizado en"',
|
'userUpdateId' => 'ID Usuario "Actualizado en"',
|
||||||
'validation' => [
|
|
||||||
'formula_price' => [
|
|
||||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
|
||||||
|
|
||||||
],
|
|
||||||
],
|
|
||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'nombre' => [
|
'nombre' => [
|
||||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
'required' => 'El campo {field} es obligatorio.',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
'validation' => [
|
|
||||||
'precio_min' => [
|
'precio_min' => [
|
||||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
'required' => 'El campo {field} es obligatorio.',
|
||||||
],
|
],
|
||||||
],
|
|
||||||
|
|
||||||
'validation' => [
|
|
||||||
'importe_fijo' => [
|
'importe_fijo' => [
|
||||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
'required' => 'El campo {field} es obligatorio.',
|
||||||
],
|
],
|
||||||
],
|
|
||||||
|
|
||||||
'validation' => [
|
|
||||||
'user_created_id' => [
|
|
||||||
'integer' => 'El campo {field} debe contener un número entero.',
|
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
'validation' => [
|
|
||||||
'user_update_id' => [
|
|
||||||
'integer' => 'El campo {field} debe contener un número entero.',
|
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
],
|
|
||||||
|
|
||||||
'validation' => [
|
|
||||||
'ajuste' => [
|
'ajuste' => [
|
||||||
'decimal' => 'El campo {field} debe contener un número decimal',
|
'decimal' => 'El campo {field} debe contener un número decimal',
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
'required' => 'El campo {field} es obligatorio.',
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,31 +40,31 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
protected $validationRules = [
|
protected $validationRules = [
|
||||||
"nombre" => [
|
"nombre" => [
|
||||||
"label" => "TarifaAcabado.nombre",
|
"label" => "Tarifaacabado.nombre",
|
||||||
"rules" => "trim|required|max_length[255]",
|
"rules" => "trim|required|max_length[255]",
|
||||||
],
|
],
|
||||||
"precio_min" => [
|
"precio_min" => [
|
||||||
"label" => "TarifaAcabado.precioMin",
|
"label" => "Tarifaacabado.precioMin",
|
||||||
"rules" => "required|decimal",
|
"rules" => "required|decimal",
|
||||||
],
|
],
|
||||||
"importe_fijo" => [
|
"importe_fijo" => [
|
||||||
"label" => "TarifaAcabado.importeFijo",
|
"label" => "Tarifaacabado.importeFijo",
|
||||||
"rules" => "required|decimal",
|
"rules" => "required|decimal",
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $validationMessages = [
|
protected $validationMessages = [
|
||||||
"nombre" => [
|
"nombre" => [
|
||||||
"max_length" => "TarifaAcabado.validation.nombre.max_length",
|
"max_length" => "Tarifaacabado.validation.nombre.max_length",
|
||||||
"required" => "TarifaAcabado.validation.nombre.required",
|
"required" => "Tarifaacabado.validation.nombre.required",
|
||||||
],
|
],
|
||||||
"precio_min" => [
|
"precio_min" => [
|
||||||
"required" => "TarifaAcabado.validation.precio_min.required",
|
"required" => "Tarifaacabado.validation.precio_min.required",
|
||||||
"decimal" => "TarifaAcabado.validation.precio_min.decimal",
|
"decimal" => "Tarifaacabado.validation.precio_min.decimal",
|
||||||
],
|
],
|
||||||
"importe_fijo" => [
|
"importe_fijo" => [
|
||||||
"required" => "TarifaAcabado.validation.importe_fijo.required",
|
"required" => "Tarifaacabado.validation.importe_fijo.required",
|
||||||
"decimal" => "TarifaAcabado.validation.importe_fijo.decimal",
|
"decimal" => "Tarifaacabado.validation.importe_fijo.decimal",
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$errorMessage = $errorMessage ?? session('errorMessage');
|
$errorMessage = $errorMessage ?? session('errorMessage');
|
||||||
$warningMessage = session('warningMessage');
|
$warningMessage = session('warningMessage');
|
||||||
|
|
||||||
@ -19,67 +18,24 @@ if (session()->has('error')) {
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (isset($successMessage) && $successMessage): ?>
|
|
||||||
<div class="alert alert-success alert-dismissible d-flex align-items-baseline" role="alert">
|
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
||||||
<i class="ti ti-check ti-sm"></i>
|
|
||||||
</span>
|
|
||||||
<div class="d-flex flex-column ps-1">
|
|
||||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Success') ?></h5>
|
|
||||||
<p class="mb-0"><?= $successMessage; ?></p>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if (isset($errorMessage) && $errorMessage): ?>
|
|
||||||
<div class="alert alert-danger alert-dismissible d-flex align-items-baseline" role="alert">
|
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
||||||
<i class="ti ti-ban ti-sm"></i>
|
|
||||||
</span>
|
|
||||||
<div class="d-flex flex-column ps-1">
|
|
||||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Error') ?></h5>
|
|
||||||
<p class="mb-0"><?= $errorMessage; ?></p>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php if (isset($warningMessage) && $warningMessage): ?>
|
|
||||||
<div class="alert alert-warning alert-dismissible d-flex align-items-baseline" role="alert">
|
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
||||||
<i class="ti ti-bell ti-sm"></i>
|
|
||||||
</span>
|
|
||||||
<div class="d-flex flex-column ps-1">
|
|
||||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Warning') ?></h5>
|
|
||||||
<p class="mb-0"><?= $warningMessage; ?></p>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div id="sk-alert">
|
<div id="sk-alert">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalInlineJs') ?>
|
<?= $this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
function popSuccessAlert(successMsg){
|
function popAlert(message, alertType){
|
||||||
|
var alertClass = "alert-" + alertType;
|
||||||
|
var alertIcon = alertType == "success" ? "ti-check" : "ti-" + alertType;
|
||||||
var htmlString = `
|
var htmlString = `
|
||||||
<div class="alert alert-success d-flex align-items-baseline" role="alert">
|
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
<i class="ti ti-check ti-sm"></i>
|
<i class="ti ${alertIcon} ti-sm"></i>
|
||||||
</span>
|
</span>
|
||||||
<div class="d-flex flex-column ps-1">
|
<div class="d-flex flex-column ps-1">
|
||||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Success') ?></h5>
|
<h5 class="alert-heading mb-2">${message}</h5>
|
||||||
<p class="mb-0">` + successMsg + `</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
$(window).scrollTop(0);
|
$(window).scrollTop(0);
|
||||||
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
@ -88,26 +44,29 @@ function popSuccessAlert(successMsg){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function popSuccessAlert(successMsg){
|
||||||
|
popAlert(successMsg, "success");
|
||||||
|
}
|
||||||
|
|
||||||
|
function popWarningAlert(warningMsg){
|
||||||
|
popAlert(warningMsg, "warning");
|
||||||
|
}
|
||||||
|
|
||||||
function popErrorAlert(errorMsg){
|
function popErrorAlert(errorMsg){
|
||||||
var htmlString = `
|
popAlert(errorMsg, "error");
|
||||||
<div class="alert alert-error d-flex align-items-baseline" role="alert">
|
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
||||||
<i class="ti ti-error ti-sm"></i>
|
|
||||||
</span>
|
|
||||||
<div class="d-flex flex-column ps-1">
|
|
||||||
<h5 class="alert-heading mb-2"><?= lang('Basic.global.Error') ?></h5>
|
|
||||||
<p class="mb-0">` + errorMsg + `</p>
|
|
||||||
</div>
|
|
||||||
</div>`;
|
|
||||||
|
|
||||||
$(window).scrollTop(0);
|
|
||||||
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
|
||||||
setTimeout(function(){
|
|
||||||
$('#sk-alert').fadeOut("slow");
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<?php if (isset($successMessage) && $successMessage){ ?>
|
||||||
|
popSuccessAlert(`<?= $successMessage ?>`);
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if (isset($warningMessage) && $warningMessage){ ?>
|
||||||
|
popWarningAlert(`<?= $warningMessage ?>`);
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<?php if (isset($errorMessage) && $errorMessage){ ?>
|
||||||
|
popErrorAlert(`<?= $errorMessage ?>`);
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|||||||
@ -1,22 +1,16 @@
|
|||||||
<?php if (config('Basics')->theme['name'] == 'vuexy') { ?>
|
<div class="alert alert-warning alert-dismissible d-flex align-items-baseline" role="alert">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||||
<symbol id="exclamation-triangle-fill" fill="currentColor" viewBox="0 0 16 16">
|
<i class="ti ti-bell ti-sm"></i>
|
||||||
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
</span>
|
||||||
</symbol>
|
<div class="d-flex flex-column ps-1">
|
||||||
</svg>
|
<h5 class="alert-heading mb-2"><?= lang('Basic.global.formErr2') ?></h5>
|
||||||
|
|
||||||
<div class="alert alert-warning" role="alert">
|
|
||||||
<svg class="bi mt-1 me-3 float-start" width="24" height="24" role="img" aria-label="Success:">
|
|
||||||
<use xlink:href="#exclamation-triangle-fill"/>
|
|
||||||
</svg>
|
|
||||||
<button type="button" class="btn-close float-end" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
||||||
<div class="fdfs">
|
|
||||||
<h4>Please correct the errors below:</h4>
|
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($errors as $error) : ?>
|
<?php foreach ($errors as $error) : ?>
|
||||||
<li><?= esc($error) ?></li>
|
<li><?= esc($error) ?></li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
|
||||||
|
|||||||
@ -1,90 +1,58 @@
|
|||||||
<!-- Push section css -->
|
<!-- Push section css -->
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/toastr/toastr.css') ?>"/>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-dark@4/dark.css">
|
|
||||||
<!-- <link rel="stylesheet" href="--><?php //= site_url('themes/vuexy/vendor/libs/toastr/toastr.css') ?><!--"/>-->
|
|
||||||
|
|
||||||
1 <style>
|
|
||||||
/* Toastr */
|
|
||||||
.colored-toast.swal2-icon-success {
|
|
||||||
background-color: #478921 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast.swal2-icon-error {
|
|
||||||
background-color: #c42a2a !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast.swal2-icon-warning {
|
|
||||||
background-color: #f8bb86 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast.swal2-icon-info {
|
|
||||||
background-color: #3fc3ee !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast.swal2-icon-question {
|
|
||||||
background-color: #87adbd !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast .swal2-title {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast .swal2-close {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.colored-toast .swal2-html-container {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Push section js -->
|
<!-- Push section js -->
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.all.min.js"></script>
|
<script src="<?= site_url('themes/vuexy/vendor/libs/toastr/toastr.js') ?>"></script>
|
||||||
<!--<script src="--><?php //= site_url('themes/vuexy/vendor/libs/toastr/toastr.js') ?><!--"></script>-->
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalInlineJs') ?>
|
<?= $this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
const Toast = Swal.mixin({
|
toastr.options = {
|
||||||
toast: true,
|
"closeButton": false,
|
||||||
position: 'top-right',
|
"debug": false,
|
||||||
iconColor: 'white',
|
"newestOnTop": false,
|
||||||
customClass: {
|
"progressBar": false,
|
||||||
popup: 'colored-toast'
|
"positionClass": "toast-top-right",
|
||||||
},
|
"preventDuplicates": false,
|
||||||
showConfirmButton: false,
|
"onclick": null,
|
||||||
timer: 6000,
|
"showDuration": "300",
|
||||||
timerProgressBar: true,
|
"hideDuration": "1000",
|
||||||
didOpen: (toast) => {
|
"timeOut": "5000",
|
||||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
"extendedTimeOut": "1000",
|
||||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
"showEasing": "swing",
|
||||||
}
|
"hideEasing": "linear",
|
||||||
});
|
"showMethod": "fadeIn",
|
||||||
|
"hideMethod": "fadeOut"
|
||||||
|
};
|
||||||
|
|
||||||
<?php if (session('sweet-success')) { ?>
|
<?php if (session('sweet-success')) {
|
||||||
Toast.fire({
|
if (isset($alertStyle) && ($alertStyle == 'toastr')) { ?>
|
||||||
icon: 'success',
|
toastr.success(`<?= session('sweet-success') ?>`);
|
||||||
title: '<?= session('sweet-success.') ?>'
|
<?php } else { ?>
|
||||||
});
|
popSuccessAlert(`<?= session('sweet-success') ?>`);
|
||||||
<?php } ?>
|
<?php }
|
||||||
<?php if (session('sweet-warning')) { ?>
|
}
|
||||||
Toast.fire({
|
?>
|
||||||
icon: 'warning',
|
|
||||||
title: '<?= session('sweet-warning.') ?>'
|
<?php if (session('sweet-warning')) {
|
||||||
});
|
if (isset($alertStyle) && ($alertStyle == 'toastr')) { ?>
|
||||||
<?php } ?>
|
toastr.warning(`<?= session('sweet-warning') ?>`);
|
||||||
<?php if (session('sweet-error')) { ?>
|
<?php } else { ?>
|
||||||
Toast.fire({
|
popWarningAlert(`<?= session('sweet-warning') ?>`);
|
||||||
icon: 'error',
|
<?php }
|
||||||
title: '<?= session('sweet-error.') ?>'
|
}
|
||||||
});
|
?>
|
||||||
<?php } ?>
|
|
||||||
|
<?php if (session('sweet-error')) {
|
||||||
|
if (isset($alertStyle) && ($alertStyle == 'toastr')) { ?>
|
||||||
|
toastr.error(`<?= session('sweet-error') ?>`);
|
||||||
|
<?php } else { ?>
|
||||||
|
popErrorgAlert(`<?= session('sweet-error') ?>`);
|
||||||
|
<?php }
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<?= $this->section('additionalInlineJs') ?>
|
<?= $this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `
|
return `
|
||||||
@ -120,7 +119,6 @@ const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -134,7 +134,6 @@ if (!empty($token) && $tfa == false) {
|
|||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
>
|
>
|
||||||
<i class="ti ti-bell ti-md"></i>
|
<i class="ti ti-bell ti-md"></i>
|
||||||
<span class="badge bg-danger rounded-pill badge-notifications">5</span>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!--/ Notification -->
|
<!--/ Notification -->
|
||||||
|
|||||||
Reference in New Issue
Block a user