From 9858616b6e89f44ebc39194142c64ec1f21016d0 Mon Sep 17 00:00:00 2001 From: imnavajas Date: Fri, 3 May 2024 01:09:25 +0200 Subject: [PATCH] Modificando usuarios y roles --- ci4/app/Controllers/Clientes/Cliente.php | 9 - ci4/app/Controllers/Configuracion/Group.php | 4 - ci4/app/Controllers/Configuracion/Users.php | 6 +- ci4/app/Controllers/Cron.php | 88 -------- ci4/app/Controllers/Home.php | 129 +----------- ci4/app/Controllers/Migrate.php | 24 --- ci4/app/Controllers/Notification.php | 190 ------------------ .../Presupuestos/.PresupuestoInterfazCliente | 63 ------ ci4/app/Models/BackupModel.php | 15 -- ci4/app/Models/Clientes/ClienteModel.php | 12 +- .../ClientePlantillaPreciosLineasModel.php | 2 +- .../Models/Clientes/ClientePreciosModel.php | 2 +- ci4/app/Models/CronTabModel.php | 15 -- ci4/app/Models/Presupuestos/BuscadorModel.php | 2 +- .../Models/Presupuestos/PresupuestoModel.php | 8 +- ci4/app/Models/UserModel.php | 4 +- ci4/app/Models/Usuarios/UserGroupModel.php | 10 +- .../vuexy/form/group/viewUserGroupForm.php | 49 ++--- .../backend/vuexy/form/user/viewUserList.php | 49 ++--- .../backend/vuexy/main/menu_impresion.php | 2 +- 20 files changed, 57 insertions(+), 626 deletions(-) delete mode 100755 ci4/app/Controllers/Cron.php delete mode 100755 ci4/app/Controllers/Migrate.php delete mode 100755 ci4/app/Controllers/Notification.php delete mode 100755 ci4/app/Controllers/Presupuestos/.PresupuestoInterfazCliente delete mode 100755 ci4/app/Models/BackupModel.php delete mode 100755 ci4/app/Models/CronTabModel.php diff --git a/ci4/app/Controllers/Clientes/Cliente.php b/ci4/app/Controllers/Clientes/Cliente.php index 29b19977..d486164a 100755 --- a/ci4/app/Controllers/Clientes/Cliente.php +++ b/ci4/app/Controllers/Clientes/Cliente.php @@ -1,7 +1,6 @@ request->getPost()) : $nullIfEmpty = true; // !(phpversion() >= '8.1'); diff --git a/ci4/app/Controllers/Configuracion/Group.php b/ci4/app/Controllers/Configuracion/Group.php index a475ba08..0a46750e 100755 --- a/ci4/app/Controllers/Configuracion/Group.php +++ b/ci4/app/Controllers/Configuracion/Group.php @@ -1,8 +1,6 @@ request->getPost()) : $nullIfEmpty = true; // !(phpversion() >= '8.1'); diff --git a/ci4/app/Controllers/Configuracion/Users.php b/ci4/app/Controllers/Configuracion/Users.php index 826bfe8d..1358a5f0 100755 --- a/ci4/app/Controllers/Configuracion/Users.php +++ b/ci4/app/Controllers/Configuracion/Users.php @@ -5,9 +5,7 @@ use App\Entities\Usuarios\UserEntity; use App\Models\Usuarios\UserGroupModel; use App\Models\Usuarios\GroupUserModel; -use App\Models\Usuarios\UserModel; - -use App\Libraries\PasswordHash; +use App\Models\UserModel; class Users extends \App\Controllers\GoBaseController { @@ -18,7 +16,7 @@ class Users extends \App\Controllers\GoBaseController { use \CodeIgniter\API\ResponseTrait; - protected static $primaryModelName = 'App\Models\Usuarios\UserModel'; + protected static $primaryModelName = 'App\Models\UserModel'; protected static $singularObjectNameCc = 'user'; protected static $singularObjectName = 'User'; diff --git a/ci4/app/Controllers/Cron.php b/ci4/app/Controllers/Cron.php deleted file mode 100755 index 36927dde..00000000 --- a/ci4/app/Controllers/Cron.php +++ /dev/null @@ -1,88 +0,0 @@ -integration = new Integration(); - $this->user_model = new UserModel(); - $this->notification_model = new NotificationModel(); - $this->settings_model = new SettingsModel(); - $this->crontab_model = new CronTabModel(); - $this->activity_model = new ActivityModel(); - $this->backup_model = new BackupModel(); - } - - public function index() - { - $settings = $this->settings_model->first()??[]; - - // Cron Notification E-mail - try { - $email_list = $this->notification_model - ->select('notification.id_notification, recipient.email, notification.title, notification.body') - ->join('user AS recipient','notification.user_recipient = recipient.token','left') - ->where('send_email_notification',true) - ->where('is_send_email',false) - ->orderBy('notification.id_notification','desc') - ->findAll(25); - foreach ($email_list as $item){ - if($this->integration->send_email($item['email'],$item['title'],$item['body'])){ - $this->notification_model->save(['id_notification' => $item['id_notification'],'is_send_email' => true]); - } - } - }catch (\Exception $e){ - $this->crontab_model->save(['routine'=>'Notification Email','error'=>$e->getMessage()]); - } - - // Cron Backup - if(date('Y-m-d') > date('Y-m-d',strtotime($settings['backup_latest']))){ - if(date('H:i:s') >= date('H:i:s',strtotime($settings['backup_time']))){ - try { - $this->settings_model->save([ - 'id_settings' => $settings['id_settings'], - 'backup_latest' => date('Y-m-d H:i:s') - ]); - $this->integration->create_backup(); - }catch (\Exception $e){ - $this->crontab_model->save(['routine'=>'Backup','error'=>$e->getMessage()]); - } - } - } - - // Cron Log Delete - if(date('Y-m-d') >= date('Y-m-d',strtotime(date($settings['remove_log_latest']) . ' +'.$settings['remove_log_time'].' day'))){ - try { - $this->settings_model->save([ - 'id_settings' => $settings['id_settings'], - 'remove_log_latest' => date('Y-m-d H:i:s') - ]); - $dateStart = date('Y-m-d H:i:s',strtotime(date('Y-m-d H:i:s') . ' -5 year')); - $dateEnd = date('Y-m-d H:i:s',strtotime(date('Y-m-d H:i:s') . ' -30 day')); - $this->crontab_model->where('created_at between "'.$dateStart.'" and "'.$dateEnd.'"')->delete(); - $this->activity_model->where('created_at between "'.$dateStart.'" and "'.$dateEnd.'"')->delete(); - $this->backup_model->where('created_at between "'.$dateStart.'" and "'.$dateEnd.'"')->delete(); - }catch (\Exception $e){ - $this->crontab_model->save(['routine'=>'Delete Log','error'=>$e->getMessage()]); - } - } - } - -} diff --git a/ci4/app/Controllers/Home.php b/ci4/app/Controllers/Home.php index 74acb616..a2dd7ffd 100755 --- a/ci4/app/Controllers/Home.php +++ b/ci4/app/Controllers/Home.php @@ -19,134 +19,7 @@ class Home extends BaseController public function index() { - $session = session(); - - echo view(getenv('theme.path').'main/defaultlayout'); - - /* - //echo view(getenv('theme.path').'main/header'); - //echo view(getenv('theme.path').'main/menu'); - //echo view(getenv('theme.path').'form/dashboard/index'); - //echo view(getenv('theme.path').'main/footer'); - - /*switch ($session->get('dashboard')): - case 'admin': - $data['title'] = [ - 'module' => lang("App.dashboard_hello").' '.$name, - 'page' => lang("App.dashboard_indicators"), - 'icon' => '' - ]; - - $data['breadcrumb'] = [ - ['title' => lang("App.menu_dashboard"), 'route' => "", 'active' => true] - ]; - - //Cards Top - $initialDate = date('Y-m-d H:i:s', strtotime('-1 day', time())); - $finalDate = date('Y-m-d H:i:s'); - $data['total_user'] = $this->user_model->countAllResults(); - $data['total_new'] = $this->user_model->where('created_at between \''.$initialDate.'\' and \''.$finalDate.'\'')->countAllResults(); - $data['total_enabled'] = $this->user_model->where('status',true)->countAllResults(); - $data['total_disabled'] = $this->user_model->where('status',false)->countAllResults(); - - //Char Bar - $titles_char_bar["labels"] = explode(',',lang("App.dashboard_chart_months")); - $value_char_bar["series"] = []; - $return_char_bar_geral = $this->user_model->select("DATE_FORMAT(created_at,'%m') AS month,COUNT(DATE_FORMAT(created_at,'%m')) AS total") - ->where("DATE_FORMAT(NOW(),'%Y') = DATE_FORMAT(created_at,'%Y')") - ->groupBy("DATE_FORMAT(created_at,'%Y-%m')") - ->findAll(); - $return_char_bar_enabled = $this->user_model->select("DATE_FORMAT(created_at,'%m') AS month,COUNT(DATE_FORMAT(created_at,'%m')) AS total") - ->where("DATE_FORMAT(NOW(),'%Y') = DATE_FORMAT(created_at,'%Y') AND status = true") - ->groupBy("DATE_FORMAT(created_at,'%Y-%m')") - ->findAll(); - $return_char_bar_disabled = $this->user_model->select("DATE_FORMAT(updated_at,'%m') AS month,COUNT(DATE_FORMAT(updated_at,'%m')) AS total") - ->where("DATE_FORMAT(NOW(),'%Y') = DATE_FORMAT(updated_at,'%Y') AND status = false") - ->groupBy("DATE_FORMAT(updated_at,'%Y-%m')") - ->findAll(); - $year = []; - for ($i = 1; $i <= 12; $i++) { - $notFound = true; - foreach ($return_char_bar_geral as $item){ - if($i == intval($item->month)){ - array_push($year,intval($item->total)); - $notFound = false; - break; - } - } - if($notFound){ - array_push($year,0); - } - } - array_push($value_char_bar["series"],$year); - $year = []; - for ($i = 1; $i <= 12; $i++) { - $notFound = true; - foreach ($return_char_bar_enabled as $item){ - if($i == intval($item->month)){ - array_push($year,intval($item->total)); - $notFound = false; - break; - } - } - if($notFound){ - array_push($year,0); - } - } - array_push($value_char_bar["series"],$year); - $year = []; - for ($i = 1; $i <= 12; $i++) { - $notFound = true; - foreach ($return_char_bar_disabled as $item){ - if($i == intval($item->month)){ - array_push($year,intval($item->total)); - $notFound = false; - break; - } - } - if($notFound){ - array_push($year,0); - } - } - array_push($value_char_bar["series"],$year); - $data['data_char_bar'] = json_encode(array_merge($titles_char_bar,$value_char_bar)); - - $data['data_user'] = $this->user_model->select('picture,first_name,last_name,email,created_at') - ->orderBy('id_user','DESC') - ->findAll(15); - - $data['data_activity'] = $this->activity_model - ->select('auth_user.first_name,auth_user.email,auth_activity.detail,auth_activity.created_at') - ->join('auth_user','auth_user.token=auth_activity.user') - ->orderBy('auth_activity.id_activity','DESC') - ->findAll(30); - - echo view(getenv('theme.path').'main/header'); - //echo view(getenv('theme.path').'form/dashboard/admin',$data); - echo view(getenv('theme.path').'main/footer'); - break; - - case 'user': - $data['title'] = [ - 'module' => lang("App.dashboard_hello").' '.$name, - 'page' => lang("App.dashboard_indicators"), - 'icon' => '' - ]; - - $data['breadcrumb'] = [ - ['title' => lang("App.menu_dashboard"), 'route' => "", 'active' => true] - ]; - - echo view(getenv('theme.path').'main/header'); - //echo view(getenv('theme.path').'form/dashboard/user',$data); - echo view(getenv('theme.path').'main/footer'); - break; - default: - echo view(getenv('theme.path').'main/header'); - //echo view(getenv('theme.path').'form/dashboard/index'); - echo view(getenv('theme.path').'main/footer'); - endswitch; - */ + echo view(getenv('theme.path') . 'main/defaultlayout'); } diff --git a/ci4/app/Controllers/Migrate.php b/ci4/app/Controllers/Migrate.php deleted file mode 100755 index ad48780d..00000000 --- a/ci4/app/Controllers/Migrate.php +++ /dev/null @@ -1,24 +0,0 @@ -force($file); - - } catch (\Exception $e) { - - echo $e->getMessage(); - } - } -} \ No newline at end of file diff --git a/ci4/app/Controllers/Notification.php b/ci4/app/Controllers/Notification.php deleted file mode 100755 index 7d30f614..00000000 --- a/ci4/app/Controllers/Notification.php +++ /dev/null @@ -1,190 +0,0 @@ -user_model = new UserModel(); - $this->countries_model = new CountriesModel(); - $this->id_user = session()->get('id_user'); - $this->token_user = session()->get('token'); - $this->notification_model = new NotificationModel(); - } - - public function index() - { - $data['title'] = [ - 'module' => lang("App.notification_title"), - 'page' => lang("App.notification_subtitle"), - 'icon' => 'fas fa-bell' - ]; - - $data['breadcrumb'] = [ - ['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false], - ['title' => lang("App.notification_title"), '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/notification/index',$data); - echo view(getenv('theme.path').'main/footer'); - } - - public function add() - { - helper('form'); - - $data['title'] = [ - 'module' => lang("App.notification_add_title"), - 'page' => lang("App.notification_add_subtitle"), - 'icon' => 'far fa-plus-square' - ]; - - $data['breadcrumb'] = [ - ['title' => lang("App.menu_dashboard"), 'route' => "/home", 'active' => false], - ['title' => lang("App.notification_title"), 'route' => "/user", 'active' => false], - ['title' => lang("App.notification_add_title"), 'route' => "", 'active' => true] - ]; - - $data['btn_return'] = [ - 'title' => lang("App.global_come_back"), - 'route' => '/notification', - 'class' => 'btn btn-dark mr-1', - 'icon' => 'fas fa-angle-left' - ]; - - $data['btn_submit'] = [ - 'title' => lang("App.global_save"), - 'route' => '', - 'class' => 'btn btn-primary mr-1', - 'icon' => 'fas fa-save' - ]; - - $data['user'] = $this->user_model->where('status',true)->findAll(); - - echo view(getenv('theme.path').'main/header'); - echo view(getenv('theme.path').'form/notification/form',$data); - echo view(getenv('theme.path').'main/footer'); - } - - public function store() - { - //Demo Mode - if(env('demo.mode')??false){ - session()->setFlashdata('sweet', ['warning',lang("App.general_demo_mode")]); - return redirect()->to('/notification'); - } - - $session = session(); - helper('form'); - - $rules = [ - 'title' => 'required', - 'body' => 'required' - ]; - - $rules_error = [ - 'title' => [ - 'required' => lang("App.notification_rules_title_r"), - ], - 'body' => [ - 'required' => lang("App.notification_rules_body_r"), - ] - ]; - - if ($this->validate($rules,$rules_error)){ - if($listPost = $this->request->getPost()){ - - $listPost['send_email_notification'] = isset($listPost['send_email_notification']) && $listPost['send_email_notification'] == 'on'; - - if(!empty($listPost['user_recipient'])){ - $user = $this->user_model->where('token',$session->get('token'))->first(); - foreach (keywordEmail()??[] as $item){ - $field = str_replace(['[','user_',']'],'',$item); - $listPost['title'] = str_replace('['.$item.']',$user[$field],$listPost['title']); - $listPost['body'] = str_replace('['.$item.']',$user[$field],$listPost['body']); - } - $listPost['token'] = md5(uniqid(rand(), true)); - $listPost['user_sender'] = $session->get('token'); - $this->notification_model->save($listPost); - }else{ - $users = $this->user_model->where('status',true)->findAll(); - $data = []; - foreach ($users as $user){ - $title = $listPost['title']; - $template = $listPost['body']; - foreach (keywordEmail()??[] as $item){ - $field = str_replace(['[','user_',']'],'',$item); - $title = str_replace('['.$item.']',$user[$field],$title); - $template = str_replace('['.$item.']',$user[$field],$template); - } - array_push($data,[ - 'id_notification' => null, - 'user_sender' => $session->get('token'), - 'user_recipient' => $user['token'], - 'title' => $title, - 'body' => $template, - 'is_read' => false, - 'is_send_email' => false, - 'send_email_notification' => $listPost['send_email_notification'], - 'token' => md5(uniqid(rand(), true)), - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => date('Y-m-d H:i:s') - ]); - } - if(count($data)>0){ - $this->notification_model->insertBatch($data); - } - } - if(empty($this->request->getPost('id_notification'))){ - $session->setFlashdata('sweet', ['success',lang("App.notification_alert_add")]); - return redirect()->to('/notification'); - }else{ - $session->setFlashdata('sweet', ['success',lang("App.notification_alert_edit")]); - return redirect()->to('/notification'); - } - } - }else{ - $session->setFlashdata('error','error'); - $this->add(); - } - } - - public function delete($token) - { - //Demo Mode - if(env('demo.mode')??false){ - session()->setFlashdata('sweet', ['warning',lang("App.general_demo_mode")]); - return redirect()->to('/notification'); - } - - $session = session(); - if(!empty($session->get('token'))){ - $this->notification_model->where('token', $token)->delete(); - $session->setFlashdata('sweet', ['success',lang("App.notification_alert_delete")]); - return redirect()->to('/notification'); - }else{ - return redirect()->to('/login'); - } - } - - -} diff --git a/ci4/app/Controllers/Presupuestos/.PresupuestoInterfazCliente b/ci4/app/Controllers/Presupuestos/.PresupuestoInterfazCliente deleted file mode 100755 index dea5ed8e..00000000 --- a/ci4/app/Controllers/Presupuestos/.PresupuestoInterfazCliente +++ /dev/null @@ -1,63 +0,0 @@ - lang("App.settings_title"), - 'page' => lang("App.settings_subtitle"), - 'icon' => 'fas fa-sliders-h' - ]; - - $data['breadcrumb'] = [ - ['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto'), 'active' => true] - ]; - - echo view(getenv('theme.path').'form/presupuestos/index', $data); - } - - public function tapa_blanda_encolada() - { - - $data['title'] = [ - 'module' => lang("App.settings_title"), - 'page' => lang("App.settings_subtitle"), - 'icon' => 'fas fa-sliders-h' - ]; - - $data['breadcrumb'] = [ - ['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto'), 'active' => false], - ['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto/tapa_blanda_encolada'), 'active' => true] - ]; - - echo view(getenv('theme.path').'form/presupuestos/tapa-blanda-encolada', $data); - } - - public function delete() - { - - } - - public function add() - { - - } - - public function edit() - { - - } - -} - \ No newline at end of file diff --git a/ci4/app/Models/BackupModel.php b/ci4/app/Models/BackupModel.php deleted file mode 100755 index 609b6d18..00000000 --- a/ci4/app/Models/BackupModel.php +++ /dev/null @@ -1,15 +0,0 @@ -table . - " t1 LEFT JOIN lg_comunidades_autonomas t2 ON t1.comunidad_autonoma_id = t2.id LEFT JOIN lg_provincias t3 ON t1.provincia_id = t3.id LEFT JOIN lg_paises t4 ON t1.pais_id = t4.id LEFT JOIN auth_user t5 ON t1.comercial_id = t5.id_user LEFT JOIN auth_user t6 ON t1.soporte_id = t6.id_user LEFT JOIN lg_formas_pago t7 ON t1.forma_pago_id = t7.id"; + " t1 LEFT JOIN lg_comunidades_autonomas t2 ON t1.comunidad_autonoma_id = t2.id + LEFT JOIN lg_provincias t3 ON t1.provincia_id = t3.id + LEFT JOIN lg_paises t4 ON t1.pais_id = t4.id + LEFT JOIN users t5 ON t1.comercial_id = t5.id + LEFT JOIN users t6 ON t1.soporte_id = t6.id + LEFT JOIN lg_formas_pago t7 ON t1.forma_pago_id = t7.id"; if (!is_null($limit) && intval($limit) > 0) { $sql .= " LIMIT " . intval($limit); } @@ -280,7 +286,7 @@ class ClienteModel extends \App\Models\BaseModel "t1.id AS id, t1.nombre AS nombre, t1.alias AS alias, t1.cif AS cif, t1.email AS email, t1.vencimiento AS vencimiento, t5.first_name AS comercial, t7.nombre AS forma_pago_id" ) ->where("is_deleted", 0);; - $builder->join("auth_user t5", "t1.comercial_id = t5.id_user", "left"); + $builder->join("users t5", "t1.comercial_id = t5.id", "left"); $builder->join("lg_formas_pago t7", "t1.forma_pago_id = t7.id", "left"); diff --git a/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php b/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php index c8ef1f71..9b3072d4 100755 --- a/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php +++ b/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php @@ -137,7 +137,7 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel t1.user_updated_id AS user_updated_id, t1.updated_at AS updated_at, CONCAT(t2.first_name, ' ', t2.last_name) AS user_updated" ); - $builder->join("auth_user t2", "t1.user_updated_id = t2.id_user", "left"); + $builder->join("users t2", "t1.user_updated_id = t2.id", "left"); $builder->where('t1.is_deleted', 0); $builder->where('t1.plantilla_id', $plantilla_id); diff --git a/ci4/app/Models/Clientes/ClientePreciosModel.php b/ci4/app/Models/Clientes/ClientePreciosModel.php index 7eba3397..a52893c8 100755 --- a/ci4/app/Models/Clientes/ClientePreciosModel.php +++ b/ci4/app/Models/Clientes/ClientePreciosModel.php @@ -267,7 +267,7 @@ class ClientePreciosModel extends \App\Models\BaseModel t1.user_updated_id AS user_updated_id, t1.updated_at AS updated_at, CONCAT(t2.first_name, ' ', t2.last_name) AS user_updated" ); - $builder->join("auth_user t2", "t1.user_updated_id = t2.id_user", "left"); + $builder->join("users t2", "t1.user_updated_id = t2.id", "left"); $builder->where('t1.is_deleted', 0); $builder->where('t1.cliente_id', $cliente_id); diff --git a/ci4/app/Models/CronTabModel.php b/ci4/app/Models/CronTabModel.php deleted file mode 100755 index 8273a3f8..00000000 --- a/ci4/app/Models/CronTabModel.php +++ /dev/null @@ -1,15 +0,0 @@ -join("clientes t2", "t1.cliente_id = t2.id", "left"); - $builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left"); + $builder->join("users t3", "t1.user_update_id = t3.id", "left"); $builder->join("lg_paises t5", "t1.pais_id = t5.id", "left"); $builder->join("presupuesto_estados t6", "t1.estado_id = t6.id", "left"); $builder->join("tipos_presupuestos t7", "t1.tipo_impresion_id = t7.id", "left"); diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php index 51a203c2..f028ba81 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php @@ -205,8 +205,8 @@ class PresupuestoModel extends \App\Models\BaseModel t6 ON t1.pais_id = t6.id = t7.id LEFT JOIN presupuesto_estados t7 ON t1.estado_id = t8.id LEFT JOIN lg_papel_formato t8 ON t1.papel_formato_id = t9.id LEFT JOIN lg_papel_generico - t9 ON t1.total_confirmado_user_id = t26.id_user LEFT JOIN auth_user - t10 ON t1.aprobado_user_id = t27.id_user LEFT JOIN auth_user"; + t9 ON t1.total_confirmado_user_id = t26.id LEFT JOIN users + t10 ON t1.aprobado_user_id = t27.id LEFT JOIN users"; if (!is_null($limit) && intval($limit) > 0) { $sql .= " LIMIT " . intval($limit); @@ -239,7 +239,7 @@ class PresupuestoModel extends \App\Models\BaseModel t1.total_presupuesto AS total_presupuesto, t1.total_presupuesto AS total_presupuesto, t6.estado AS estado" ); $builder->join("clientes t2", "t1.cliente_id = t2.id", "left"); - $builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left"); + $builder->join("users t3", "t1.user_update_id = t3.id", "left"); $builder->join("lg_paises t5", "t1.pais_id = t5.id", "left"); $builder->join("presupuesto_estados t6", "t1.estado_id = t6.id", "left"); @@ -299,7 +299,7 @@ class PresupuestoModel extends \App\Models\BaseModel CONCAT(t4.ancho, 'x', t4.alto) AS formato" ); $builder->join("clientes t2", "t1.cliente_id = t2.id", "left"); - $builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left"); + $builder->join("users t3", "t1.user_update_id = t3.id", "left"); $builder->join("lg_papel_formato t4", "t1.papel_formato_id = t4.id", "left"); $builder->where("t1.is_deleted", 0); diff --git a/ci4/app/Models/UserModel.php b/ci4/app/Models/UserModel.php index 4cae8741..bd001e74 100644 --- a/ci4/app/Models/UserModel.php +++ b/ci4/app/Models/UserModel.php @@ -14,8 +14,8 @@ class UserModel extends ShieldUserModel $this->allowedFields = [ ...$this->allowedFields, - - // 'first_name', + 'first_name', // Añadido + 'last_name', // Añadido ]; } } diff --git a/ci4/app/Models/Usuarios/UserGroupModel.php b/ci4/app/Models/Usuarios/UserGroupModel.php index 938a1b0b..4c9f7e5b 100755 --- a/ci4/app/Models/Usuarios/UserGroupModel.php +++ b/ci4/app/Models/Usuarios/UserGroupModel.php @@ -70,7 +70,8 @@ class UserGroupModel extends \App\Models\BaseModel $builder = $this->db ->table($this->table . " t1") ->select( - "t1.id_group AS id_group, t1.title AS title, t1.dashboard AS dashboard, t1.rules AS rules, t1.token AS token, t1.created_at AS created_at, t1.updated_at AS updated_at" + "t1.id_group AS id_group, t1.title AS title, t1.dashboard AS dashboard, t1.rules AS rules, + t1.token AS token, t1.created_at AS created_at, t1.updated_at AS updated_at" ); return empty($search) @@ -84,13 +85,6 @@ class UserGroupModel extends \App\Models\BaseModel ->orLike("t1.token", $search) ->orLike("t1.created_at", $search) ->orLike("t1.updated_at", $search) - ->orLike("t1.id_group", $search) - ->orLike("t1.title", $search) - ->orLike("t1.dashboard", $search) - ->orLike("t1.rules", $search) - ->orLike("t1.token", $search) - ->orLike("t1.created_at", $search) - ->orLike("t1.updated_at", $search) ->groupEnd(); } } diff --git a/ci4/app/Views/themes/backend/vuexy/form/group/viewUserGroupForm.php b/ci4/app/Views/themes/backend/vuexy/form/group/viewUserGroupForm.php index c664c8dd..50c3d8f1 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/group/viewUserGroupForm.php +++ b/ci4/app/Views/themes/backend/vuexy/form/group/viewUserGroupForm.php @@ -57,36 +57,25 @@
- - - - - - - - - - - - - - + + + + - + @@ -108,7 +97,7 @@ - +
- - >> - -
- rules, $item['name'], $subitem) ? 'checked' : '' ?> - > - -
-
+ Recurso + +
+ + +
+
diff --git a/ci4/app/Views/themes/backend/vuexy/form/user/viewUserList.php b/ci4/app/Views/themes/backend/vuexy/form/user/viewUserList.php index beb87e71..1f66425e 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/user/viewUserList.php +++ b/ci4/app/Views/themes/backend/vuexy/form/user/viewUserList.php @@ -15,10 +15,11 @@ - */?> - + + @@ -27,34 +28,30 @@ - + - - - - - */?> + */ ?> - - id_user ?> - - */?> + + + + getGroupsTitles($item->token)) || strlen($user_model->getGroupsTitles($item->token)) < 51 ? esc($user_model->getGroupsTitles($item->token)) : character_limiter($user_model->getGroupsTitles($item->token), 50) ?> @@ -101,29 +98,11 @@ - - token) ?> - - - - - */ ?> diff --git a/ci4/app/Views/themes/backend/vuexy/main/menu_impresion.php b/ci4/app/Views/themes/backend/vuexy/main/menu_impresion.php index 778587c9..1667cd7c 100755 --- a/ci4/app/Views/themes/backend/vuexy/main/menu_impresion.php +++ b/ci4/app/Views/themes/backend/vuexy/main/menu_impresion.php @@ -398,7 +398,7 @@
first_name) || strlen($item->first_name) < 51 ? esc($item->first_name) : character_limiter(esc($item->first_name), 50) ?> last_name) || strlen($item->last_name) < 51 ? esc($item->last_name) : character_limiter(esc($item->last_name), 50) ?> + last_active) ? '' : date('d/m/Y H:m:s', strtotime($item->last_active)) ?> + email_confirmed) ?> + */ ?> - status ) { ?> - - - - - - - created_at) ? '' : date('d/m/Y H:m:s', strtotime($item->created_at)) ?> - - updated_at) ? '' : date('d/m/Y H:m:s', strtotime($item->updated_at)) ?> - - id_user), "", ['class'=>'text-body', 'data-id'=>$item->id_user,]); ?> - ", ['class'=>'text-body', 'data-href'=>route_to('deleteUser', $item->id_user), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?> + id), "", ['class'=>'text-body', 'data-id'=>$item->id,]); ?> + ", ['class'=>'text-body', 'data-href'=>route_to('deleteUser', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>