changeset 6690:0b0325d1ab7f

issue1391: Fix syntax in gauge macros and add km filtering
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 29 Jul 2013 12:14:51 +0200
parents e568788f519d
children f41ba63e7a43
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Mon Jul 29 11:56:03 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon Jul 29 12:14:51 2013 +0200
@@ -1284,22 +1284,21 @@
     <dc:macro name="discharge_table_gauge">
       <dc:context>
         <dc:statement>
-          SELECT id   AS gauge_id,
-                 name AS gauge_name
-          FROM gauges WHERE river_id = ${river_id}
+          SELECT g.id   AS gauge_id,
+                 g.name AS gauge_name
+          FROM gauges g
+          LEFT JOIN ranges r ON g.range_id = r.id
+          WHERE g.river_id = ${river_id}
+          AND NOT((${tokm} &lt; r.a) or (${fromkm} &gt; r.b))
         </dc:statement>
         <dc:if test="dc:has-result()">
-          <discharge_table_nn>
-            <discharge_table_gauge>
-              <dc:for-each>
-                <gauge name="{$gauge_name}"
-                  factory="gaugedischarge" target_out="{$out}"
-                  from="{$g_start}"
-                  to="{$g_stop}"
-                  ids="{$gauge_name}"/>
-              </dc:for-each>
-            </discharge_table_gauge>
-          </discharge_table_nn>
+          <discharge_table_gauge>
+            <dc:for-each>
+              <gauge name="{$gauge_name}"
+                factory="gaugedischarge" target_out="{$out}"
+                ids="{$gauge_name}"/>
+            </dc:for-each>
+          </discharge_table_gauge>
         </dc:if>
       </dc:context>
     </dc:macro>

http://dive4elements.wald.intevation.org