Skip to content

Commit 327f28a

Browse files
committed
Fixed: FS#1045 - Error when a reseller edit site
1 parent 7bc0f15 commit 327f28a

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

interface/web/dns/dns_soa_edit.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ function onShowEnd() {
7676
$clients = $app->db->queryAllRecords($sql);
7777
$client_select = '';
7878
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
79+
$tmp_data_record = $app->tform->getDataRecord($this->id);
7980
if(is_array($clients)) {
8081
foreach( $clients as $client) {
81-
$selected = ($client["groupid"] == @$this->dataRecord["sys_groupid"])?'SELECTED':'';
82+
$selected = ($client["groupid"] == @$tmp_data_record["sys_groupid"])?'SELECTED':'';
8283
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
8384
}
8485
}
@@ -93,9 +94,10 @@ function onShowEnd() {
9394
$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name";
9495
$clients = $app->db->queryAllRecords($sql);
9596
$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
97+
$tmp_data_record = $app->tform->getDataRecord($this->id);
9698
if(is_array($clients)) {
9799
foreach( $clients as $client) {
98-
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
100+
$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
99101
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
100102
}
101103
}

interface/web/mail/mail_domain_edit.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ function onShowEnd() {
8080
$clients = $app->db->queryAllRecords($sql);
8181
$client_select = '';
8282
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
83+
$tmp_data_record = $app->tform->getDataRecord($this->id);
8384
if(is_array($clients)) {
8485
foreach( $clients as $client) {
85-
$selected = ($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
86+
$selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
8687
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
8788
}
8889
}
@@ -103,9 +104,10 @@ function onShowEnd() {
103104
$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id'];
104105
$clients = $app->db->queryAllRecords($sql);
105106
$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
107+
$tmp_data_record = $app->tform->getDataRecord($this->id);
106108
if(is_array($clients)) {
107109
foreach( $clients as $client) {
108-
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
110+
$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
109111
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
110112
}
111113
}

interface/web/sites/database_edit.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ function onShowEnd() {
9696
$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name";
9797
$clients = $app->db->queryAllRecords($sql);
9898
$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
99+
$tmp_data_record = $app->tform->getDataRecord($this->id);
99100
if(is_array($clients)) {
100101
foreach( $clients as $client) {
101-
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
102+
$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
102103
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
103104
}
104105
}
@@ -133,9 +134,10 @@ function onShowEnd() {
133134
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
134135
$clients = $app->db->queryAllRecords($sql);
135136
$client_select = "<option value='0'></option>";
137+
$tmp_data_record = $app->tform->getDataRecord($this->id);
136138
if(is_array($clients)) {
137139
foreach( $clients as $client) {
138-
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
140+
$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
139141
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
140142
}
141143
}

interface/web/sites/web_domain_edit.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ function onShowEnd() {
114114
$sql = "SELECT groupid, name FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." ORDER BY name";
115115
$records = $app->db->queryAllRecords($sql);
116116
$client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
117+
$tmp_data_record = $app->tform->getDataRecord($this->id);
117118
if(is_array($records)) {
118119
foreach( $records as $rec) {
119-
$selected = @($rec["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
120+
$selected = @($rec["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
120121
$client_select .= "<option value='$rec[groupid]' $selected>$rec[name]</option>\r\n";
121122
}
122123
}
@@ -169,9 +170,10 @@ function onShowEnd() {
169170
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
170171
$clients = $app->db->queryAllRecords($sql);
171172
$client_select = "<option value='0'></option>";
173+
$tmp_data_record = $app->tform->getDataRecord($this->id);
172174
if(is_array($clients)) {
173175
foreach( $clients as $client) {
174-
$selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
176+
$selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
175177
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
176178
}
177179
}

0 commit comments

Comments
 (0)