[Mpuls-commits] r2371 - in wasko/branches/2.0/jmdweb: controllers model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 15 12:30:04 CEST 2010


Author: torsten
Date: 2010-04-15 12:30:03 +0200 (Thu, 15 Apr 2010)
New Revision: 2371

Removed:
   wasko/branches/2.0/jmdweb/controllers/jmd.py
   wasko/branches/2.0/jmdweb/model/appointment.py
Log:
Deleted. Special logic can now be configured in base.


Deleted: wasko/branches/2.0/jmdweb/controllers/jmd.py
===================================================================
--- wasko/branches/2.0/jmdweb/controllers/jmd.py	2010-04-15 10:27:27 UTC (rev 2370)
+++ wasko/branches/2.0/jmdweb/controllers/jmd.py	2010-04-15 10:30:03 UTC (rev 2371)
@@ -1,21 +0,0 @@
-import logging
-
-from mpulsweb.model.appointment import CaseReminderOverview
-from jmdweb.model.appointment import MaxSaveTimeReminderOverview
-import mpulsweb.lib.helpers as h
-from mpulsweb.controllers.mpuls import MpulsController
-
-log = logging.getLogger(__name__)
-
-class JmdController(MpulsController):
-
-    def get_reminders(self):
-        """Return an AppointmentOverview instance with reminders.
-        The overview always contains the max save time reminders. For case
-        managers it also contains the case reminders.
-        """
-        remindlist = MaxSaveTimeReminderOverview()
-        if h.hasRole(['cm']):
-            remindlist.join(CaseReminderOverview())
-            remindlist.sort()
-        return remindlist

Deleted: wasko/branches/2.0/jmdweb/model/appointment.py
===================================================================
--- wasko/branches/2.0/jmdweb/model/appointment.py	2010-04-15 10:27:27 UTC (rev 2370)
+++ wasko/branches/2.0/jmdweb/model/appointment.py	2010-04-15 10:30:03 UTC (rev 2371)
@@ -1,121 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-#
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
-# Web-Anwendungs-Server fuer Kompetenzagenturen).
-#
-# mpuls WASKA is free software: you can redistribute it and/or modify it under
-# the terms of the GNU Affero General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
-# License for more details.
-#
-# You should have received a copy of the GNU Affero General Public
-# License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-#
-# mpuls WASKA has been developed on behalf of the
-# Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
-# within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
-# European Social Fund resources.
-#
-# Authors:
-# Torsten Irländer <torsten.irlaender at intevation.de>
-#
-
-from mpulsweb.lib.base import session, g
-from mpulsweb.lib.db import db
-from mpulsweb.model.appointment import MaxSaveTimeReminderOverview as \
-    MpulsMaxSaveTimeReminderOverview
-
-GET_OLDACTIVE_CASES_4_ADMIN = """
-SELECT m.id, s.zugriff, getLastCaseAppointment(m.id) AS last_date
-FROM
-  (SELECT * FROM ka_status_tbl_view
-   WHERE zugriff < now() - interval '1 day' * %%(maxdays)s AND status <> 5) s
-   JOIN master_tbl_view m ON m.id = s.master_id
-WHERE phase in (%s)
-AND extract(year from age(geburtsdatum)) >= 27
-"""
-
-GET_OLDACTIVE_CASES = """
-SELECT m.id, s.zugriff, getLastCaseAppointment(m.id) AS last_date
-FROM
-  (SELECT * FROM ka_status_tbl_view
-   WHERE zugriff < now() - interval '1 day' * %%(maxdays)s 
-   AND status <> 5) s
-   JOIN master_tbl_view m ON m.id = s.master_id
-WHERE phase in (%s) AND m.bearbeiter_id = %%(editor)s
-AND extract(year from age(geburtsdatum)) >= 27
-"""
-
-GET_OLDFINISHED_CASES_4_ADMIN = """\
-SELECT m.id, s.zugriff, getLastCaseAppointment(m.id) as last_date
-FROM master_tbl_view m JOIN ka_status_tbl_view s ON s.master_id = m.id
-WHERE s.status <> 5
-      AND extract(year from age(geburtsdatum)) >= 27
-      AND extract(day from now()-s.zugriff) > %%(maxdays)s
-      AND phase in (%s)
-"""
-
-GET_OLDFINISHED_CASES = """\
-SELECT m.id, s.zugriff, getLastCaseAppointment(m.id) as last_date
-FROM master_tbl_view m JOIN ka_status_tbl_view s ON s.master_id = m.id
-WHERE s.status <> 5
-      AND m.bearbeiter_id = %%(editor)s
-      AND extract(year from age(geburtsdatum)) >= 27
-      AND extract(day from now()-s.zugriff) > %%(maxdays)s
-      AND phase in (%s)
-"""
-
-class MaxSaveTimeReminderOverview(MpulsMaxSaveTimeReminderOverview):
-
-    def getOldAndFinishedCases(self, days, user):
-        conn, cur = None, None
-        list = {}
-        try:
-            conn = db.getConnection()
-            cur = conn.cursor()
-            if user.isAdmin():
-                sql = (GET_OLDFINISHED_CASES_4_ADMIN
-                       % ",".join(g.mpuls_config.get('phases', 'finished')))
-                cur.execute(sql,
-                            {'maxdays': days})
-            else:
-                sql = (GET_OLDFINISHED_CASES
-                       % ",".join(g.mpuls_config.get('phases', 'finished')))
-                cur.execute(sql, {'maxdays': days, 'editor': user.id})
-            result = cur.fetchall()
-            for r in result:
-                list[r[0]] = {'access':r[1], 'last_date': r[2]}
-            return list
-        finally:
-            db.recycleConnection(conn, cur)
-        return False
-
-    def getOldAndActiveCases(self, days, user):
-        conn, cur = None, None
-        list = {}
-        try:
-            conn = db.getConnection()
-            cur = conn.cursor()
-            if user.isAdmin():
-                sql = (GET_OLDACTIVE_CASES_4_ADMIN
-                       % ",".join(g.mpuls_config.get('phases', 'active')))
-                cur.execute(sql, {'maxdays': days, 'editor': user.id})
-            else:
-                sql = (GET_OLDACTIVE_CASES
-                       % ",".join(g.mpuls_config.get('phases', 'active')))
-                cur.execute(sql, {'maxdays': days, 'editor': user.id})
-            result = cur.fetchall()
-            for r in result:
-                list[r[0]] = {'access':r[1], 'last_date': r[2]}
-            return list
-        finally:
-            db.recycleConnection(conn, cur)
-        return False



More information about the Mpuls-commits mailing list