From a9a6b283ce5104736b5c44d35272a8aedab6fcbb Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Fri, 30 Dec 2005 11:37:53 -0500
Subject: [PATCH] 

---
 interface/lib/classes/listform_actions.inc.php |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/interface/lib/classes/listform_actions.inc.php b/interface/lib/classes/listform_actions.inc.php
index 0df5391..3f8cf9e 100644
--- a/interface/lib/classes/listform_actions.inc.php
+++ b/interface/lib/classes/listform_actions.inc.php
@@ -87,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];
 		
@@ -99,11 +107,15 @@
 		// Generate the search sql
 		if($app->listform->listDef["auth"] != 'no') {
 			if($_SESSION["s"]["user"]["typ"] == "admin") {
-				$sql_where = $this->SQLExtWhere;
+				$sql_where = "";
 			} else {
-				$sql_where = $this->SQLExtWhere ." ". $app->tform->getAuthSQL('r')." and";
+				$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