[Mpuls-commits] r1084 - wasko/branches/2.0/waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 1 16:32:58 CET 2010


Author: torsten
Date: 2010-02-01 16:32:57 +0100 (Mon, 01 Feb 2010)
New Revision: 1084

Modified:
   wasko/branches/2.0/waskaweb/controllers/case.py
Log:
* waskaweb/controllers/case.py 
  (CaseController.phase, CaseController.setPhaseAction): Deleted
  unused functions. Are not called from anywhere now.


Modified: wasko/branches/2.0/waskaweb/controllers/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/case.py	2010-02-01 15:24:23 UTC (rev 1083)
+++ wasko/branches/2.0/waskaweb/controllers/case.py	2010-02-01 15:32:57 UTC (rev 1084)
@@ -676,90 +676,6 @@
         c.appointmentlist = CaseAppointmentOverview(id)
         return render('/casemanagement/appointments.mako')
 
-    @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')
-
     @checkRole('cm_ka')
     @checkPrivacyStatement('keepActive')
     def keepActive(self, id, confirmed):



More information about the Mpuls-commits mailing list