[Mpuls-commits] r1739 - in wasko/branches/2.0: . waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Feb 24 11:58:54 CET 2010
Author: torsten
Date: 2010-02-24 11:58:53 +0100 (Wed, 24 Feb 2010)
New Revision: 1739
Removed:
wasko/branches/2.0/waskaweb/controllers/phase.py
Modified:
wasko/branches/2.0/ChangeLog
Log:
Removed old phasecontroller from waskaweb
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-02-24 10:57:21 UTC (rev 1738)
+++ wasko/branches/2.0/ChangeLog 2010-02-24 10:58:53 UTC (rev 1739)
@@ -26,6 +26,7 @@
* mpulsweb/controllers/phase.py,
jmdweb/controllers/phase.py: Moved phasecontroller to mpulsbase
+ * waskaweb/controllers/phase.py: Deleted old phase controller
2010-02-24 Bernhard Herzog <bh at intevation.de>
Deleted: wasko/branches/2.0/waskaweb/controllers/phase.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/phase.py 2010-02-24 10:57:21 UTC (rev 1738)
+++ wasko/branches/2.0/waskaweb/controllers/phase.py 2010-02-24 10:58:53 UTC (rev 1739)
@@ -1,116 +0,0 @@
-# -*- coding: utf-8 -*-
-import logging
-
-from pylons import session, g, c
-
-from mpulsweb.lib.security import checkRole
-from mpulsweb.model.phase import PhaseFactory
-
-from waskaweb.lib.base import BaseController, h, render, request
-
-SET_PHASE_NOTIFICATION_SUCCESS = u"""Phase gewechselt!"""
-SET_PHASE_NOTIFICATION_TEXT_SUCCESS= u"""\
-Die Phase konnte erfolgreich gewechselt werden. Bitte folgen Sie den
-aufgeführten Schritten, um zur Phasenübersicht fortzufahren."""
-
-log = logging.getLogger(__name__)
-
-class PhaseController(BaseController):
-
- @checkRole(('admin_ka', 'cm_ka'))
- def index(self, id):
- return self.overview(id)
-
- @checkRole(('admin_ka', 'cm_ka'))
- def overview(self, id):
- id = self._checkInt(id)
- c.phases = PhaseFactory().load(id)
- return render('/phase/phase.mako')
-
- # Old methods from controllers.case.
- # TODO: Reimplement these functions using the new libformed
-
- #@checkRole(('admin_ka', 'cm_ka'))
- #def phase(self, id):
- # id = self._checkInt(id)
- # case = self._loadCase(id)
- # phase = case.getState().getPhase()
-
- # # FIXME: the links generated by link are very likely wrong.
- # # They should point to formularpage/select.
- # link = lambda ti, extra = "": '"/case/show/%d/%s%s"' % (id, ti.key,
- # extra)
-
- # rf = RequiredFields(g.formedTree)
-
- # navigation = self.getNavigation()
-
- # c.phase_pairs = rf.phases_pairs(phase, navigation, link)
- # c.current_phase = Phase(phase, True)
-
- # D = g.formedTree.getData
- # nbtr = int(D('nbtr'))
- # abbr = int(D('cm_end_art'))
- # c.nachbetreuung_geplant = nbtr not in [1,-1,-3] and abbr != 3
-
- # c.global_warnings = g.formedTree.linksToGlobalWarnings(id, navigation,
- # link)
- # return render('/casemanagement/phase.mako')
-
- #@checkRole(('cm_ka'))
- #def setPhaseAction(self):
- # validator = SetPhaseForm()
- # factory = CaseFactory()
- # c.form_errors = {}
- # c.form_result = {}
- # try:
- # try:
- # form_result = validator.to_python(request.params)
- # # Load case and do something on phase
- # case = factory.loadById(form_result.get('case_id'))
-
- # new_phase, new_phase_symbol = None, None
-
- # for new_phase_symbol in request.params.iterkeys():
- # try:
- # new_phase = symbol_phase(new_phase_symbol)
- # break
- # except KeyError:
- # pass
-
- # if new_phase is None:
- # raise StandardError("Phase nicht gefunden.")
-
- # state = case.getState()
-
- # current_phase = state.getPhase()
-
- # #if not phase_neighbors(current_phase, new_phase):
- # # raise StandardError("Phasen sind nicht benachbart.")
-
- # case_session = session.get('case')
-
- # #if case_session.isYoungerThan(INCONSISTENCY_CHECK_AFTER):
- # # fields = case.getRequiredFields()
- # # if not fields.isPhaseComplete(new_phase_symbol):
- # # raise StandardError("Phase ist nicht komplett.")
-
- # state.setPhase(new_phase)
-
- # case_session.state = state
- # session.save()
-
- # # After setting the phase. Show print-dialog
- # c.success_for = SET_PHASE_NOTIFICATION_SUCCESS
- # c.success_text = SET_PHASE_NOTIFICATION_TEXT_SUCCESS
- # c.url_ok = h.url_for(controller='/case', action='phase',
- # id=case.id)
-
- # return render('/casemanagement/dialogs/success_set_phase.mako')
- # except formencode.Invalid, error:
- # c.form_result = error.value
- # c.form_errors = error.error_dict or {}
- # return self.phase(form_result.get('case_id'))
- # except:
- # return render('/tests/trace.mako')
-
More information about the Mpuls-commits
mailing list