[Mpuls-commits] r5882 - base/trunk/mpulsweb/controllers

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Mar 8 13:46:38 CET 2012


Author: ludwig
Date: 2012-03-08 13:46:38 +0100 (Thu, 08 Mar 2012)
New Revision: 5882

Modified:
   base/trunk/mpulsweb/controllers/administration.py
   base/trunk/mpulsweb/controllers/appointment.py
   base/trunk/mpulsweb/controllers/case.py
   base/trunk/mpulsweb/controllers/case_bundle.py
   base/trunk/mpulsweb/controllers/caseappointment.py
   base/trunk/mpulsweb/controllers/casedocument.py
   base/trunk/mpulsweb/controllers/document.py
   base/trunk/mpulsweb/controllers/evaluation_overview.py
   base/trunk/mpulsweb/controllers/formularpage.py
   base/trunk/mpulsweb/controllers/logbook.py
   base/trunk/mpulsweb/controllers/meta.py
   base/trunk/mpulsweb/controllers/news.py
   base/trunk/mpulsweb/controllers/phase.py
   base/trunk/mpulsweb/controllers/privacy.py
   base/trunk/mpulsweb/controllers/repeatgroup.py
   base/trunk/mpulsweb/controllers/settings.py
   base/trunk/mpulsweb/controllers/usersettings.py
Log:
Issue 2738: Replace url_for (controllers)


Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/administration.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -33,14 +33,14 @@
 import logging
 import formencode
 
-from pylons import request, tmpl_context as c, url
+from pylons import request, tmpl_context as c
 from pylons.controllers.util import redirect
 
 from mpulsweb.lib.translation import _
 
 from mpulsweb.lib.db import db
 from mpulsweb.lib.base import BaseController, render, session
-from mpulsweb.lib.helpers import url_for
+from mpulsweb.lib.helpers import url
 from mpulsweb.lib.security import checkRole, getDbName
 from mpulsweb.lib.validators import ValidatorStateObject, NewUserGroupForm, \
     EditUserGroupForm , NewUserForm, EditUserForm, DeleteUserHelperForm
@@ -141,7 +141,7 @@
             c.uo.store()
             c.dialog_title = _('User configs saved!')
             c.dialog_text = _("Please click okay to continue.")
-            c.url_ok = url_for(controller='/administration',
+            c.url_ok = url(controller='administration',
                                action='overviewUser')
             return render('/administration/dialogs/success_edit_user.mako')
         except formencode.Invalid, error:
@@ -163,9 +163,9 @@
             c.dialog_text = "%s %s, %s" % (_('Confirm reset user password:'),
                                            c.uo.last_name, c.uo.first_name)
 
-            c.url_yes = url_for(controller='/administration',
+            c.url_yes = url(controller='administration',
                                 action='resetUserPassword', id=id, confirmed=1)
-            c.url_no = url_for(controller='/administration',
+            c.url_no = url(controller='administration',
                                action='showUser', id=id)
             return render('/administration/dialogs/confirm_resetpassword.mako')
 
@@ -184,7 +184,7 @@
     #        c.dialog_title = _('User not deleted!')
     #        c.dialog_text = _('Not possible to delete current login user. '
     #                          'Click on okay to continue.')
-    #        c.url_ok = url_for(controller='/administration',
+    #        c.url_ok = url(controller='administration',
     #                           action='overviewUser')
     #        return render('/administration/dialogs/failed_delete_user.mako')
 
@@ -197,7 +197,7 @@
     #                              u'is agent of at least one case.'
     #    u' Please move all cases of this agent to a different agent and repeat'
     #    u' the action. Click on \"OK\" to navigate back to the user overview.')
-    #            c.url_ok = url_for(controller='/administration',
+    #            c.url_ok = url(controller='administration',
     #                               action='overviewUser')
     #            return render('/administration/dialogs/failed_delete_user.mako')
     #        else:
@@ -205,7 +205,7 @@
     #            c.dialog_title =  _('User deleted!')
     #            c.dialog_text = _('User sucessfully deleted. '
     #                              'Click okay to continue.')
-    #            c.url_ok = url_for(controller='/administration',
+    #            c.url_ok = url(controller='administration',
     #                               action='overviewUser')
     #            return render('/administration/dialogs/success_delete_user.mako')
 
@@ -216,9 +216,9 @@
     #          '<strong>%s, %s</strong> (login: %s).') % (uo.last_name,
     #                                                     uo.first_name,
     #                                                     uo.login)
-    #        c.url_yes = url_for(controller='/administration',
+    #        c.url_yes = url(controller='administration',
     #                            action='deleteUser', id=id, confirmed=1)
-    #        c.url_no = url_for(controller='/administration',
+    #        c.url_no = url(controller='administration',
     #                           action='overviewUser')
     #        return render('/administration/dialogs/confirm_deleteuser.mako')
 
@@ -232,7 +232,7 @@
             c.failed_for = _('User not deleted!')
             c.failed_text = _('Not possible to delete current login user.'
                     ' Click on okay to continue.')
-            c.url_ok = url_for(controller='/administration',
+            c.url_ok = url(controller='administration',
                                action='overviewUser')
             return render('/administration/dialogs/failed_delete_user.mako')
 
@@ -263,7 +263,7 @@
                 c.success_for = _('User deleted!')
                 c.success_text = _('User sucessfully deleted. '
                         'Click okay to continue.')
-                c.url_ok = url_for(controller='/administration',
+                c.url_ok = url(controller='administration',
                                    action='overviewUser')
                 return render('/administration/dialogs/'
                               'success_delete_user.mako')
@@ -275,9 +275,9 @@
               '<strong>%s, %s</strong> (login: %s).') % (uo.last_name,
                                                          uo.first_name,
                                                          uo.login)
-            c.url_yes = url_for(controller='/administration',
+            c.url_yes = url(controller='administration',
                                 action='deleteUser', id=id, confirmed=1)
-            c.url_no = url_for(controller='/administration',
+            c.url_no = url(controller='administration',
                                action='overviewUser')
             return render('/administration/dialogs/confirm_deleteuser.mako')
 
@@ -309,7 +309,7 @@
                                  'state:5' % del_user.id)
                 num = case_bundle.setEditor(form_result.get('editor'))
                 rest = all_cases.numDatasets() - case_bundle.numDatasets()
-                c.url_ok = url_for(controller='/administration',
+                c.url_ok = url(controller='administration',
                                    action='deleteUser',
                                    id=form_result.get('user_id'), confirmed=1)
                 c.success_for = _('Case document assigned!')
@@ -366,7 +366,7 @@
             c.dialog_text =  _(u'User group successfully created. '
                     u'Please click on OK to continue to the'
                     u' user group overview')
-            c.url_ok = url_for(controller='/administration',
+            c.url_ok = url(controller='administration',
                                action='overviewUserGroups')
             return render('/administration/dialogs/success_new_usergroup.mako')
         except formencode.Invalid, error:
@@ -382,7 +382,7 @@
             c.dialog_title = _('Failed to create user group!')
             c.dialog_text =  _('Failed to create the user group.'
   ' Please click on OK to continue in the user overview.')
-            c.url_ok = url_for(controller='/administration',
+            c.url_ok = url(controller='administration',
                                action='overviewUserGroups')
             return render('/administration/dialogs/failed_new_usergroup.mako')
 
@@ -437,7 +437,7 @@
             c.dialog_text = _('The user group was successfully edited. '
                     'Please click on OK '
                     'to continue in the user group overview.')
-            c.url_ok = url_for(controller='/administration',
+            c.url_ok = url(controller='administration',
                                action='overviewUserGroups')
             return render('/administration/dialogs/success_edit_usergroup.mako')
         except formencode.Invalid, error:
@@ -461,7 +461,7 @@
                 c.dialog_title = _('User group deleted!')
                 c.dialog_text =  _('The user group was successfully deleted.'
     ' Please click on OK to continue in the user group overview.')
-                c.url_ok = url_for(controller='/administration',
+                c.url_ok = url(controller='administration',
                                    action='overviewUserGroups')
                 return render('/administration/dialogs/'
                               'success_deletegroup_user.mako')
@@ -470,10 +470,10 @@
                 c.dialog_title = _('Delete user group?')
                 c.dialog_text =  _('Do you want to delete the user group and '
                         'lose the data?')
-                c.url_yes = url_for(controller='/administration',
+                c.url_yes = url(controller='administration',
                                     action='deleteUserGroup', id=ugo.id,
                                     confirmed=1)
-                c.url_no = url_for(controller='/administration',
+                c.url_no = url(controller='administration',
                                    action='overviewUserGroups')
                 return render('/administration/dialogs/'
                               'confirm_deleteusergroup.mako')
@@ -483,7 +483,7 @@
             c.dialog_text = _('Deletion of the user group failed. '
                     'Please click on OK to continue'
                     ' in the user group overview.')
-            c.url_ok = url_for(controller='/administration',
+            c.url_ok = url(controller='administration',
                                action='overviewUserGroups')
             return render('/administration/dialogs/failed_new_usergroup.mako')
 

Modified: base/trunk/mpulsweb/controllers/appointment.py
===================================================================
--- base/trunk/mpulsweb/controllers/appointment.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/appointment.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -31,7 +31,6 @@
 import logging
 from datetime import datetime
 
-from pylons import url
 from pylons.controllers.util import redirect
 
 import formencode
@@ -39,7 +38,7 @@
 from mpulsweb.lib.translation import _, ungettext
 
 from mpulsweb.lib.base import BaseController, c, render, request
-from mpulsweb.lib.helpers import url_for, dd_mm_YYYY, HH_MM
+from mpulsweb.lib.helpers import url, dd_mm_YYYY, HH_MM
 from mpulsweb.lib.security import checkRole
 from mpulsweb.model.appointment import GlobalAppointmentOverview, \
      GlobalAppointmentFactory
@@ -87,7 +86,7 @@
             c.dialog_text = _(u"The appointment was successfully created.") + \
                     " "  + \
                     _("Please click OK to continue to the appointment overview")
-            c.url_ok = url_for(controller='/appointment', action='overview')
+            c.url_ok = url(controller='appointment', action='overview')
             return render('/appointments/dialogs/success_create_appointment.mako')
         except formencode.Invalid, error:
             c.form_result = error.value
@@ -141,7 +140,7 @@
             c.dialog_text = _(u"The appointment was successfully edited") + \
                     " " + \
                     _("Please click OK to continue to the appointment overview")
-            c.url_ok = url_for(controller='/appointment', action='overview')
+            c.url_ok = url(controller='appointment', action='overview')
             return render('/appointments/dialogs/success_edit_appointment.mako')
         except formencode.Invalid, error:
             c.form_result = error.value
@@ -164,16 +163,16 @@
             c.dialog_text = _(u"The appointment was successfully deleted.") + \
                    " " + \
                    _("Please click OK to continue to the appointment overview")
-            c.url_ok = url_for(controller='/appointment', action='overview')
+            c.url_ok = url(controller='appointment', action='overview')
             return render('/appointments/dialogs/success_delete_appointment.mako')
         else:
             c.context = "../main.mako"
             c.dialog_title = _(u'Delete appointment?')
             c.dialog_text = _(u"Do you really want to delete the appointment"
                               u"\nand irrevocably lose all the data?")
-            c.url_yes = url_for(controller='/appointment', action='delete',
+            c.url_yes = url(controller='appointment', action='delete',
                                 id=id, confirmed=1)
-            c.url_no = url_for(controller='/appointment', action='overview')
+            c.url_no = url(controller='appointment', action='overview')
             return render('/appointments/dialogs/confirm.mako')
 
     @checkRole(('admin', 'cm', 'pt_dlr'))

Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/case.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -105,7 +105,7 @@
             c.dialog_title = _("Case document deleted!")
             c.dialog_text = _("The case document is given to the administrator"
                               " for deletion.")
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             session['render_mode'] = 'ro'
             session.save()
             return render('/casemanagement/dialogs/success_delete_cm.mako')
@@ -118,9 +118,9 @@
                               " for deletion.<br>") \
                             % "\n".join(build_case_list([case]))
 
-            c.url_yes = h.url_for(controller='/case', action='markForDelete',
+            c.url_yes = h.url(controller='/case', action='markForDelete',
                                   id=id, confirmed=1)
-            c.url_no = h.url_for(controller='/case_overview')
+            c.url_no = h.url(controller='/case_overview', action='index')
             return render('/casemanagement/dialogs/confirm.mako')
 
     @checkRole('admin')
@@ -139,9 +139,9 @@
                               "<br><br>Do you want to delete the case "
                               "from the server?%s<br>") \
                             % "\n".join(build_case_list([case]))
-            c.url_yes = h.url_for(controller='/case', action='delete',
+            c.url_yes = h.url(controller='/case', action='delete',
                                   id=id, confirmed=1)
-            c.url_no = h.url_for(controller='/case_overview')
+            c.url_no = h.url(controller='/case_overview')
             return render('/casemanagement/dialogs/confirm_delete.mako')
 
         try:
@@ -154,7 +154,7 @@
                                     _("The case can not be deleted because"
                                       " of an unexpected problem with the"
                                       " meta server."),
-                                    h.url_for(controller="/case_overview"),
+                                    h.url(controller="case_overview", action='index'),
                                     '/casemanagement/dialogs'
                                     '/failed_delete.mako')
         except Exception:
@@ -162,7 +162,7 @@
             c.dialog_title = _("Case document not deleted!")
             c.dialog_text = _("The case can not be deleted because of an"
                               " unexpected problem.")
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             return render('/casemanagement/dialogs/failed_delete.mako')
 
     def _do_delete_case(self, case):
@@ -173,7 +173,7 @@
         case.delete()
         c.dialog_title = _("Case document deleted!")
         c.dialog_text = _("Click on OK to continue.")
-        c.url_ok = h.url_for(controller="/case_overview")
+        c.url_ok = h.url(controller="case_overview", action='index')
         return render('/casemanagement/dialogs/success_delete.mako')
 
 
@@ -182,13 +182,13 @@
     #
     @checkRole('cm')
     def markForAnonymizeFromOverview(self, id, confirmed):
-        url = h.url_for(controller="/case_overview")
+        url = h.url(controller="case_overview", action='index')
         return self._markForAnonymize(id, confirmed, url)
 
     @checkRole('cm')
     def markForAnonymize(self, id, confirmed):
         check_feature('case-module', 'anonymize')
-        url = h.url_for(controller='/case', action='digest', id=id)
+        url = h.url(controller='/case', action='digest', id=id)
         return self._markForAnonymize(id, confirmed, url)
 
     def _markForAnonymize(self, id, confirmed, url):
@@ -231,7 +231,7 @@
                                u" anonymised in phase </b>%s<b>!</b><br>""") \
                              % ("\n".join(build_case_list([case])),
                                 " ".join(phase_name)))
-            c.url_yes = h.url_for(controller='/case', action='markForAnonymize',
+            c.url_yes = h.url(controller='/case', action='markForAnonymize',
                                   id=id, confirmed=1)
             c.url_no = url
             return render('/casemanagement/dialogs/confirm_markanonymize.mako')
@@ -255,7 +255,8 @@
                                         " meta-case has been removed."
                                         " A second attempt to anonymize the"
                                         " case should succeed."),
-                                      h.url_for(controller="/case_overview"),
+                                      h.url(controller="case_overview",
+                                            action='index'),
                                       '/casemanagement/dialogs'
                                       '/failed_markanonymize.mako')
 
@@ -274,7 +275,8 @@
                                         " meta-case has been removed."
                                         " A second attempt to anonymize the"
                                         " case should succeed."),
-                                      h.url_for(controller="/case_overview"),
+                                      h.url(controller="case_overview",
+                                            action='index'),
                                       '/casemanagement/dialogs'
                                       '/failed_markanonymize.mako')
 
@@ -290,7 +292,8 @@
                                         " The case may become editable again"
                                         " later if it is restored on the"
                                         " meta-server."),
-                                      h.url_for(controller="/case_overview"),
+                                      h.url(controller="case_overview",
+                                            action='index'),
                                       '/casemanagement/dialogs'
                                       '/failed_markanonymize.mako')
 
@@ -304,7 +307,8 @@
                                       " anonymization because of an"
                                       " unexpected problem with the"
                                       " meta server."),
-                                    h.url_for(controller="/case_overview"),
+                                    h.url(controller="case_overview",
+                                          action='index'),
                                     '/casemanagement/dialogs'
                                     '/failed_markanonymize.mako')
 
@@ -314,7 +318,8 @@
             c.dialog_title = _("Case document not marked for anonymisation!")
             c.dialog_text = _("The case can not be marked for anonymisation"
                               " because of an unexpected problem.")
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview",
+                             action='index')
             return render('/casemanagement/dialogs/failed_markanonymize.mako')
 
     def _do_mark_anonymize_case(self, case):
@@ -335,7 +340,7 @@
                               u" administration for final anonymisation."
                               u" Please click on OK, to get back to the"
                               u" overview.")
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             session['render_mode'] = 'ro'
             session.save()
             return render('/casemanagement/dialogs/success_markanonymize.mako')
@@ -352,7 +357,7 @@
                               u"<p><i>%s</i></p>"
                               u"<p>Please click on OK to geht back to the"
                               u" overview.</p>""") % "<br>".join(errors)
-            c.url_ok = h.url_for(controller='/case', action='select',
+            c.url_ok = h.url(controller='/case', action='select',
                                  id=case.id, confirmed=1)
             return render('/casemanagement/dialogs/failed_markanonymize.mako')
 
@@ -370,7 +375,7 @@
         except ConsistenceCheckException, e:
             c.dialog_title = _(u"Anonymising not possible.")
             c.dialog_text = h.literal(e.value)
-            c.url_ok = h.url_for(controller='/case', action='digest', id=id)
+            c.url_ok = h.url(controller='/case', action='digest', id=id)
             return render('/casemanagement/dialogs/failed_markanonymize.mako')
 
         # Show confirmation dialog if necessary.
@@ -384,9 +389,9 @@
                               u" The anonymised case will still be considered"
                               u" for the analysis.<br>") \
                             % "\n".join(build_case_list([case]))
-            c.url_yes = h.url_for(controller='/case', action='anonymize',
+            c.url_yes = h.url(controller='/case', action='anonymize',
                                   id=id, confirmed=1)
-            c.url_no = h.url_for(controller='/case', action='digest', id=id)
+            c.url_no = h.url(controller='/case', action='digest', id=id)
             return render('/casemanagement/dialogs/confirm_anonymize.mako')
 
         try:
@@ -405,7 +410,8 @@
                                         " meta-case has been removed."
                                         " A second attempt to anonymize the"
                                         " case should succeed."),
-                                      h.url_for(controller="/case_overview"),
+                                      h.url(controller="case_overview",
+                                            action='index'),
                                       '/casemanagement/dialogs'
                                       '/failed_anonymize.mako')
         except UnknownProjectPart:
@@ -422,7 +428,8 @@
                                         " meta-case has been removed."
                                         " A second attempt to anonymize the"
                                         " case should succeed."),
-                                      h.url_for(controller="/case_overview"),
+                                      h.url(controller="case_overview",
+                                            action='index'),
                                       '/casemanagement/dialogs'
                                       '/failed_anonymize.mako')
 
@@ -437,7 +444,8 @@
                                         " The case may become editable again"
                                         " later if it is restored on the"
                                         " meta-server."),
-                                      h.url_for(controller="/case_overview"),
+                                      h.url(controller="case_overview",
+                                            action='index'),
                                       '/casemanagement/dialogs'
                                       '/failed_anonymize.mako')
 
@@ -449,7 +457,8 @@
                                     _("The case can not be anonymized because"
                                       " of an unexpected problem with the"
                                       " meta server."),
-                                    h.url_for(controller="/case_overview"),
+                                    h.url(controller="case_overview",
+                                          action='index'),
                                     '/casemanagement/dialogs'
                                     '/failed_anonymize.mako')
 
@@ -458,7 +467,7 @@
             c.dialog_title = _("Case document not anonymized!")
             c.dialog_text = _("The case can not be anonymized because of an"
                               " unexpected problem.")
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             return render('/casemanagement/dialogs/failed_anonymize.mako')
 
     def _do_anonymize_case(self, case):
@@ -472,7 +481,7 @@
                           u" deleted and the case document is removed from"
                           u" the overview. Please click on OK, to get back to"
                           u" the overview.")
-        c.url_ok = h.url_for(controller="/case_overview")
+        c.url_ok = h.url(controller="case_overview", action='index')
         return render('/casemanagement/dialogs/success_anonymize.mako')
 
 
@@ -490,7 +499,7 @@
             case.checkValidity()
             c.dialog_title = ungettext(u'Case restored!', u'Cases restored!', 1)
             c.dialog_text = _(u'Please click OK to continue.')
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             return render('/casemanagement/dialogs/success_restore.mako')
         else:
             c.context = "../main.mako"
@@ -499,9 +508,9 @@
                               " The case will be editable afterwards again"
                               " for the users.<br>") \
                             % "\n".join(build_case_list([case]))
-            c.url_yes = h.url_for(controller='/case', action='restore', id=id,
+            c.url_yes = h.url(controller='/case', action='restore', id=id,
                                   confirmed=1)
-            c.url_no = h.url_for(controller='/case_overview')
+            c.url_no = h.url(controller='/case_overview')
             return render('/casemanagement/dialogs/confirm_restore.mako')
 
     #
@@ -679,15 +688,15 @@
             c.dialog_text = _('The case was succussfully copied and is now'
                               ' available in the case overview.'
                               ' Click on "OK" to open the case overview.')
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             return render('/casemanagement/dialogs/success_copy.mako')
         else:
             c.dialog_title = _('Copy case?')
             c.dialog_text = _('Do you really want to copy this case?'
                               ' All data will be copied in the new case.')
-            c.url_yes = h.url_for(controller='/case', action='copy',
+            c.url_yes = h.url(controller='/case', action='copy',
                                   id=id, confirmed=1)
-            c.url_no = h.url_for(controller='/case', action='digest', id=id)
+            c.url_no = h.url(controller='/case', action='digest', id=id)
             return render('/casemanagement/dialogs/confirm_copy.mako')
 
     @checkRole("cm")
@@ -708,7 +717,7 @@
             c.dialog_title = _("Case(s) imported!""")
             c.dialog_text = _("The file was imported successfully."
                               " Click on 'OK' to open the case overview.")
-            c.url_ok = h.url_for(controller="/case_overview")
+            c.url_ok = h.url(controller="case_overview", action='index')
             return render('/casemanagement/dialogs/success_xml_import.mako')
         except Exception, e:
             log.exception("Exception during xml import")
@@ -718,7 +727,7 @@
             else:
                 c.dialog_text = _("An error occurred during the import."
                                   " Click 'OK' to return to the import dialog.")
-            c.url_ok = h.url_for(controller='/case', action='importCase')
+            c.url_ok = h.url(controller='/case', action='importCase')
             return render('/casemanagement/dialogs/failed_xml_import.mako')
 
     #
@@ -828,7 +837,7 @@
             c.dialog_title = _('Case storage extended')
             c.dialog_text = _('The max case storage has been extended.'
                               ' Please click on OK to continue')
-            c.url_ok = h.url_for(controller="/")
+            c.url_ok = h.url("/")
             return render('/casemanagement/dialogs/success_keepactive.mako')
         except:
             log.exception('Can not refresh case in'

Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/case_bundle.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -11,7 +11,7 @@
 
 from mpulsweb.lib.translation import _, ungettext
 from mpulsweb.lib.base import c, render, request, session, BaseController
-from mpulsweb.lib.helpers import url_for, format_object
+from mpulsweb.lib.helpers import url, format_object
 from mpulsweb.lib.security import checkRole, check_feature
 from mpulsweb.lib.validators import BundleActionForm, SetBundleEditorForm, \
     SetBundleStandinForm, ExportSelectorValidator
@@ -180,7 +180,7 @@
                 session["id_field"] = session.get('id_field_candidate')
                 session["sql_where"] = session.get('sql_where_candidate')
                 session.save()
-                c.url_ok = url_for(controller='/case_overview')
+                c.url_ok = url(controller='case_overview', action='index')
                 num = len(case_bundle)
                 c.dialog_title= ungettext("Case was marked for evaluation",
                                           "Cases were marked for evaluation",
@@ -241,7 +241,7 @@
         return MpulsCaseBundle(ids)
 
     def _empty_caselist(self):
-        c.url_ok = url_for(controller='/case_overview')
+        c.url_ok = url(controller='case_overview', action='index')
         c.dialog_title = _("No valid cases in the selection!")
         c.dialog_text = _(u"The selected action can not be executed"
                 u"\non any of the cases in your selection."
@@ -260,7 +260,7 @@
         c.dialog_text = _("""You have not selected any action for the
 selection. Please click OK to go to the case overview and select there
 an action from the drop down menu.""")
-        c.url_ok = url_for(controller='/case_overview')
+        c.url_ok = url(controller='case_overview', action='index')
         return render('/casebundle/dialogs/error.mako')
 
     # DELETE
@@ -277,7 +277,7 @@
                                        u"%s cases were successfully cleared for"
                                        u" deletion.", num) % num
                              + " " + _("Please click OK to continue."))
-            c.url_ok = url_for(controller='/case_overview')
+            c.url_ok = url(controller='case_overview', action='index')
             del session['casebundle']
             return render ('/casebundle/dialogs/success_markdelete.mako')
         else:
@@ -290,9 +290,9 @@
                                        ' following cases?%s',
                                        len(case_bundle.getCases()))
                              % "\n".join(self._buildCaseList(case_bundle)))
-            c.url_yes = url_for(controller='/case_bundle', action='markDelete',
+            c.url_yes = url(controller='case_bundle', action='markDelete',
                                 confirmed=1)
-            c.url_no = url_for(controller='/case_overview')
+            c.url_no = url(controller='case_overview', action='index')
             return render('/casemanagement/dialogs/confirm.mako')
 
     @checkRole(('admin'))
@@ -320,9 +320,9 @@
                                  "Do you want to delete the case from the"
                                  " server?""")
                              + "<br><br>")
-            c.url_yes = url_for(controller='/case_bundle', action='delete',
+            c.url_yes = url(controller='case_bundle', action='delete',
                                 confirmed=1)
-            c.url_no = url_for(controller='/case_overview')
+            c.url_no = url(controller='case_overview', action='index')
             return render('/casemanagement/dialogs/confirm.mako')
 
         successes = case_bundle.delete()
@@ -358,7 +358,7 @@
 
             template = '/casebundle/dialogs/failure_delete_admin.mako'
 
-        c.url_ok = url_for(controller='/case_overview')
+        c.url_ok = url(controller='case_overview', action='index')
         del session['casebundle']
         return render(template)
 
@@ -388,9 +388,9 @@
                           u" anonymisation.%s",
                           total)
                 % "\n".join(self._buildCaseList(case_bundle)))
-            c.url_yes = url_for(controller='/case_bundle',
+            c.url_yes = url(controller='case_bundle',
                                 action='markAnonymize', confirmed=1)
-            c.url_no = url_for(controller='/case_overview')
+            c.url_no = url(controller='case_overview', action='index')
             return render('/casebundle/dialogs/confirm_anonymize.mako')
 
         successes = case_bundle.markAnonymize()
@@ -440,7 +440,7 @@
                              + " " + _("Please click OK to continue."))
             template = '/casebundle/dialogs/failure_anonymize.mako'
 
-        c.url_ok = url_for(controller='/case_overview')
+        c.url_ok = url(controller='case_overview', action='index')
         del session['casebundle']
         return render(template)
 
@@ -469,9 +469,9 @@
                           u" in the analysis.%s",
                           total)
                 % "\n".join(self._buildCaseList(case_bundle)))
-            c.url_yes = url_for(controller='/case_bundle', action='anonymize',
+            c.url_yes = url(controller='case_bundle', action='anonymize',
                                 confirmed=1)
-            c.url_no = url_for(controller='/case_overview')
+            c.url_no = url(controller='case_overview', action='index')
             return render('/casebundle/dialogs/confirm_anonymize.mako')
 
         successes = case_bundle.anonymize()
@@ -515,7 +515,7 @@
                              + " " + _("Please click OK to continue."))
             template = '/casebundle/dialogs/failure_anonymize.mako'
 
-        c.url_ok = url_for(controller='/case_overview')
+        c.url_ok = url(controller='case_overview', action='index')
         del session['casebundle']
         return render(template)
 
@@ -533,7 +533,7 @@
             c.dialog_text = ungettext(u"%s was successfully restored.",
                                       u"%s were successfully restored.",
                                       num) % num + " " + _("Please click OK to continue.")
-            c.url_ok = url_for(controller='/case_overview')
+            c.url_ok = url(controller='case_overview', action='index')
             del session['casebundle']
             return render ('/casemanagement/dialogs/success_restore.mako')
         else:
@@ -546,9 +546,9 @@
                           u' They will be available again for editing.%s',
                           len(case_bundle.getCases()))
                 % "\n".join(self._buildCaseList(case_bundle)))
-            c.url_yes = url_for(controller='/case_bundle', action='restore',
+            c.url_yes = url(controller='case_bundle', action='restore',
                                 confirmed=1)
-            c.url_no = url_for(controller='/case_overview')
+            c.url_no = url(controller='case_overview', action='index')
             return render('/casemanagement/dialogs/confirm_restore.mako')
 
     # ORGANISATION
@@ -567,7 +567,7 @@
                           u"%s cases were successfully transferred to %s %s",
                           num) % (num, user.first_name, user.last_name)
                 + " " +_("Please click OK to continue.") )
-            c.url_ok = url_for(controller='/case_overview')
+            c.url_ok = url(controller='case_overview', action='index')
             del session['casebundle']
             return render('/casebundle/dialogs/success_editor.mako')
         except formencode.Invalid, error:
@@ -593,7 +593,7 @@
             else:
                 del session['casebundle']
                 return self._empty_caselist()
-            c.url_ok = url_for(controller='/case_overview')
+            c.url_ok = url(controller='case_overview', action='index')
             del session['casebundle']
             
             return render('/casebundle/dialogs/success_standin.mako')

Modified: base/trunk/mpulsweb/controllers/caseappointment.py
===================================================================
--- base/trunk/mpulsweb/controllers/caseappointment.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/caseappointment.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -11,7 +11,7 @@
 
 from mpulsweb.lib.base import BaseController, render
 from mpulsweb.lib.security import checkRole
-from mpulsweb.lib.helpers import url_for, dd_mm_YYYY, HH_MM
+from mpulsweb.lib.helpers import url, dd_mm_YYYY, HH_MM
 from mpulsweb.lib.dialogs import checkPrivacyStatement
 from mpulsweb.lib.validators import CreateAppointmentForm
 from mpulsweb.model.appointment import CaseAppointmentOverview, \
@@ -79,7 +79,7 @@
                 c.success_text =  _(u"The appointment was successfully created.") \
                     + " " \
                     +  _("Please click OK to continue to the appointment overview")
-                c.url_ok = url_for(controller='/caseappointment',
+                c.url_ok = url(controller='caseappointment',
                                    action='index', id=appointment.case_id)
                 return render('/casemanagement/dialogs/'
                               'success_create_appointment.mako')
@@ -152,7 +152,7 @@
                 c.success_text =  _(u"The appointment was successfully edited") \
                     + " " \
                     +  _("Please click OK to continue to the appointment overview")
-                c.url_ok = url_for(controller='/caseappointment',
+                c.url_ok = url(controller='caseappointment',
                                    action='index',
                                    id=appointment.case_id)
                 return render('/casemanagement/dialogs/'
@@ -180,7 +180,7 @@
             c.success_text =  _(u"The appointment was successfully deleted.") \
                 + " " \
                 + _("Please click OK to continue to the appointment overview")
-            c.url_ok = url_for(controller='/caseappointment', action='index',
+            c.url_ok = url(controller='caseappointment', action='index',
                                id=appointment.case_id)
             return render('/casemanagement/dialogs/'
                           'success_delete_appointment.mako')
@@ -189,9 +189,9 @@
             c.confirm_for = _(u'Delete appointment?')
             c.question =  _(u"Do you really want to delete the appointment\n"
                             u"and irrevocably lose all the data?")
-            c.url_yes = url_for(controller='/caseappointment', action='delete',
+            c.url_yes = url(controller='caseappointment', action='delete',
                                 id=id, confirmed=1)
-            c.url_no = url_for(controller='/caseappointment', action='index',
+            c.url_no = url(controller='caseappointment', action='index',
                                id=appointment.case_id)
             return render('/casemanagement/dialogs/'
                           'confirm_delete_appointment.mako')

Modified: base/trunk/mpulsweb/controllers/casedocument.py
===================================================================
--- base/trunk/mpulsweb/controllers/casedocument.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/casedocument.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -75,7 +75,7 @@
                 doc.create(filename, content, case)
             c.dialog_title = _(u"Attachment added!")
             c.dialog_text = _(u"Please click OK to continue.")
-            c.url_ok = h.url_for(controller="/casedocument", action="index",
+            c.url_ok = h.url(controller="casedocument", action="index",
                                  id=case)
             return render('/documents/dialogs/success_attachment.mako')
         except formencode.Invalid, error:
@@ -113,7 +113,7 @@
                 deleteDocument(id, True)
             except Exception, e:
                 log.exception(e)
-            c.url_ok = h.url_for(controller="/casedocument", action="index" ,
+            c.url_ok = h.url(controller="casedocument", action="index" ,
                                  id=session['case'].id)
             c.success_for = _(u"Attachment deleted!")
             c.success_text = _(u"Please click OK to continue.")
@@ -123,9 +123,9 @@
             c.context = "../main.mako"
             c.confirm_for = _(u"Delete attachment?")
             c.question = _(u"Do you want to irrevocably delete the attachment?")
-            c.url_yes = h.url_for(controller='/casedocument', action='delete',
+            c.url_yes = h.url(controller='casedocument', action='delete',
                                   id=id, confirmed=1)
-            c.url_no = h.url_for(controller="/casedocument", action="index",
+            c.url_no = h.url(controller="casedocument", action="index",
                                  id=session['case'].id)
             return render('/casemanagement/dialogs/'
                           'confirm_delete_attachment.mako')

Modified: base/trunk/mpulsweb/controllers/document.py
===================================================================
--- base/trunk/mpulsweb/controllers/document.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/document.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -97,7 +97,7 @@
                doc.create(filename, content)
             c.dialog_title = _(u"Document added!")
             c.dialog_text = _("Please click OK to continue.")
-            c.url_ok = h.url_for(controller="document",
+            c.url_ok = h.url(controller="document",
                                  action="globalOverview")
             return render('/documents/dialogs/success_documents.mako')
         except formencode.Invalid, error:
@@ -136,7 +136,7 @@
             except Exception, e:
                 log.exception(e)
                 return self.globalOverview()
-            c.url_ok = h.url_for(controller="/document",
+            c.url_ok = h.url(controller="document",
                                  action="globalOverview")
             c.dialog_title = _(u"Document deleted!")
             c.dialog_text =  _("Please click OK to continue.")
@@ -145,9 +145,9 @@
             c.context = "../main.mako"
             c.dialog_title = _(u"Delete document?")
             c.dialog_text = _(u"Do you want to delete the document and irrevocably lose the data?")
-            c.url_yes = h.url_for(controller='/document',
+            c.url_yes = h.url(controller='document',
                                   action='globalDelete', id=id, confirmed=1)
-            c.url_no = h.url_for(controller='/document',
+            c.url_no = h.url(controller='document',
                                  action='globalOverview')
             return render('/documents/dialogs/confirm.mako')
     

Modified: base/trunk/mpulsweb/controllers/evaluation_overview.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluation_overview.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/evaluation_overview.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -10,7 +10,7 @@
 from mpulsweb.lib.base import c, render, request, session, BaseController
 from mpulsweb.lib.db import db
 from mpulsweb.lib.security import checkRole
-from mpulsweb.lib.helpers import url_for
+from mpulsweb.lib.helpers import url
 from mpulsweb.lib.translation import _, ungettext
 from mpulsweb.model.user import UserListObject
 from mpulsweb.model.agency import MpulsAgencyOverview
@@ -180,7 +180,7 @@
         return parseSearchOptions(options, extended)
 
     def _empty_caselist(self):
-        c.url_ok = url_for(controller='/evaluation_overview')
+        c.url_ok = url(controller='evaluation_overview', action='index')
         c.dialog_title = _("No valid agencys in the selection!")
         c.dialog_text = _(u"""The selected action can not be executed
 on any of the agencys in your selection. Please make sure that the agencys are
@@ -192,7 +192,7 @@
         c.dialog_text = _("""You have not selected any action for the
 selection. Please click OK to go to the case overview and select there
 an action from the drop down menu.""")
-        c.url_ok = url_for(controller='/evaluation_overview')
+        c.url_ok = url(controller='evaluation_overview', action='index')
         return render('/casebundle/dialogs/error.mako')
 
     def bundleAction(self):
@@ -219,7 +219,7 @@
                 if form_result.get('all_cases') > 0:
                     session["evaluation_ids"] = form_result.get('all_ids')
                 session.save()
-                c.url_ok = url_for(controller='/evaluation_overview')
+                c.url_ok = url(controller='evaluation_overview', action='index')
                 num = len(session["evaluation_ids"])
                 c.dialog_title= ungettext("Agency was marked for evaluation",
                                           "Agency were marked for evaluation",

Modified: base/trunk/mpulsweb/controllers/formularpage.py
===================================================================
--- base/trunk/mpulsweb/controllers/formularpage.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/formularpage.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -16,7 +16,7 @@
 from mpulsweb.lib.db import  PostgresDBInterface
 from mpulsweb.lib.navigation import mark_folderopen, get_navigation
 from mpulsweb.lib.base import BaseController, render, session
-from mpulsweb.lib.helpers import url_for, literal, url
+from mpulsweb.lib.helpers import literal, url
 from mpulsweb.lib.formedrenderer import ViewRenderer, ViewPrintRenderer, \
         UrlFactory
 
@@ -242,7 +242,7 @@
                     # build dialog
                     c.dialog_title = fullautomatic_title
                     c.dialog_text = literal((fullautomatic_text % (cpd, rpd)))
-                    c.url_ok = url_for(controller="formularpage",
+                    c.url_ok = url(controller="formularpage",
                                        action="select", id=page_id)
                     return render('/phase/dialogs/success_fullautomatic_set_phase.mako')
                 else:
@@ -250,10 +250,10 @@
                     # build dialog
                     c.dialog_title = halfautomatic_title
                     c.dialog_text = literal((halfautomatic_text % (cpd, rpd)))
-                    c.url_ok = url_for(controller="phase", action="setPhase",
+                    c.url_ok = url(controller="phase", action="setPhase",
                                        id=session['case'].id,
                                        value=reachable_phase)
-                    c.url_no = url_for(controller="formularpage",
+                    c.url_no = url(controller="formularpage",
                                        action="select", id=page_id)
                     return render('/phase/dialogs/success_halfautomatic_set_phase.mako')
         return None

Modified: base/trunk/mpulsweb/controllers/logbook.py
===================================================================
--- base/trunk/mpulsweb/controllers/logbook.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/logbook.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -37,7 +37,7 @@
 from mpulsweb.lib.security import checkRole
 from mpulsweb.model.logbook import Logbook, LogbookEntry, LogbookEntryChecker
 
-from mpulsweb.lib.helpers import url_for
+from mpulsweb.lib.helpers import url
 from mpulsweb.lib.base import BaseController, c, render, request, session
 from mpulsweb.lib.validators import CreateLogbookForm, EditLogbookForm
 
@@ -80,7 +80,7 @@
             c.failed_for = _(u"Showing of logbook entry failed!")
             c.failed_text = _(u"An error occured while showing the logbook"
                               u" entry.")
-            c.url_ok = url_for(controller='/logbook', action='index',
+            c.url_ok = url(controller='logbook', action='index',
                                id=session['case'].id)
             log.exception(e)
             return render('/logbook/dialogs/failed_show_logbook_entry.mako')
@@ -137,7 +137,7 @@
             entry = checker.getLogbookEntry()
             logbook.addEntry(entry)
             logbook.store(session['USER_AUTHORIZED'].id)
-            c.url_ok = url_for(controller='/logbook', action='index',
+            c.url_ok = url(controller='logbook', action='index',
                                id=session['case'].id)
             c.success_for = _(u"Entry successfully created.")
             c.success_text = _(u"The logbook entry was sucessfully created")
@@ -147,7 +147,7 @@
             c.failed_for = _(u"Logbook entry was not created!")
             c.failed_text = _(u"An error occured while creating a logbook"
                               u" entry")
-            c.url_ok = url_for(controller='/case', action='logbook',
+            c.url_ok = url(controller='case', action='logbook',
                                id=session['case'].id)
             return render('/logbook/dialogs/failed_create_logbook_entry.mako')
 
@@ -179,7 +179,7 @@
             c.failed_for = _(u"Showing of logbook entry failed!")
             c.failed_text = _(u"An error occured while showing the logbook"
                               u" entry.")
-            c.url_ok = url_for(controller='/logbook', action='index',
+            c.url_ok = url(controller='logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/failed_show_logbook_entry.mako')
 
@@ -209,7 +209,7 @@
             c.success_for = _(u"Changes on logbook successfull!")
             c.success_text = _(u"The changes on the logbook entry were"
                                u" applied successfully.")
-            c.url_ok = url_for(controller='/logbook', action='index',
+            c.url_ok = url(controller='logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/success_save_logbook_entry.mako')
         except Exception, e:
@@ -217,7 +217,7 @@
             c.failed_for = _(u"Changes on logbook failed!")
             c.failed_text = _(u"An error occured applying changes on the"
                               u" logbook entry")
-            c.url_ok = url_for(controller='/logbook', action='index',
+            c.url_ok = url(controller='logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/failed_save_logbook_entry.mako')
 
@@ -230,7 +230,7 @@
                 Logbook().deleteEntryById(int(id))
                 c.success_for = _(u"Logbook entry successfully deleted!")
                 c.success_text = _(u"Logbook entry was successfully deleted!")
-                c.url_ok = url_for(controller='logbook', action='index',
+                c.url_ok = url(controller='logbook', action='index',
                                    id=session['case'].id)
                 return render('/logbook/dialogs/success_delete_logbook_entry.mako')
             except Exception, e:
@@ -238,16 +238,16 @@
                 c.failed_for = _(u"Deletion of logbook entry failed!")
                 c.failed_text = _(u"An error occured while deleting the"
                                   u" logbook entry.")
-                c.url_ok = url_for(controller='/logbook', action='index',
+                c.url_ok = url(controller='logbook', action='index',
                                    id=session['case'].id)
                 return render('/logbook/dialogs/failed_delete_logbook_entry.mako')
         else:
             c.confirm_for = _(u"Delete logbook entry?")
             c.question = _(u"Do you want to delete this logbook entry?\n"
                            u"The data will be irrevocably lost.")
-            c.url_yes = url_for(controller='/logbook', action='delete', id=id,
+            c.url_yes = url(controller='logbook', action='delete', id=id,
                                 confirmed=1)
-            c.url_no = url_for(controller='/logbook', action='index',
+            c.url_no = url(controller='logbook', action='index',
                                id=session['case'].id)
             return render('/logbook/dialogs/confirm_delete_logbook_entry.mako')
 

Modified: base/trunk/mpulsweb/controllers/meta.py
===================================================================
--- base/trunk/mpulsweb/controllers/meta.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/meta.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -13,7 +13,7 @@
 from mpulsweb.lib.translation import _, N_
 from mpulsweb.lib.base import BaseController, c, render, request, session
 from mpulsweb.lib.dialogs import confirm, success, error
-from mpulsweb.lib.helpers import url_for, format_date, escape
+from mpulsweb.lib.helpers import url, format_date, escape
 from mpulsweb.lib.metaclient import MetaUnauthorized, UnknownMetaCase, \
      UnknownProjectPart, MetaCaseAnonymized, MetaCasePending
 from mpulsweb.lib.validators import MetaSearchForm
@@ -135,12 +135,12 @@
             return success(header=_('Synchronisation allowed.'),
                            text=_('The sychronisation of data with the meta'
                                   ' case has succsessfully been allowed.'),
-                           url_ok=url_for(controller="/meta", action="search",
+                           url_ok=url(controller="meta", action="search",
                                           id=id))
         except MetaException, ex:
             log.exception('Can not allow sync for case %s', id)
             return error(header=_('Error! Synchronisation not allowed.'),
-                         url_ok=url_for(controller="/meta", action="index",
+                         url_ok=url(controller="meta", action="index",
                                         id=id),
                          text=ex.message)
 
@@ -165,7 +165,7 @@
                            text=_('The sychronisation of data'
                                   ' with the meta case has succsessfully been'
                                   ' disallowed.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, exc:
             return self._handle_meta_exception(meta, exc,
@@ -193,7 +193,7 @@
                                   ' with the meta case has succsessfully been'
                                   ' withdrawn. Already transfered data has'
                                   ' been deleted.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, exc:
             return self._handle_meta_exception(meta, exc,
@@ -223,7 +223,7 @@
                                   ' with the meta case has succsessfully been'
                                   ' withdrawn. Meta case has been marked for'
                                   ' anonymization.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, exc:
             return self._handle_meta_exception(meta, exc,
@@ -254,7 +254,7 @@
                                   ' withdrawn. Already transfered data has been'
                                   ' deleted. Meta case has been marked for'
                                   ' deletion.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, exc:
             return self._handle_meta_exception(meta, exc,
@@ -318,7 +318,7 @@
                              "possible from now on. Please contact the "
                              "administration of the meta-server to "
                              "reactivate your account."),
-                             url_ok=url_for(controller="/meta", 
+                             url_ok=url(controller="meta", 
                                             action="index", 
                                             id = c.case.id))
 
@@ -341,7 +341,7 @@
                      ' data: %s'
                      ' Do you really want to create a new meta case for this'
                      ' case?'),
-             url_abort = url_for(controller="/meta", action="search"),
+             url_abort = url(controller="meta", action="search"),
              dynfunc=show_newmetcasedata)
     def create(self, id):
         case = self._loadCase(id)
@@ -366,19 +366,19 @@
             return success(header=_('Meta case created.'),
                            text=_('The meta case was sucessfully created and'
                                   ' linked with this case.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, ex:
             log.exception('Can not create a meta case for case %s', id)
             return error(header=_('Error! Meta case not created.'),
                          text=ex.message,
-                         url_ok=url_for(controller="/meta", action="index",
+                         url_ok=url(controller="meta", action="index",
                                         id=id))
 
     @confirm(header=N_('Link with meta?'),
              text=N_('Do you really want to link this the case with the'
                      ' selected meta case?'),
-             url_abort=url_for(controller="/meta", action="search"))
+             url_abort=url(controller="meta", action="search"))
     def link(self, id):
         if not validate_uuid(id):
             # The uuid is not valid. Abort with HTTP response 400 Bad Request.
@@ -393,13 +393,13 @@
             return success(header=_('Case linked.'),
                            text=_('The case was sucessfully link with the'
                                   ' meta case.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=case_id))
         except MetaException, ex:
             log.exception('Can not link case with meta %s', id)
             return error(header=_('Error! Case not linked.'),
                          text=ex.message,
-                         url_ok=url_for(controller="/meta", action="index",
+                         url_ok=url(controller="meta", action="index",
                                         id=case_id))
 
     def unlink(self, id):
@@ -420,7 +420,7 @@
                            text=_('The case was sucessfully unlinked from the'
                                   ' meta case. Already transfered data has'
                                   ' been deleted in meta case.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, exc:
             return self._handle_meta_exception(meta, exc,
@@ -434,7 +434,7 @@
             return success(header=_('Data uploaded.'),
                            text=_('The data was sucessfully uploaded to the'
                                   ' meta case.'),
-                           url_ok=url_for(controller="/meta", action="index",
+                           url_ok=url(controller="meta", action="index",
                                           id=id))
         except MetaException, exc:
             return self._handle_meta_exception(meta, exc, "push",
@@ -551,7 +551,7 @@
                                " MetaException instance")
 
         return error(header=title, text=text,
-                     url_ok=url_for(controller="/meta", action="index",
+                     url_ok=url(controller="meta", action="index",
                                     id=meta.master_id))
 
 

Modified: base/trunk/mpulsweb/controllers/news.py
===================================================================
--- base/trunk/mpulsweb/controllers/news.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/news.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -6,7 +6,7 @@
 from pylons.controllers.util import redirect
 from mpulsweb.lib.translation import _, ungettext
 
-from mpulsweb.lib.helpers import url_for
+from mpulsweb.lib.helpers import url
 from mpulsweb.lib.base import BaseController, session, render
 from mpulsweb.model.user import UserObject
 
@@ -32,9 +32,9 @@
             c.dialog_title = _(u"Mark message as read")
             c.dialog_text = _(u"""Do you really want to mark the message as read?
 It will permanently disappear from the overview.""")
-            c.url_yes = url_for(controller='/news', action='hide', id=id,
+            c.url_yes = url(controller='news', action='hide', id=id,
                                 confirmed=1)
-            c.url_no = url_for("/")
+            c.url_no = url("/")
             return render('/news/dialogs/confirm_mark_news_as_read.mako')
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: base/trunk/mpulsweb/controllers/phase.py
===================================================================
--- base/trunk/mpulsweb/controllers/phase.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/phase.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -38,7 +38,7 @@
         c.dialog_text = _("The phase could be changed successfully."
                           " Please follow the shown steps to reach the phase"
                           " overview.")
-        c.url_ok = h.url_for(controller='/phase', action='overview', id=case.id)
+        c.url_ok = h.url(controller='phase', action='overview', id=case.id)
         return render('/phase/dialogs/success_set_phase.mako')
 
     @checkRole(('cm'))

Modified: base/trunk/mpulsweb/controllers/privacy.py
===================================================================
--- base/trunk/mpulsweb/controllers/privacy.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/privacy.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -43,7 +43,7 @@
 
     @checkRole('cm')
     def set(self, id):
-        c.targeturl = h.url_for(controller="/case", action="digest", id=id)
+        c.targeturl = h.url(controller="case", action="digest", id=id)
         c.ds_id = id
         return render('privacy/edit_statement.mako')
 
@@ -63,7 +63,7 @@
             c.dialog_title = _(u"Privacy statement set!")
             c.dialog_text = _(u'Please click Bitte klick "OK" to continue work'
                     ' on the case')
-            c.url_ok = h.url_for(controller="/case", action="select",
+            c.url_ok = h.url(controller="case", action="select",
                                  id=case.id)
             return render('privacy/dialogs/accept_success.mako')
         else:
@@ -72,9 +72,9 @@
                     "consent from\nthe young adult to the acquisition, handling "
                     "and storage of personal data.\n"
                     "Are you sure this is correct?")
-            c.url_yes = h.url_for(controller="privacy", action="accept",
+            c.url_yes = h.url(controller="privacy", action="accept",
                                   id=id, confirmed="1")
-            c.url_no = h.url_for(controller="/case", action="select",
+            c.url_no = h.url(controller="case", action="select",
                                  id=id, confirmed=0)
             return render('privacy/dialogs/confirm.mako')
 
@@ -88,14 +88,14 @@
         except PhaseAnonymizableCheckException, e:
             c.dialog_title = _('Decline privacy statement not possible')
             c.dialog_text = h.literal( _('The case is in a non consistent state und it will not be possible to anonimise it after retracting the privacy statement. The reason for this is listed below:%s') % e.value)
-            c.url_ok = h.url_for(controller='/case', action='digest',
+            c.url_ok = h.url(controller='case', action='digest',
                                  id=case.id)
             return render('/casemanagement/dialogs/failed_markanonymize.mako')
 
         except ConsistenceCheckException, e:
             c.dialog_title = _('Decline privacy statement not possible')
             c.dialog_text = h.literal(_('<p>The case is in a non consistent state und it will not be possible to anonimise it after retracting the privacy statement. The reason for this is listed below:</p><p>%s</p><p>Please refer to the documentation in case that the privacy statement has been declined.</p>') % e.value)
-            c.url_ok = h.url_for(controller='/case', action='digest',
+            c.url_ok = h.url(controller='case', action='digest',
                                  id=case.id)
             return render('/casemanagement/dialogs/failed_markanonymize.mako')
 
@@ -109,7 +109,7 @@
                         u" anonymised and has been given to\n"
                         u"the admininstration. Please click on OK, to get back "
                         u"to the overview.")
-                c.url_ok = h.url_for ('/case_overview')
+                c.url_ok = h.url('case_overview', action='index')
                 statement = case.getPrivacyStatement()
                 statement.decline()
                 return render('/privacy/dialogs/decline_success.mako')
@@ -123,7 +123,7 @@
                         "possible, because of following \nreason:"
                         "</p><p><i>%s</i></p><p>Please click on OK to get"
                         " back to the overview.\n</p>") % "<br>".join(errors) 
-                c.url_ok = h.url_for(controller='/case', action='select',
+                c.url_ok = h.url(controller='case', action='select',
                                      id=case.id, confirmed=1)
                 return render('/privacy/dialogs/decline_failed.mako')
 
@@ -132,9 +132,9 @@
             pdescriptions = g.mpuls_config.get('phases', 'description')[0]
             c.dialog_title =  _(u"Retract privacy statement?")
             c.dialog_text = _(u"The case will be anonymised if you retract the privacy statement.""")
-            c.url_yes = h.url_for(controller="privacy", action="decline",
+            c.url_yes = h.url(controller="privacy", action="decline",
                                   id=id, confirmed="1")
-            c.url_no = h.url_for(controller="/case", action="select",
+            c.url_no = h.url(controller="case", action="select",
                                  id=id, confirmed=0)
             return render('privacy/dialogs/confirm.mako')
 

Modified: base/trunk/mpulsweb/controllers/repeatgroup.py
===================================================================
--- base/trunk/mpulsweb/controllers/repeatgroup.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/repeatgroup.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -57,9 +57,9 @@
             c.confirm_for = _(u"Delete dataset?")
             c.question = _(u"Do you want to delete this dataset and\n"
                            u"irrevocably lose the data?")
-            c.url_yes = h.url_for(controller='/repeatgroup', action='delete',
+            c.url_yes = h.url(controller='repeatgroup', action='delete',
                                   id=id, confirmed=1)
-            c.url_no = h.url_for(controller='/formularpage', action='select',
+            c.url_no = h.url(controller='formularpage', action='select',
                                  id=session['navigation.selectedpage'])
             return render('/repeatgroup/dialogs/confirm_delete_rg_entry.mako')
 

Modified: base/trunk/mpulsweb/controllers/settings.py
===================================================================
--- base/trunk/mpulsweb/controllers/settings.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/settings.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -5,7 +5,7 @@
 from pylons import request, tmpl_context as c
 from mpulsweb.lib.translation import _
 
-from mpulsweb.lib.helpers import url_for
+from mpulsweb.lib.helpers import url
 from mpulsweb.lib.base import BaseController, render
 from mpulsweb.lib.validators import EditSettingsForm
 from mpulsweb.lib.security import checkRole
@@ -56,7 +56,7 @@
         c.agency.store(c.form_result)
         c.dialog_title = _('Configurations saved!')
         c.dialog_text = _('Please click on ok to continue.')
-        c.url_ok = url_for(controller='/settings')
+        c.url_ok = url(controller='settings', action='index')
         return render ('/settings/dialogs/success_edit.mako')
 
 

Modified: base/trunk/mpulsweb/controllers/usersettings.py
===================================================================
--- base/trunk/mpulsweb/controllers/usersettings.py	2012-03-08 11:52:14 UTC (rev 5881)
+++ base/trunk/mpulsweb/controllers/usersettings.py	2012-03-08 12:46:38 UTC (rev 5882)
@@ -89,7 +89,7 @@
                 c.dialog_title = _(u"User password changed!")
                 c.dialog_text = _(u"You password was successfully changed") + \
                         " " + _("Please click OK to continue.")
-                c.url_ok = h.url_for(controller="/usersettings",
+                c.url_ok = h.url(controller="usersettings",
                                      action="showSettings")
             else:
                 return "Password could not be changed"
@@ -124,7 +124,7 @@
                 c.dialog_title = _(u"User password changed!")
                 c.dialog_text = _(u"You password was successfully changed") + \
                         " " + _("Please click OK to continue.")
-                c.url_ok = h.url_for(controller="/usersettings",
+                c.url_ok = h.url(controller="usersettings",
                                      action="showSettings")
             else:
                 return "Password could not be changed"
@@ -163,7 +163,7 @@
             return render('usersettings/edit_standin.mako')
         c.dialog_title = _('Standin saved!')
         c.dialog_text =  _('Your standin is saved. Please click on ok to continue.')
-        c.url_ok = h.url_for(controller='/usersettings', action='showSettings')
+        c.url_ok = h.url(controller='usersettings', action='showSettings')
         return render ('/usersettings/dialogs/success_edit_standin.mako')
 
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list