[Mpuls-commits] r840 - in wasko/branches/2.0: . waskaweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Mon Jan 25 17:36:09 CET 2010
Author: bh
Date: 2010-01-25 17:36:06 +0100 (Mon, 25 Jan 2010)
New Revision: 840
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/waskaweb/model/agencysettings.py
wasko/branches/2.0/waskaweb/model/case.py
wasko/branches/2.0/waskaweb/model/statement.py
Log:
* waskaweb/model/case.py (getAidPlanStatement),
waskaweb/model/agencysettings.py (Agency.getAidPlanStatement),
waskaweb/model/statement.py (AidPlanStatement): Removed. Aid
plans are not used in WASKO.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-01-25 16:07:52 UTC (rev 839)
+++ wasko/branches/2.0/ChangeLog 2010-01-25 16:36:06 UTC (rev 840)
@@ -1,5 +1,12 @@
2010-01-25 Bernhard Herzog <bh at intevation.de>
+ * waskaweb/model/case.py (getAidPlanStatement),
+ waskaweb/model/agencysettings.py (Agency.getAidPlanStatement),
+ waskaweb/model/statement.py (AidPlanStatement): Removed. Aid
+ plans are not used in WASKO.
+
+2010-01-25 Bernhard Herzog <bh at intevation.de>
+
* waskaweb/model/case.py (_createDependencies)
(_createTablesForImport, _fetchKundennummerFromPDF, _caseExists):
Removed. Unused.
Modified: wasko/branches/2.0/waskaweb/model/agencysettings.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/agencysettings.py 2010-01-25 16:07:52 UTC (rev 839)
+++ wasko/branches/2.0/waskaweb/model/agencysettings.py 2010-01-25 16:36:06 UTC (rev 840)
@@ -103,12 +103,6 @@
except: pass
return unicode(statement, 'utf-8')
- def getAidPlanStatement(self):
- form = self.conf.get('fp_formular', '')
- if len(form) > 0:
- return unicode(form, 'utf-8')
- return self._loadDefaultStatement(get_path('formed','aid_plan_statement.html'))
-
def getPrivacyStatement(self):
form = self.conf.get('ee_formular', '')
if len(form) > 0:
Modified: wasko/branches/2.0/waskaweb/model/case.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/case.py 2010-01-25 16:07:52 UTC (rev 839)
+++ wasko/branches/2.0/waskaweb/model/case.py 2010-01-25 16:36:06 UTC (rev 840)
@@ -60,8 +60,7 @@
from waskaweb.model.agencysettings import Agency
from waskaweb.model.repeatgroup import AidList, CREATE_RG_BILDEN_DS,\
CREATE_RG_LEBEN_DS, CREATE_RG_QUALI_DS, CREATE_RG_BERUF_DS
-from waskaweb.model.statement import PrivacyStatement, AidPlanStatement, \
- DiscretionStatement
+from waskaweb.model.statement import PrivacyStatement, DiscretionStatement
from waskaweb.model.document import listDocuments
from waskaweb.model.phase_transition import phase_description, phase_end, \
CM_START, CLEAR_START, CLEAR_ENDE
@@ -957,23 +956,6 @@
raise
return None
- def getAidPlanStatement(self):
- """Returns the aid plan statement of the case"""
- if not self.aidplan_statement is None:
- return self.aidplan_statement
- try:
- # Create aidplan statement
- rg_list = AidList(self.id)
- self.aidplan_statement = AidPlanStatement(self.id)
- self.aidplan_statement.fillout(client=self.getDigest(),
- agency=Agency(),
- rg_list=rg_list.getDatasets())
- return self.aidplan_statement
- except:
- self.aidplan_statement = None
- raise
- return None
-
def getDocuments(self):
"""Returns a list of documents which are attached to this case"""
try:
Modified: wasko/branches/2.0/waskaweb/model/statement.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/statement.py 2010-01-25 16:07:52 UTC (rev 839)
+++ wasko/branches/2.0/waskaweb/model/statement.py 2010-01-25 16:36:06 UTC (rev 840)
@@ -157,51 +157,5 @@
finally:
db.recycleConnection(conn, cur)
-class AidPlanStatement(Statement):
- def __init__(self, id=None):
- Statement.__init__(self, id)
- def fillout(self, client, agency, **kwargs):
- list = self._buildAidList(kwargs.get('rg_list', []))
- tmpl = agency.getAidPlanStatement()
- self.template = Template(tmpl)
- self.content = self._substitute(client, agency, list)
- return self.content
-
- def _buildAidList(self, rg_list):
- out = []
- out.append(u'<table width="100%">\n<tr>')
- out.append(u'<th width="100">Von</th>')
- out.append(u'<th width="100">Bis</th>')
- out.append(u'<th>Institution</th>')
- out.append(u'<th>Art der Unterstützung</th>')
- out.append(u'<th>Angebotsform</th>')
- out.append(u"</tr>")
- if len(rg_list) <= 0:
- out.append(u'<tr><td colspan="4">Keine Angebote gefunden</td></tr>')
- else:
- for rg in rg_list:
- out.append(u"""<tr style="border:0">""")
- out.append(u"""<td style="border:0">%s</td>""" % escape(F.NA(rg.start_date)))
- out.append(u"""<td style="border:0">%s</td>""" % escape(F.NA(rg.end_date)))
- out.append(u"""<td style="border:0">%s</td>""" % escape(F.NA(rg.institution)))
- out.append(u"""<td style="border:0">%s</td>""" % escape(F.NA(rg.type)))
- out.append(u"""<td style="border:0">%s</td>""" % escape(F.NA(rg.category)))
- out.append(u"</tr>")
- out.append(u"""<tr><td colspan="5">Zielsetzung: %s</tr>""" % escape(F.NA(rg.goal)))
- out.append(u"</table>")
- out.append(u"""<div class="legend">
- Legende: <strong>(BB)</strong>: Allgemein bildenden Bereich <strong>(BV)</strong>: Bereich der Berufsvorbereitung <strong>(BQ)</strong>: Berufliche Qualifizierung <strong>(LB)</strong>: Lebensbewältigung</div>""")
- return u"\n".join(out)
-
- def _substitute(self, client, agency, list):
- # Substitution dictionary
- s = {
- 'VORNAME' : escape(client.first_name),
- 'NACHNAME': escape(client.last_name),
- 'ANGEBOTE': list
- }
- result = self.template.safe_substitute(s)
- return result
-
# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8:
More information about the Mpuls-commits
mailing list