[Mapbender-commits] r9507 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 6 05:42:43 PDT 2016


Author: armin11
Date: 2016-06-06 05:42:43 -0700 (Mon, 06 Jun 2016)
New Revision: 9507

Modified:
   trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js
   trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js
Log:
Fixes for metadata addon editor license switcher

Modified: trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js	2016-06-06 12:37:29 UTC (rev 9506)
+++ trunk/mapbender/http/plugins/mb_metadata_showMetadataAddon.js	2016-06-06 12:42:43 UTC (rev 9507)
@@ -33,6 +33,7 @@
 				}
 				$metadataAddonForm.easyform("reset");
 				$metadataAddonForm.easyform("fill", obj);
+				$('#license_source_md').css("display","none");
 				if (obj.md_termsofuse !== "0") {
 					//alert(JSON.stringify(obj));
 					that.fillLicence(obj.md_termsofuse);
@@ -187,13 +188,13 @@
 					} else {
 						$('#license_source_md').css("display","none");
 					}
-					$('#licence_info_md').css('display', 'block');
+					$('#license_info_md').css('display', 'block');
 				} else {
 					$('#licence_symbol_md').attr('src', '');
 					$('#licence_descriptionlink_md').attr('href', '');
 					$('#licence_descriptionlink_md').text('');
 					$('#open_symbol_md').attr('src', '');
-					$('#licence_info_md').css('display', 'none');
+					$('#license_info_md').css('display', 'none');
 				}
 			}
 		});

Modified: trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js	2016-06-06 12:37:29 UTC (rev 9506)
+++ trunk/mapbender/http/plugins/mb_metadata_showMetadataAddonWfs.js	2016-06-06 12:42:43 UTC (rev 9507)
@@ -33,8 +33,12 @@
 				}
 				$metadataAddonForm.easyform("reset");
 				$metadataAddonForm.easyform("fill", obj);
+				$('#license_source_md').css("display","none");
+				if (obj.md_termsofuse !== "0") {
+					//alert(JSON.stringify(obj));
+					that.fillLicence(obj.md_termsofuse);
+				}
 				
-				
 				//that.showForm(metadataId, featuretypeId);
 				/*
 				//enable link element to edit link!
@@ -134,7 +138,51 @@
 			}
 		});
 		req.send();	
-	}		
+	}	
+
+	//Show more information about the licences of the metadata 
+	this.fillLicence = function(obj) {
+		// get licence information from server per termsofuse_id
+		var req = new Mapbender.Ajax.Request({
+			url: "../plugins/mb_metadata_server.php",
+			method: "getLicenceInformation",
+			parameters: {
+				"id": obj
+			},
+			callback: function (obj, result, message) {
+				if (!result) {
+					return;
+				}
+				if (obj.termsofuse_id) {
+					//alert(JSON.stringify(obj));
+					$('#licence_symbol_md').attr('src', obj.symbollink);
+					$('#licence_descriptionlink_md').text(obj.description);
+					$('#licence_descriptionlink_md').attr('href', obj.descriptionlink);
+					if (obj.isopen == 1) {
+						$('#open_symbol_md').attr('src', '../img/od_80x15_blue.png');
+						$('#open_symbol_md').css("display","block");
+					} else {
+						$('#open_symbol_md').attr('src', '');
+						$('#open_symbol_md').css("display","none");
+					}
+					if (obj.source_required == 1) {
+						$('#license_source_md').css("display","block");
+					} else {
+						$('#license_source_md').css("display","none");
+					}
+					$('#license_info_md').css('display', 'block');
+				} else {
+					$('#licence_symbol_md').attr('src', '');
+					$('#licence_descriptionlink_md').attr('href', '');
+					$('#licence_descriptionlink_md').text('');
+					$('#open_symbol_md').attr('src', '');
+					$('#license_info_md').css('display', 'none');
+				}
+			}
+		});
+		req.send();
+	}	
+	
 	this.insertAddedMetadata = function(featuretypeId, data){
 		// push metadata from server
 		var req = new Mapbender.Ajax.Request({



More information about the Mapbender_commits mailing list