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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 7 05:37:59 EDT 2007


Author: christoph
Date: 2007-08-07 05:37:58 -0400 (Tue, 07 Aug 2007)
New Revision: 1620

Modified:
   trunk/mapbender/http/php/mod_wfs_conf.php
   trunk/mapbender/http/php/mod_wfs_edit.php
Log:
http://trac.osgeo.org/mapbender/ticket/80

Modified: trunk/mapbender/http/php/mod_wfs_conf.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_conf.php	2007-08-07 07:50:44 UTC (rev 1619)
+++ trunk/mapbender/http/php/mod_wfs_conf.php	2007-08-07 09:37:58 UTC (rev 1620)
@@ -133,25 +133,20 @@
                 if(!empty($_REQUEST["f_mandatory".$i])){
                 	$sql .= "'1'";
                 }else{$sql .= "'0'";}
-                $sql .= ", ";
-                $sql .= "f_auth_varname = '".addslashes($_REQUEST["f_auth_varname".$i]);
-				$sql .= "'";
+//                $sql .= ", ";
+//                $sql .= "'".addslashes($_REQUEST["f_auth_varname".$i]);
+//				$sql .= "'";
                 $sql .= "); ";
 
                 $res = db_query($sql);
-     
         }
-        $sql = "UPDATE wfs_conf_element SET ";
-        $sql .= "f_geom = 1";
-        $sql .= " WHERE fkey_wfs_conf_id = ".$wfsID." AND f_id = ".$_REQUEST["f_geom"].";";
-		$res = db_query($sql);
+        if (isset($_REQUEST["f_geom"])) {
+	        $sql = "UPDATE wfs_conf_element SET ";
+	        $sql .= "f_geom = 1";
+	        $sql .= " WHERE fkey_wfs_conf_id = ".$wfsID." AND f_id = ".$_REQUEST["f_geom"].";";
+			$res = db_query($sql);
+        }
 		
-
-        $sql = "UPDATE wfs_conf_element SET ";
-        $sql .= "f_gid = 1";
-        $sql .= " WHERE fkey_wfs_conf_id = ".$wfsID." AND f_id = ".$_REQUEST["f_gid"].";";
-		$res = db_query($sql);
-		
 		echo "<script language='javascript'>";
 		echo "document.location.href = 'mod_wfs_edit.php?gaz=".$wfsID."';";
 		echo "</script>";
@@ -258,7 +253,7 @@
                 echo "<td>" . toImage('mandatory') . "</td>";
                 echo "<td>" . toImage('edit') . "</td>";
                 echo "<td>" . toImage('html') . "</td>";
-                echo "<td>" . toImage('auth') . "</td>";
+//                echo "<td>" . toImage('auth') . "</td>";
         echo "</tr>";
 
         for($i=0; $i<count($aWFS->elements->element_id); $i++){
@@ -277,7 +272,7 @@
                 echo "<td><input name='f_mandatory".$i."' type='checkbox'></td>";
                 echo "<td><input name='f_edit".$i."' type='checkbox'></td>";
                 echo "<td><textarea name='f_form_element_html".$cnt."' cols='15' rows='1' ></textarea></td>";
-                echo "<td><input name='f_auth_varname".$cnt."' type='text' size='8' value='".$row["f_auth_varname"]."'></td>";
+//                echo "<td><input name='f_auth_varname".$cnt."' type='text' size='8' value='".$row["f_auth_varname"]."'></td>";
                 echo "</tr>";
         }
         echo "</table>";

Modified: trunk/mapbender/http/php/mod_wfs_edit.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_edit.php	2007-08-07 07:50:44 UTC (rev 1619)
+++ trunk/mapbender/http/php/mod_wfs_edit.php	2007-08-07 09:37:58 UTC (rev 1620)
@@ -74,29 +74,26 @@
         
         $res = db_query($sql);
 		        
-        $sql = "UPDATE wfs_conf_element SET ";
-        $sql .= "f_geom = 1";
-        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_geom"].";";
-		$res = db_query($sql);
+		if (isset($_REQUEST["f_geom"])) {
+	        $sql = "UPDATE wfs_conf_element SET ";
+	        $sql .= "f_geom = 1";
+	        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_geom"].";";
+			$res = db_query($sql);
+			
+			$sql = "UPDATE wfs_conf_element SET ";
+	        $sql .= "f_geom = 0";
+	        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id <>  ".$_REQUEST["f_geom"].";";
+			$res = db_query($sql);
+		}
+		else {
+			$sql = "UPDATE wfs_conf_element SET ";
+	        $sql .= "f_geom = 0";
+	        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"].";";
+			$res = db_query($sql);
+		}
 		
-		$sql = "UPDATE wfs_conf_element SET ";
-        $sql .= "f_geom = 0";
-        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id <>  ".$_REQUEST["f_geom"].";";
-		$res = db_query($sql);
-
-        $sql = "UPDATE wfs_conf_element SET ";
-        $sql .= "f_gid = 1";
-        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id = ".$_REQUEST["f_gid"].";";
-		$res = db_query($sql);
-		
-		$sql = "UPDATE wfs_conf_element SET ";
-        $sql .= "f_gid = 0";
-        $sql .= " WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." AND f_id <> ".$_REQUEST["f_gid"].";";
-		$res = db_query($sql);
-		
-		
-		
         for($i=0; $i<$_REQUEST["num"]; $i++){
+        	
                 $sql = "UPDATE wfs_conf_element SET ";
                 $sql .= "f_search = '";
                 if(!empty($_REQUEST["f_search".$i])){
@@ -190,7 +187,7 @@
         /* set element options */
         $sql = "SELECT * FROM wfs_conf_element ";
         $sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
-        $sql .= "WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"];
+        $sql .= "WHERE fkey_wfs_conf_id = ".$_REQUEST["gaz"]." ORDER BY f_id";
 
         $res = db_query($sql);
 		



More information about the Mapbender_commits mailing list