[fusion-commits] r2537 - trunk/widgets/Theme/classes

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sun May 20 23:23:01 PDT 2012


Author: liuar
Date: 2012-05-20 23:23:01 -0700 (Sun, 20 May 2012)
New Revision: 2537

Modified:
   trunk/widgets/Theme/classes/theme.php
Log:
Submit on behalf of Spark Liu: Fix ticket #524 - "Individual" theme doesn't work for provider not supporting distinct

If provider doesn't support distinct, "Individual theme" will not work for the layer depending on it. This is because it uses distinct function. The solution is using calculation function UNIQUE to work around this.

Modified: trunk/widgets/Theme/classes/theme.php
===================================================================
--- trunk/widgets/Theme/classes/theme.php	2012-05-03 10:17:07 UTC (rev 2536)
+++ trunk/widgets/Theme/classes/theme.php	2012-05-21 06:23:01 UTC (rev 2537)
@@ -312,14 +312,13 @@
         {
             $values = array();
             
-            $aggregateOptions->AddFeatureProperty($this->args['PROPERTYNAME']);
-            $aggregateOptions->SelectDistinct(true);
+            $aggregateOptions->AddComputedProperty('THEME_VALUE', 'UNIQUE("' . $this->args['PROPERTYNAME'] . '")');
             if($filter != '')
                 $aggregateOptions->SetFilter($filter);
-            $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);            
+            $dataReader = $featureService->SelectAggregate($resId, $layer->GetFeatureClassName(), $aggregateOptions);
             while ($dataReader->ReadNext())
             {
-                $value = $this->GetFeaturePropertyValue($dataReader, $this->args['PROPERTYNAME']);
+                $value = $this->GetFeaturePropertyValue($dataReader, 'THEME_VALUE');
                 array_push($values, $value);
             }
             $dataReader->Close();



More information about the fusion-commits mailing list