[Erp5-report] r19786 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 11 13:57:02 CET 2008


Author: alex
Date: Tue Mar 11 13:56:59 2008
New Revision: 19786

URL: http://svn.erp5.org?rev=19786&view=rev
Log:
* Base_checkConsistency: raise a list of Messages as exception argument, instead of only the first Message
* Base_getWorkflowHistoryItemList, Base_workflowStatusModify: add ability to handle a list of message

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkConsistency.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkConsistency.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkConsistency.xml?rev=19786&r1=19785&r2=19786&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkConsistency.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkConsistency.xml Tue Mar 11 13:56:59 2008
@@ -3,11 +3,8 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.PythonScripts.PythonScript</string>
-          <string>PythonScript</string>
-        </tuple>
-        <none/>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
@@ -71,14 +68,17 @@
             <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
 \n
 check_result = context.checkConsistency()\n
+message_list = []\n
 \n
-if check_result:\n
-  err = check_result[0]\n
-  if hasattr(err, \'getTranslatedMessage\'):\n
-    raise ValidationFailed, err.getTranslatedMessage()\n
+for err in check_result:\n
+  if getattr(err, \'getTranslatedMessage\', None) is not None:\n
+    message_list.append(err.getTranslatedMessage())\n
   else:\n
     # backward compatibility:\n
-    raise ValidationFailed, "%s: %s" % (err[4], err[3])\n
+    message.append(err[3])\n
+\n
+if message_list:\n
+  raise ValidationFailed, message_list\n
 </string> </value>
         </item>
         <item>
@@ -89,6 +89,12 @@
         </item>
         <item>
             <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
             <value>
               <none/>
             </value>
@@ -124,11 +130,15 @@
                             <string>Products.DCWorkflow.DCWorkflow</string>
                             <string>ValidationFailed</string>
                             <string>_getattr_</string>
-<string>context</string>
+                            <string>context</string>
                             <string>check_result</string>
+                            <string>message_list</string>
+                            <string>_getiter_</string>
+                            <string>err</string>
+                            <string>getattr</string>
+                            <string>None</string>
+                            <string>message</string>
                             <string>_getitem_</string>
-                            <string>err</string>
-                            <string>hasattr</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml?rev=19786&r1=19785&r2=19786&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowHistoryItemList.xml Tue Mar 11 13:56:59 2008
@@ -111,10 +111,12 @@
         else:\n
           value = wf_transitions.get(value, marker) and (wf_transitions[value].id or wf_transitions[value].actbox_name) or value\n
     if display:\n
-      if key == \'error_message\' and not same_type(value, \'\'):\n
-        value = \'%s\' %value\n
-      elif key == \'error_message\' and same_type(value, \'\'):\n
+      if key == \'error_message\' and same_type(value, \'\'):\n
         value = context.Localizer.erp5_ui.gettext(value)\n
+      elif key == \'error_message\' and same_type(value, []):\n
+        value = \'. \'.join([\'%s\' % x for x in value])\n
+      elif key == \'error_message\':\n
+        value = \'%s\' % value\n
       elif same_type(value, \'\') and key in ( \'action\', \'state\' ): \n
         value = context.Localizer.erp5_ui.gettext(value)\n
     if value is marker:\n
@@ -226,6 +228,9 @@
                             <string>compatibility_name</string>
                             <string>len</string>
                             <string>same_type</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>x</string>
                             <string>getattr</string>
                           </tuple>
                         </value>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.xml?rev=19786&r1=19785&r2=19786&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.xml Tue Mar 11 13:56:59 2008
@@ -3,11 +3,8 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.PythonScripts.PythonScript</string>
-          <string>PythonScript</string>
-        </tuple>
-        <none/>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
@@ -82,7 +79,9 @@
      workflow_action,\n
      comment=comment,\n
      **kw)\n
-  except ValidationFailed, message: \n
+  except ValidationFailed, message:\n
+    if getattr(message, \'msg\', None) and same_type(message.msg, []):\n
+      message = \'. \'.join(\'%s\' % x for x in message.msg)\n
     if not batch :\n
       context.REQUEST.RESPONSE.redirect(\n
                  "%s/view?portal_status_message=%s" %\n
@@ -150,6 +149,10 @@
                             <string>action_id_list</string>
                             <string>_apply_</string>
                             <string>message</string>
+                            <string>getattr</string>
+                            <string>None</string>
+                            <string>same_type</string>
+                            <string>_getiter_</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=19786&r1=19785&r2=19786&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Tue Mar 11 13:56:59 2008
@@ -1,1 +1,1 @@
-729
+735




More information about the Erp5-report mailing list