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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jun 6 09:31:23 PDT 2019


Author: armin11
Date: 2019-06-06 09:31:23 -0700 (Thu, 06 Jun 2019)
New Revision: 10144

Modified:
   trunk/mapbender/http/php/mod_showOrganizationList.php
Log:
Filter mb_group entries to searchable rows and small fix

Modified: trunk/mapbender/http/php/mod_showOrganizationList.php
===================================================================
--- trunk/mapbender/http/php/mod_showOrganizationList.php	2019-06-06 16:18:27 UTC (rev 10143)
+++ trunk/mapbender/http/php/mod_showOrganizationList.php	2019-06-06 16:31:23 UTC (rev 10144)
@@ -1,5 +1,6 @@
 <?php
 //server component to pull statistics FROM geoportal catalogue
+
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 $orderBy = 'rank';
 if (isset($_REQUEST["orderBy"]) & $_REQUEST["orderBy"] != "") {
@@ -25,7 +26,7 @@
 		) AS owner_wms INNER JOIN mb_user_mb_group on owner_wms.wms_owner = mb_user_mb_group.fkey_mb_user_id WHERE mb_user_mb_group_type = 2
 	) AS published_wms INNER JOIN (
 		SELECT layer_id, fkey_wms_id FROM layer WHERE layer_searchable = 1
-) AS layer on published_wms.wms_id = layer.fkey_wms_id GROUP BY fkey_mb_group_id) AS layer_count INNER JOIN mb_group on mb_group.mb_group_id = layer_count.fkey_mb_group_id 
+) AS layer on published_wms.wms_id = layer.fkey_wms_id GROUP BY fkey_mb_group_id) AS layer_count INNER JOIN mb_group on mb_group.mb_group_id = layer_count.fkey_mb_group_id WHERE mb_group.searchable = true
 
 UNION
 
@@ -38,17 +39,17 @@
 		) AS owner_wfs INNER JOIN mb_user_mb_group on owner_wfs.wfs_owner = mb_user_mb_group.fkey_mb_user_id WHERE mb_user_mb_group_type = 2
 	) AS published_wfs INNER JOIN (
 		SELECT featuretype_id, fkey_wfs_id FROM wfs_featuretype WHERE featuretype_searchable = 1
-) AS featuretype on published_wfs.wfs_id = featuretype.fkey_wfs_id GROUP BY fkey_mb_group_id) AS featuretype_count INNER JOIN mb_group on mb_group.mb_group_id = featuretype_count.fkey_mb_group_id
+) AS featuretype on published_wfs.wfs_id = featuretype.fkey_wfs_id GROUP BY fkey_mb_group_id) AS featuretype_count INNER JOIN mb_group on mb_group.mb_group_id = featuretype_count.fkey_mb_group_id WHERE mb_group.searchable = true
 
 UNION
 
 SELECT COUNT(metadata_id) AS dataset_count, 0 AS featuretype_count, 0 AS layer_count, 0 AS wmc_count, mb_group_id FROM (
-SELECT metadata_id, fkey_mb_group_id, searchable FROM mb_metadata WHERE fkey_mb_group_id <> 0 AND fkey_mb_group_id IS NOT NULL GROUP BY fkey_mb_group_id, fkey_mb_group_id, metadata_id 
+SELECT metadata_id, fkey_mb_group_id, searchable FROM mb_metadata WHERE fkey_mb_group_id <> 0 AND fkey_mb_group_id IS NOT NULL GROUP BY fkey_mb_group_id, fkey_mb_group_id, metadata_id, searchable  
 UNION SELECT metadata_id, fkey_mb_group_id, searchable FROM (
 		SELECT fkey_mb_user_id, metadata_id, searchable FROM mb_metadata WHERE fkey_mb_group_id = 0 OR fkey_mb_group_id is null GROUP BY  fkey_mb_user_id, metadata_id
-) AS owner_metadata INNER JOIN mb_user_mb_group on owner_metadata.fkey_mb_user_id = mb_user_mb_group.fkey_mb_user_id WHERE mb_user_mb_group_type = 2
+,searchable) AS owner_metadata INNER JOIN mb_user_mb_group on owner_metadata.fkey_mb_user_id = mb_user_mb_group.fkey_mb_user_id WHERE mb_user_mb_group_type = 2
 
-) AS published_metadata INNER JOIN mb_group on mb_group.mb_group_id = published_metadata.fkey_mb_group_id WHERE searchable = true GROUP BY mb_group_id, fkey_mb_group_id
+) AS published_metadata INNER JOIN mb_group on mb_group.mb_group_id = published_metadata.fkey_mb_group_id WHERE published_metadata.searchable = true AND mb_group.searchable = true GROUP BY mb_group_id, fkey_mb_group_id
 
 UNION
 
@@ -56,7 +57,7 @@
 		SELECT fkey_user_id, wmc_serial_id FROM  mb_user_wmc WHERE wmc_public = 1 GROUP BY fkey_user_id, wmc_serial_id
 ) AS owner_wmc INNER JOIN mb_user_mb_group on owner_wmc.fkey_user_id = mb_user_mb_group.fkey_mb_user_id WHERE mb_user_mb_group_type = 2 ) AS published_wmc GROUP BY fkey_mb_group_id
 
-) AS resources GROUP BY mb_group_id ) AS published_resources INNER JOIN mb_group on published_resources.mb_group_id = mb_group.mb_group_id 
+) AS resources GROUP BY mb_group_id ) AS published_resources INNER JOIN mb_group on published_resources.mb_group_id = mb_group.mb_group_id WHERE mb_group.searchable = true
 SQL;
 
 switch ($orderBy) {



More information about the Mapbender_commits mailing list