Commit 681b9f5e authored by Fabien Morin's avatar Fabien Morin

update ERP5Site_getSecurityFromLatestWorkflowHistory to remove workflow hardcoded value

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24253 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c81fb86a
...@@ -79,23 +79,31 @@ The parameters are\n ...@@ -79,23 +79,31 @@ The parameters are\n
\n \n
NOTE: for now, this script requires proxy manager\n NOTE: for now, this script requires proxy manager\n
"""\n """\n
from Products.CMFCore.WorkflowCore import WorkflowException\n
\n \n
portal_workflow = context.getPortalObject().portal_workflow\n portal_workflow = context.getPortalObject().portal_workflow\n
\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 last_site, last_group, last_function, last_user = (None, None, None, None)\n
for history_line in history_list:\n \n
if history_line.has_key(\'assigned_group\') and history_line[\'assigned_group\']:\n wf_list = [x for x, y in context.getWorkflowStateItemList()]\n
last_group = history_line[\'assigned_group\']\n for wf_id in wf_list: \n
last_function = history_line[\'assigned_function\']\n try:\n
last_site = history_line[\'assigned_site\']\n history_list = context.portal_workflow.getInfoFor(ob=context, \n
if history_line.has_key(\'assigned_user\') and history_line[\'assigned_user\']:\n name=\'history\', wf_id=wf_id)\n
last_user = history_line[\'assigned_user\']\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 \n
if last_group:\n if last_group:\n
return [{\'function\': last_function,\n return [{\'function\': last_function,\n
...@@ -159,17 +167,25 @@ return []\n ...@@ -159,17 +167,25 @@ return []\n
<string>user_name</string> <string>user_name</string>
<string>object</string> <string>object</string>
<string>portal_type</string> <string>portal_type</string>
<string>Products.CMFCore.WorkflowCore</string>
<string>WorkflowException</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_workflow</string> <string>portal_workflow</string>
<string>history_list</string>
<string>list</string>
<string>None</string> <string>None</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>last_site</string> <string>last_site</string>
<string>last_group</string> <string>last_group</string>
<string>last_function</string> <string>last_function</string>
<string>last_user</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>history_line</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>user</string> <string>user</string>
......
2008-10-20 fabien
* update ERP5Site_getSecurityFromLatestWorkflowHistory to remove workflow hardcoded value
2008-10-16 fabien 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 * 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
......
402 405
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment