From deb07dacfa147db24499fe57bb8c204a11ccbb7a Mon Sep 17 00:00:00 2001
From: mike_p <mike_p@ispconfig3>
Date: Sat, 29 May 2010 16:36:36 -0400
Subject: [PATCH] fix bug FS#1200 and give nav list items unique ids (requires nav.css be changed too!)
---
interface/web/sites/database_edit.php | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/interface/web/sites/database_edit.php b/interface/web/sites/database_edit.php
index 9ffc42b..58fd924 100644
--- a/interface/web/sites/database_edit.php
+++ b/interface/web/sites/database_edit.php
@@ -95,10 +95,12 @@
// Fill the client select field
$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";
$clients = $app->db->queryAllRecords($sql);
- $client_select = '<option value="'.$client['client_id'].'">'.$client['contact_name'].'</option>';
+ $tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
+ $client_select = '<option value="'.$tmp['groupid'].'">'.$client['contact_name'].'</option>';
+ $tmp_data_record = $app->tform->getDataRecord($this->id);
if(is_array($clients)) {
foreach( $clients as $client) {
- $selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
+ $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
}
}
@@ -133,9 +135,10 @@
$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
$clients = $app->db->queryAllRecords($sql);
$client_select = "<option value='0'></option>";
+ $tmp_data_record = $app->tform->getDataRecord($this->id);
if(is_array($clients)) {
foreach( $clients as $client) {
- $selected = @($client["groupid"] == $this->dataRecord["sys_groupid"])?'SELECTED':'';
+ $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
}
}
--
Gitblit v1.9.1