diff --git a/interface/web/client/domain_edit.php b/interface/web/client/domain_edit.php index 9064581c17396cd64623157bf83040c2f6403882..67be43e04c829058babcdde95b54928964351d07 100644 --- a/interface/web/client/domain_edit.php +++ b/interface/web/client/domain_edit.php @@ -85,10 +85,10 @@ class page_action extends tform_actions { $clients = $app->db->queryAllRecords($sql); $client_select = ''; if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>"; - $tmp_data_record = $app->tform->getDataRecord($this->id); + if($this->id > 0) $tmp_data_record = $app->tform->getDataRecord($this->id); else $tmp_data_record = $this->dataRecord; if(is_array($clients)) { foreach( $clients as $client) { - $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':''; + $selected = ($client["groupid"] == $tmp_data_record["sys_groupid"] || $client["groupid"] == $tmp_data_record["client_group_id"])?'SELECTED':''; $client_select .= "<option value='$client[groupid]' $selected>$client[contactname]</option>\r\n"; } }