[Mapbender-commits] r1753 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 26 09:59:20 EDT 2007


Author: christoph
Date: 2007-10-26 09:59:20 -0400 (Fri, 26 Oct 2007)
New Revision: 1753

Modified:
   trunk/mapbender/http/php/mod_filteredGroup_User.php
   trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php
   trunk/mapbender/http/php/mod_filteredGui_User.php
   trunk/mapbender/http/php/mod_filteredGui_filteredUser.php
   trunk/mapbender/http/php/mod_filteredUser_Group.php
   trunk/mapbender/http/php/mod_filteredUser_Gui.php
   trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php
   trunk/mapbender/http/php/mod_filteredUser_filteredGui.php
   trunk/mapbender/http/php/mod_group_filteredUser.php
   trunk/mapbender/http/php/mod_group_user.php
   trunk/mapbender/http/php/mod_gui_filteredUser.php
   trunk/mapbender/http/php/mod_gui_owner.php
   trunk/mapbender/http/php/mod_gui_user.php
   trunk/mapbender/http/php/mod_user_filteredGroup.php
   trunk/mapbender/http/php/mod_user_filteredGui.php
   trunk/mapbender/http/php/mod_user_group.php
   trunk/mapbender/http/php/mod_user_gui.php
Log:
filter search results via AJAX-like text field

Modified: trunk/mapbender/http/php/mod_filteredGroup_User.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredGroup_User.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredGroup_User.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -58,6 +58,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -125,12 +179,13 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_email[$cnt_user] =  $row["mb_user_email"];
 	$cnt_user++;
 }
 
 /*get only owner user from selected group**********************************************************/
 if(count($group_id)>0){
-	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
 	$sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
 	$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id = $1 ";
 	$sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
@@ -143,6 +198,7 @@
 	while($row = db_fetch_array($res_mb_user_mb_group)){
 		$user_id_group[$cnt_group_user] = $row["mb_user_id"];
 		$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+		$user_email_group[$cnt_group_user] =  $row["mb_user_email"];
 		$cnt_group_user++;
 	}
 
@@ -162,11 +218,13 @@
 }
 echo "</select>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -178,11 +236,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),groupuser,this.value);'/>";
 /*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_group_user; $i++){
-	echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+	echo "<option value='" . $user_id_group[$i]  . "' title='".$user_email_group[$i]."'>" . $user_name_group[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -195,6 +255,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_group.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var groupuser=[];
+<?php
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "groupuser[".$i."]=[];\n";
+	echo "groupuser[".$i."]['id']='" . $user_id_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['name']='" . $user_name_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['email']='" . $user_email_group[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredGroup_filteredUser.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -59,6 +59,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -130,6 +184,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_email[$cnt_user] =  $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -137,7 +192,7 @@
 if (count($group_id)>0){
 	$v = array();
 	$t = array();
-	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+	$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
 	$sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
 	$sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id = $1 ";	
 	if(!$selected_group){array_push($v,$group_id[0]); array_push($t,'i');}
@@ -150,6 +205,7 @@
 	while($row = db_fetch_array($res_mb_user_mb_group)){
 		$user_id_group[$cnt_group_user] = $row["mb_user_id"];
 		$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+		$user_email_group[$cnt_group_user] =  $row["mb_user_email"];
 		$cnt_group_user++;
 	}
 	
@@ -169,11 +225,13 @@
 	}
 	echo "</select>";
 	
-	/*insert all profiles in selectbox*************************************************************/
+	/*filterbox****************************************************************************************/
+	echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+	/*insert all profiles in selectbox*****************************************************************/
 	echo "<div class='text2'>USER:</div>";
-	echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+	echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 	for($i=0; $i<$cnt_user; $i++){
-		echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+		echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 	}
 	echo "</select>";
 	
@@ -185,11 +243,13 @@
 	echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 	echo "<input type='hidden' name='remove'>";
 	
-	/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+	/*filterbox****************************************************************************************/
+	echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),groupuser,this.value);'/>";
+	/*insert container_profile_dependence and container_group_dependence in selectbox******************/
 	echo "<div class='text3'>SELECTED USER:</div>";
-	echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+	echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 	for($i=0; $i<$cnt_group_user; $i++){
-		echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+		echo "<option value='" . $user_id_group[$i]  . "' title='".$user_email_group[$i]."'>" . $user_name_group[$i]  . "</option>";
 	}
 	echo "</select>";
 	
@@ -201,6 +261,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_group.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var groupuser=[];
+<?php
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "groupuser[".$i."]=[];\n";
+	echo "groupuser[".$i."]['id']='" . $user_id_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['name']='" . $user_name_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['email']='" . $user_email_group[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredGui_User.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredGui_User.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredGui_User.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -58,6 +58,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -132,21 +186,21 @@
 	$cnt_gui++;
 }
 
-/*get all user ************************************************************************************/
+/*get all user **********************************************************************************************/
 $sql_user = "SELECT * FROM mb_user ORDER BY mb_user_name";
 $res_user = db_query($sql_user);
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
-	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
 /*get all user from selected gui*******************************************************************/
-$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user = "SELECT mb_user.mb_user_email, mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
 $sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
-$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id = $1 ";
+$sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= $1 ";
 $sql_gui_mb_user .= " ORDER BY mb_user.mb_user_name";
-
 if(!$selected_gui){$v = array($gui_id_array[0]);}
 if($selected_gui){$v = array($selected_gui);}
 $t = array('s');
@@ -154,6 +208,7 @@
 while($row = db_fetch_array($res_gui_mb_user)){
 	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
 	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$user_email_gui[$cnt_gui_user] = $row["mb_user_email"];
 	$cnt_gui_user++;
 }
 
@@ -173,14 +228,15 @@
 	echo ">" . $gui_name[$i]  . "</option>";                 }
 echo "</select>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
-
 /*Button*******************************************************************************************/
 
 echo "<div class='button1'><input type='button'  value='==>' onClick='validate(\"insert\")'></div>";
@@ -189,11 +245,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),guiuser,this.value);'/>";
 /*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_gui_user; $i++){
-	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+	echo "<option value='" . $user_id_gui[$i]  . "' title='".$user_email_gui[$i]."'>" . $user_name_gui[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -203,6 +261,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_gui.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var guiuser=[];
+<?php
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "guiuser[".$i."]=[];\n";
+	echo "guiuser[".$i."]['id']='" . $user_id_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['name']='" . $user_name_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['email']='" . $user_email_gui[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredGui_filteredUser.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredGui_filteredUser.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredGui_filteredUser.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -140,11 +194,12 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];	
 	$cnt_user++;
 }
 
 /*get only owner user from selected gui************************************************************/
-$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
 $sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
 $sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id = $1 ";
 
@@ -160,6 +215,7 @@
 while($row = db_fetch_array($res_gui_mb_user)){
 	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
 	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$user_email_gui[$cnt_gui_user] = $row["mb_user_email"];
 	$cnt_gui_user++;
 }
 
@@ -179,11 +235,13 @@
 }
 echo "</select>";
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -195,11 +253,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
-/*insert gui_user_dependence in selectbox**************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),guiuser,this.value);'/>";
+/*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_gui_user; $i++){
-	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+	echo "<option value='" . $user_id_gui[$i]  . "' title='".$user_email_gui[$i]."'>" . $user_name_gui[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -209,6 +269,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_gui.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var guiuser=[];
+<?php
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "guiuser[".$i."]=[];\n";
+	echo "guiuser[".$i."]['id']='" . $user_id_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['name']='" . $user_name_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['email']='" . $user_email_gui[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredUser_Group.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredUser_Group.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredUser_Group.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -123,6 +177,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -146,11 +201,13 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
@@ -191,6 +248,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredUser_Gui.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredUser_Gui.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredUser_Gui.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -120,6 +174,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -157,17 +212,20 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
-	echo ">" . $user_name[$i] . "</option>";
+	echo ">" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
+
 /*insert allocated gui in selectbox****************************************************************/
 echo "<div class='text2'>GUI: </div>";
 echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
@@ -193,6 +251,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredUser_filteredGroup.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -125,6 +179,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -153,16 +208,18 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
-echo ">" . $user_name[$i]  . "</option>";
-                 }
+	echo ">" . $user_name[$i]  . "</option>";
+}
 echo "</select>";
 
 /*insert all group in selectbox********************************************************************/
@@ -195,6 +252,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_filteredUser_filteredGui.php
===================================================================
--- trunk/mapbender/http/php/mod_filteredUser_filteredGui.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_filteredUser_filteredGui.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -58,6 +58,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -122,6 +176,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -197,17 +252,20 @@
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-   echo "<option value='" . $user_id[$i] . "' ";
-   if($selected_user && $selected_user == $user_id[$i]){
-      echo "selected";
-   }
-   echo ">" . $user_name[$i] . "</option>";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
+	if($selected_user && $selected_user == $user_id[$i]){
+		echo "selected";
+	}
+	echo ">" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
+
 /*insert allocated gui in selectbox****************************************************************/
 echo "<div class='text2'>GUI: </div>";
 echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
@@ -240,6 +298,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_group_filteredUser.php
===================================================================
--- trunk/mapbender/http/php/mod_group_filteredUser.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_group_filteredUser.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -55,6 +55,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -121,11 +175,12 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_email[$cnt_user] =  $row["mb_user_email"];
 	$cnt_user++;
 }
 
 /*get only owner user from selected group**********************************************************/
-$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
 $sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
 $sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id = $1 ";
 if(!$selected_group){$v = array($group_id[0]);}
@@ -139,6 +194,7 @@
 while($row = db_fetch_array($res_mb_user_mb_group)){
 	$user_id_group[$cnt_group_user] = $row["mb_user_id"];
 	$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+	$user_email_group[$cnt_group_user] =  $row["mb_user_email"];
 	$cnt_group_user++;
 }
 /*INSERT HTML*/
@@ -156,12 +212,14 @@
 }
 echo "</select>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
-	for($i=0; $i<$cnt_user; $i++){
-		echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
-	}
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
+}
 echo "</select>";
 
 /*Button*******************************************************************************************/
@@ -172,11 +230,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),groupuser,this.value);'/>";
 /*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_group_user; $i++){
-	echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+	echo "<option value='" . $user_id_group[$i]  . "' title='".$user_email_group[$i]."'>" . $user_name_group[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -186,6 +246,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_group.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var groupuser=[];
+<?php
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "groupuser[".$i."]=[];\n";
+	echo "groupuser[".$i."]['id']='" . $user_id_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['name']='" . $user_name_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['email']='" . $user_email_group[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_group_user.php
===================================================================
--- trunk/mapbender/http/php/mod_group_user.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_group_user.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -55,6 +55,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -118,11 +172,12 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];	
 	$cnt_user++;
 }
 
 /*get all user from selected group******************************************************************************/
-$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
+$sql_mb_user_mb_group = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, mb_user_mb_group.fkey_mb_group_id FROM mb_user_mb_group ";
 $sql_mb_user_mb_group .= "INNER JOIN mb_user ON mb_user_mb_group.fkey_mb_user_id = mb_user.mb_user_id ";
 $sql_mb_user_mb_group .= "WHERE mb_user_mb_group.fkey_mb_group_id= $1 ";
 $sql_mb_user_mb_group .= " ORDER BY mb_user.mb_user_name";
@@ -135,6 +190,7 @@
 while($row = db_fetch_array($res_mb_user_mb_group)){
 	$user_id_group[$cnt_group_user] = $row["mb_user_id"];
 	$user_name_group[$cnt_group_user] =  $row["mb_user_name"];
+	$user_email_group[$cnt_group_user] =  $row["mb_user_email"];
 	$cnt_group_user++;
 }
 
@@ -154,11 +210,13 @@
 }
 echo "</select>";
 
-/*insert all profiles in selectbox**************************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -170,11 +228,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
-/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),groupuser,this.value);'/>";
+/*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_group_user; $i++){
-	echo "<option value='" . $user_id_group[$i]  . "'>" . $user_name_group[$i]  . "</option>";
+	echo "<option value='" . $user_id_group[$i]  . "' title='".$user_email_group[$i]."'>" . $user_name_group[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -184,6 +244,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_group.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var groupuser=[];
+<?php
+for($i=0; $i<$cnt_group_user; $i++){
+	echo "groupuser[".$i."]=[];\n";
+	echo "groupuser[".$i."]['id']='" . $user_id_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['name']='" . $user_name_group[$i]  . "';\n";
+	echo "groupuser[".$i."]['email']='" . $user_email_group[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_gui_filteredUser.php
===================================================================
--- trunk/mapbender/http/php/mod_gui_filteredUser.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_gui_filteredUser.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -56,6 +56,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -125,11 +179,12 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] =  $row["mb_user_name"];
+	$user_email[$cnt_user] =  $row["mb_user_email"];
 	$cnt_user++;
 }
 
 /*get only owner user from selected gui************************************************************/
-$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
 $sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
 $sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id = $1";
 if(!$selected_gui){$v = array($gui_id_array[0]);}
@@ -143,6 +198,7 @@
 while($row = db_fetch_array($res_gui_mb_user)){
 	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
 	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$user_email_gui[$cnt_gui_user] = $row["mb_user_email"];
 	$cnt_gui_user++;
 }
 
@@ -162,11 +218,13 @@
                  }
 echo "</select>";
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -178,11 +236,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
-/*insert gui_user_dependence in selectbox**************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),guiuser,this.value);'/>";
+/*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_gui_user; $i++){
-	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+	echo "<option value='" . $user_id_gui[$i]  . "' title='".$user_email_gui[$i]."'>" . $user_name_gui[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -192,6 +252,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_gui.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var guiuser=[];
+<?php
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "guiuser[".$i."]=[];\n";
+	echo "guiuser[".$i."]['id']='" . $user_id_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['name']='" . $user_name_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['email']='" . $user_email_gui[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_gui_owner.php
===================================================================
--- trunk/mapbender/http/php/mod_gui_owner.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_gui_owner.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -59,6 +59,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -138,12 +192,13 @@
 	$res_user = db_query($sql_user);
 	while($row = db_fetch_array($res_user)){
 		$user_id[$cnt_user] = $row["mb_user_id"];
-		$user_name[$cnt_user] =  $row["mb_user_name"];
+		$user_name[$cnt_user] = $row["mb_user_name"];
+		$user_email[$cnt_user] = $row["mb_user_email"];
 		$cnt_user++;
 	}
 
 /*get all user from selected gui******************************************************************************/
-$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, mb_user.mb_user_email, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
 $sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
 $sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id = $1";
 $sql_gui_mb_user .= " AND gui_mb_user.mb_user_type = 'owner' ORDER BY mb_user.mb_user_name";
@@ -154,6 +209,7 @@
 while($row = db_fetch_array($res_gui_mb_user)){
 	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
 	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$user_email_gui[$cnt_gui_user] =  $row["mb_user_email"];
 	$cnt_gui_user++;
 }
 
@@ -173,12 +229,14 @@
 }
 echo "</select>";
 
-/*insert all profiles in selectbox**************************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
-	for($i=0; $i<$cnt_user; $i++){
-		echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
-	}
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
+for($i=0; $i<$cnt_user; $i++){
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
+}
 echo "</select>";
 
 /*Button****************************************************************************************************/
@@ -189,11 +247,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
-/*insert container_profile_dependence and container_group_dependence in selectbox**************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),guiuser,this.value);'/>";
+/*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>OWNER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_gui_user; $i++){
-	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+	echo "<option value='" . $user_id_gui[$i]  . "' title='".$user_email_gui[$i]."'>" . $user_name_gui[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -205,6 +265,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_gui.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var guiuser=[];
+<?php
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "guiuser[".$i."]=[];\n";
+	echo "guiuser[".$i."]['id']='" . $user_id_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['name']='" . $user_name_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['email']='" . $user_email_gui[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_gui_user.php
===================================================================
--- trunk/mapbender/http/php/mod_gui_user.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_gui_user.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 </head>
 <body>
@@ -118,11 +172,12 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
 /*get all user from selected gui*******************************************************************/
-$sql_gui_mb_user = "SELECT mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
+$sql_gui_mb_user = "SELECT mb_user.mb_user_email, mb_user.mb_user_id, mb_user.mb_user_name, gui_mb_user.fkey_gui_id FROM gui_mb_user ";
 $sql_gui_mb_user .= "INNER JOIN mb_user ON gui_mb_user.fkey_mb_user_id = mb_user.mb_user_id ";
 $sql_gui_mb_user .= "WHERE gui_mb_user.fkey_gui_id= $1 ";
 $sql_gui_mb_user .= " ORDER BY mb_user.mb_user_name";
@@ -133,6 +188,7 @@
 while($row = db_fetch_array($res_gui_mb_user)){
 	$user_id_gui[$cnt_gui_user] = $row["mb_user_id"];
 	$user_name_gui[$cnt_gui_user] =  $row["mb_user_name"];
+	$user_email_gui[$cnt_gui_user] = $row["mb_user_email"];
 	$cnt_gui_user++;
 }
 
@@ -152,11 +208,13 @@
 }
 echo "</select>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter2' id='filter2' name='filter2' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all profiles in selectbox*****************************************************************/
 echo "<div class='text2'>USER:</div>";
-echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select2' multiple='multiple' id='selecteduser' name='selected_user[]' size='$fieldHeight' >";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i]  . "'>" . $user_name[$i]  . "</option>";
+	echo "<option value='" . $user_id[$i]  . "' title='".$user_email[$i]."'>" . $user_name[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -168,11 +226,13 @@
 echo "<div class='button2'><input type='button' value='<==' onClick='validate(\"remove\")'></div>";
 echo "<input type='hidden' name='remove'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter3' id='filter3' name='filter3' onkeyup='filterUser(document.getElementById(\"removeuser\"),guiuser,this.value);'/>";
 /*insert container_profile_dependence and container_group_dependence in selectbox******************/
 echo "<div class='text3'>SELECTED USER:</div>";
-echo "<select style='background:#ffffff' class='select3' multiple='multiple' name='remove_user[]' size='$fieldHeight' >";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select3' multiple='multiple' name='remove_user[]' id='removeuser' size='$fieldHeight' >";
 for($i=0; $i<$cnt_gui_user; $i++){
-	echo "<option value='" . $user_id_gui[$i]  . "'>" . $user_name_gui[$i]  . "</option>";
+	echo "<option value='" . $user_id_gui[$i]  . "' title='".$user_email_gui[$i]."'>" . $user_name_gui[$i]  . "</option>";
 }
 echo "</select>";
 
@@ -182,6 +242,24 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_gui.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
+var guiuser=[];
+<?php
+for($i=0; $i<$cnt_gui_user; $i++){
+	echo "guiuser[".$i."]=[];\n";
+	echo "guiuser[".$i."]['id']='" . $user_id_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['name']='" . $user_name_gui[$i]  . "';\n";
+	echo "guiuser[".$i."]['email']='" . $user_email_gui[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_user_filteredGroup.php
===================================================================
--- trunk/mapbender/http/php/mod_user_filteredGroup.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_user_filteredGroup.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -121,6 +175,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -147,11 +202,13 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
-/*insert all user in selectbox*********************************************************************/
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
+/*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
@@ -189,6 +246,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_user_filteredGui.php
===================================================================
--- trunk/mapbender/http/php/mod_user_filteredGui.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_user_filteredGui.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -62,6 +62,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -129,6 +183,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -200,16 +255,20 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
-	echo ">" . $user_name[$i] . "</option>";}
+	echo ">" . $user_name[$i]  . "</option>";
+}
 echo "</select>";
+
 /*insert allocated gui in selectbox**************************************************************************/
 echo "<div class='text2'>GUI:</div>";
 echo "<select style='background:#ffffff' class='select2' multiple='multiple' name='selected_gui[]' size='$fieldHeight' >";
@@ -239,6 +298,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_user_group.php
===================================================================
--- trunk/mapbender/http/php/mod_user_group.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_user_group.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -57,6 +57,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -117,6 +171,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -140,11 +195,13 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
@@ -182,6 +239,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 </body>

Modified: trunk/mapbender/http/php/mod_user_gui.php
===================================================================
--- trunk/mapbender/http/php/mod_user_gui.php	2007-10-26 12:37:55 UTC (rev 1752)
+++ trunk/mapbender/http/php/mod_user_gui.php	2007-10-26 13:59:20 UTC (rev 1753)
@@ -59,6 +59,60 @@
 		}
 	}
 }
+/**
+ * filter the Userlist by str
+ */
+function filterUser(list, all, str){
+	str=str.toLowerCase();
+	var selection=[];
+	var i,j,selected;
+	for(i=0;i<list.options.length;i++){
+		if(list.options[i].selected)
+			selection[selection.length]=list.options[i].value;
+	}
+	
+	list.options.length = 0;
+	for(i=0; i<all.length; i++){
+		if(all[i]['name'].toLowerCase().indexOf(str)==-1)
+			continue;
+		selected=false;
+		for(j=0;j<selection.length;j++){
+			if(selection[j]==all[i]['id']){
+				selected=true;
+				break;
+			}
+		}
+		var newOption = new Option(selected?all[i]['name']+" ("+all[i]['email']+")":all[i]['name'],all[i]['id'],false,selected);
+		newOption.setAttribute("title", all[i]['email']);
+		list.options[list.options.length] = newOption;
+	}	
+}
+/**
+ * add Mail adress on selection
+ */
+function updateMail(list, all){
+	var j=0;
+	for(var i=0; i<list.options.length;i++){
+		if(list.options[i].selected){
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name']+" ("+all[j]['email']+")";
+					list.options[i].selected = true;
+					break;
+				}
+			}
+		}
+		else{
+			for(j=j;j<all.length;j++){
+				if(all[j]['id']==list.options[i].value){
+					list.options[i].text=all[j]['name'];
+					list.options[i].selected = false;
+					break;
+				}
+			}
+		}
+	}
+}
 </script>
 
 </head>
@@ -122,6 +176,7 @@
 while($row = db_fetch_array($res_user)){
 	$user_id[$cnt_user] = $row["mb_user_id"];
 	$user_name[$cnt_user] = $row["mb_user_name"];
+	$user_email[$cnt_user] = $row["mb_user_email"];
 	$cnt_user++;
 }
 
@@ -144,11 +199,13 @@
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."&e_id_css=".$_REQUEST["e_id_css"]."' method='post'>";
 
+/*filterbox****************************************************************************************/
+echo "<input type='text' value='' class='filter1' id='filter1' name='filter1' onkeyup='filterUser(document.getElementById(\"selecteduser\"),user,this.value);'/>";
 /*insert all user in selectbox*************************************************************************************/
 echo "<div class='text1'>USER: </div>";
-echo "<select style='background:#ffffff' class='select1' name='selected_user' onChange='submit()' size='10'>";
+echo "<select style='background:#ffffff' onchange='updateMail(this, user)' class='select1' id='selecteduser' name='selected_user' onChange='submit()' size='10'>";
 for($i=0; $i<$cnt_user; $i++){
-	echo "<option value='" . $user_id[$i] . "' ";
+	echo "<option value='" . $user_id[$i] . "' title='".$user_email[$i]."'";
 	if($selected_user && $selected_user == $user_id[$i]){
 		echo "selected";
 	}
@@ -185,6 +242,15 @@
 <script type="text/javascript">
 <!--
 document.forms[0].selected_user.focus();
+var user=[];
+<?php
+for($i=0; $i<$cnt_user; $i++){
+	echo "user[".$i."]=[];\n";
+	echo "user[".$i."]['id']='" . $user_id[$i]  . "';\n";
+	echo "user[".$i."]['name']='" . $user_name[$i]  . "';\n";
+	echo "user[".$i."]['email']='" . $user_email[$i]  . "';\n";
+}
+?>
 // -->
 </script>
 



More information about the Mapbender_commits mailing list