[Mpuls-commits] r6008 - in base/trunk/mpulsweb: controllers templates/meta

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 1 15:43:02 CEST 2012


Author: ludwig
Date: 2012-08-01 15:43:02 +0200 (Wed, 01 Aug 2012)
New Revision: 6008

Modified:
   base/trunk/mpulsweb/controllers/meta.py
   base/trunk/mpulsweb/templates/meta/index.mako
Log:
Remove meta_discretion_statement from the meta controller.
The meta_acceptance_statement should include both statements.
The reason is to simplify the statements.


Modified: base/trunk/mpulsweb/controllers/meta.py
===================================================================
--- base/trunk/mpulsweb/controllers/meta.py	2012-08-01 13:30:22 UTC (rev 6007)
+++ base/trunk/mpulsweb/controllers/meta.py	2012-08-01 13:43:02 UTC (rev 6008)
@@ -76,7 +76,6 @@
             id = session.get('case').id
         if id != session.get('meta_caseid'):
             session['meta_caseid'] = id
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
         c.case = self._loadCase(id, read_only=True)
@@ -101,36 +100,12 @@
         sychronize data with the meta case'''
         session['meta_acceptance_statement'] = True
         session.save()
-        if (session['meta_acceptance_statement']
-            and session['meta_discretion_statement']):
+        if (session['meta_acceptance_statement']):
             return self._allow_sync(id)
         else:
             return self.index(id)
 
-    def print_statement2(self, id):
-        '''Returns a rendered statement of the agreement statement to
-        sychronize data with the meta case'''
-        c.case = self._loadCase(id, read_only=True)
-        c.agency = Agency()
-        return render('/meta/statement2.mako')
 
-    @confirm(header=N_('Set discretion statement?'),
-             text=N_('Do you really want to mark the discretion statement'
-                     ' as set. This requires a printable and signed discretion'
-                     ' statement from the client.'))
-    def set_statement2(self, id):
-        '''Returns a rendered statement of the agreement statement to
-        sychronize data with the meta case'''
-        session['meta_discretion_statement'] = True
-        session.save()
-        if (session['meta_acceptance_statement']
-            and session['meta_discretion_statement']):
-            return self._allow_sync(id)
-        else:
-            return self.index(id)
-        return self.index(id)
-
-
     @confirm(header=N_('Allow synchronisation with meta?'),
              text=N_('Sychronisation of data with the meta case requires the'
                      ' agreement of the subject.'))
@@ -168,7 +143,6 @@
         meta = case.getMeta()
         try:
             meta.disallow_sync()
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
             return success(header=_('Synchronisation disallowed.'),
@@ -195,7 +169,6 @@
         meta = case.getMeta()
         try:
             meta.delete_projectdata_and_reset()
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
             return success(header=_('Agreement withdrawn.'),
@@ -225,7 +198,6 @@
         meta = case.getMeta()
         try:
             meta.delete_incomplete_parts_and_anonymize()
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
             return success(header=_('Agreement globally withdrawn.'),
@@ -255,7 +227,6 @@
         meta = case.getMeta()
         try:
             meta.delete_metacase_and_reset()
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
             return success(header=_('Agreement globally withdrawn.'),
@@ -508,7 +479,6 @@
                       " Unlinking the meta case and revoking link permission.",
                       meta.master_id)
             meta.reset()
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
             text = _("The meta case doesn't seem to exist (anymore)"
@@ -524,7 +494,6 @@
                       " Resetting the meta information",
                       meta.master_id)
             meta.reset()
-            session['meta_discretion_statement'] = False
             session['meta_acceptance_statement'] = False
             session.save()
             text = _("The meta-case has been anonymized."

Modified: base/trunk/mpulsweb/templates/meta/index.mako
===================================================================
--- base/trunk/mpulsweb/templates/meta/index.mako	2012-08-01 13:30:22 UTC (rev 6007)
+++ base/trunk/mpulsweb/templates/meta/index.mako	2012-08-01 13:43:02 UTC (rev 6008)
@@ -20,7 +20,7 @@
       <a href="${h.url(controller='meta', action='digest', id=session.get('case').id)}" class="button">${_('Show digest of meta')}</a>
     % endif
   </p>
-% elif not session.get('meta_acceptance_statement') or  not session.get('meta_discretion_statement'):
+% elif not session.get('meta_acceptance_statement'):
   <p>
     <strong>${_('State')}:</strong>
     <img width="22" height="22" alt="Error" src="${h.url('/images/icons/info/failure_22.png')}">
@@ -57,23 +57,6 @@
           %endif
         </p>
       </td>
-      <td>
-        <h3>${_('Discretion statement')}</h3>
-        <p>
-          ${h.literal(_('This must be translated with the deatailed description for the discretion statement.'))}
-        </p>
-        <p>
-          % if not session.get('meta_discretion_statement') and not c.meta.is_sync_allowed():
-            <a href="${h.url(controller='meta', action='print_statement2', id=session.get('case').id, confirmed=0)}" onclick="return checkModification();" class="button" target="_blank">${_('Print discretion statement')}</a>
-            <br>
-            <br>
-            <a href="${h.url(controller='meta', action='set_statement2', id=session.get('case').id, confirmed=0)}" onclick="return checkModification();" class="button">${_('Set discretion statement')}</a>
-          % else:
-            <img width="22" height="22" alt="Ok" src="${h.url('/images/icons/info/ok_22.png')}">
-            ${_('Discretion statement is set')}
-          %endif
-        </p>
-      </td>
     </tr>
   </table>
 </div>



More information about the Mpuls-commits mailing list