[Mpuls-commits] r2044 - wasko/branches/2.0/jmdweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Mar 19 15:43:59 CET 2010
Author: torsten
Date: 2010-03-19 15:43:56 +0100 (Fri, 19 Mar 2010)
New Revision: 2044
Modified:
wasko/branches/2.0/jmdweb/model/case.py
Log:
* jmdweb/model/case.py (State): Delete unused function working which
the old phasemodell.
Modified: wasko/branches/2.0/jmdweb/model/case.py
===================================================================
--- wasko/branches/2.0/jmdweb/model/case.py 2010-03-19 14:35:19 UTC (rev 2043)
+++ wasko/branches/2.0/jmdweb/model/case.py 2010-03-19 14:43:56 UTC (rev 2044)
@@ -55,11 +55,7 @@
#from jmdweb.lib.xmlexport import exportAsXML
from jmdweb.model.statement import PrivacyStatement, DiscretionStatement
-from jmdweb.model.phase_transition import phase_description, phase_end, \
- CM_START, CLEAR_START, CLEAR_ENDE
-from jmdweb.model.phases_factory import RequiredFields
-
log = logging.getLogger(__name__)
@@ -488,60 +484,6 @@
desc.append(_('Finished'))
return " ".join(desc)
- def phasesAreConsistent(self):
- """Returns True when the required fields for the current phase are
- complete and there are no other inconsistencys. Else False"""
- #case = g.case_factory.loadById(self.master_id) # Ugly we need to load the case here :(
- cf = self.getPhase()
- rf = RequiredFields(g.formedTree)
- p_pairs = rf.phases_pairs(cf, master_id=self.master_id)
-
- for pair in p_pairs:
- p1, p2 = pair.getStart(), pair.getEnd()
- # Find current phase
- if p1.isRunning() and not p1.isRecursiveComplete():
- return False
- elif p2.isRunning() and not p2.isRecursiveComplete():
- return False
-
- # Deaktiviert, da noch keine weiteren Inkonsistezen geprüft (bekannt
- # sind)) werden
- # Check other inconsistency
- # Search all cases with are inconsistent and then check if the current case is among them
- #user = session['USER_AUTHORIZED']
- #search_str = "state:1;state:2;state:4;state:5;bad:1;bad:2;bad:3;bad:4;bad:5;bad:6;bad:7;own:%s;standin:%s" % (user.id, user.id)
- #error_cases = Set(c.id for c in CaseOverview().search(search_str))
- #if case.id in error_cases: return False
- return True
-
- def phasesAreCompleted(self):
- """Returns True if the required fields for the ending of the
- current phase pair are completed and the phase ist finished.
- Else False."""
- cf = self.getPhase()
- rf = RequiredFields(g.formedTree)
- current_phase = rf.currentPhase(cf, master_id=self.master_id)
-
- # WASKO requires a special handling of CM_START:
- # - if CM_START is completed and
- # - cm_end_art == 3 (Abbruch) and
- # - datum_cm_ende is set.
- if cf == CM_START:
- if (current_phase.isRecursiveComplete()
- and g.formedTree.getData('cm_end_art', self.master_id) == 3
- and g.formedTree.getData('datum_cm_ende', self.master_id)
- and (str(g.formedTree.getData('datum_cm_ende', self.master_id))
- != '0001-01-01')):
- return True
- else:
- return False
- elif cf == CLEAR_START or cf == CLEAR_ENDE:
- return False
- elif phase_end(cf) and current_phase.isRecursiveComplete():
- return True
- else:
- return False
-
def getAccessTime(self):
return self.access
More information about the Mpuls-commits
mailing list