[Mpuls-commits] r1508 - in wasko/branches/2.0: mpulsweb/controllers waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Feb 11 10:26:31 CET 2010
Author: torsten
Date: 2010-02-11 10:26:29 +0100 (Thu, 11 Feb 2010)
New Revision: 1508
Added:
wasko/branches/2.0/mpulsweb/controllers/repeatgroup.py
Removed:
wasko/branches/2.0/waskaweb/controllers/repeatgroup.py
Log:
Moved reapeatgroup controller to mpuls base.
Copied: wasko/branches/2.0/mpulsweb/controllers/repeatgroup.py (from rev 1507, wasko/branches/2.0/waskaweb/controllers/repeatgroup.py)
Property changes on: wasko/branches/2.0/mpulsweb/controllers/repeatgroup.py
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: wasko/branches/2.0/waskaweb/controllers/repeatgroup.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/repeatgroup.py 2010-02-11 09:21:11 UTC (rev 1507)
+++ wasko/branches/2.0/waskaweb/controllers/repeatgroup.py 2010-02-11 09:26:29 UTC (rev 1508)
@@ -1,86 +0,0 @@
-import logging
-
-from pylons import session, c, g
-from pylons.i18n import _
-from pylons.controllers.util import abort
-
-from formed.instance.backends.postgres import DBFactory as InstanceFactory
-
-from mpulsweb.lib.base import BaseController, render
-import mpulsweb.lib.helpers as h
-from mpulsweb.lib.db import PostgresDBInterface
-from mpulsweb.lib.navigation import get_navigation
-from mpulsweb.controllers.formularpage import FormularpageController
-
-log = logging.getLogger(__name__)
-
-
-DELETE_RG_ENTRY_CONFIRM = u"""Datensatz löschen?"""
-DELETE_RG_ENTRY_CONFIRM_TEXT = u"""\
-Wollen Sie wirklich diesen Datensatz löschen und die Daten
-unwiederbringlich verlieren?"""
-
-
-class RepeatgroupController(BaseController):
-
- def list(self, id):
- """List rg-pages as overview page"""
- pass
-
- def select(self, id):
- """Switch between rg in embedded rg"""
- # Currently this function is not needed as we do not support
- # navigationable repeatgroups
- return FormularpageController().select(session.get('navigation'
- '.selectedpage'))
-
- def delete(self, id, confirmed='0'):
- """Delete rg"""
- if confirmed == '1':
- factory = InstanceFactory(g.formedTree, PostgresDBInterface())
- instance_tree = factory.loadInstanceTreeByIdentifier(
- session['case'].id,
- session.get('uncommited_fields'))
- rg = instance_tree.getItem(id)
- if not rg:
- abort(404, _('Repeat group not found.'))
- try:
- rg.getParent().deleteInstance(rg)
- except:
- c.status_msg = h.status_message(u"Fehler beim Löschen"
- u" des Datensatzes.")
-
- # Build new Navigation
- navigation = get_navigation(session['case'].id,
- session['navigation.openfolders'])
- session['navigation.tree'] = navigation
- session.save()
- c.status_msg = h.status_message(u"Datensatz wurde erfolgreich"
- u" gelöscht.")
- return FormularpageController().select(session.get('navigation'
- '.selectedpage'))
- else:
- c.confirm_for = DELETE_RG_ENTRY_CONFIRM
- c.question = DELETE_RG_ENTRY_CONFIRM_TEXT
- c.url_yes = "/repeatgroup/delete/%s/1" % id
- c.url_no = "/formularpage/select/%s" % session['case'].getPageId()
- return render('/repeatgroup/dialogs/confirm_delete_rg_entry.mako')
-
- def new(self, id):
- """New rg"""
- factory = InstanceFactory(g.formedTree, PostgresDBInterface())
- instance_tree = factory.loadInstanceTreeByIdentifier(
- session['case'].id,
- session.get('uncommited_fields'))
- rgcontainer = instance_tree.getItem(id)
- if not rgcontainer:
- abort(404, _('repeat group container not found.'))
- rgcontainer.createInstance()
-
- # Build new Navigation
- navigation = get_navigation(session['case'].id,
- session['navigation.openfolders'])
- session['navigation.tree'] = navigation
- session.save()
- return FormularpageController().select(session.get('navigation'
- '.selectedpage'))
More information about the Mpuls-commits
mailing list