[Mpuls-commits] r5804 - in base/trunk: . mpulsweb/controllers mpulsweb/i18n/de/LC_MESSAGES mpulsweb/lib mpulsweb/templates/casemanagement mpulsweb/templates/documents mpulsweb.egg-info

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 6 11:21:59 CET 2012


Author: torsten
Date: 2012-02-06 11:21:59 +0100 (Mon, 06 Feb 2012)
New Revision: 5804

Modified:
   base/trunk/
   base/trunk/mpulsweb.egg-info/PKG-INFO
   base/trunk/mpulsweb.egg-info/SOURCES.txt
   base/trunk/mpulsweb/controllers/case.py
   base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
   base/trunk/mpulsweb/lib/base.py
   base/trunk/mpulsweb/lib/dialogs.py
   base/trunk/mpulsweb/lib/metaclient.py
   base/trunk/mpulsweb/templates/casemanagement/caselist.mako
   base/trunk/mpulsweb/templates/documents/global_rename.mako
   base/trunk/mpulsweb/templates/documents/global_upload.mako
   base/trunk/setup.py
Log:
Merged 2.1.0 Release branch



Property changes on: base/trunk
___________________________________________________________________
Modified: svnmerge-integrated
   - /base/branches/2.1.0:1-5782
   + /base/branches/2.1.0:1-5803

Modified: base/trunk/mpulsweb/controllers/case.py
===================================================================
--- base/trunk/mpulsweb/controllers/case.py	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/controllers/case.py	2012-02-06 10:21:59 UTC (rev 5804)
@@ -560,8 +560,12 @@
         # 3. Do we want to sign the statement?
         if form_result.get('statement_signed'):
             statement.sign()
-        return case
 
+        # Reload case to load navigation and set session correct. Loading
+        # overhead here is not nice but not critical as creating new cases
+        # should not happen so often
+        return self._loadCase(case.id)
+
     @checkRole('cm')
     def new(self):
         session_case = SessionCase()

Modified: base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
===================================================================
--- base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2012-02-06 10:21:59 UTC (rev 5804)
@@ -8,7 +8,7 @@
 "Project-Id-Version: mpulsweb 0.0.0\n"
 "Report-Msgid-Bugs-To: EMAIL at ADDRESS\n"
 "POT-Creation-Date: 2011-09-15 17:48+0200\n"
-"PO-Revision-Date: 2012-01-19 15:48+0100\n"
+"PO-Revision-Date: 2012-01-24 12:28+0100\n"
 "Last-Translator: Torsten Irländer <torsten.irlaender at intevation.de>\n"
 "Language-Team: de <LL at li.org>\n"
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"

Modified: base/trunk/mpulsweb/lib/base.py
===================================================================
--- base/trunk/mpulsweb/lib/base.py	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/lib/base.py	2012-02-06 10:21:59 UTC (rev 5804)
@@ -109,67 +109,70 @@
                            cache_type=cache_type, cache_expire=cache_expire)
 render = render_mako
 
-class BaseController(WSGIController):
+def load_case(id, uncommitted=None, read_only=False):
+    """Load and return the case object for the case with the given id.
 
-    def __init__(self):
-        self.db = None
-        self.page_cache = None
+    The parameter uncommitted, if given and not None, should be a
+    dictionary usable as the uncommitted parameter of the loadById
+    method of the case factory.
 
-    def _loadCase(self, id, uncommitted=None, read_only=False):
-        """Load and return the case object for the case with the given id.
+    If the parameter read_only is false (the default), the case must
+    be editable by the current user as determined by the case's
+    user_may_edit method. If the case is not editable in this sense,
+    the method calls the showError method. Also, showError is called
+    if the case is not readable by the current user as determined by
+    the case's user_may_read method.
 
-        The parameter uncommitted, if given and not None, should be a
-        dictionary usable as the uncommitted parameter of the loadById
-        method of the case factory.
+    Note that the default value of the read_only parameter means
+    that by default the _loadCase assumes that cases are loaded in
+    order to modify them and will raise an exception if the user is
+    not allowed to do that. The default value was chosen to err on
+    the side of caution. From a security point of view it's better
+    to deny an action that should have been allowed, than to allow
+    an action that ought to have been denied.
+    """
+    case = g.case_factory.loadById(id, uncommitted=uncommitted)
 
-        If the parameter read_only is false (the default), the case must
-        be editable by the current user as determined by the case's
-        user_may_edit method. If the case is not editable in this sense,
-        the method calls the showError method. Also, showError is called
-        if the case is not readable by the current user as determined by
-        the case's user_may_read method.
+    user = session["USER_AUTHORIZED"]
+    if not case.user_may_read(user):
+        self.showError()
+    if not read_only and not case.user_may_edit(user):
+        self.showError()
 
-        Note that the default value of the read_only parameter means
-        that by default the _loadCase assumes that cases are loaded in
-        order to modify them and will raise an exception if the user is
-        not allowed to do that. The default value was chosen to err on
-        the side of caution. From a security point of view it's better
-        to deny an action that should have been allowed, than to allow
-        an action that ought to have been denied.
-        """
-        case = g.case_factory.loadById(id, uncommitted=uncommitted)
+    session_case = case.getSessionCase()
+    if session.has_key('case'):
+        old_caseid = session.get('case').id
+    else: old_caseid = None
 
-        user = session["USER_AUTHORIZED"]
-        if not case.user_may_read(user):
-            self.showError()
-        if not read_only and not case.user_may_edit(user):
-            self.showError()
+    # New session code
+    session['case'] = session_case
 
-        session_case = case.getSessionCase()
-        if session.has_key('case'):
-            old_caseid = session.get('case').id
-        else: old_caseid = None
+    # Only reset navigation if case is switched
+    if str(old_caseid) != str(id) or not  \
+      session.has_key('navigation.tree') \
+      or session.has_key('navigation.tree.recreate'):
+        if session.has_key('navigation.tree.recreate'):
+            del session['navigation.tree.recreate']
+        open_folders = []
+        navigation = get_navigation(id)
+        session['render_mode'] = 'ro'
+        session['navigation.tree'] = navigation
+        session['navigation.openfolders'] = open_folders
+        session['navigation.selectedpage'] = None 
+        # Also reset uncommited fields, because a new case is loaded.
+        session['uncommited_fields'] = {}
+    session.save()
+    return case
 
-        # New session code
-        session['case'] = session_case
+class BaseController(WSGIController):
 
-        # Only reset navigation if case is switched
-        if str(old_caseid) != str(id) or not  \
-          session.has_key('navigation.tree') \
-          or session.has_key('navigation.tree.recreate'):
-            if session.has_key('navigation.tree.recreate'):
-                del session['navigation.tree.recreate']
-            open_folders = []
-            navigation = get_navigation(id)
-            session['render_mode'] = 'ro'
-            session['navigation.tree'] = navigation
-            session['navigation.openfolders'] = open_folders
-            session['navigation.selectedpage'] = None 
-            # Also reset uncommited fields, because a new case is loaded.
-            session['uncommited_fields'] = {}
-        session.save()
-        return case
+    def __init__(self):
+        self.db = None
+        self.page_cache = None
 
+    def _loadCase(self, id, uncommitted=None, read_only=False):
+        return load_case(id, uncommitted, read_only)
+
     def _load_current_case(self, read_only=False):
         """Load and return the case object for the session's current case.
 

Modified: base/trunk/mpulsweb/lib/dialogs.py
===================================================================
--- base/trunk/mpulsweb/lib/dialogs.py	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/lib/dialogs.py	2012-02-06 10:21:59 UTC (rev 5804)
@@ -8,7 +8,7 @@
 from pylons import request, tmpl_context as c, app_globals as g
 from mpulsweb.lib.translation import _
 
-from mpulsweb.lib.base import render, session
+from mpulsweb.lib.base import render, session, load_case
 from mpulsweb.lib.helpers import url_for 
 from mpulsweb.model.appointment import CaseAppointmentFactory
 
@@ -51,8 +51,7 @@
                 c.targeturl = url_for(controller="/case", action=context,
                                         id=case_id, confirmed=1)
 
-            case = g.case_factory.loadById(case_id)
-
+            case = load_case(case_id)
             statement = case.getPrivacyStatement()
             # Check if there is a "Einverstaendniserklaerung" None if it is
             # not either signed or declined
@@ -95,7 +94,7 @@
                 c.targeturl = url_for(controller="/case", action=context,
                                         id=case_id, confirmed=1)
 
-            case = g.case_factory.loadById(case_id)
+            case = load_case(case_id)
             meta = case.getMeta()
             statement = case.getPrivacyStatement()
             # Only check if there is a "Syncpermission" if the Privacy

Modified: base/trunk/mpulsweb/lib/metaclient.py
===================================================================
--- base/trunk/mpulsweb/lib/metaclient.py	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/lib/metaclient.py	2012-02-06 10:21:59 UTC (rev 5804)
@@ -93,7 +93,7 @@
             log_debug("connect: (%s, %s)", host, port)
             sock.connect(sa)
         except socket.error, msg:
-            log_debug("connect fail:", host, port)
+            log_debug("connect fail: (%s, %s)", host, port)
             if sock:
                 sock.close()
             sock = None

Modified: base/trunk/mpulsweb/templates/casemanagement/caselist.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/templates/casemanagement/caselist.mako	2012-02-06 10:21:59 UTC (rev 5804)
@@ -126,10 +126,10 @@
 
 <%def name="get_validity_icon(case)">
   % for validity in g.mpuls_config.get('validities', 'enabled'):
-    % if validity['id'] == case.getValidity():  
-      <a href="${h.url_for(controller='tags', action='overview', id=case.id)}">
+    % if validity['id'] == case.getValidity():
+      ##<a href="${h.url_for(controller='tags', action='overview', id=case.id)}">
         <img src="${h.url_for('/images/icons/%s' % validity['icon'])}" alt="${validity['name']}" title="${validity['name']}" width="22" height="22">
-      </a>  	
+      ##</a>
     % endif
   % endfor
 </%def>

Modified: base/trunk/mpulsweb/templates/documents/global_rename.mako
===================================================================
--- base/trunk/mpulsweb/templates/documents/global_rename.mako	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/templates/documents/global_rename.mako	2012-02-06 10:21:59 UTC (rev 5804)
@@ -15,7 +15,7 @@
       <ul>
 	<li>
           <a href="${h.url_for(controller='document', action='globalOverview')}">
-            ${_('Back to: user overview')}
+            ${_('Back to: Attachment overview')}
           </a>
         </li>
       </ul>

Modified: base/trunk/mpulsweb/templates/documents/global_upload.mako
===================================================================
--- base/trunk/mpulsweb/templates/documents/global_upload.mako	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb/templates/documents/global_upload.mako	2012-02-06 10:21:59 UTC (rev 5804)
@@ -15,7 +15,7 @@
       <ul>
 	<li>
           <a href="${h.url_for(controller='document', action='globalOverview')}">
-            ${_('Back to: user overview')}
+            ${_('Back to: Attachment overview')}
           </a>
         </li>
       </ul>

Modified: base/trunk/mpulsweb.egg-info/PKG-INFO
===================================================================
--- base/trunk/mpulsweb.egg-info/PKG-INFO	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb.egg-info/PKG-INFO	2012-02-06 10:21:59 UTC (rev 5804)
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: mpulsweb
-Version: 2.0.16dev-r5455
+Version: 2.1.0dev-r5782
 Summary: mpuls ist ein Web-Applikations-Rahmen zur Verwaltung von elektronischen Fallakten (Schwerpunkt Sozialinformatik)
 Home-page: http://wald.intevation.org/projects/mpuls/
 Author: Intevation GmbH

Modified: base/trunk/mpulsweb.egg-info/SOURCES.txt
===================================================================
--- base/trunk/mpulsweb.egg-info/SOURCES.txt	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/mpulsweb.egg-info/SOURCES.txt	2012-02-06 10:21:59 UTC (rev 5804)
@@ -146,6 +146,7 @@
 mpulsweb/public/images/icons/go_previous_16.png
 mpulsweb/public/images/icons/new_16.png
 mpulsweb/public/images/icons/new_22.png
+mpulsweb/public/images/icons/not-available.png
 mpulsweb/public/images/icons/open_active_22.png
 mpulsweb/public/images/icons/phase-running-22.png
 mpulsweb/public/images/icons/phase-stop-22.png
@@ -160,20 +161,35 @@
 mpulsweb/public/images/icons/validity-1-22.png
 mpulsweb/public/images/icons/validity-2-22.png
 mpulsweb/public/images/icons/validity-background.png
+mpulsweb/public/images/icons/case_status/a.png
 mpulsweb/public/images/icons/case_status/a_finished.png
 mpulsweb/public/images/icons/case_status/a_running.png
+mpulsweb/public/images/icons/case_status/b.png
 mpulsweb/public/images/icons/case_status/b_finished.png
 mpulsweb/public/images/icons/case_status/b_running.png
 mpulsweb/public/images/icons/case_status/c_finished.png
 mpulsweb/public/images/icons/case_status/c_running.png
 mpulsweb/public/images/icons/case_status/e_finished.png
 mpulsweb/public/images/icons/case_status/e_running.png
+mpulsweb/public/images/icons/case_status/f.png
 mpulsweb/public/images/icons/case_status/f_finished.png
 mpulsweb/public/images/icons/case_status/f_running.png
+mpulsweb/public/images/icons/case_status/g.png
+mpulsweb/public/images/icons/case_status/g_finished.png
+mpulsweb/public/images/icons/case_status/g_running.png
+mpulsweb/public/images/icons/case_status/l_finished.png
+mpulsweb/public/images/icons/case_status/l_running.png
+mpulsweb/public/images/icons/case_status/n.png
 mpulsweb/public/images/icons/case_status/n_finished.png
 mpulsweb/public/images/icons/case_status/n_running.png
+mpulsweb/public/images/icons/case_status/s.png
+mpulsweb/public/images/icons/case_status/s_finished.png
+mpulsweb/public/images/icons/case_status/s_running.png
 mpulsweb/public/images/icons/case_status/u_finished.png
 mpulsweb/public/images/icons/case_status/u_running.png
+mpulsweb/public/images/icons/case_status/ue.png
+mpulsweb/public/images/icons/case_status/ue_finished.png
+mpulsweb/public/images/icons/case_status/ue_running.png
 mpulsweb/public/images/icons/formular/evaluation.png
 mpulsweb/public/images/icons/formular/help.png
 mpulsweb/public/images/icons/formular/info.png
@@ -242,20 +258,35 @@
 mpulsweb/public/images/svg/validity-background.svg
 mpulsweb/public/images/svg/validity.svg
 mpulsweb/public/images/svg/Palette/Tango-Palette.svg
+mpulsweb/public/images/svg/case_status/a.svg
 mpulsweb/public/images/svg/case_status/a_running.svg
 mpulsweb/public/images/svg/case_status/a_stopped.svg
+mpulsweb/public/images/svg/case_status/b.svg
 mpulsweb/public/images/svg/case_status/b_running.svg
 mpulsweb/public/images/svg/case_status/b_stopped.svg
 mpulsweb/public/images/svg/case_status/c_running.svg
 mpulsweb/public/images/svg/case_status/c_stopped.svg
 mpulsweb/public/images/svg/case_status/e_running.svg
 mpulsweb/public/images/svg/case_status/e_stopped.svg
+mpulsweb/public/images/svg/case_status/f.svg
 mpulsweb/public/images/svg/case_status/f_running.svg
 mpulsweb/public/images/svg/case_status/f_stopped.svg
+mpulsweb/public/images/svg/case_status/g.svg
+mpulsweb/public/images/svg/case_status/g_running.svg
+mpulsweb/public/images/svg/case_status/g_stopped.svg
+mpulsweb/public/images/svg/case_status/l_running.svg
+mpulsweb/public/images/svg/case_status/l_stopped.svg
+mpulsweb/public/images/svg/case_status/n.svg
 mpulsweb/public/images/svg/case_status/n_running.svg
 mpulsweb/public/images/svg/case_status/n_stopped.svg
+mpulsweb/public/images/svg/case_status/s.svg
+mpulsweb/public/images/svg/case_status/s_running.svg
+mpulsweb/public/images/svg/case_status/s_stopped.svg
 mpulsweb/public/images/svg/case_status/u_running.svg
 mpulsweb/public/images/svg/case_status/u_stopped.svg
+mpulsweb/public/images/svg/case_status/ue.svg
+mpulsweb/public/images/svg/case_status/ue_running.svg
+mpulsweb/public/images/svg/case_status/ue_stopped.svg
 mpulsweb/public/images/svg/sources/gnome-icon-theme/Makefile.am
 mpulsweb/public/images/svg/sources/gnome-icon-theme/Makefile.in
 mpulsweb/public/images/svg/sources/gnome-icon-theme/actions/Makefile.am
@@ -1276,6 +1307,7 @@
 mpulsweb/templates/casemanagement/organisation.mako
 mpulsweb/templates/casemanagement/overview.mako
 mpulsweb/templates/casemanagement/reminderlist.mako
+mpulsweb/templates/casemanagement/rename_attachment.mako
 mpulsweb/templates/casemanagement/search.mako
 mpulsweb/templates/casemanagement/search_extra.mako
 mpulsweb/templates/casemanagement/showAppointment.mako
@@ -1319,6 +1351,7 @@
 mpulsweb/templates/documents/case_new.mako
 mpulsweb/templates/documents/case_overview.mako
 mpulsweb/templates/documents/global_overview.mako
+mpulsweb/templates/documents/global_rename.mako
 mpulsweb/templates/documents/global_upload.mako
 mpulsweb/templates/documents/dialogs/confirm.mako
 mpulsweb/templates/documents/dialogs/delete_attachment_success.mako
@@ -1339,6 +1372,7 @@
 mpulsweb/templates/formularpage/formular_print.mako
 mpulsweb/templates/help/help.mako
 mpulsweb/templates/home/caseappointmentlist.mako
+mpulsweb/templates/home/customcontent.mako
 mpulsweb/templates/home/globalappointmentlist.mako
 mpulsweb/templates/home/home.mako
 mpulsweb/templates/home/remindlist.mako
@@ -1382,6 +1416,7 @@
 mpulsweb/templates/privacy/dialogs/decline_success.mako
 mpulsweb/templates/privacy/dialogs/missing_statement.mako
 mpulsweb/templates/privacy/dialogs/missing_statement_body.mako
+mpulsweb/templates/privacy/dialogs/missing_syncpermission.mako
 mpulsweb/templates/repeatgroup/dialogs/confirm_delete_rg_entry.mako
 mpulsweb/templates/search/search.mako
 mpulsweb/templates/settings/edit.mako

Modified: base/trunk/setup.py
===================================================================
--- base/trunk/setup.py	2012-02-06 10:15:06 UTC (rev 5803)
+++ base/trunk/setup.py	2012-02-06 10:21:59 UTC (rev 5804)
@@ -30,7 +30,7 @@
 
 setup(
     name='mpulsweb',
-    version="2.0.16",
+    version="2.1.0",
     description=('mpuls ist ein Web-Applikations-Rahmen zur Verwaltung von'
                  ' elektronischen Fallakten (Schwerpunkt Sozialinformatik)'),
     author='Intevation GmbH',



More information about the Mpuls-commits mailing list