[Mpuls-commits] r5346 - in base/trunk/mpulsweb: controllers templates/phase/dialogs

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 15 15:47:08 CEST 2011


Author: bh
Date: 2011-09-15 15:47:08 +0200 (Thu, 15 Sep 2011)
New Revision: 5346

Modified:
   base/trunk/mpulsweb/controllers/phase.py
   base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako
Log:
Port meta-server support code for phase changes from WASKU to mpulsweb.
After a phase change, if the meta-server support is enabled and the case
is linked to a meta-case, suggest to the user to update the meta-case as
well.

The code was ported from WASKU web revision 424:e29a9cf6a2bc. It was
slightly modified to also check whether the meta-server support is
activated in addition to checking whether the case is linked.


Modified: base/trunk/mpulsweb/controllers/phase.py
===================================================================
--- base/trunk/mpulsweb/controllers/phase.py	2011-09-15 11:13:50 UTC (rev 5345)
+++ base/trunk/mpulsweb/controllers/phase.py	2011-09-15 13:47:08 UTC (rev 5346)
@@ -36,6 +36,9 @@
         case.setPhase(value)
 
         # After setting the phase. Show print-dialog
+        c.case_is_linked = (g.mpuls_config.is_enabled('case-module',
+                                                      'meta-server')
+                            and case.getMeta().is_linked())
         c.dialog_title = SET_PHASE_NOTIFICATION_SUCCESS
         c.dialog_text = SET_PHASE_NOTIFICATION_TEXT_SUCCESS
         c.url_ok = h.url_for(controller='/phase', action='overview', id=case.id)

Modified: base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako
===================================================================
--- base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako	2011-09-15 11:13:50 UTC (rev 5345)
+++ base/trunk/mpulsweb/templates/phase/dialogs/success_set_phase.mako	2011-09-15 13:47:08 UTC (rev 5346)
@@ -10,11 +10,21 @@
   <h1><img src="${h.url_for('/images/icons/info/confirmation.png')}" alt="Erledigt"/>${c.dialog_title | F.NA}</h1>
   <p>${c.dialog_text | F.NA}</p>
   <div class="import_box_dialog">
-    <p>
-      ${_('Please remember: If the modus changes a printed case file has to be delivered to the young person. Further information you will find in')} 
-      <a href="${h.url_for(controller='/annotations', action='help', id='datenschutz_veraenderte_daten')}" target="_blank">${_('Help')}</a>.
-    </p>
-      <a class="button import" href="${h.url_for(controller='/case', action='printAll', id=session.get('case').id, confirmed=0)}" target="_blank">${_('Print')}</a>
+    <ol>
+      % if c.case_is_linked:
+      <li>
+        ${_('It is strongly recommended to sync the case with its meta-case after changing the phase as this is a significant change in the support of the client. Please open the meta-case to sync the updated case to the meta-server.')}<br>
+        <a class="button import" href="${h.url_for(controller='/meta', action='index', id=session.get('case').id)}" target="_blank">${_('Meta case')}</a>
+        <br>
+        <br>
+      </li>
+      % endif
+      <li>
+        ${_('Please remember: If the modus changes a printed case file has to be delivered to the young person. Further information you will find in')} 
+        <a href="${h.url_for(controller='/annotations', action='help', id='datenschutz_veraenderte_daten')}" target="_blank">${_('Help')}</a>.<br>
+        <a class="button import" href="${h.url_for(controller='/case', action='printAll', id=session.get('case').id, confirmed=0)}" target="_blank">${_('Print')}</a>
+      </li>
+    </ol>
   </div>
   <br/>
   <div>



More information about the Mpuls-commits mailing list