[Mpuls-commits] r5261 - jmd/trunk
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Aug 26 15:33:17 CEST 2011
Author: roland
Date: 2011-08-26 15:33:16 +0200 (Fri, 26 Aug 2011)
New Revision: 5261
Added:
jmd/trunk/tagging_struktur.xml
Modified:
jmd/trunk/ChangeLog
jmd/trunk/jmdstruktur.json
Log:
issue2231: add rules to prevent double entries per year in the structure part
Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog 2011-08-25 07:56:52 UTC (rev 5260)
+++ jmd/trunk/ChangeLog 2011-08-26 13:33:16 UTC (rev 5261)
@@ -1,3 +1,9 @@
+2011-08-26 Roland Geider <roland.geider at intevation.de>
+
+ * tagging_struktur.xml,
+ jmdstruktur.json: issue2231: add rules to prevent double entries per
+ year in the structure part
+
2011-08-02 Roland Geider <roland.geider at intevation.de>
* jmdstrukturweb/public/xml/eval_gruppenangebote.xml,
Modified: jmd/trunk/jmdstruktur.json
===================================================================
--- jmd/trunk/jmdstruktur.json 2011-08-25 07:56:52 UTC (rev 5260)
+++ jmd/trunk/jmdstruktur.json 2011-08-26 13:33:16 UTC (rev 5261)
@@ -19,7 +19,9 @@
"logbook": "0",
"privacy": "0",
"copy": "1",
- "casebundle": "0"
+ "casebundle": "0",
+ "tags": "1",
+ "checktags": "1"
},
"phases": {
"changemode": "2",
@@ -151,5 +153,22 @@
{"name": "Netzwerkaktivitäten", "id": "2", "config": "eval_netzwerk.xml"},
{"name": "Gruppenangebote", "id": "3", "config": "eval_gruppenangebote.xml"}
]
+ },
+ "validities": {
+ "enabled": [
+ {
+ "name": "Nicht auswertbar",
+ "id": "0",
+ "tags": [],
+ "icon": "validity-0-22.png"
+ },
+ {
+ "name": "Auswertbar",
+ "id": "1",
+ "tags": [1],
+ "icon": "validity-2-22.png"
+ }
+ ]
}
+
}
Added: jmd/trunk/tagging_struktur.xml
===================================================================
--- jmd/trunk/tagging_struktur.xml 2011-08-25 07:56:52 UTC (rev 5260)
+++ jmd/trunk/tagging_struktur.xml 2011-08-26 13:33:16 UTC (rev 5261)
@@ -0,0 +1,45 @@
+<checks>
+ <!-- Dummytag. Jede Fallakte braucht derzeit einen Tag -->
+ <check tagid="0">
+ <name>Alle</name>
+ <desc>Jede Fallakte hat einen Tag</desc>
+ <addtag>
+ <sql>SELECT id from ( %(table)s ) m</sql>
+ </addtag>
+ <deltag>
+ <sql>SELECT id from ( %(table)s ) m</sql>
+ </deltag>
+ </check>
+
+ <!-- Es darf nur eine Fallakte pro Jahr angelegt werden -->
+ <check tagid="1">
+ <name>Alle</name>
+ <desc>Es darf nur eine Fallakte pro Jahr angelegt werden</desc>
+ <addtag>
+ <sql>SELECT id from ( %(table)s ) m
+ WHERE (datum_begin_zeitraum IS NOT NULL)
+ AND (datum_begin_zeitraum != '0001-01-01'::date)
+ AND (datum_ende_zeitraum IS NOT NULL)
+ AND (datum_ende_zeitraum != '0001-01-01'::date)
+ AND (SELECT COUNT(1) = 0
+ FROM master_tbl_view JOIN nm_tags_cases_view
+ ON nm_tags_cases_view.case_id = master_tbl_view.id
+ WHERE master_tbl_view.id IN (%(master_id)s)
+ AND nm_tags_cases_view.tag_id = 1
+ )
+ AND (SELECT COUNT(1) = 1
+ FROM master_tbl_view JOIN ka_status_tbl_view
+ ON master_tbl_view.id = ka_status_tbl_view.master_id
+ WHERE date_trunc('year', datum_begin_zeitraum::date) = (SELECT date_trunc('year', datum_begin_zeitraum)
+ FROM master_tbl_view
+ WHERE master_tbl_view.id IN (%(master_id)s))
+ AND ka_status_tbl_view.status = 1
+ )
+ </sql>
+ </addtag>
+ <deltag>
+ <sql>SELECT id from ( %(table)s ) m</sql>
+ </deltag>
+ </check>
+
+</checks>
More information about the Mpuls-commits
mailing list