From 21b6004208d44289e4695016e9c7634ea658bd77 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Mon, 10 Feb 2020 09:40:53 +0100 Subject: [PATCH 1/2] Show (disabled) client field on mail_domain edit --- interface/web/mail/mail_domain_edit.php | 8 +++++++- interface/web/mail/templates/mail_domain_edit.htm | 13 ++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/interface/web/mail/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php index 51d55ef2de..6f2bdb8f91 100644 --- a/interface/web/mail/mail_domain_edit.php +++ b/interface/web/mail/mail_domain_edit.php @@ -75,7 +75,13 @@ class page_action extends tform_actions { $app->uses('ini_parser,getconf'); $settings = $app->getconf->get_global_config('domains'); - if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') { + if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] == 'y') { + $sql = "SELECT CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id = ?"; + $clients = $app->db->queryAllRecords($sql, $this->dataRecord['sys_groupid']); + $client_select = ''; + $app->tpl->setVar("client_group_name", $client_select); + } + elseif($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') { // Getting Clients of the user $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name"; diff --git a/interface/web/mail/templates/mail_domain_edit.htm b/interface/web/mail/templates/mail_domain_edit.htm index 1e4a49c2a5..42ae8fe280 100644 --- a/interface/web/mail/templates/mail_domain_edit.htm +++ b/interface/web/mail/templates/mail_domain_edit.htm @@ -6,21 +6,28 @@ {tmpl_var name='server_id'} - +
- + +
+ +
+
+
-
+ -- GitLab From 272fc9ac8fc74b1e595598dc04c40ca66e724d12 Mon Sep 17 00:00:00 2001 From: Herman van Rink Date: Thu, 23 Jul 2020 10:22:24 +0200 Subject: [PATCH 2/2] Fix query and tab indent --- interface/web/mail/mail_domain_edit.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/interface/web/mail/mail_domain_edit.php b/interface/web/mail/mail_domain_edit.php index 6f2bdb8f91..19aa4f91e6 100644 --- a/interface/web/mail/mail_domain_edit.php +++ b/interface/web/mail/mail_domain_edit.php @@ -75,13 +75,13 @@ class page_action extends tform_actions { $app->uses('ini_parser,getconf'); $settings = $app->getconf->get_global_config('domains'); - if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] == 'y') { - $sql = "SELECT CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id = ?"; - $clients = $app->db->queryAllRecords($sql, $this->dataRecord['sys_groupid']); - $client_select = ''; - $app->tpl->setVar("client_group_name", $client_select); - } - elseif($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') { + if($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] == 'y') { + $sql = "SELECT CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.groupid = ?"; + $clients = $app->db->queryAllRecords($sql, $this->dataRecord['sys_groupid']); + $client_select = ''; + $app->tpl->setVar("client_group_name", $client_select); + } + elseif($_SESSION["s"]["user"]["typ"] == 'admin' && $settings['use_domain_module'] != 'y') { // Getting Clients of the user $sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(IF(client.company_name != '', CONCAT(client.company_name, ' :: '), ''), client.contact_name, ' (', client.username, IF(client.customer_no != '', CONCAT(', ', client.customer_no), ''), ')') as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY client.company_name, client.contact_name, sys_group.name"; -- GitLab