Commit 64ca0fd6 authored by Fabien Morin's avatar Fabien Morin

erp5_web.Document_viewHistoryWidget script depend on...

erp5_web.Document_viewHistoryWidget script depend on Base_getWorkflowEventInfoList, so move it from erp5_km to erp5_web

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31768 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c283c601
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Return a merge list of all workflow history sorted by time.\n
Result is returned as a sorted list of tempobject (returned by\n
Base_getWorkflowHistoryItemList).\n
This script can easily be used as list method by a listbox\n
"""\n
\n
from Products.CMFCore.WorkflowCore import WorkflowException\n
history = {}\n
workflow_id_list = [workflow_id for workflow_id, workflow_state in context.getWorkflowStateItemList()]\n
for wf_id in workflow_id_list:\n
try:\n
history[wf_id]=context.Base_getWorkflowHistoryItemList(workflow_id=wf_id)\n
except WorkflowException:\n
# some workflow don\'t have history\n
pass\n
\n
event_list = []\n
for worrkflow_id in history.keys():\n
event_list += history[worrkflow_id]\n
if sort: event_list.sort(key=lambda x:x.time, reverse=True)\n
return event_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>sort=1</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>sort</string>
<string>Products.CMFCore.WorkflowCore</string>
<string>WorkflowException</string>
<string>history</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>context</string>
<string>workflow_id</string>
<string>workflow_state</string>
<string>workflow_id_list</string>
<string>wf_id</string>
<string>_write_</string>
<string>event_list</string>
<string>worrkflow_id</string>
<string>_inplacevar_</string>
<string>_getitem_</string>
<string>True</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>1</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getWorkflowEventInfoList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
891
\ No newline at end of file
892
\ 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