Skip to content

Commit 76ebcb3

Browse files
committed
- Implemented FS#2200.
1 parent 248bc32 commit 76ebcb3

File tree

9 files changed

+828
-837
lines changed

9 files changed

+828
-837
lines changed

interface/web/dns/dns_import.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
$app->tpl->setVar("server_id",$server_id_option);
8585

8686
// load the list of clients
87-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
87+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
8888
$clients = $app->db->queryAllRecords($sql);
8989
$client_select = '';
9090
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
9191
if(is_array($clients)) {
9292
foreach( $clients as $client) {
9393
$selected = ($client["groupid"] == $sys_groupid)?'SELECTED':'';
94-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
94+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
9595
}
9696
}
9797

@@ -102,18 +102,18 @@
102102

103103
// Get the limits of the client
104104
$client_group_id = $_SESSION["s"]["user"]["default_group"];
105-
$client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, CONCAT(company_name,' :: ',contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
105+
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
106106

107107

108108
// load the list of clients
109-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
109+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
110110
$clients = $app->db->queryAllRecords($sql);
111111
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
112-
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].'::'.$client['contactname'].'</option>';
112+
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>';
113113
if(is_array($clients)) {
114114
foreach( $clients as $client) {
115115
$selected = ($client["groupid"] == $sys_groupid)?'SELECTED':'';
116-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
116+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
117117
}
118118
}
119119

interface/web/dns/dns_slave_edit.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,34 @@ function onShowEnd() {
7272
// If user is admin, we will allow him to select to whom this record belongs
7373
if($_SESSION["s"]["user"]["typ"] == 'admin') {
7474
// Getting Domains of the user
75-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
75+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
7676
$clients = $app->db->queryAllRecords($sql);
7777
$client_select = '';
7878
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
7979
//$tmp_data_record = $app->tform->getDataRecord($this->id);
8080
if(is_array($clients)) {
8181
foreach( $clients as $client) {
8282
$selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
83-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
83+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
8484
}
8585
}
8686
$app->tpl->setVar("client_group_id",$client_select);
8787
} else if($app->auth->has_clients($_SESSION['s']['user']['userid'])) {
8888

8989
// Get the limits of the client
9090
$client_group_id = $_SESSION["s"]["user"]["default_group"];
91-
$client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, client.contact_name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
91+
$client = $app->db->queryOneRecord("SELECT client.client_id, sys_group.name, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
9292

9393
// Fill the client select field
94-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name";
94+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
9595
$clients = $app->db->queryAllRecords($sql);
9696
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
97-
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].'::'.$client['contactname'].'</option>';
97+
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>';
9898
//$tmp_data_record = $app->tform->getDataRecord($this->id);
9999
if(is_array($clients)) {
100100
foreach( $clients as $client) {
101101
$selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
102-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
102+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
103103
}
104104
}
105105
$app->tpl->setVar("client_group_id",$client_select);

interface/web/dns/dns_soa_edit.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,34 @@ function onShowEnd() {
8282
// If user is admin, we will allow him to select to whom this record belongs
8383
if($_SESSION["s"]["user"]["typ"] == 'admin') {
8484
// Getting Domains of the user
85-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
85+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
8686
$clients = $app->db->queryAllRecords($sql);
8787
$client_select = '';
8888
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
8989
//$tmp_data_record = $app->tform->getDataRecord($this->id);
9090
if(is_array($clients)) {
9191
foreach( $clients as $client) {
9292
$selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
93-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
93+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
9494
}
9595
}
9696
$app->tpl->setVar("client_group_id",$client_select);
9797
} else if($app->auth->has_clients($_SESSION['s']['user']['userid'])) {
9898

9999
// Get the limits of the client
100100
$client_group_id = $_SESSION["s"]["user"]["default_group"];
101-
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(company_name,' :: ',contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
101+
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
102102

103103
// Fill the client select field
104-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name";
104+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
105105
$clients = $app->db->queryAllRecords($sql);
106106
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
107-
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].'::'.$client['contactname'].'</option>';
107+
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>';
108108
//$tmp_data_record = $app->tform->getDataRecord($this->id);
109109
if(is_array($clients)) {
110110
foreach( $clients as $client) {
111111
$selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
112-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
112+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
113113
}
114114
}
115115
$app->tpl->setVar("client_group_id",$client_select);

interface/web/dns/dns_wizard.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@
8181
$app->tpl->setVar("server_id",$server_id_option);
8282

8383
// load the list of clients
84-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
84+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
8585
$clients = $app->db->queryAllRecords($sql);
8686
$client_select = '';
8787
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
8888
if(is_array($clients)) {
8989
foreach( $clients as $client) {
9090
$selected = ($client["groupid"] == $sys_groupid)?'SELECTED':'';
91-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
91+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
9292
}
9393
}
9494

@@ -99,18 +99,18 @@
9999

100100
// Get the limits of the client
101101
$client_group_id = $_SESSION["s"]["user"]["default_group"];
102-
$client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, CONCAT(company_name,' :: ',contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
102+
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
103103

104104

105105
// load the list of clients
106-
$sql = "SELECT groupid, name, CONCAT(company_name,' :: ',contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
106+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
107107
$clients = $app->db->queryAllRecords($sql);
108108
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
109-
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].'::'.$client['contactname'].'</option>';
109+
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>';
110110
if(is_array($clients)) {
111111
foreach( $clients as $client) {
112112
$selected = ($client["groupid"] == $sys_groupid)?'SELECTED':'';
113-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]::$client[contactname]</option>\r\n";
113+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
114114
}
115115
}
116116

interface/web/help/form/support_message.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
'formtype' => 'SELECT',
7070
'default' => $sm_default_recipient_id,
7171
'datasource' => array ( 'type' => 'SQL',
72-
'querystring' => 'SELECT userid,username FROM sys_user WHERE userid != 1 AND {AUTHSQL} ORDER BY username',
72+
'querystring' => "SELECT sys_user.userid, CONCAT(sys_user.username,' :: ',client.company_name,' :: ',client.contact_name) as contactname FROM sys_user, client WHERE sys_user.userid != 1 AND sys_user.client_id = client.client_id AND {AUTHSQL} ORDER BY sys_user.username",
7373
'keyfield' => 'userid',
74-
'valuefield' => 'username'
74+
'valuefield' => 'contactname'
7575
),
7676
'validators' => array ( 0 => array ( 'type' => 'ISINT',
7777
'errmsg'=> 'recipient_id_is_not_integer'),

interface/web/mail/mail_domain_edit.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,16 @@ function onShowEnd() {
7171

7272
if($_SESSION["s"]["user"]["typ"] == 'admin') {
7373
// Getting Clients of the user
74-
if($_SESSION["s"]["user"]["typ"] == 'admin') {
75-
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
76-
} else {
77-
$client_group_id = $_SESSION["s"]["user"]["default_group"];
78-
$sql = "SELECT client.client_id, limit_web_domain, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id";
79-
}
74+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND sys_group.client_id > 0 ORDER BY sys_group.name";
75+
8076
$clients = $app->db->queryAllRecords($sql);
8177
$client_select = '';
8278
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
8379
//$tmp_data_record = $app->tform->getDataRecord($this->id);
8480
if(is_array($clients)) {
8581
foreach( $clients as $client) {
8682
$selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
87-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
83+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
8884
}
8985
}
9086
$app->tpl->setVar("client_group_id",$client_select);
@@ -93,23 +89,23 @@ function onShowEnd() {
9389

9490
// Get the limits of the client
9591
$client_group_id = $_SESSION["s"]["user"]["default_group"];
96-
$client = $app->db->queryOneRecord("SELECT client.client_id, contact_name, default_mailserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by contact_name");
92+
$client = $app->db->queryOneRecord("SELECT client.client_id, client.contact_name, client.default_mailserver, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id order by client.contact_name");
9793

9894
// Set the mailserver to the default server of the client
9995
$tmp = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = $client[default_mailserver]");
10096
$app->tpl->setVar("server_id","<option value='$client[default_mailserver]'>$tmp[server_name]</option>");
10197
unset($tmp);
10298

10399
// Fill the client select field
104-
$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
100+
$sql = "SELECT sys_group.groupid, sys_group.name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY sys_group.name";
105101
$clients = $app->db->queryAllRecords($sql);
106102
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
107-
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contact_name'].'</option>';
103+
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['name'].' :: '.$client['contactname'].'</option>';
108104
//$tmp_data_record = $app->tform->getDataRecord($this->id);
109105
if(is_array($clients)) {
110106
foreach( $clients as $client) {
111107
$selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
112-
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
108+
$client_select .= "<option value='$client[groupid]' $selected>$client[name] :: $client[contactname]</option>\r\n";
113109
}
114110
}
115111
$app->tpl->setVar("client_group_id",$client_select);

0 commit comments

Comments
 (0)