[Mapbender-commits] r10382 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 1 23:55:47 PST 2020


Author: armin11
Date: 2020-01-01 23:55:46 -0800 (Wed, 01 Jan 2020)
New Revision: 10382

Modified:
   trunk/mapbender/http/classes/class_metadata.php
Log:
Fix - set price to null if defined price in owsproxy is '0' or ''

Modified: trunk/mapbender/http/classes/class_metadata.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata.php	2019-12-20 10:44:14 UTC (rev 10381)
+++ trunk/mapbender/http/classes/class_metadata.php	2020-01-02 07:55:46 UTC (rev 10382)
@@ -297,8 +297,8 @@
 				$this->databaseIdColumnName = 'layer_id';
 				$this->databaseTableName = 'layer';
 				//$this->keywordRelation = 'layer_keyword';
-				$this->searchView = 'wms_search_table';
-				//$this->searchView = 'search_wms_view';
+				//$this->searchView = 'wms_search_table';
+				$this->searchView = 'search_wms_view';
 				$this->whereStrCatExtension = " AND custom_category.custom_category_hidden = 0";
 				switch ($this->orderBy) {
 					case "rank":
@@ -321,8 +321,8 @@
 				$this->generateWMSMetadata($this->wmsDoc);
 			}
 			if (isset($this->searchResources) & strtolower($this->searchResources) === "wmc") {
-				//$this->searchView = 'search_wmc_view';
-				$this->searchView = 'wmc_search_table';
+				$this->searchView = 'search_wmc_view';
+				//$this->searchView = 'wmc_search_table';
 				$this->databaseIdColumnName = 'wmc_serial_id';
 				$this->databaseTableName = 'wmc';
 				//the following is needed to give a special filter to the custom cat table!
@@ -494,7 +494,11 @@
 				$this->wfsJSON->wfs->srv[$i-$j]->status = $wfsMatrix[$i]['status'];
 				$this->wfsJSON->wfs->srv[$i-$j]->avail = $wfsMatrix[$i]['availability'];
 				$this->wfsJSON->wfs->srv[$i-$j]->logged = $wfsMatrix[$i]['wfs_proxylog']; //$wfsMatrix[$i][''];
-				$this->wfsJSON->wfs->srv[$i-$j]->price = $wfsMatrix[$i]['wfs_pricevolume']; //$wfsMatrix[$i][''];
+				if ($wfsMatrix[$i]['wfs_pricevolume'] == '0' || $wfsMatrix[$i]['wfs_pricevolume'] == null || $wfsMatrix[$i]['wfs_pricevolume'] == '') {
+				    $this->wfsJSON->wfs->srv[$i-$j]->price = null;
+				} else {
+  				    $this->wfsJSON->wfs->srv[$i-$j]->price = $wfsMatrix[$i]['wfs_pricevolume'];
+				}
 				$this->wfsJSON->wfs->srv[$i-$j]->nwaccess = $wfsMatrix[$i]['wfs_network_access']; //$wfsMatrix[$i][''];
 				$this->wfsJSON->wfs->srv[$i-$j]->bbox = "-180.0,-90.0,180.0,90.0"; //$wfsMatrix[$i][''];
 				//if featuretype hasn't been created - do it



More information about the Mapbender_commits mailing list