From c3bc265ff04adf731b292daae511837b43f1c3fd Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 26 Feb 2025 12:24:37 -0700 Subject: [PATCH] Show contact details --- core/users/users.php | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/core/users/users.php b/core/users/users.php index d787de164d..7f0890e625 100644 --- a/core/users/users.php +++ b/core/users/users.php @@ -52,21 +52,7 @@ $users = $_POST['users'] ?? ''; } -//check to see if contact details are in the view - $sql = "select * from view_users "; - $sql .= "where domain_uuid = :domain_uuid "; - $parameters = null; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $row = $database->select($sql, $parameters, 'row'); - if (isset($row['contact_organization'])) { - $show_contact_fields = true; - } - else { - $show_contact_fields = false; - } - unset($parameters); - -//process the http post data by action +S//process the http post data by action if (!empty($action) && is_array($users) && @sizeof($users) != 0) { switch ($action) { case 'copy': @@ -153,9 +139,7 @@ //get the list $sql = "select domain_name, domain_uuid, user_uuid, username, group_names, "; - if ($show_contact_fields) { - $sql .= "contact_organization,contact_name,contact_note, "; - } + $sql .= "contact_organization,contact_name,contact_note, "; $sql .= "cast(user_enabled as text) "; $sql .= "from view_users "; if ($show == "all" && permission_exists('user_all')) { @@ -260,10 +244,8 @@ } echo th_order_by('username', $text['label-username'], $order_by, $order, null, null, $param); echo th_order_by('group_names', $text['label-groups'], $order_by, $order, null, null, $param); - if ($show_contact_fields) { - echo th_order_by('contact_organization', $text['label-organization'], $order_by, $order, null, null, $param); - echo th_order_by('contact_name', $text['label-name'], $order_by, $order, null, null, $param); - } + echo th_order_by('contact_organization', $text['label-organization'], $order_by, $order, null, null, $param); + echo th_order_by('contact_name', $text['label-name'], $order_by, $order, null, null, $param); //echo th_order_by('contact_name_family', $text['label-contact_name_family'], $order_by, $order); //echo th_order_by('user_status', $text['label-user_status'], $order_by, $order); //echo th_order_by('add_date', $text['label-add_date'], $order_by, $order); @@ -273,7 +255,6 @@ echo "  \n"; } echo "\n"; - if (is_array($users) && @sizeof($users) != 0) { $x = 0; foreach ($users as $row) { @@ -303,10 +284,8 @@ } echo " \n"; echo " ".escape($row['group_names'])."\n"; - if ($show_contact_fields) { - echo " ".escape($row['contact_organization'])."\n"; - echo " ".escape($row['contact_name'])."\n"; - } + echo " ".escape($row['contact_organization'])."\n"; + echo " ".escape($row['contact_name'])."\n"; //echo " ".escape($row['contact_name_given'])."\n"; //echo " ".escape($row['contact_name_family'])."\n"; //echo " ".escape($row['user_status'])."\n";