[Mpuls-commits] r4308 - in wasko/trunk: . waskoweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Dec 2 15:29:16 CET 2010


Author: roland
Date: 2010-12-02 15:29:15 +0100 (Thu, 02 Dec 2010)
New Revision: 4308

Modified:
   wasko/trunk/ChangeLog
   wasko/trunk/waskoweb/model/appointment.py
Log:
issue1535: show automatic reminders only for editable cases

Modified: wasko/trunk/ChangeLog
===================================================================
--- wasko/trunk/ChangeLog	2010-12-02 11:47:23 UTC (rev 4307)
+++ wasko/trunk/ChangeLog	2010-12-02 14:29:15 UTC (rev 4308)
@@ -1,3 +1,8 @@
+2010-12-02  Roland Geider <roland.geider at intevation.de>
+
+	* waskoweb/model/appointment.py: issue1535: don't show the automatic
+	  reminders for cases that are pending deletion or anonymisation
+
 2010-11-25  Torsten Irlaender <torsten at intevation.de>
 
 	* tagging.xml: New tagging config.

Modified: wasko/trunk/waskoweb/model/appointment.py
===================================================================
--- wasko/trunk/waskoweb/model/appointment.py	2010-12-02 11:47:23 UTC (rev 4307)
+++ wasko/trunk/waskoweb/model/appointment.py	2010-12-02 14:29:15 UTC (rev 4308)
@@ -37,37 +37,45 @@
 from mpulsweb.model.appointment import AppointmentOverview, CaseAppointmentFactory
 from mpulsweb.controllers.case_overview import default_phases
 
+
+# Get cases with long extensions only for working status.
 GET_MAX_CM_CASES_NO_EXTENSIONS = """
-SELECT id,
+SELECT master.id,
     ABS(extract(day from (datum_cm_start - coalesce(datum_cm_ende,
             now())))) AS dauer
-FROM master_tbl_view
+FROM master_tbl_view master JOIN ka_status_tbl_view status
+ON master.id = status.master_id
 WHERE
-    ABS(extract(day from (datum_cm_start - coalesce(datum_cm_ende,
+    status.status = 1
+    AND ABS(extract(day from (datum_cm_start - coalesce(datum_cm_ende,
             now())))) > 365
     AND cm_datum_verlaengerung_1 IS NULL
     AND cm_datum_verlaengerung_2 IS NULL;
 """
 
 GET_MAX_CM_CASES_1_EXTENSION = """
-SELECT id,
+SELECT master.id,
     ABS(extract(day from (datum_cm_start - coalesce(cm_datum_verlaengerung_1,
             now())))) AS dauer
-FROM master_tbl_view
+FROM master_tbl_view master JOIN ka_status_tbl_view status
+ON master.id = status.master_id
 WHERE
-    ABS(extract(day from (datum_cm_start - coalesce(cm_datum_verlaengerung_1,
+    status.status = 1
+    AND ABS(extract(day from (datum_cm_start - coalesce(cm_datum_verlaengerung_1,
             now())))) > 31*15
     AND cm_datum_verlaengerung_1 IS NOT NULL
     AND cm_datum_verlaengerung_2 IS NULL;
 """
 
 GET_MAX_CM_CASES_2_EXTENSIONS = """
-SELECT id,
+SELECT master.id,
     ABS(extract(day from (datum_cm_start - coalesce(cm_datum_verlaengerung_2,
             now())))) AS dauer
-FROM master_tbl_view
+FROM master_tbl_view master JOIN ka_status_tbl_view status
+ON master.id = status.master_id
 WHERE
-    ABS(extract(day from (datum_cm_start - coalesce(cm_datum_verlaengerung_2,
+    status.status = 1
+    AND ABS(extract(day from (datum_cm_start - coalesce(cm_datum_verlaengerung_2,
             now())))) > 31*18
     AND cm_datum_verlaengerung_1 IS NOT NULL
     AND cm_datum_verlaengerung_2 IS NOT NULL;



More information about the Mpuls-commits mailing list