[Mapbender-commits] r3503 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 29 09:38:17 EST 2009


Author: christoph
Date: 2009-01-29 09:38:17 -0500 (Thu, 29 Jan 2009)
New Revision: 3503

Modified:
   trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
http://trac.osgeo.org/mapbender/ticket/356

Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-01-29 14:34:25 UTC (rev 3502)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php	2009-01-29 14:38:17 UTC (rev 3503)
@@ -902,6 +902,9 @@
 					d.get(-1).wfs_conf = wfsConfId;
 					d.get(-1).e = wfsProperties;
 				}
+				// remove the original and the temporary polygon
+				d.del(0);
+				d.del(0);
 				parent.mb_disableThisButton(button_difference);
 			});
 		}
@@ -1204,7 +1207,7 @@
 				}
 					
 				// button: remove geometry from database
-				if (isValidWfsConfIndex(wfsConf, d.get(i).wfs_conf)) {
+				if (d.get(i).e.getElementValueByName('fid')) {
 					listOfGeom += "<img src = '"+buttonDig_imgdir+buttonDig_removeDb_src+"' title='"+msgObj.buttonDig_removeDb_title+"' onclick=\"var deltrans = confirm('"+msgObj.messageConfirmDeleteGeomFromDb+"');if (deltrans) dbGeom('delete', "+i+")\">";
 				}
 				listOfGeom += "<div class='digitizeGeometryListItem' onmouseover='parent.mb_wfs_perform(\"over\",d.get("+i+"));' ";
@@ -1692,7 +1695,12 @@
 			for (var i=0; i<myform.length; i++){
 				if (myform.elements[i].id == "fid") {
 					fid = myform.elements[i].value;
-					d.get(m).e.setElement('fid', fid);
+					if (fid == "false") {
+						fid = false;
+					}
+					else {
+						d.get(m).e.setElement('fid', fid);
+					}
 				}
 				else if (myform.elements[i].type == 'text' ){
 					if (myform.elements[i].id) {
@@ -1730,23 +1738,24 @@
 }
 
 function wfsSubWrite(m, type, status, response, fid) {
-	if (type == 'save' && fid) {
-		d.get(m).e.setElement("fid", fid);
-	}
-	if (type == 'delete') {
-		parent.mb_disableThisButton(mod_digitizeEvent);
-		d.del(m);
-	}
-	parent.mb_execWfsWriteSubFunctions();
-	executeDigitizeSubFunctions();
-	
 	if (status == "success" && response == "success") {
+		if (type == 'save' && fid) {
+			d.get(m).e.setElement("fid", fid);
+		}
+		if (type == 'delete') {
+			parent.mb_disableThisButton(mod_digitizeEvent);
+			d.del(m);
+		}
+		
 		var wfsWriteMessage = msgObj.messageSuccessWfsWrite;
 	}
 	else {
 		var wfsWriteMessage = msgObj.messageErrorWfsWrite;
 	} 
 
+	parent.mb_execWfsWriteSubFunctions();
+	executeDigitizeSubFunctions();
+
 	if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
 		wfsWindow.alert(wfsWriteMessage);
 		window.setTimeout("wfsWindow.close()",0);



More information about the Mapbender_commits mailing list