[Erp5-report] r24253 - in /erp5/trunk/bt5/erp5_egov: SkinTemplateItem/portal_skins/erp5_ego...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Oct 20 16:08:56 CEST 2008


Author: fabien
Date: Mon Oct 20 16:08:52 2008
New Revision: 24253

URL: http://svn.erp5.org?rev=24253&view=rev
Log:
update ERP5Site_getSecurityFromLatestWorkflowHistory  to remove workflow hardcoded value

Modified:
    erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/ERP5Site_getSecurityFromWorkflowAssignment.xml
    erp5/trunk/bt5/erp5_egov/bt/change_log
    erp5/trunk/bt5/erp5_egov/bt/revision

Modified: erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/ERP5Site_getSecurityFromWorkflowAssignment.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/ERP5Site_getSecurityFromWorkflowAssignment.xml?rev=24253&r1=24252&r2=24253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/ERP5Site_getSecurityFromWorkflowAssignment.xml (original)
+++ erp5/trunk/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/ERP5Site_getSecurityFromWorkflowAssignment.xml Mon Oct 20 16:08:52 2008
@@ -79,23 +79,31 @@
 \n
 NOTE: for now, this script requires proxy manager\n
 """\n
+from Products.CMFCore.WorkflowCore import WorkflowException\n
 \n
 portal_workflow = context.getPortalObject().portal_workflow\n
 \n
-history_list = context.portal_workflow.getInfoFor(ob=context, \n
-                                          name=\'history\', wf_id=\'egov_universal_workflow\')\n
-# reverse the list to get the first assign user\n
-history_list = list(history_list)\n
-history_list.reverse()\n
-\n
 last_site, last_group, last_function, last_user = (None, None, None, None)\n
-for history_line in history_list:\n
-  if history_line.has_key(\'assigned_group\') and history_line[\'assigned_group\']:\n
-    last_group = history_line[\'assigned_group\']\n
-    last_function = history_line[\'assigned_function\']\n
-    last_site = history_line[\'assigned_site\']\n
-  if history_line.has_key(\'assigned_user\') and history_line[\'assigned_user\']:\n
-    last_user = history_line[\'assigned_user\']\n
+\n
+wf_list = [x for x, y in context.getWorkflowStateItemList()]\n
+for wf_id in wf_list: \n
+  try:\n
+    history_list = context.portal_workflow.getInfoFor(ob=context, \n
+                                              name=\'history\', wf_id=wf_id)\n
+  except WorkflowException:\n
+    continue\n
+\n
+  # reverse the list to get the first assign user\n
+  history_list = list(history_list)\n
+  history_list.reverse()\n
+\n
+  for history_line in history_list:\n
+    if history_line.has_key(\'assigned_group\') and history_line[\'assigned_group\']:\n
+      last_group = history_line[\'assigned_group\']\n
+      last_function = history_line[\'assigned_function\']\n
+      last_site = history_line[\'assigned_site\']\n
+    if history_line.has_key(\'assigned_user\') and history_line[\'assigned_user\']:\n
+      last_user = history_line[\'assigned_user\']\n
 \n
 if last_group:\n
   return [{\'function\': last_function,\n
@@ -159,17 +167,25 @@
                             <string>user_name</string>
                             <string>object</string>
                             <string>portal_type</string>
+                            <string>Products.CMFCore.WorkflowCore</string>
+                            <string>WorkflowException</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>portal_workflow</string>
-                            <string>history_list</string>
-                            <string>list</string>
                             <string>None</string>
                             <string>_getiter_</string>
                             <string>last_site</string>
                             <string>last_group</string>
                             <string>last_function</string>
                             <string>last_user</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>x</string>
+                            <string>y</string>
+                            <string>wf_list</string>
+                            <string>wf_id</string>
+                            <string>history_list</string>
+                            <string>list</string>
                             <string>history_line</string>
                             <string>_getitem_</string>
                             <string>user</string>

Modified: erp5/trunk/bt5/erp5_egov/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/bt/change_log?rev=24253&r1=24252&r2=24253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_egov/bt/change_log Mon Oct 20 16:08:52 2008
@@ -1,3 +1,6 @@
+2008-10-20 fabien
+* update ERP5Site_getSecurityFromLatestWorkflowHistory  to remove workflow hardcoded value
+
 2008-10-16 fabien
 * change css to have all the tabs of the forms (actions) on the right instead of have the first on right and the others in the middle
 

Modified: erp5/trunk/bt5/erp5_egov/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/bt/revision?rev=24253&r1=24252&r2=24253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/bt/revision (original)
+++ erp5/trunk/bt5/erp5_egov/bt/revision Mon Oct 20 16:08:52 2008
@@ -1,1 +1,1 @@
-402
+405




More information about the Erp5-report mailing list