mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en formularios/vista paises
This commit is contained in:
@ -34,7 +34,18 @@ $routes->setAutoRoute(true);
|
||||
|
||||
$routes->group('', [], function($routes) {
|
||||
|
||||
|
||||
$routes->group('paises', ['namespace' => 'App\Controllers\Configuracion'], function ($routes) {
|
||||
$routes->get('', 'Paises::index', ['as' => 'paisList']);
|
||||
$routes->get('index', 'Paises::index', ['as' => 'paisIndex']);
|
||||
$routes->get('list', 'Paises::index', ['as' => 'paisList2']);
|
||||
$routes->get('add', 'Paises::add', ['as' => 'newPais']);
|
||||
$routes->post('add', 'Paises::add', ['as' => 'createPais']);
|
||||
$routes->get('edit/(:num)', 'Paises::edit/$1', ['as' => 'editPais']);
|
||||
$routes->post('edit/(:num)', 'Paises::edit/$1', ['as' => 'updatePais']);
|
||||
$routes->get('delete/(:num)', 'Paises::delete/$1', ['as' => 'deletePais']);
|
||||
$routes->post('allmenuitems', 'Paises::allItemsSelect', ['as' => 'select2ItemsOfPaises']);
|
||||
$routes->post('menuitems', 'Paises::menuItems', ['as' => 'menuItemsOfPaises']);
|
||||
});
|
||||
|
||||
$routes->group('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->get('', 'Tarifaacabado::index', ['as' => 'tarifaacabadoList']);
|
||||
|
||||
231
ci4/app/Controllers/Configuracion/Paises.php
Normal file
231
ci4/app/Controllers/Configuracion/Paises.php
Normal file
@ -0,0 +1,231 @@
|
||||
<?php namespace App\Controllers\Configuracion;
|
||||
|
||||
use App\Entities\Configuracion\Pais;
|
||||
|
||||
class Paises extends \App\Controllers\GoBaseController {
|
||||
|
||||
use \CodeIgniter\API\ResponseTrait;
|
||||
|
||||
protected static $primaryModelName = 'App\Models\Configuracion\PaisModel';
|
||||
|
||||
protected static $singularObjectNameCc = 'pais';
|
||||
protected static $singularObjectName = 'Pais';
|
||||
protected static $pluralObjectName = 'Paises';
|
||||
protected static $controllerSlug = 'paises';
|
||||
|
||||
static $viewPath = '';
|
||||
|
||||
protected $indexRoute = 'paisList';
|
||||
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) {
|
||||
$this->viewData['pageTitle'] = lang('Paises.moduleTitle');
|
||||
self::$viewPath = getenv('theme.path').'form/configuracion/paises/';
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->viewData['usingClientSideDataTable'] = true;
|
||||
|
||||
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Paises.pais')]);
|
||||
parent::index();
|
||||
|
||||
}
|
||||
|
||||
public function add() {
|
||||
|
||||
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['errorMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Paises.pais'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
endif;
|
||||
|
||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [mb_strtolower(lang('Paises.pais'))]).'.';
|
||||
$message .= anchor(route_to('editPais', $id), lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message);
|
||||
else:
|
||||
return $this->redirect2listView('successMessage', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->viewData['successMessage'] = $message;
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['pais'] = isset($sanitizedData) ? new Pais($sanitizedData) : new Pais();
|
||||
|
||||
$this->viewData['formAction'] = route_to('createPais');
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew').' '.lang('Paises.pais').' '.lang('Basic.global.addNewSuffix');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__);
|
||||
} // end function add()
|
||||
|
||||
public function edit($requestedId = null) {
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$pais = $this->model->find($id);
|
||||
|
||||
if ($pais == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Paises.pais')), $id]);
|
||||
return $this->redirect2listView('errorMessage', $message);
|
||||
endif;
|
||||
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
if ($requestMethod === 'post') :
|
||||
|
||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
if ($this->request->getPost('show_erp') == null ) {
|
||||
$sanitizedData['show_erp'] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
|
||||
|
||||
if ($this->canValidate()) :
|
||||
try {
|
||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||
} catch (\Exception $e) {
|
||||
$noException = false;
|
||||
$this->dealWithException($e);
|
||||
}
|
||||
else:
|
||||
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Paises.pais'))]);
|
||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||
|
||||
endif;
|
||||
|
||||
$pais->fill($sanitizedData);
|
||||
|
||||
$thenRedirect = true;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $pais->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Paises.pais'))]).'.';
|
||||
$message .= anchor(route_to('editPais', $id), lang('Basic.global.continueEditing').'?');
|
||||
$message = ucfirst(str_replace("'", "\'", $message));
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('successMessage', $message);
|
||||
else:
|
||||
return $this->redirect2listView('successMessage', $message);
|
||||
endif;
|
||||
else:
|
||||
$this->viewData['successMessage'] = $message;
|
||||
endif;
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['pais'] = $pais;
|
||||
|
||||
$this->viewData['formAction'] = route_to('updatePais', $id);
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2').' '.lang('Paises.pais').' '.lang('Basic.global.edit3');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
} // end function edit(...)
|
||||
|
||||
|
||||
|
||||
public function allItemsSelect() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$onlyActiveOnes = true;
|
||||
$reqVal = $this->request->getPost('val') ?? 'id';
|
||||
$menu = $this->model->getAllForMenu($reqVal.', Select a field...', 'Select a field...', $onlyActiveOnes, false);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
//$nonItem->'Select a field...' = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function menuItems() {
|
||||
if ($this->request->isAJAX()) {
|
||||
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||
$reqId = goSanitize($this->request->getPost('id'))[0];
|
||||
$reqText = goSanitize($this->request->getPost('text'))[0];
|
||||
$onlyActiveOnes = false;
|
||||
$columns2select = [$reqId ?? 'id', $reqText ?? 'Select a field...'];
|
||||
$onlyActiveOnes = false;
|
||||
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
|
||||
$nonItem = new \stdClass;
|
||||
$nonItem->id = '';
|
||||
$nonItem->text = '- '.lang('Basic.global.None').' -';
|
||||
array_unshift($menu , $nonItem);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'menu' => $menu,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
22
ci4/app/Entities/Configuracion/Pais.php
Normal file
22
ci4/app/Entities/Configuracion/Pais.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace App\Entities\Configuracion;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class Pais extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"nombre" => null,
|
||||
"code" => null,
|
||||
"code3" => null,
|
||||
"moneda" => null,
|
||||
"url_erp" => null,
|
||||
"user_erp" => null,
|
||||
"key_erp" => null,
|
||||
"show_erp" => false,
|
||||
];
|
||||
protected $casts = [
|
||||
"show_erp" => "boolean",
|
||||
];
|
||||
}
|
||||
@ -139,7 +139,7 @@ class LoginAuthFilter implements FilterInterface
|
||||
'Integration',
|
||||
'Migrate',
|
||||
'Test',
|
||||
|
||||
'GoBaseController'
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
@ -190,6 +190,7 @@ function getDictionary($word=''){
|
||||
'Serviciocliente' => lang("App.permisos_serviciocliente"),
|
||||
'Calendario' => lang("App.permisos_calendario"),
|
||||
'Correo' => lang("App.permisos_correo"),
|
||||
'Paises' => lang("App.permisos_paises"),
|
||||
|
||||
'Presupuestos' => lang("App.permisos_presupuestos"),
|
||||
'Presupuesto' => lang("App.permisos_presupuestos"),
|
||||
|
||||
@ -638,6 +638,7 @@ return [
|
||||
"permisos_serviciocliente" => "Customer service",
|
||||
"permisos_calendario" => "Calendar",
|
||||
"permisos_correo" => "Mail",
|
||||
"permisos_paises" => "Countries",
|
||||
|
||||
"permisos_presupuestos" => "Budgets",
|
||||
"permisos_presupuestomaquetacion" => "Layout",
|
||||
@ -674,6 +675,7 @@ return [
|
||||
|
||||
"menu_configuration" => "Settings",
|
||||
"menu_calendario" => "Calendar",
|
||||
"menu_paises" => "Countries",
|
||||
"menu_correo" => "Mail",
|
||||
"menu_formaspago" => "Payment methods",
|
||||
"menu_imposiciones" => "Impositions",
|
||||
|
||||
@ -8,11 +8,11 @@ return [
|
||||
'id' => 'ID',
|
||||
'keyErp' => 'Key Erp',
|
||||
'moduleTitle' => 'Paises',
|
||||
'moneda' => 'Moneda',
|
||||
'nombre' => 'Nombre',
|
||||
'pais' => 'Pais',
|
||||
'paisList' => 'Pais List',
|
||||
'paises' => 'Paises',
|
||||
'moneda' => 'Currency',
|
||||
'nombre' => 'Name',
|
||||
'pais' => 'Country',
|
||||
'paisList' => 'Country List',
|
||||
'paises' => 'Countries',
|
||||
'showErp' => 'Show Erp',
|
||||
'urlErp' => 'URL Erp',
|
||||
'userErp' => 'User Erp',
|
||||
|
||||
@ -638,6 +638,7 @@ return [
|
||||
"permisos_serviciocliente" => "Servicio cliente",
|
||||
"permisos_calendario" => "Calendario",
|
||||
"permisos_correo" => "Correo",
|
||||
"permisos_paises" => "Paises",
|
||||
|
||||
"permisos_presupuestos" => "Presupuestos",
|
||||
"permisos_presupuestomaquetacion" => "Maquetación",
|
||||
@ -674,6 +675,7 @@ return [
|
||||
|
||||
"menu_configuration" => "Configuracion",
|
||||
"menu_calendario" => "Calendario",
|
||||
"menu_paises" => "Paises",
|
||||
"menu_correo" => "Correo",
|
||||
"menu_formaspago" => "Metodos de pago",
|
||||
"menu_imposiciones" => "Imposiciones",
|
||||
|
||||
@ -3,20 +3,52 @@
|
||||
|
||||
|
||||
return [
|
||||
'code' => 'Code',
|
||||
'code3' => 'Code3',
|
||||
'code' => 'Código',
|
||||
'code3' => 'Código33',
|
||||
'id' => 'ID',
|
||||
'keyErp' => 'Key Erp',
|
||||
'moduleTitle' => 'Paises',
|
||||
'moneda' => 'Moneda',
|
||||
'nombre' => 'Nombre',
|
||||
'pais' => 'Pais',
|
||||
'paisList' => 'Pais List',
|
||||
'pais' => 'País',
|
||||
'paisList' => 'Lista Paises',
|
||||
'paises' => 'Paises',
|
||||
'showErp' => 'Show Erp',
|
||||
'showErp' => 'Mostrar Erp',
|
||||
'urlErp' => 'URL Erp',
|
||||
'userErp' => 'User Erp',
|
||||
'validation' => [
|
||||
'code3' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
'key_erp' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
'url_erp' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
'user_erp' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
'moneda' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'nombre' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
'code' => [
|
||||
'is_unique' => 'The {field} field must contain a unique value',
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
@ -27,61 +59,5 @@ return [
|
||||
|
||||
],
|
||||
|
||||
'validation' => [
|
||||
'code3' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
'validation' => [
|
||||
'key_erp' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
'validation' => [
|
||||
'moneda' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
'validation' => [
|
||||
'nombre' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
'required' => 'The {field} field is required.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
'validation' => [
|
||||
'url_erp' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
'validation' => [
|
||||
'user_erp' => [
|
||||
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
|
||||
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
|
||||
|
||||
];
|
||||
78
ci4/app/Models/Configuracion/PaisModel.php
Normal file
78
ci4/app/Models/Configuracion/PaisModel.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class PaisModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "lg_paises";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $allowedFields = ["nombre", "code", "code3", "moneda", "url_erp", "user_erp", "key_erp", "show_erp"];
|
||||
protected $returnType = "App\Entities\Admin\Pais";
|
||||
|
||||
public static $labelField = "Select a field...";
|
||||
|
||||
protected $validationRules = [
|
||||
"code" => [
|
||||
"label" => "Paises.code",
|
||||
"rules" => "trim|required|max_length[2]|is_unique[lg_paises.code,id,{id}]",
|
||||
],
|
||||
"code3" => [
|
||||
"label" => "Paises.code3",
|
||||
"rules" => "trim|max_length[3]",
|
||||
],
|
||||
"key_erp" => [
|
||||
"label" => "Paises.keyErp",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
"moneda" => [
|
||||
"label" => "Paises.moneda",
|
||||
"rules" => "trim|required|max_length[3]",
|
||||
],
|
||||
"nombre" => [
|
||||
"label" => "Paises.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
"url_erp" => [
|
||||
"label" => "Paises.urlErp",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
"user_erp" => [
|
||||
"label" => "Paises.userErp",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"code" => [
|
||||
"is_unique" => "Paises.validation.code.is_unique",
|
||||
"max_length" => "Paises.validation.code.max_length",
|
||||
"required" => "Paises.validation.code.required",
|
||||
],
|
||||
"code3" => [
|
||||
"max_length" => "Paises.validation.code3.max_length",
|
||||
],
|
||||
"key_erp" => [
|
||||
"max_length" => "Paises.validation.key_erp.max_length",
|
||||
],
|
||||
"moneda" => [
|
||||
"max_length" => "Paises.validation.moneda.max_length",
|
||||
"required" => "Paises.validation.moneda.required",
|
||||
],
|
||||
"nombre" => [
|
||||
"max_length" => "Paises.validation.nombre.max_length",
|
||||
"required" => "Paises.validation.nombre.required",
|
||||
],
|
||||
"url_erp" => [
|
||||
"max_length" => "Paises.validation.url_erp.max_length",
|
||||
],
|
||||
"user_erp" => [
|
||||
"max_length" => "Paises.validation.user_erp.max_length",
|
||||
],
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Paises.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $pais->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?=lang('Paises.code') ?>*
|
||||
</label>
|
||||
<input type="text" id="code" name="code" required maxLength="2" class="form-control" value="<?=old('code', $pais->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code3" class="form-label">
|
||||
<?=lang('Paises.code3') ?>
|
||||
</label>
|
||||
<input type="text" id="code3" name="code3" maxLength="3" class="form-control" value="<?=old('code3', $pais->code3) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="moneda" class="form-label">
|
||||
<?=lang('Paises.moneda') ?>*
|
||||
</label>
|
||||
<input type="text" id="moneda" name="moneda" required maxLength="3" class="form-control" value="<?=old('moneda', $pais->moneda) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="urlErp" class="form-label">
|
||||
<?=lang('Paises.urlErp') ?>
|
||||
</label>
|
||||
<input type="url" id="urlErp" name="url_erp" maxLength="255" class="form-control" value="<?=old('url_erp', $pais->url_erp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="userErp" class="form-label">
|
||||
<?=lang('Paises.userErp') ?>
|
||||
</label>
|
||||
<input type="text" id="userErp" name="user_erp" maxLength="255" class="form-control" value="<?=old('user_erp', $pais->user_erp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="keyErp" class="form-label">
|
||||
<?=lang('Paises.keyErp') ?>
|
||||
</label>
|
||||
<input type="text" id="keyErp" name="key_erp" maxLength="255" class="form-control" value="<?=old('key_erp', $pais->key_erp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="showErp" class="form-check-label">
|
||||
<input type="checkbox" id="showErp" name="show_erp" value="1" class="form-check-input"<?=$pais->show_erp== true ? 'checked' : ''; ?>>
|
||||
<?=lang('Paises.showErp') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,26 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?=$this->extend('themes/backend/focus2/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<form id="paisForm" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/focus2/form/configuracion/paises/_paisFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("paisList2"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,84 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->extend('themes/backend/focus2/main/defaultlayout') ?>
|
||||
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Paises.paisList') ?></h3>
|
||||
<?=anchor(route_to('newPais'), lang('Basic.global.addNew').' '.lang('Paises.pais'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPaises" class="table table-striped table-hover using-data-table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Paises.id') ?></th>
|
||||
<th><?= lang('Paises.nombre') ?></th>
|
||||
<th><?= lang('Paises.code') ?></th>
|
||||
<th><?= lang('Paises.code3') ?></th>
|
||||
<th><?= lang('Paises.moneda') ?></th>
|
||||
<th><?= lang('Paises.urlErp') ?></th>
|
||||
<th><?= lang('Paises.userErp') ?></th>
|
||||
<th><?= lang('Paises.keyErp') ?></th>
|
||||
<th><?= lang('Paises.showErp') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($paisList as $item ) : ?>
|
||||
<tr>
|
||||
<td class="align-middle text-center">
|
||||
<?=$item->id ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->code) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->code3) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->moneda) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= esc($item->url_erp) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= empty($item->user_erp) || strlen($item->user_erp) < 51 ? esc($item->user_erp) : character_limiter(esc($item->user_erp), 50) ?>
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<?= empty($item->key_erp) || strlen($item->key_erp) < 51 ? esc($item->key_erp) : character_limiter(esc($item->key_erp), 50) ?>
|
||||
</td>
|
||||
<td class="align-middle text-center text-green">
|
||||
|
||||
<?php if ( $item->show_erp ) { ?>
|
||||
|
||||
<i class="text-success bi bi-check-lg"></i>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</td>
|
||||
<td class="align-middle text-center text-nowrap">
|
||||
<?=anchor(route_to('editPais', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
|
||||
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deletePais', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -24,7 +24,7 @@
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if(allowMenuSection($menus, ['Calendario', 'Correo', 'Formaspago', 'Imposiciones', 'Maquina', 'Papelgenerico', 'Seriefactura', 'Serviciocliente', 'Tamanioformatos', 'Tamaniolibros', 'Tareaservicio', 'Tiposimpresion', 'Trabajo'], 'index')): ?>
|
||||
<?php if(allowMenuSection($menus, ['Paises', 'Calendario', 'Correo', 'Formaspago', 'Imposiciones', 'Maquina', 'Papelgenerico', 'Seriefactura', 'Serviciocliente', 'Tamanioformatos', 'Tamaniolibros', 'Tareaservicio', 'Tiposimpresion', 'Trabajo'], 'index')): ?>
|
||||
<li><a class="has-arrow" href="Javascript:void()" aria-expanded="false"><i class="icon-arrow-down"></i><span class="nav-text"><?= lang("App.menu_configuration") ?></span></a>
|
||||
<ul aria-expanded="false">
|
||||
<?php if (count($temp=getArrayItem($menus,'name','Calendario')) > 0): ?>
|
||||
@ -32,6 +32,11 @@
|
||||
<li><a href="<?= site_url("configuracion/calendario")?>" aria-expanded="false"><i class="icon-list"></i><span class="nav-text"><?= lang("App.menu_calendario") ?></span></a></li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp=getArrayItem($menus,'name','Paises')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp,'methods','index',true)) > 0): ?>
|
||||
<li><a href="<?= site_url("configuracion/paises")?>" aria-expanded="false"><i class="icon-list"></i><span class="nav-text"><?= lang("App.menu_paises") ?></span></a></li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp=getArrayItem($menus,'name','Correo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp,'methods','index',true)) > 0): ?>
|
||||
<li><a href="<?= site_url("configuracion/correo")?>" aria-expanded="false"><i class="icon-list"></i><span class="nav-text"><?= lang("App.menu_correo") ?></span></a></li>
|
||||
|
||||
Reference in New Issue
Block a user