From 630bb56ea9dd7dd9bf3244e2fc75c6f4c6d25e17 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 2 Jan 2025 11:40:14 +0100 Subject: [PATCH] show user_name in dropdown --- application/controllers/Club.php | 1 + application/models/User_model.php | 3 ++- assets/js/sections/club_permissions.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/Club.php b/application/controllers/Club.php index 225570508..cb81b9a9d 100644 --- a/application/controllers/Club.php +++ b/application/controllers/Club.php @@ -88,6 +88,7 @@ class Club extends CI_Controller foreach ($users->result() as $user) { $result[] = [ 'user_id' => $user->user_id, + 'user_name' => $user->user_name, 'user_callsign' => $user->user_callsign, 'user_firstname' => $user->user_firstname, 'user_lastname' => $user->user_lastname diff --git a/application/models/User_model.php b/application/models/User_model.php index b2207c5d2..5066be0db 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -160,13 +160,14 @@ class User_Model extends CI_Model { if (strlen($query) < 2) { return false; } - $this->db->select('user_id, user_callsign, user_firstname, user_lastname'); + $this->db->select('user_id, user_name, user_callsign, user_firstname, user_lastname'); if (!$clubstations) { $this->db->where('clubstation', 0); } $this->db->group_start(); $this->db->like('user_callsign', $query); + $this->db->or_like('user_name', $query); $this->db->or_like('user_firstname', $query); $this->db->or_like('user_lastname', $query); $this->db->group_end(); diff --git a/assets/js/sections/club_permissions.js b/assets/js/sections/club_permissions.js index 7d2f7899d..d4bfda049 100644 --- a/assets/js/sections/club_permissions.js +++ b/assets/js/sections/club_permissions.js @@ -48,11 +48,11 @@ $(document).ready(function(){ }, render: { option: function(item) { - let string = '
' + item.user_callsign.toUpperCase() + ' - ' + item.user_firstname + ' ' + item.user_lastname + '
'; + let string = '
[' + item.user_name + '] ' + item.user_callsign.toUpperCase() + ' - ' + item.user_firstname + ' ' + item.user_lastname + '
'; return string; }, item: function(item) { - let string = '
' + item.user_callsign.toUpperCase() + ' - ' + item.user_firstname + ' ' + item.user_lastname + '
'; + let string = '
[' + item.user_name + '] ' + item.user_callsign.toUpperCase() + ' - ' + item.user_firstname + ' ' + item.user_lastname + '
'; return string; } },