mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'dev/presupuesto_cliente_2'
Main See merge request jjimenez/safekat!235
This commit is contained in:
6
.idea/safekat.iml
generated
6
.idea/safekat.iml
generated
@ -1,7 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="WEB_MODULE" version="4">
|
<module type="WEB_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/ci4" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/ci4/app" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/ci4/app/ThirdParty/DatatablesEditor/" isTestSource="false" packagePrefix="DataTables\" />
|
||||||
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@ -47,15 +47,14 @@ const SK_PERMISSION_MATRIX = [
|
|||||||
"actividad.menu",
|
"actividad.menu",
|
||||||
],
|
],
|
||||||
"cliente" => [
|
"cliente" => [
|
||||||
"token.token",
|
"clientes.create",
|
||||||
"token.menu",
|
"clientes.edit",
|
||||||
"Profile.index",
|
"clientes.delete",
|
||||||
"Profile.store",
|
"clientes.menu",
|
||||||
"Profile.menu",
|
"presupuesto.create",
|
||||||
"Activity.index",
|
"presupuesto.edit",
|
||||||
"Activity.menu",
|
"presupuesto.delete",
|
||||||
"save.save",
|
"presupuesto.menu",
|
||||||
"save.menu",
|
|
||||||
],
|
],
|
||||||
"comercial" => [
|
"comercial" => [
|
||||||
"token.token",
|
"token.token",
|
||||||
|
|||||||
@ -11,7 +11,7 @@ service('auth')->routes($routes);
|
|||||||
|
|
||||||
//WEB ROUTER ------------------------------------------------------
|
//WEB ROUTER ------------------------------------------------------
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
$routes->get('/', 'Home::index');
|
$routes->get('/', 'Home::index', ['as' => 'home']);
|
||||||
$routes->get('lang/{locale}', 'Language::index');
|
$routes->get('lang/{locale}', 'Language::index');
|
||||||
$routes->get('viewmode/(:alpha)', 'Viewmode::index/$1');
|
$routes->get('viewmode/(:alpha)', 'Viewmode::index/$1');
|
||||||
|
|
||||||
@ -334,7 +334,29 @@ $routes->group('provincias', ['namespace' => 'App\Controllers\Configuracion'], f
|
|||||||
$routes->resource('provincias', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Provincias', 'except' => 'show,new,create,update']);
|
$routes->resource('provincias', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Provincias', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
|
|
||||||
$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
/* Rutas para configuraciones */
|
||||||
|
$routes->group('clientes', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
|
|
||||||
|
/* Cliente */
|
||||||
|
$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
|
$routes->get('', 'Cliente::index', ['as' => 'clienteList']);
|
||||||
|
$routes->match(['get', 'post'], 'add', 'Cliente::add', ['as' => 'clienteAdd']);
|
||||||
|
$routes->match(['get', 'post'], 'edit/(:num)', 'Cliente::edit/$1', ['as' => 'clienteEdit']);
|
||||||
|
$routes->get('delete/(:num)', 'Cliente::delete/$1', ['as' => 'clienteDelete']);
|
||||||
|
$routes->post('datatable', 'Cliente::datatable', ['as' => 'clienteDT']);
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Precios */
|
||||||
|
/*$routes->group('precios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
|
$routes->post('datatable', 'ClientePrecios::datatable', ['as' => 'clientePreciosDT']);
|
||||||
|
$routes->post('datatable_editor', 'ClientePrecios::datatable_editor', ['as' => 'clientePreciosDTE']);
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*$routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
$routes->get('', 'Cliente::index', ['as' => 'clienteList']);
|
$routes->get('', 'Cliente::index', ['as' => 'clienteList']);
|
||||||
$routes->get('add', 'Cliente::add', ['as' => 'newCliente']);
|
$routes->get('add', 'Cliente::add', ['as' => 'newCliente']);
|
||||||
$routes->post('add', 'Cliente::add', ['as' => 'createCliente']);
|
$routes->post('add', 'Cliente::add', ['as' => 'createCliente']);
|
||||||
@ -346,15 +368,15 @@ $routes->group('cliente', ['namespace' => 'App\Controllers\Clientes'], function
|
|||||||
$routes->post('allmenuitems', 'Cliente::allItemsSelect', ['as' => 'select2ItemsOfClientes']);
|
$routes->post('allmenuitems', 'Cliente::allItemsSelect', ['as' => 'select2ItemsOfClientes']);
|
||||||
$routes->post('menuitems', 'Cliente::menuItems', ['as' => 'menuItemsOfClientes']);
|
$routes->post('menuitems', 'Cliente::menuItems', ['as' => 'menuItemsOfClientes']);
|
||||||
});
|
});
|
||||||
$routes->resource('cliente', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Cliente', 'except' => 'show,new,create,update']);
|
$routes->resource('cliente', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Cliente', 'except' => 'show,new,create,update']);*/
|
||||||
|
|
||||||
$routes->group('clienteprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
$routes->group('clienteprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
$routes->post('datatable', 'Clienteprecios::datatable', ['as' => 'dataTableOfClienteprecios']);
|
$routes->post('datatable', 'Clienteprecios::datatable', ['as' => 'dataTableOfClienteprecios']);
|
||||||
$routes->post('datatable_editor', 'Clienteprecios::datatable_editor', ['as' => 'editorOfClienteprecios']);
|
$routes->post('datatable_editor', 'Clienteprecios::datatable_editor', ['as' => 'editorOfClienteprecios']);
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteprecios', 'except' => 'show,new,create,update']);
|
$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteprecios', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
|
|
||||||
$routes->group('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
$routes->group('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
$routes->get('', 'Clienteplantillaprecios::index', ['as' => 'clienteplantillapreciosList']);
|
$routes->get('', 'Clienteplantillaprecios::index', ['as' => 'clienteplantillapreciosList']);
|
||||||
$routes->get('add', 'Clienteplantillaprecios::add', ['as' => 'newClienteplantillaprecios']);
|
$routes->get('add', 'Clienteplantillaprecios::add', ['as' => 'newClienteplantillaprecios']);
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Catalogo;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Catalogo extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Catalogo Libros';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function importar()
|
|
||||||
{
|
|
||||||
echo 'Importar Catalogo Libros';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function nuevo()
|
|
||||||
{
|
|
||||||
echo 'Nuevo Catalogo Libros';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function categorias()
|
|
||||||
{
|
|
||||||
echo 'Categorias de Catalogo de Libros';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ class Cliente extends \App\Controllers\BaseResourceController
|
|||||||
$this->viewData['userList2'] = $this->getUserListItems2($clienteEntity->soporte_id ?? null);
|
$this->viewData['userList2'] = $this->getUserListItems2($clienteEntity->soporte_id ?? null);
|
||||||
$this->viewData['formaDePagoList'] = $this->getFormaDePagoListItems($clienteEntity->forma_pago_id ?? null);
|
$this->viewData['formaDePagoList'] = $this->getFormaDePagoListItems($clienteEntity->forma_pago_id ?? null);
|
||||||
|
|
||||||
$this->viewData['formAction'] = site_url('cliente/add'); // route_to('createCliente'); IMN
|
$this->viewData['formAction'] = route_to('clienteAdd');
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ class Cliente extends \App\Controllers\BaseResourceController
|
|||||||
$this->viewData['userList2'] = $this->getUserListItems2($clienteEntity->soporte_id ?? null);
|
$this->viewData['userList2'] = $this->getUserListItems2($clienteEntity->soporte_id ?? null);
|
||||||
$this->viewData['formaDePagoList'] = $this->getFormaDePagoListItems($clienteEntity->forma_pago_id ?? null);
|
$this->viewData['formaDePagoList'] = $this->getFormaDePagoListItems($clienteEntity->forma_pago_id ?? null);
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updateCliente', $id);
|
$this->viewData['formAction'] = route_to('clienteEdit', $id);
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||||
|
|
||||||
@ -355,10 +355,10 @@ class Cliente extends \App\Controllers\BaseResourceController
|
|||||||
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 (!is_null($selId)) :
|
||||||
$userModel = model('App\Models\Usuarios\UserModel');
|
$userModel = model('App\Models\UserModel');
|
||||||
|
|
||||||
$selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
|
$selOption = $userModel->where('id', $selId)->findColumn('first_name');
|
||||||
if (!empty($selOption)) :
|
if (!empty($selOption)) :
|
||||||
$data[$selId] = $selOption[0];
|
$data[$selId] = $selOption[0];
|
||||||
endif;
|
endif;
|
||||||
@ -370,7 +370,7 @@ class Cliente extends \App\Controllers\BaseResourceController
|
|||||||
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 (!is_null($selId)) :
|
||||||
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
|
$comunidadAutonomaModel = model('App\Models\Configuracion\ComunidadAutonomaModel');
|
||||||
|
|
||||||
$selOption = $comunidadAutonomaModel->where('id', $selId)->findColumn('nombre');
|
$selOption = $comunidadAutonomaModel->where('id', $selId)->findColumn('nombre');
|
||||||
@ -385,10 +385,10 @@ class Cliente extends \App\Controllers\BaseResourceController
|
|||||||
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 (!is_null($selId)) :
|
||||||
$userModel = model('App\Models\Configuracion\UserModel');
|
$userModel = model('App\Models\UserModel');
|
||||||
|
|
||||||
$selOption = $userModel->where('id_user', $selId)->findColumn('last_name');
|
$selOption = $userModel->where('id', $selId)->findColumn('last_name');
|
||||||
if (!empty($selOption)) :
|
if (!empty($selOption)) :
|
||||||
$data[$selId] = $selOption[0];
|
$data[$selId] = $selOption[0];
|
||||||
endif;
|
endif;
|
||||||
|
|||||||
@ -189,6 +189,12 @@ class Group extends \App\Controllers\GoBaseController
|
|||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
|
|
||||||
|
// IMN hacer las configuraciones hard coded
|
||||||
|
helper('rbac');
|
||||||
|
generate_php_roles_constant();
|
||||||
|
generate_php_permissions_matrix_constant();
|
||||||
|
|
||||||
$id = $groupEntity->id ?? $id;
|
$id = $groupEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,10 @@
|
|||||||
use App\Entities\Usuarios\UserEntity;
|
use App\Entities\Usuarios\UserEntity;
|
||||||
|
|
||||||
use App\Models\Usuarios\GroupModel;
|
use App\Models\Usuarios\GroupModel;
|
||||||
use App\Models\Usuarios\GroupsUsersModel;
|
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
|
use App\Models\Usuarios\GroupsUsersModel;
|
||||||
|
use CodeIgniter\Shield\Entities\User;
|
||||||
|
|
||||||
class Users extends \App\Controllers\GoBaseController {
|
class Users extends \App\Controllers\GoBaseController {
|
||||||
|
|
||||||
@ -43,49 +45,40 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
public function index() {
|
public function index() {
|
||||||
|
|
||||||
$this->viewData['usingClientSideDataTable'] = true;
|
$this->viewData['usingClientSideDataTable'] = true;
|
||||||
|
|
||||||
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
|
$this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('Users.user')]);
|
||||||
|
|
||||||
$this->viewData['user_model'] = $this->user_model;
|
$this->viewData['user_model'] = $this->user_model;
|
||||||
|
|
||||||
parent::index();
|
parent::index();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function add() {
|
public function add() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->request->getPost()) :
|
if ($this->request->getPost()) :
|
||||||
|
|
||||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
if(!empty($postData['password'])){
|
|
||||||
$phpass = new PasswordHash(8, true);
|
|
||||||
$postData['password'] = $phpass->HashPassword($this->request->getPost('password'));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$currentGroups = $postData['group']??[];
|
$currentGroups = $postData['group']??[];
|
||||||
unset($postData['group']);
|
unset($postData['group']);
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, true);
|
||||||
|
|
||||||
if ($this->request->getPost('last_ip') == null ) {
|
|
||||||
$sanitizedData['last_ip'] = '::1';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sanitizedData['token'] = md5(uniqid(rand(), true));
|
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
|
|
||||||
|
$users = auth()->getProvider();
|
||||||
|
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
|
|
||||||
if ($this->canValidate()) :
|
if ($this->canValidate()) :
|
||||||
try {
|
try {
|
||||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
|
||||||
|
$user = new User([
|
||||||
|
'username' => strstr($sanitizedData['email'], '@', true),
|
||||||
|
'email' => $sanitizedData['email'],
|
||||||
|
'password' => 'Safekat2024',
|
||||||
|
]);
|
||||||
|
$users->save($user);
|
||||||
|
$successfulResult = true; // Hacked
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$noException = false;
|
$noException = false;
|
||||||
$this->dealWithException($e);
|
$this->dealWithException($e);
|
||||||
@ -99,11 +92,12 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $users->getInsertID();
|
||||||
|
$this->group_user_model->where('user_id', $user->id)->delete();
|
||||||
foreach($currentGroups as $group){
|
foreach($currentGroups as $group){
|
||||||
$group_user_data = [
|
$group_user_data = [
|
||||||
'token_user' => $sanitizedData['token'],
|
'user_id' => $user->id,
|
||||||
'token_group' => $group
|
'group' => $group
|
||||||
];
|
];
|
||||||
$this->group_user_model->insert($group_user_data);
|
$this->group_user_model->insert($group_user_data);
|
||||||
}
|
}
|
||||||
@ -127,11 +121,8 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
$this->viewData['user'] = isset($sanitizedData) ? new UserEntity($sanitizedData) : new UserEntity();
|
$this->viewData['user'] = isset($sanitizedData) ? new UserEntity($sanitizedData) : new UserEntity();
|
||||||
$this->viewData['paisList'] = $this->getPaisListItems();
|
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('createUser');
|
$this->viewData['formAction'] = route_to('createUser');
|
||||||
$this->viewData['groups'] = $this->group_model->select('token,title')->findAll();
|
$this->viewData['groups'] = $this->group_model->select('keyword, title')->findAll();
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') .lang('Users.user').' '.lang('Basic.global.addNewSuffix');
|
$this->viewData['boxTitle'] = lang('Basic.global.addNew') .lang('Users.user').' '.lang('Basic.global.addNewSuffix');
|
||||||
|
|
||||||
|
|
||||||
@ -143,6 +134,7 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
if ($requestedId == null) :
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||||
$user = $this->model->find($id);
|
$user = $this->model->find($id);
|
||||||
|
|
||||||
@ -150,37 +142,22 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Users.user')), $id]);
|
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Users.user')), $id]);
|
||||||
return $this->redirect2listView('errorMessage', $message);
|
return $this->redirect2listView('errorMessage', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->request->getPost()) :
|
if ($this->request->getPost()) :
|
||||||
|
|
||||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$currentGroups = $postData['group'];
|
$currentGroups = $postData['group'];
|
||||||
unset($postData['group']);
|
unset($postData['group']);
|
||||||
|
$sanitizedData = $this->sanitized($postData, true);
|
||||||
|
|
||||||
if(!empty($postData['password'])){
|
if ($this->request->getPost('status') == 0 ) {
|
||||||
$phpass = new PasswordHash(8, true);
|
$sanitizedData['status'] = null;
|
||||||
$postData['password'] = $phpass->HashPassword($this->request->getPost('password'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
|
||||||
if ($this->request->getPost('tfa') == null ) {
|
|
||||||
$sanitizedData['tfa'] = false;
|
|
||||||
}
|
|
||||||
if ($this->request->getPost('blocked') == null ) {
|
|
||||||
$sanitizedData['blocked'] = false;
|
|
||||||
}
|
|
||||||
if ($this->request->getPost('last_ip') == null ) {
|
|
||||||
$sanitizedData['last_ip'] = '::1';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$noException = true;
|
$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 {
|
||||||
@ -196,22 +173,21 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
endif;
|
endif;
|
||||||
|
|
||||||
$user->fill($sanitizedData);
|
$user->fill($sanitizedData);
|
||||||
|
|
||||||
$thenRedirect = false;
|
$thenRedirect = false;
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$postData = $this->request->getPost();
|
|
||||||
|
$this->group_user_model->where('user_id', $user->id)->delete();
|
||||||
$this->group_user_model->where('token_user', $user->token)->delete();
|
|
||||||
foreach($currentGroups as $group){
|
foreach($currentGroups as $group){
|
||||||
$group_user_data = [
|
$group_user_data = [
|
||||||
'token_user' => $user->token,
|
'user_id' => $user->id,
|
||||||
'token_group' => $group
|
'group' => $group
|
||||||
];
|
];
|
||||||
$this->group_user_model->insert($group_user_data);
|
$this->group_user_model->insert($group_user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $user->id_user ?? $id;
|
$id = $user->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads';
|
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Users.user'))]) . 'Downloads';
|
||||||
$message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?');
|
$message .= anchor(route_to('editUser', $id), lang('Basic.global.continueEditing').'?');
|
||||||
$message = ucfirst(str_replace("'", "\'", $message));
|
$message = ucfirst(str_replace("'", "\'", $message));
|
||||||
@ -230,18 +206,38 @@ class Users extends \App\Controllers\GoBaseController {
|
|||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
$this->viewData['user'] = $user;
|
$this->viewData['user'] = $user;
|
||||||
$this->viewData['paisList'] = $this->getPaisListItems();
|
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updateUser', $id);
|
$this->viewData['formAction'] = route_to('updateUser', $id);
|
||||||
|
$this->viewData['selectedGroups'] = $this->group_model->getUsersRoles($requestedId);
|
||||||
$this->viewData['selectedGroups'] = $this->group_user_model->select('token_group')->where('token_user', $user->token)->findAll();
|
$this->viewData['groups'] = $this->group_model->select('keyword, title')->findAll();
|
||||||
$this->viewData['groups'] = $this->group_model->select('token,title')->findAll();
|
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') .lang('Users.user').' '.lang('Basic.global.edit3');
|
$this->viewData['boxTitle'] = lang('Basic.global.edit2') .lang('Users.user').' '.lang('Basic.global.edit3');
|
||||||
|
|
||||||
|
|
||||||
return $this->displayForm(__METHOD__, $id);
|
return $this->displayForm(__METHOD__, $id);
|
||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
|
public function delete($requestedId = null, bool $deletePermanently = true) {
|
||||||
|
|
||||||
|
if ($requestedId == null) :
|
||||||
|
return $this->redirect2listView();
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||||
|
$user = $this->model->find($id);
|
||||||
|
|
||||||
|
if ($user == false) :
|
||||||
|
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Users.user')), $id]);
|
||||||
|
return $this->redirect2listView('errorMessage', $message);
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$users = auth()->getProvider();
|
||||||
|
$users->delete($user->id, $deletePermanently);
|
||||||
|
|
||||||
|
$message = "Usuario eliminado correctamente";
|
||||||
|
return $this->redirect2listView('successMessage', $message);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // end function delete(...)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\EnviosLogistica;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Logistica extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Logistica';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function etiquetas()
|
|
||||||
{
|
|
||||||
echo 'Etiquetas';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function tracking()
|
|
||||||
{
|
|
||||||
echo 'Traking';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -8,12 +8,10 @@ use App\Models\Usuarios\UserModel;
|
|||||||
class Home extends BaseController
|
class Home extends BaseController
|
||||||
{
|
{
|
||||||
private $user_model;
|
private $user_model;
|
||||||
private $activity_model;
|
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
$this->user_model = new UserModel();
|
$this->user_model = new UserModel();
|
||||||
$this->activity_model = new ActivityModel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Importacion;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Importar extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Importar';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// public function delete_files()
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function pedidos_maquetacion()
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function pedidos_prestashop()
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Informes;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Informe extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Informe';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -22,74 +22,5 @@ class My extends BaseController
|
|||||||
return redirect()->to('profile');
|
return redirect()->to('profile');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function notification()
|
|
||||||
{
|
|
||||||
$session = session();
|
|
||||||
$data['title'] = [
|
|
||||||
'module' => lang("App.notification_title_my"),
|
|
||||||
'page' => lang("App.notification_subtitle_my"),
|
|
||||||
'icon' => 'fas fa-bell'
|
|
||||||
];
|
|
||||||
|
|
||||||
$data['breadcrumb'] = [
|
|
||||||
['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false],
|
|
||||||
['title' => lang("App.notification_title_my"), 'route' => "", 'active' => true]
|
|
||||||
];
|
|
||||||
|
|
||||||
$data['btn_add'] = [
|
|
||||||
'title' => lang("App.notification_btn_add"),
|
|
||||||
'route' => '/notification/add',
|
|
||||||
'class' => 'btn btn-lg btn-primary float-md-right',
|
|
||||||
'icon' => 'fas fa-plus'
|
|
||||||
];
|
|
||||||
|
|
||||||
echo view(getenv('theme.path').'main/header');
|
|
||||||
echo view(getenv('theme.path').'form/my/notification',$data);
|
|
||||||
echo view(getenv('theme.path').'main/footer');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function notification_view($id)
|
|
||||||
{
|
|
||||||
$session = session();
|
|
||||||
$data['obj'] = $this->notification_model->where('token', $id)->first();
|
|
||||||
if($data['obj']==null){
|
|
||||||
return redirect()->to('/my/notification');
|
|
||||||
}else{
|
|
||||||
if(!$data['obj']['is_read']){
|
|
||||||
$this->notification_model->save(['id_notification' => $data['obj']['id_notification'],'is_read' => true]);
|
|
||||||
$notification = $session->get('notification')??[];
|
|
||||||
foreach ($notification as $key => $value){
|
|
||||||
if($notification[$key]['token'] == $id){
|
|
||||||
$notification[$key]['is_read'] = '1';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$pulse = $this->notification_model->where('user_recipient',$session->get('token'))->where('is_read',false)->countAllResults() ?? 0;
|
|
||||||
$session->set('pulse', $pulse);
|
|
||||||
$session->set('notification',$notification);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['title'] = [
|
|
||||||
'module' => lang("App.notification_title_my"),
|
|
||||||
'page' => lang("App.notification_subtitle_view"),
|
|
||||||
'icon' => 'far fa-envelope-open'
|
|
||||||
];
|
|
||||||
|
|
||||||
$data['breadcrumb'] = [
|
|
||||||
['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false],
|
|
||||||
['title' => lang("App.notification_title_my"), 'route' => "/my/notification", 'active' => false],
|
|
||||||
['title' => lang("App.notification_subtitle_view"), 'route' => "", 'active' => true]
|
|
||||||
];
|
|
||||||
|
|
||||||
$data['btn_return'] = [
|
|
||||||
'title' => lang("App.global_come_back"),
|
|
||||||
'route' => '/my/notification',
|
|
||||||
'class' => 'btn btn-dark mr-1',
|
|
||||||
'icon' => 'fas fa-angle-left'
|
|
||||||
];
|
|
||||||
|
|
||||||
echo view(getenv('theme.path').'main/header');
|
|
||||||
echo view(getenv('theme.path').'form/my/view',$data);
|
|
||||||
echo view(getenv('theme.path').'main/footer');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Compras extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Compras';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function ajustes()
|
|
||||||
{
|
|
||||||
echo 'Ajustes de Compras';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Digitalizacion extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Digitalización';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Impresion extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Impresion';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
use function App\Controllers\ServiciosDigitalizacion\base_url;
|
|
||||||
use function App\Controllers\ServiciosDigitalizacion\service;
|
|
||||||
use function App\Controllers\ServiciosDigitalizacion\view;
|
|
||||||
|
|
||||||
|
|
||||||
class Maquetacion extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Maquetacion';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
use function App\Controllers\ServiciosDigitalizacion\base_url;
|
|
||||||
use function App\Controllers\ServiciosDigitalizacion\service;
|
|
||||||
use function App\Controllers\ServiciosDigitalizacion\view;
|
|
||||||
|
|
||||||
|
|
||||||
class Mensajes extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Mensajes';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Productos extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Productos';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Servicios;
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
|
|
||||||
|
|
||||||
class Proveedor extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo 'Proveedor';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ -10,6 +10,7 @@ use App\Models\Presupuestos\PresupuestoModel;
|
|||||||
use App\Models\Usuarios\GroupModel;
|
use App\Models\Usuarios\GroupModel;
|
||||||
use App\Models\Usuarios\PermisosModel;
|
use App\Models\Usuarios\PermisosModel;
|
||||||
use App\Services\PresupuestoService;
|
use App\Services\PresupuestoService;
|
||||||
|
use CodeIgniter\Shield\Entities\User;
|
||||||
|
|
||||||
class Test extends BaseController
|
class Test extends BaseController
|
||||||
{
|
{
|
||||||
@ -21,8 +22,11 @@ class Test extends BaseController
|
|||||||
{
|
{
|
||||||
helper('rbac');
|
helper('rbac');
|
||||||
|
|
||||||
|
var_dump(auth()->user()->can('plantilla-tarifa.menu'));
|
||||||
|
|
||||||
//$user = auth()->user();
|
//$user = auth()->user();
|
||||||
|
|
||||||
|
generate_php_permissions_constant();
|
||||||
|
|
||||||
//echo generate_php_permissions_matrix_constant();
|
//echo generate_php_permissions_matrix_constant();
|
||||||
|
|
||||||
|
|||||||
17
ci4/app/Entities/Usuarios/GroupsUsersEntity.php
Normal file
17
ci4/app/Entities/Usuarios/GroupsUsersEntity.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Entities\Usuarios;
|
||||||
|
|
||||||
|
use CodeIgniter\Entity;
|
||||||
|
|
||||||
|
class GroupsUsersEntity extends \CodeIgniter\Entity\Entity
|
||||||
|
{
|
||||||
|
protected $attributes = [
|
||||||
|
"id" => null,
|
||||||
|
"user_id" => null,
|
||||||
|
"group" => null,
|
||||||
|
"created_at" => null
|
||||||
|
];
|
||||||
|
protected $casts = [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
16
ci4/app/Entities/Usuarios/UsersEntity.php
Normal file
16
ci4/app/Entities/Usuarios/UsersEntity.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Entities\Usuarios;
|
||||||
|
|
||||||
|
use CodeIgniter\Entity;
|
||||||
|
use CodeIgniter\Shield\Entities\User;
|
||||||
|
|
||||||
|
class UsersEntity extends User
|
||||||
|
{
|
||||||
|
protected $attributes = [
|
||||||
|
"first_name" => null,
|
||||||
|
"last_name" => null
|
||||||
|
];
|
||||||
|
protected $casts = [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
namespace App\Models\Clientes;
|
namespace App\Models\Clientes;
|
||||||
|
|
||||||
class ClienteUsuariosModel extends \App\Models\BaseModel
|
use CodeIgniter\Shield\Models\UserModel as ShieldUserModel;
|
||||||
|
|
||||||
|
class ClienteUsuariosModel extends ShieldUserModel
|
||||||
{
|
{
|
||||||
protected $table = "auth_user";
|
protected $table = "users";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether primary key uses auto increment.
|
* Whether primary key uses auto increment.
|
||||||
@ -16,11 +18,11 @@ class ClienteUsuariosModel extends \App\Models\BaseModel
|
|||||||
const SORTABLE = [
|
const SORTABLE = [
|
||||||
0 => "t1.first_name",
|
0 => "t1.first_name",
|
||||||
1 => "t1.last_name",
|
1 => "t1.last_name",
|
||||||
2 => "t1.email",
|
2 => "t2.secret",
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $allowedFields = ["id", "first_name", "last_name", "email"];
|
protected $allowedFields = ["id", "first_name", "last_name", "email"];
|
||||||
protected $returnType = "App\Entities\Usuarios\UserEntity";
|
protected $returnType = "App\Entities\Usuarios\UsersEntity";
|
||||||
|
|
||||||
protected $useTimestamps = true;
|
protected $useTimestamps = true;
|
||||||
protected $useSoftDeletes = false;
|
protected $useSoftDeletes = false;
|
||||||
@ -93,10 +95,12 @@ class ClienteUsuariosModel extends \App\Models\BaseModel
|
|||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select(
|
->select(
|
||||||
"t1.id_user AS id, t1.first_name AS nombre, t1.last_name AS apellidos, t1.email AS email"
|
"t1.id AS id, t1.first_name AS nombre, t1.last_name AS apellidos,
|
||||||
|
t2.secret AS email"
|
||||||
);
|
);
|
||||||
|
|
||||||
$builder->where('t1.id_user', $cliente_id);
|
$builder->join("auth_identities t2", "t1.id = t2.user_id", "left");
|
||||||
|
$builder->where('t1.id', $cliente_id);
|
||||||
|
|
||||||
return empty($search)
|
return empty($search)
|
||||||
? $builder
|
? $builder
|
||||||
@ -104,7 +108,7 @@ class ClienteUsuariosModel extends \App\Models\BaseModel
|
|||||||
->groupStart()
|
->groupStart()
|
||||||
->like("t1.first_name", $search)
|
->like("t1.first_name", $search)
|
||||||
->orLike("t1.last_name", $search)
|
->orLike("t1.last_name", $search)
|
||||||
->orLike("t1.email", $search)
|
->orLike("t2.secret", $search)
|
||||||
->groupEnd();
|
->groupEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,4 +18,12 @@ class UserModel extends ShieldUserModel
|
|||||||
'last_name', // Añadido
|
'last_name', // Añadido
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*protected $validationRules = [
|
||||||
|
"email" => [
|
||||||
|
"label" => "RolesPermisos.email",
|
||||||
|
"rules" => "required|max_length[150]",
|
||||||
|
]
|
||||||
|
|
||||||
|
];*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,6 +100,18 @@ class GroupModel extends \App\Models\BaseModel
|
|||||||
->countAllResults();
|
->countAllResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getUsersRoles($userId)
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->db
|
||||||
|
->table('auth_groups_users')
|
||||||
|
->select('group')
|
||||||
|
->where('user_id', $userId)
|
||||||
|
->get()
|
||||||
|
->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
public function getRolPermissionList($rolId)
|
public function getRolPermissionList($rolId)
|
||||||
{
|
{
|
||||||
$rolRecord = $this->find($rolId);
|
$rolRecord = $this->find($rolId);
|
||||||
|
|||||||
23
ci4/app/Models/Usuarios/GroupsUsersModel.php
Normal file
23
ci4/app/Models/Usuarios/GroupsUsersModel.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Usuarios;
|
||||||
|
|
||||||
|
class GroupsUsersModel extends \App\Models\BaseModel
|
||||||
|
{
|
||||||
|
protected $table = "auth_groups_users";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether primary key uses auto increment.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected $primaryKey = "id";
|
||||||
|
|
||||||
|
protected $allowedFields = ["id", "user_id", "group"];
|
||||||
|
protected $returnType = "App\Entities\Usuarios\GroupsUsersEntity";
|
||||||
|
|
||||||
|
public static $labelField = "group";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@
|
|||||||
Ficha de Cliente
|
Ficha de Cliente
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<?php if ($formAction !== site_url('cliente/add')){ ?>
|
<?php if ($formAction !== route_to('clienteAdd')){ ?>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -564,7 +564,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php if ($formAction !== site_url('cliente/add')){ ?>
|
<?php if ($formAction !== route_to('clienteAdd')){ ?>
|
||||||
<div class="tab-pane fade" id="tarifascliente" role="tabpanel">
|
<div class="tab-pane fade" id="tarifascliente" role="tabpanel">
|
||||||
<?= view("themes/backend/vuexy/form/clientes/cliente/convert2templateModal") ?>
|
<?= view("themes/backend/vuexy/form/clientes/cliente/convert2templateModal") ?>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
@ -685,7 +685,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php if ($formAction !== site_url('cliente/add')){ ?>
|
<?php if ($formAction !== route_to('clienteAdd')){ ?>
|
||||||
<?= $this->section("additionalInlineJs") ?>
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
/****************************************
|
/****************************************
|
||||||
Funcionamiento general
|
Funcionamiento general
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<div class="card card-info">
|
<div class="card card-info">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?=lang('Clientes.clienteList') ?></h3>
|
<h3 class="card-title"><?=lang('Clientes.clienteList') ?></h3>
|
||||||
<?=anchor(route_to('newCliente'), lang('Basic.global.addNew').' '.lang('Clientes.cliente'), ['class'=>'btn btn-primary float-end']); ?>
|
<?=anchor(route_to('clienteAdd'), lang('Basic.global.addNew').' '.lang('Clientes.cliente'), ['class'=>'btn btn-primary float-end']); ?>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
@ -76,7 +76,7 @@
|
|||||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
},
|
},
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfClientes') ?>',
|
url: '<?= route_to('clienteDT') ?>',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
async: true,
|
async: true,
|
||||||
|
|||||||
@ -1,246 +0,0 @@
|
|||||||
<!--Style-->
|
|
||||||
<link rel="stylesheet" href="<?= site_url("themes/focus2/vendor/chartist/css/chartist.min.css") ?>">
|
|
||||||
<style>
|
|
||||||
.ct-series-a .ct-bar, .ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a,.bg-char-lead{
|
|
||||||
stroke: #6b51df;
|
|
||||||
}
|
|
||||||
.ct-series-b .ct-bar, .ct-series-b .ct-line, .ct-series-b .ct-point, .ct-series-b,.bg-char-conversion{
|
|
||||||
stroke: limegreen;
|
|
||||||
}
|
|
||||||
.ct-series-c .ct-bar, .ct-series-c .ct-line, .ct-series-c .ct-point, .ct-series-c,.bg-char-disengaged{
|
|
||||||
stroke: #ff004d;
|
|
||||||
}
|
|
||||||
.ct-pie-chart .ct-label {
|
|
||||||
fill: rgb(255 255 255);
|
|
||||||
color: rgb(255 255 255);
|
|
||||||
font-size: .70rem;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
.ct-icon {
|
|
||||||
height: 23px;
|
|
||||||
width: 23px;
|
|
||||||
margin-right: 5px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<!--Content Body-->
|
|
||||||
<div class="content-body">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row page-titles mx-0">
|
|
||||||
<div class="col-sm-6 p-md-0">
|
|
||||||
<div class="welcome-text">
|
|
||||||
<h4><i class="<?= $title['icon']??'' ?>"></i> <?= $title['module']??'' ?></h4>
|
|
||||||
<span class="ml-1"><?= $title['page']??'' ?></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
|
||||||
<ol class="breadcrumb">
|
|
||||||
<?php foreach ($breadcrumb??[] as $item) : ?>
|
|
||||||
<?php if (!$item['active']) : ?>
|
|
||||||
<li class="breadcrumb-item"><a href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
|
||||||
<?php else : ?>
|
|
||||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-3 col-sm-6">
|
|
||||||
<div class="card">
|
|
||||||
<div class="stat-widget-one card-body">
|
|
||||||
<div class="d-inline-block">
|
|
||||||
<i class="fas fa-users text-pink fa-3x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="stat-content d-inline-block">
|
|
||||||
<div class="stat-text text-pink"><?=strtoupper(lang("App.dashboard_user_total"))?></div>
|
|
||||||
<div class="stat-digit"><?=$total_user??'0'?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-3 col-sm-6">
|
|
||||||
<div class="card">
|
|
||||||
<div class="stat-widget-one card-body">
|
|
||||||
<div class="d-inline-block">
|
|
||||||
<i class="fas fa-user-friends text-pink fa-3x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="stat-content d-inline-block">
|
|
||||||
<div class="stat-text text-pink"><?=strtoupper(lang("App.dashboard_user_new"))?></div>
|
|
||||||
<div class="stat-digit"><?=$total_new??'0'?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-3 col-sm-6">
|
|
||||||
<div class="card">
|
|
||||||
<div class="stat-widget-one card-body">
|
|
||||||
<div class="d-inline-block">
|
|
||||||
<i class="fas fa-user-check text-pink fa-3x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="stat-content d-inline-block">
|
|
||||||
<div class="stat-text text-pink"><?=strtoupper(lang("App.dashboard_user_enabled"))?></div>
|
|
||||||
<div class="stat-digit"><?=$total_enabled??'0'?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-3 col-sm-6">
|
|
||||||
<div class="card">
|
|
||||||
<div class="stat-widget-one card-body">
|
|
||||||
<div class="d-inline-block">
|
|
||||||
<i class="fas fa-user-times text-pink fa-3x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="stat-content d-inline-block">
|
|
||||||
<div class="stat-text text-pink"><?=strtoupper(lang("App.dashboard_user_disabled"))?></div>
|
|
||||||
<div class="stat-digit"><?=$total_disabled??'0'?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-8">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h4 class="card-title"><?=lang("App.dashboard_chart_history")?></h4>
|
|
||||||
<span><i class="fas fa-square" style="color: #6b51df"></i> <?=lang("App.dashboard_user_total")?> <i class="fas fa-square" style="color: limegreen"></i> <?=lang("App.dashboard_user_enabled")?> <i class="fas fa-square" style="color: #ff004d"></i> <?=lang("App.dashboard_user_disabled")?></span>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="ct-bar-chart mt-5"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-4">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h4 class="card-title"><?=lang("App.dashboard_grid_user")?></h4>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="table-responsive" style="max-height: 300px; overflow-y: auto;">
|
|
||||||
<table class="table" id="table-grid" >
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($data_user??[] as $item) : ?>
|
|
||||||
<tr>
|
|
||||||
<td style="height: 56px; text-align: center;">
|
|
||||||
<img src="<?= $item['picture']??''?>" class="btn-circle btn-circle-sm">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<b><?= $item['first_name']??''?> <?= $item['last_name']??''?></b><br>
|
|
||||||
<?= $item['email']??''?><br>
|
|
||||||
<span class="timeAgo"><?= $item['created_at']??'' ?></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-8">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h4 class="card-title"><?=lang("App.dashboard_grid_access")?></h4>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="table-responsive" style="max-height: 370px; overflow-y: auto;">
|
|
||||||
<table class="table" id="table-grid">
|
|
||||||
<thead class="text-primary">
|
|
||||||
<tr>
|
|
||||||
<th><?=lang("App.dashboard_user")?></th>
|
|
||||||
<th><?=lang("App.dashboard_email")?></th>
|
|
||||||
<th><?=lang("App.dashboard_created_at")?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($data_activity??[] as $item) : ?>
|
|
||||||
<?php $data = json_decode($item['detail'],true); ?>
|
|
||||||
<tr>
|
|
||||||
<td><?= $item['first_name']??''?></td>
|
|
||||||
<td><?= $item['email']??''?></td>
|
|
||||||
<td><span class="timeAgo"><?= $item['created_at']??'' ?></span> </td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Required vendors -->
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/global/global.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/js/quixnav-init.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/js/custom.min.js")?>"></script>
|
|
||||||
<!-- Form -->
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/chartist/js/chartist.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/moment/moment.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/pg-calendar/js/pignose.calendar.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js")?>"></script>
|
|
||||||
<script>
|
|
||||||
"use strict";
|
|
||||||
$(document).ready(function () {
|
|
||||||
let dataPie = <?= $data_char_pie??'{}' ?>;
|
|
||||||
let labels = dataPie['labels'];
|
|
||||||
let icons = document.getElementById("ct-icon-chart").innerHTML;
|
|
||||||
for (let i = 0; i < labels.length; i++) {
|
|
||||||
switch (labels[i].toLowerCase()) {
|
|
||||||
case 'vkontakte':
|
|
||||||
icons += '<p class="btn-vk btn-circle ct-icon"><i class="fab fa-vk mt-1 ml-1"></i></p>';
|
|
||||||
break;
|
|
||||||
case 'wechat':
|
|
||||||
icons += '<p class="btn-wechat btn-circle ct-icon"><i class="fab fa-weixin mt-1 ml-1"></i></p>';
|
|
||||||
break;
|
|
||||||
case 'google':
|
|
||||||
icons += '<p class="btn-'+labels[i].toLowerCase()+'-plus btn-circle ct-icon"><i class="fab fa-'+labels[i].toLowerCase()+' mt-1 ml-1"></i></p>';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
icons += '<p class="btn-'+labels[i].toLowerCase()+' btn-circle ct-icon"><i class="fab fa-'+labels[i].toLowerCase()+' mt-1 ml-1"></i></p>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.getElementById("ct-icon-chart").innerHTML = icons;
|
|
||||||
let optionsPie = {
|
|
||||||
labelInterpolationFnc: function(value) {
|
|
||||||
return value[0]+value[1]+value[2]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let responsiveOptionsPie = [
|
|
||||||
['screen and (min-width: 640px)', {
|
|
||||||
chartPadding: 30,
|
|
||||||
labelOffset: 100,
|
|
||||||
labelDirection: 'explode',
|
|
||||||
labelInterpolationFnc: function(value) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
['screen and (min-width: 1024px)', {
|
|
||||||
labelOffset: 0,
|
|
||||||
chartPadding: 10
|
|
||||||
}]
|
|
||||||
];
|
|
||||||
new Chartist.Pie('.ct-pie-chart', dataPie, optionsPie, responsiveOptionsPie);
|
|
||||||
let dataBar = <?= $data_char_bar??'{}' ?>;
|
|
||||||
let optionsBar = {
|
|
||||||
seriesBarDistance: 10
|
|
||||||
};
|
|
||||||
let responsiveOptionsBar = [
|
|
||||||
['screen and (max-width: 640px)', {
|
|
||||||
seriesBarDistance: 5,
|
|
||||||
axisX: {
|
|
||||||
labelInterpolationFnc: function(value) {
|
|
||||||
return value[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
];
|
|
||||||
new Chartist.Bar('.ct-bar-chart', dataBar, optionsBar, responsiveOptionsBar);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?= sweetAlert() ?>
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<!--Content Body-->
|
|
||||||
<div class="content-body"></div>
|
|
||||||
<!-- Required vendors -->
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/global/global.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/js/quixnav-init.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/js/custom.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js")?>"></script>
|
|
||||||
<script>
|
|
||||||
"use strict";
|
|
||||||
$(document).ready(function () {
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
<div class="content-body">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row page-titles mx-0">
|
|
||||||
<div class="col-sm-6 p-md-0">
|
|
||||||
<div class="welcome-text">
|
|
||||||
<h4><i class="<?= $title['icon']??'' ?>"></i> <?= $title['module']??'' ?></h4>
|
|
||||||
<span class="ml-1"><?= $title['page']??'' ?></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
|
||||||
<ol class="breadcrumb">
|
|
||||||
<?php foreach ($breadcrumb??[] as $item) : ?>
|
|
||||||
<?php if (!$item['active']) : ?>
|
|
||||||
<li class="breadcrumb-item"><a href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
|
||||||
<?php else : ?>
|
|
||||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Required vendors -->
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/global/global.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/js/quixnav-init.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/js/custom.min.js")?>"></script>
|
|
||||||
<script src="<?=site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js")?>"></script>
|
|
||||||
<?= sweetAlert() ?>
|
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<?php foreach ($permiso->rules as $key => $rules): ?>
|
<?php foreach ($permiso->rules as $key => $rules): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-nowrap fw-semibold" >
|
<td class="text-nowrap fw-semibold" >
|
||||||
  <?= lang("RolesPermisos." . $key . "Section") ?>
|
  <?= lang("RolesPermisos." . convertToCamelCase($key) . "Section") ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($rules as $rule): ?>
|
<?php foreach ($rules as $rule): ?>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@ -1,172 +1,77 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 col-lg-6 px-4">
|
<div class="col-md-12 col-lg-6 px-4">
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="firstName" class="form-label">
|
<label for="firstName" class="form-label">
|
||||||
<?=lang('Users.firstName') ?>
|
<?= lang('Users.firstName') ?>
|
||||||
</label>
|
</label>
|
||||||
<input tabindex="1" type="text" id="firstName" name="first_name" maxLength="150" class="form-control" value="<?=old('first_name', $user->first_name) ?>">
|
<input tabindex="1" type="text" id="firstName" name="first_name" maxLength="150" class="form-control"
|
||||||
</div><!--//.mb-3 -->
|
value="<?= old('first_name', $user->first_name) ?>">
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="address" class="form-label">
|
<label for="email" class="form-label">
|
||||||
<?=lang('Users.address') ?>
|
<?= lang('Users.email') ?>*
|
||||||
</label>
|
</label>
|
||||||
<input tabindex="3" type="text" id="address" name="address" maxLength="255" class="form-control" value="<?=old('address', $user->address) ?>">
|
<input tabindex="13" type="email" id="email" name="email" maxLength="150" class="form-control"
|
||||||
</div><!--//.mb-3 -->
|
value="<?= old('email', $user->email) ?>">
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="state" class="form-label">
|
<div class="form-group">
|
||||||
<?=lang('Users.state') ?>
|
<label for="group" class="form-label"> <?= lang('Users.group') ?></label>
|
||||||
</label>
|
<select tabindex="17" name="group[]" id="group" multiple="multiple"
|
||||||
<input tabindex="5" type="text" id="state" name="state" maxLength="255" class="form-control" value="<?=old('state', $user->state) ?>">
|
class="form-control select2 form-select">
|
||||||
</div><!--//.mb-3 -->
|
<option value=""><?= lang('Basic.global.pleaseSelectA', [lang('Users.group')]) ?></option>
|
||||||
|
<?php
|
||||||
<div class="mb-3">
|
$selectedGroups = isset($selectedGroups) && is_array($selectedGroups) ? $selectedGroups : [];
|
||||||
<label for="country" class="form-label">
|
$selectedKeywords = array_map(fn($group) => $group->group, $selectedGroups);
|
||||||
<?=lang('Users.country') ?>
|
foreach ($groups as $item) :
|
||||||
</label>
|
$isSelected = in_array($item->keyword, $selectedKeywords) ? 'selected' : '';
|
||||||
|
?>
|
||||||
<select tabindex="7" id="country" name="country" class="select2 form-control " style="width: 100%;" >
|
<option value="<?= $item->keyword ?>"
|
||||||
<option value=""><?=lang('Basic.global.pleaseSelectA', [lang('Users.country')]) ?></option>
|
data-select2-id=<?= $item->keyword ?> <?= $isSelected ?>>
|
||||||
|
<?= $item->title ?>
|
||||||
<?php foreach ($paisList as $item) : ?>
|
</option>
|
||||||
<option value="<?=$item->code ?>"<?=$item->code==$user->country ? ' selected':'' ?> >
|
<?php endforeach; ?>
|
||||||
<?=$item->nombre ?>
|
</select>
|
||||||
</option>
|
</div>
|
||||||
<?php endforeach; ?>
|
</div><!--//.mb-3 -->
|
||||||
</select>
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="dateBirth" class="form-label">
|
|
||||||
<?=lang('Users.dateBirth') ?>
|
|
||||||
</label>
|
|
||||||
<input tabindex="9" type="date" id="dateBirth" name="date_birth" maxLength="10" class="form-control" value="<?=old('date_birth', $user->date_birth) ?>">
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-3">
|
</div><!--//.col -->
|
||||||
<label for="mobile" class="form-label">
|
<div class="col-md-12 col-lg-6 px-4">
|
||||||
<?=lang('Users.mobile') ?>
|
|
||||||
</label>
|
|
||||||
<input tabindex="11" type="text" id="mobile" name="mobile" maxLength="50" class="form-control" value="<?=old('mobile', $user->mobile) ?>">
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="email" class="form-label">
|
<label for="lastName" class="form-label">
|
||||||
<?=lang('Users.email') ?>*
|
<?= lang('Users.lastName') ?>
|
||||||
</label>
|
</label>
|
||||||
<input tabindex="13" type="email" id="email" name="email" maxLength="150" class="form-control" value="<?=old('email', $user->email) ?>">
|
<input tabindex="2" type="text" id="lastName" name="last_name" maxLength="150" class="form-control"
|
||||||
</div><!--//.mb-3 -->
|
value="<?= old('last_name', $user->last_name) ?>">
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="password" class="form-label">
|
<label for="status" class="form-label">
|
||||||
<?=lang('Users.password') ?>*
|
<?= lang('Users.blocked') ?>
|
||||||
</label>
|
</label>
|
||||||
<input tabindex="15" type="password" id="password" name="password" maxLength="35" class="form-control" value="<?=old('password', $user->password) ?>">
|
<?php $isBanned = old('blocked', $user->status); ?>
|
||||||
</div><!--//.mb-3 -->
|
<select tabindex="12" name="status" id="status" class="select2 form-control">
|
||||||
|
<option value="0" <?= is_null($isBanned) ? 'selected' : '' ?>><?= lang("Users.non_blocked") ?></option>
|
||||||
|
<option value="1" <?= $isBanned === "banned" ? 'selected' : '' ?>><?= lang("Users.blocked") ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="form-group">
|
<label for="active" class="form-label">
|
||||||
<label for="group" class="form-label"> <?=lang('Users.group') ?></label>
|
<?= lang('Users.status') ?>
|
||||||
<select tabindex="17" name="group[]" id="group" multiple="multiple" class="form-control select2 form-select">
|
</label>
|
||||||
<option value=""><?=lang('Basic.global.pleaseSelectA', [lang('Users.group')]) ?></option>
|
<?php $isActive = old('status', $user->active); ?>
|
||||||
<?php foreach ($groups as $item) : ?>
|
<select tabindex="16" name="active" id="active" class="select2 form-control">
|
||||||
<?php if (isset($selectedGroups) && sizeof($selectedGroups)>=1): ?>
|
<option value="1" <?= $isActive ? 'selected' : '' ?>><?= lang("Users.global_active") ?></option>
|
||||||
<?php foreach ($selectedGroups as $selItem) : ?>
|
<option value="0" <?= $isActive ? '' : 'selected' ?>><?= lang("Users.global_inactive") ?></option>
|
||||||
<option value="<?=$item->token ?>" data-select2-id=<?=$item->token ?> <?=$item->token==$selItem['token_group']?'selected':'' ?>> <?= $item->title ?>
|
</select>
|
||||||
</option>
|
</div><!--//.mb-3 -->
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<option value="<?=$item->token ?>" data-select2-id=<?=$item->token ?> > <?= $item->title ?>
|
|
||||||
</option>
|
|
||||||
<?php endif ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
|
</div><!--//.col -->
|
||||||
|
|
||||||
</div><!--//.col -->
|
</div><!-- //.row -->
|
||||||
<div class="col-md-12 col-lg-6 px-4">
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="lastName" class="form-label">
|
|
||||||
<?=lang('Users.lastName') ?>
|
|
||||||
</label>
|
|
||||||
<input tabindex="2" type="text" id="lastName" name="last_name" maxLength="150" class="form-control" value="<?=old('last_name', $user->last_name) ?>">
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="city" class="form-label">
|
|
||||||
<?=lang('Users.city') ?>
|
|
||||||
</label>
|
|
||||||
<input tabindex="4" type="text" id="city" name="city" maxLength="255" class="form-control" value="<?=old('city', $user->city) ?>">
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="zipCode" class="form-label">
|
|
||||||
<?=lang('Users.zipCode') ?>
|
|
||||||
</label>
|
|
||||||
<input tabindex="6" type="text" id="zipCode" name="zip_code" maxLength="50" class="form-control" value="<?=old('zip_code', $user->zip_code) ?>">
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="language" class="text-dark"><?=lang("Users.language")?></label>
|
|
||||||
<?php $id_select = old('language', $user->language);?>
|
|
||||||
<select tabindex="8" name="language" id="language" class="form-control">
|
|
||||||
<option value=""><?=lang("App.global_select")?></option>
|
|
||||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?=lang("App.lang_en")?></option>
|
|
||||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?=lang("App.lang_es")?></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="picture" class="form-label">
|
|
||||||
<?=lang('Users.picture') ?>
|
|
||||||
</label>
|
|
||||||
<input tabindex="10" type="text" id="picture" name="picture" placeholder="/assets/img/default-user.png" maxLength="150" class="form-control" value="<?=old('picture', $user->picture) ?>">
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="blocked" class="form-label">
|
|
||||||
<?=lang('Users.blocked') ?>
|
|
||||||
</label>
|
|
||||||
<?php $id_select = old('blocked', $user->blocked);?>
|
|
||||||
<select tabindex="12" name="blocked" id="blocked" class="select2 form-control">
|
|
||||||
<option value="0" <?= $id_select == "0" ? 'selected' : '' ?>><?=lang("Users.non_blocked")?></option>
|
|
||||||
<option value="1" <?= $id_select == "1" ? 'selected' : '' ?>><?=lang("Users.blocked")?></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="emailConfirmed" class="form-label">
|
|
||||||
<?=lang('Users.emailConfirmed') ?>*
|
|
||||||
</label>
|
|
||||||
<?php $id_select = old('email_confirmed', $user->email_confirmed);?>
|
|
||||||
<select tabindex="14" name="email_confirmed" id="email_confirmed" class="select2 form-control">
|
|
||||||
<option value="0" <?= $id_select == "0" ? 'selected' : '' ?>><?=lang("Users.email_not_confirmed")?></option>
|
|
||||||
<option value="1" <?= $id_select == "1" ? 'selected' : '' ?>><?=lang("Users.email_confirmed")?></option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="status" class="form-label">
|
|
||||||
<?=lang('Users.status') ?>
|
|
||||||
</label>
|
|
||||||
<?php $id_select = old('status', $user->status);?>
|
|
||||||
<select tabindex="16" name="status" id="status" class="select2 form-control">
|
|
||||||
<option value="1" <?= $id_select == "1" ? 'selected' : '' ?>><?=lang("Users.global_active")?></option>
|
|
||||||
<option value="0" <?= $id_select == "0" ? 'selected' : '' ?>><?=lang("Users.global_inactive")?></option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
</div><!--//.col -->
|
|
||||||
|
|
||||||
</div><!-- //.row -->
|
|
||||||
578
ci4/app/Views/themes/backend/vuexy/main/menu_impresion.old.php
Normal file
578
ci4/app/Views/themes/backend/vuexy/main/menu_impresion.old.php
Normal file
@ -0,0 +1,578 @@
|
|||||||
|
<!-- Menu -->
|
||||||
|
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
|
||||||
|
<div class="app-brand">
|
||||||
|
<a href="<?= site_url('home') ?>" class="app-brand-link">
|
||||||
|
<span class="app-brand-logo">
|
||||||
|
<img src="<?= site_url('themes/vuexy/img/safekat/logos/sk-logo.png') ?>" width="150px">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
|
||||||
|
<i class="ti menu-toggle-icon d-none d-xl-block ti-sm align-middle"></i>
|
||||||
|
<i class="ti ti-x d-block d-xl-none ti-sm align-middle"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="menu-inner-shadow"></div>
|
||||||
|
|
||||||
|
<ul class="menu-inner py-1">
|
||||||
|
|
||||||
|
<li class="menu-item active">
|
||||||
|
<a href="<?= site_url("") ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_dashboard") ?>"><?= lang("App.menu_dashboard") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU CLIENTES
|
||||||
|
*/
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!-- Clientes -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-users"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("clientes/cliente") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("clientes/clienteplantillaprecios") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_plantillas_tarifas_clientes") ?>"><?= lang("App.menu_plantillas_tarifas_clientes") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU PRESUPUESTOS
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Budgets -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-currency-dollar"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_presupuestos") ?>"><?= lang("App.menu_presupuestos") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/buscador") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_presupuesto_buscador") ?>"><?= lang("App.menu_presupuesto_buscador") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros") ?>"><?= lang("App.menu_libros") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/cosidotapablanda/list/1") ?>"
|
||||||
|
class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_fresasdo_tapa_dura") ?>"><?= lang("App.menu_libros_fresasdo_tapa_dura") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/cosidotapablanda/list/2") ?>"
|
||||||
|
class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_fresasdo_tapa_blanda") ?>"><?= lang("App.menu_libros_fresasdo_tapa_blanda") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/cosidotapablanda/list/3") ?>"
|
||||||
|
class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_cosido_tapa_dura") ?>"><?= lang("App.menu_libros_cosido_tapa_dura") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/cosidotapablanda/list/4") ?>"
|
||||||
|
class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_cosido_tapa_blanda") ?>"><?= lang("App.menu_libros_cosido_tapa_blanda") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/grapados") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_grapados") ?>"><?= lang("App.menu_libros_grapados") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/espiraltapadura") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_espiral_tapa_dura") ?>"><?= lang("App.menu_libros_espiral_tapa_dura") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/espiraltapablanda") ?>"
|
||||||
|
class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_espiral_tapa_blanda") ?>"><?= lang("App.menu_libros_espiral_tapa_blanda") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/wireotapadura") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_wireo_tapa_dura") ?>"><?= lang("App.menu_libros_wireo_tapa_dura") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/wireotapablanda") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_libros_wireo_tapa_blanda") ?>"><?= lang("App.menu_libros_wireo_tapa_blanda") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/marcapaginas") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_marcapaginas") ?>"><?= lang("App.menu_marcapaginas") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/flyers") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_flyers") ?>"><?= lang("App.menu_flyers") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/carteles") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_carteles") ?>"><?= lang("App.menu_carteles") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/tarjetascomerciales") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_tarjetas_comerciales") ?>"><?= lang("App.menu_tarjetas_comerciales") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/invitaciones") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_invitaciones") ?>"><?= lang("App.menu_invitaciones") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/estuches") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_estuches") ?>"><?= lang("App.menu_estuches") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<div data-i18n="<?= lang("App.menu_folletos") ?>"><?= lang("App.menu_folletos") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/dipticos") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_folleto_diptico") ?>"><?= lang("App.menu_folleto_diptico") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/tripticos") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_folleto_triptico") ?>"><?= lang("App.menu_folleto_triptico") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/cuadripticos") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_folleto_cuadriptico") ?>"><?= lang("App.menu_folleto_cuadriptico") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("presupuestos/calendarios") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_calendarios") ?>"><?= lang("App.menu_calendarios") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU PEDIDOS
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Orders -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-file-description"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_pedidos") ?>"><?= lang("App.menu_pedidos") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("pedidos/pedido/activos") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_pedidos_activos") ?>"><?= lang("App.menu_pedidos_activos") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("pedidos/pedido/finalizados") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_pedidos_finalizados") ?>"><?= lang("App.menu_pedidos_finalizados") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("pedidos/pedido/cancelados") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_pedidos_cancelados") ?>"><?= lang("App.menu_pedidos_cancelados") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("pedidos/pedido/manuales") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_pedidos_manuales") ?>"><?= lang("App.menu_pedidos_manuales") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU PRODUCCION
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Production -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-printer"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_produccion") ?>"><?= lang("App.menu_produccion") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("produccion/ordentrabajo") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_orden_trabajo") ?>"><?= lang("App.menu_orden_trabajo") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("produccion/ordentrabajo/cien") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_orden_trabajo_100") ?>"><?= lang("App.menu_orden_trabajo_100") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("produccion/ordentrabajo/finalizado") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_orden_trabajo_finalizados") ?>"><?= lang("App.menu_orden_trabajo_finalizados") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("produccion/ordentrabajo/pendiente") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_orden_trabajo_pendientes") ?>"><?= lang("App.menu_orden_trabajo_pendientes") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU IMPORTACION
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Import -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("importacion/importar") ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-file-import"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_importacion") ?>"><?= lang("App.menu_importacion") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU CATALOGO
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Orders -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-book"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_catalogo") ?>"><?= lang("App.menu_catalogo") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("catalogo/catalogo") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_catalogo_libros") ?>"><?= lang("App.menu_catalogo_libros") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("catalogo/catalogo/nuevo") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_catalogo_nuevo") ?>"><?= lang("App.menu_catalogo_nuevo") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("catalogo/catalogo/categorias") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_catalogo_categorias") ?>"><?= lang("App.menu_catalogo_categorias") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("catalogo/catalogo/importar") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_catalogo_importar") ?>"><?= lang("App.menu_catalogo_importar") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU FACTURACION
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Invoicing -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_facturación") ?>"><?= lang("App.menu_facturación") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("facturacion/factura") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_facturas") ?>"><?= lang("App.menu_facturas") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("facturacion/factura/vencimiento") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_facturas_vencimiento") ?>"><?= lang("App.menu_facturas_vencimiento") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("facturacion/factura/nueva") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_facturas_nueva") ?>"><?= lang("App.menu_facturas_nueva") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("facturacion/albaran") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_albaran") ?>"><?= lang("App.menu_albaran") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU LOGISTICA
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Invoicing -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-truck"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_logistica") ?>"><?= lang("App.menu_logistica") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("envioslogistica/logistica") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_logistica_envios") ?>"><?= lang("App.menu_logistica_envios") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("envioslogistica/logistica/etiquetas") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_logistica_etiquetas") ?>"><?= lang("App.menu_logistica_etiquetas") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("envioslogistica/logistica/tracking") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_logistica_tracking") ?>"><?= lang("App.menu_logistica_tracking") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU TARIFAS
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Prices -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-receipt"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_tarifas") ?>"><?= lang("App.menu_tarifas") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to("tarifapreimpresionList") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_tarifapreimpresion") ?>"><?= lang("App.menu_tarifapreimpresion") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to("tarifaManipuladoList") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_tarifamanipulado") ?>"><?= lang("App.menu_tarifamanipulado") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to('tarifaAcabadoList') ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_tarifaacabado") ?>"><?= lang("App.menu_tarifaacabado") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("tarifas/tarifasencuadernacion") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_encuadernacion") ?>"><?= lang("App.menu_encuadernacion") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("tarifas/tarifasenvios") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_tarifaenvio") ?>"><?= lang("App.menu_tarifaenvio") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU COMPRAS
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- BUY -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-shopping-cart"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_compras") ?>"><?= lang("App.menu_compras") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("servicios/compras") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_compras") ?>"><?= lang("App.menu_compras") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("servicios/productos") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_productos") ?>"><?= lang("App.menu_productos") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("compras/proveedores") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_proveedores") ?>"><?= lang("App.menu_proveedores") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("servicios/compras/ajustes") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_compras_ajustes") ?>"><?= lang("App.menu_compras_ajustes") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU CONFIGURACION
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-adjustments-horizontal"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_configuration") ?>"><?= lang("App.menu_configuration") ?></div>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/maquinas") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_maquina") ?>"><?= lang("App.menu_maquina") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/maquinasdefecto") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_maquina_defecto") ?>"><?= lang("App.menu_maquina_defecto") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to('paisList') ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_paises") ?>"><?= lang("App.menu_paises") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/users") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_users") ?>"><?= lang("App.menu_users") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/group") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_permission_group") ?>"><?= lang("App.menu_permission_group") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/papelesgenericos") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_papelgenerico") ?>"><?= lang("App.menu_papelgenerico") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("configuracion/papelesimpresion") ?>" class="menu-link">
|
||||||
|
<div data-i18n="<?= lang("App.menu_papelimpresion") ?>"><?= lang("App.menu_papelimpresion") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU MENSAJES
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Messages -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("servicios/mensajes") ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-message"></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_mensajes") ?>"><?= lang("App.menu_mensajes") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
<li class="menu-header small text-uppercase">
|
||||||
|
<span class="menu-header-text">Ajustes del Sistema</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU AJUSTES
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Settings -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("settings") ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-settings""></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_settings") ?>"><?= lang("App.menu_settings") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU ACTIVIDAD
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!-- Activity -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to("activityList") ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-fingerprint""></i>
|
||||||
|
<div data-i18n="<?= lang("App.menu_activity") ?>"><?= lang("App.menu_activity") ?></div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!---
|
||||||
|
/**
|
||||||
|
* JJO
|
||||||
|
*/
|
||||||
|
|
||||||
|
<li class="menu-header small text-uppercase">
|
||||||
|
<span class="menu-header-text">Test JJO</span>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to('nuevoPresupuestoCliente' ) ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-settings"></i>
|
||||||
|
<div data-i18n="Test">Test</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
--->
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</aside>
|
||||||
|
<!-- / Menu -->
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU CLIENTES
|
||||||
|
*/
|
||||||
|
if (auth()->user()->can('clientes.menu') ||
|
||||||
|
auth()->user()->can('plantilla-tarifa.menu')) {
|
||||||
|
?>
|
||||||
|
<!-- Clientes -->
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
|
<i class="menu-icon tf-icons ti ti-users"></i>
|
||||||
|
<?= lang("App.menu_clientes") ?>
|
||||||
|
</a>
|
||||||
|
<ul class="menu-sub">
|
||||||
|
<?php if (auth()->user()->can('clientes.menu')) { ?>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= route_to("clienteList") ?>" class="menu-link">
|
||||||
|
<?= lang("App.menu_clientes") ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if (auth()->user()->can('plantilla-tarifa.menu')) { ?>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a href="<?= site_url("clientes/clienteplantillaprecios") ?>" class="menu-link">
|
||||||
|
<?= lang("App.menu_plantillas_tarifas_clientes") ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* MENU DASHBOARD
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<li class="menu-item active">
|
||||||
|
<a href="<?= route_to("home") ?>" class="menu-link">
|
||||||
|
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||||
|
<?= lang("App.menu_dashboard") ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
@ -1,99 +0,0 @@
|
|||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of CodeIgniter 4 framework.
|
|
||||||
*
|
|
||||||
* (c) CodeIgniter Foundation <admin@codeigniter.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* --------------------------------------------------------------------
|
|
||||||
* CodeIgniter command-line tools
|
|
||||||
* --------------------------------------------------------------------
|
|
||||||
* The main entry point into the CLI system and allows you to run
|
|
||||||
* commands and perform maintenance on your application.
|
|
||||||
*
|
|
||||||
* Because CodeIgniter can handle CLI requests as just another web request
|
|
||||||
* this class mainly acts as a passthru to the framework itself.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Refuse to run when called from php-cgi
|
|
||||||
if (strpos(PHP_SAPI, 'cgi') === 0) {
|
|
||||||
exit("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check PHP version.
|
|
||||||
$minPhpVersion = '7.4'; // If you update this, don't forget to update `public/index.php`.
|
|
||||||
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
|
|
||||||
$message = sprintf(
|
|
||||||
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
|
|
||||||
$minPhpVersion,
|
|
||||||
PHP_VERSION
|
|
||||||
);
|
|
||||||
|
|
||||||
exit($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
// We want errors to be shown when using it from the CLI.
|
|
||||||
error_reporting(-1);
|
|
||||||
ini_set('display_errors', '1');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*
|
|
||||||
* @deprecated No longer in use. `CodeIgniter` has `$context` property.
|
|
||||||
*/
|
|
||||||
define('SPARKED', true);
|
|
||||||
|
|
||||||
// Path to the front controller
|
|
||||||
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR);
|
|
||||||
|
|
||||||
// Ensure the current directory is pointing to the front controller's directory
|
|
||||||
chdir(FCPATH);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*---------------------------------------------------------------
|
|
||||||
* BOOTSTRAP THE APPLICATION
|
|
||||||
*---------------------------------------------------------------
|
|
||||||
* This process sets up the path constants, loads and registers
|
|
||||||
* our autoloader, along with Composer's, loads our constants
|
|
||||||
* and fires up an environment-specific bootstrapping.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Load our paths config file
|
|
||||||
// This is the line that might need to be changed, depending on your folder structure.
|
|
||||||
require FCPATH . '../app/Config/Paths.php';
|
|
||||||
// ^^^ Change this line if you move your application folder
|
|
||||||
|
|
||||||
$paths = new Config\Paths();
|
|
||||||
|
|
||||||
// Location of the framework bootstrap file.
|
|
||||||
require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php';
|
|
||||||
|
|
||||||
// Load environment settings from .env files into $_SERVER and $_ENV
|
|
||||||
require_once SYSTEMPATH . 'Config/DotEnv.php';
|
|
||||||
(new CodeIgniter\Config\DotEnv(ROOTPATH))->load();
|
|
||||||
|
|
||||||
// Grab our CodeIgniter
|
|
||||||
$app = Config\Services::codeigniter();
|
|
||||||
$app->initialize();
|
|
||||||
|
|
||||||
// Grab our Console
|
|
||||||
$console = new CodeIgniter\CLI\Console();
|
|
||||||
|
|
||||||
// Show basic information before we do anything else.
|
|
||||||
if (is_int($suppress = array_search('--no-header', $_SERVER['argv'], true))) {
|
|
||||||
unset($_SERVER['argv'][$suppress]); // @codeCoverageIgnore
|
|
||||||
$suppress = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$console->showHeader($suppress);
|
|
||||||
|
|
||||||
// fire off the command in the main framework.
|
|
||||||
$exit = $console->run();
|
|
||||||
|
|
||||||
exit(is_int($exit) ? $exit : EXIT_SUCCESS);
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Valid PHP Version?
|
|
||||||
$minPHPVersion = '7.3';
|
|
||||||
if (phpversion() < $minPHPVersion)
|
|
||||||
{
|
|
||||||
die("Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter 4.<br>Current version: " . phpversion());
|
|
||||||
}
|
|
||||||
unset($minPHPVersion);
|
|
||||||
|
|
||||||
// Path to the front controller (this file)
|
|
||||||
define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*---------------------------------------------------------------
|
|
||||||
* BOOTSTRAP THE APPLICATION
|
|
||||||
*---------------------------------------------------------------
|
|
||||||
* This process sets up the path constants, loads and registers
|
|
||||||
* our autoloader, along with Composer's, loads our constants
|
|
||||||
* and fires up an environment-specific bootstrapping.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Ensure the current directory is pointing to the front controller's directory
|
|
||||||
chdir(FCPATH);
|
|
||||||
|
|
||||||
// Load our paths config file
|
|
||||||
// This is the line that might need to be changed, depending on your folder structure.
|
|
||||||
$pathsConfig = FCPATH . '../ci4/app/Config/Paths.php';
|
|
||||||
// ^^^ Change this if you move your application folder
|
|
||||||
require realpath($pathsConfig) ?: $pathsConfig;
|
|
||||||
|
|
||||||
$paths = new Config\Paths();
|
|
||||||
|
|
||||||
//Check Installation
|
|
||||||
$rootFolder = realpath(rtrim($paths->appDirectory, '/ ') . '/../');
|
|
||||||
$env = file_exists($rootFolder . '/.env');
|
|
||||||
if($env == false) {
|
|
||||||
$domain = $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
|
|
||||||
$domain = preg_replace('/index.php.*/', '', $domain); //remove everything after index.php
|
|
||||||
if (!empty($_SERVER['HTTPS'])) {
|
|
||||||
$domain = 'https://' . $domain;
|
|
||||||
} else {
|
|
||||||
$domain = 'http://' . $domain;
|
|
||||||
}
|
|
||||||
header("Location: $domain./install");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Location of the framework bootstrap file.
|
|
||||||
require rtrim($paths->systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php';
|
|
||||||
|
|
||||||
// Load environment settings from .env files into $_SERVER and $_ENV
|
|
||||||
require_once SYSTEMPATH . 'Config/DotEnv.php';
|
|
||||||
(new CodeIgniter\Config\DotEnv(ROOTPATH))->load();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ---------------------------------------------------------------
|
|
||||||
* GRAB OUR CODEIGNITER INSTANCE
|
|
||||||
* ---------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* The CodeIgniter class contains the core functionality to make
|
|
||||||
* the application run, and does all of the dirty work to get
|
|
||||||
* the pieces all working together.
|
|
||||||
*/
|
|
||||||
|
|
||||||
$app = Config\Services::codeigniter();
|
|
||||||
$app->initialize();
|
|
||||||
$context = is_cli() ? 'php-cli' : 'web';
|
|
||||||
$app->setContext($context);
|
|
||||||
|
|
||||||
/*
|
|
||||||
*---------------------------------------------------------------
|
|
||||||
* LAUNCH THE APPLICATION
|
|
||||||
*---------------------------------------------------------------
|
|
||||||
* Now that everything is setup, it's time to actually fire
|
|
||||||
* up the engines and make this app do its thang.
|
|
||||||
*/
|
|
||||||
|
|
||||||
$app->run();
|
|
||||||
Reference in New Issue
Block a user