From 573f3531f46d7c2f0c98abaa66c5ee670ee6c17b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Fri, 09 Dec 2005 14:30:13 -0500
Subject: [PATCH] correct row values for select fields

---
 interface/lib/classes/listform_actions.inc.php |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/interface/lib/classes/listform_actions.inc.php b/interface/lib/classes/listform_actions.inc.php
index 4b13692..3f8cf9e 100644
--- a/interface/lib/classes/listform_actions.inc.php
+++ b/interface/lib/classes/listform_actions.inc.php
@@ -40,6 +40,7 @@
 	var $id;
 	var $idx_key;
 	var $DataRowColor;
+	var $SQLExtWhere = '';
 	
 	function onLoad() {
 		global $app, $conf, $list_def_file;
@@ -86,6 +87,14 @@
 		$this->DataRowColor = ($this->DataRowColor == "#FFFFFF")?"#EEEEEE":"#FFFFFF";
 		$rec["bgcolor"] = $this->DataRowColor;
 		
+		// substitute value for select fields
+		foreach($app->listform->listDef["item"] as $field) {
+			$key = $field["field"];
+			if($field['formtype'] == "SELECT") {
+				$rec[$key] = $field['value'][$rec[$key]];
+			}
+		}
+		
 		// The variable "id" contains always the index variable
 		$rec["id"] = $rec[$this->idx_key];
 		
@@ -103,6 +112,10 @@
 				$sql_where = $app->tform->getAuthSQL('r')." and";
 			}
 		}
+		
+		if($this->SQLExtWhere != '') {
+			$sql_where .= " ".$this->SQLExtWhere." and";
+		}
 
 		$sql_where = $app->listform->getSearchSQL($sql_where);
 		$app->tpl->setVar($app->listform->searchValues);

--
Gitblit v1.9.1