From c5d17d3fd1bbdca95dd9230a2ab54f5aef04aef8 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 22 Jul 2011 09:48:47 -0400
Subject: [PATCH] Bugfixes in server list in vm server forms.

---
 interface/lib/classes/tform.inc.php |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index f00e69e..3ca2c06 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -166,6 +166,9 @@
                 global $conf, $app;
 				if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab).");
                 $new_record = '';
+				$table_idx = $this->formDef['db_table_idx'];
+				if(isset($record[$table_idx])) $new_record[$table_idx] = intval($record[$table_idx ]);
+				
 				if(is_array($record)) {
                         foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
                                 switch ($field['datatype']) {
@@ -236,11 +239,12 @@
                         $table_idx = $this->formDef['db_table_idx'];
 						
 						$tmp_recordid = (isset($record[$table_idx]))?$record[$table_idx]:0;
+						//$tmp_recordid = intval($this->primary_id);
                         $querystring = str_replace("{RECORDID}",$tmp_recordid,$querystring);
 						unset($tmp_recordid);
 						
                         $querystring = str_replace("{AUTHSQL}",$this->getAuthSQL('r'),$querystring);
-
+						
                         // Getting the records
                         $tmp_records = $app->db->queryAllRecords($querystring);
                         if($app->db->errorMessage != '') die($app->db->errorMessage);
@@ -433,7 +437,7 @@
                                                                         if(trim($tvl) == trim($k)) $checked = ' CHECKED';
                                                                 }
                                                                 // $out .= "<label for=\"".$key."[]\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"checkbox\" $checked /> $v</label>\r\n";
-																$out .= "<input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"checkbox\" $checked /> $v &nbsp;\r\n";
+																$out .= "<input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"checkbox\" $checked /> $v <br/>\r\n";
                                                         }
                                                 }
                                                 $new_record[$key] = $out;

--
Gitblit v1.9.1