[Erp5-report] r24320 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Oct 24 16:39:48 CEST 2008
Author: yusei
Date: Fri Oct 24 16:39:47 2008
New Revision: 24320
URL: http://svn.erp5.org?rev=24320&view=rev
Log:
2008-10-24 yusei
* Cleaned up Base_getTranslatedWorkflowStateItemList and separate generic function to Base_getWorkflowStateItemList.
Added:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.xml
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getTranslatedWorkflowStateItemList.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getTranslatedWorkflowStateItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getTranslatedWorkflowStateItemList.xml?rev=24320&r1=24319&r2=24320&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getTranslatedWorkflowStateItemList.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getTranslatedWorkflowStateItemList.xml Fri Oct 24 16:39:47 2008
@@ -53,32 +53,22 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string># wf_id : the id of workflow. It can be string, list or tuple.\n
-from Products.CMFCore.utils import getToolByName\n
+ <value> <string># wf_id is a bad argument name. But I will keep this for backward compatibility.\n
+# wf_id : the id of workflow. It can be string, list or tuple.\n
\n
Base_translateString = context.Base_translateString\n
\n
+if same_type(wf_id, []) or same_type(wf_id, ()):\n
+ workflow_id_list = wf_id\n
+else:\n
+ workflow_id_list = [wf_id]\n
\n
-if same_type(wf_id, []) or same_type(wf_id, ()):\n
- wf_id_list = wf_id\n
-else:\n
- wf_id_list = [wf_id]\n
+result = []\n
+for state_title, state_id in context.Base_getWorkflowStateItemList(workflow_id_list=workflow_id_list):\n
+ translated_state_title = Base_translateString(state_title)\n
+ result.append((translated_state_title, state_id))\n
\n
-state_dict = {}\n
-item_list = []\n
-for wf_id in wf_id_list:\n
-\n
- wf = getToolByName(context, \'portal_workflow\')[wf_id]\n
-\n
-\n
- for state in wf.states.objectValues():\n
- if state.title and state.id != \'deleted\':\n
- if not state_dict.has_key(state.id):\n
- # we hide states without titles\n
- item_list.append((Base_translateString(state.title), state.id))\n
- state_dict[state.id] = None\n
-\n
-return item_list\n
+return result\n
</string> </value>
</item>
<item>
@@ -94,11 +84,7 @@
<item>
<key> <string>_proxy_roles</string> </key>
<value>
- <tuple>
- <string>Auditor</string>
- <string>Manager</string>
- <string>Member</string>
- </tuple>
+ <tuple/>
</value>
</item>
<item>
@@ -126,21 +112,16 @@
<value>
<tuple>
<string>wf_id</string>
- <string>Products.CMFCore.utils</string>
- <string>getToolByName</string>
<string>_getattr_</string>
<string>context</string>
<string>Base_translateString</string>
<string>same_type</string>
- <string>wf_id_list</string>
- <string>state_dict</string>
- <string>item_list</string>
+ <string>workflow_id_list</string>
+ <string>result</string>
<string>_getiter_</string>
- <string>_getitem_</string>
- <string>wf</string>
- <string>state</string>
- <string>None</string>
- <string>_write_</string>
+ <string>state_title</string>
+ <string>state_id</string>
+ <string>translated_state_title</string>
</tuple>
</value>
</item>
Added: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.xml?rev=24320&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getWorkflowStateItemList.xml Fri Oct 24 16:39:47 2008
@@ -1,0 +1,160 @@
+<?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>from Products.CMFCore.utils import getToolByName\n
+\n
+if not (same_type(workflow_id_list, []) or same_type(workflow_id_list, ())):\n
+ workflow_id_list = (workflow_id_list,)\n
+\n
+state_dict = {}\n
+item_list = []\n
+for workflow_id in workflow_id_list:\n
+ workflow = getToolByName(context, \'portal_workflow\')[workflow_id]\n
+ for state in workflow.states.objectValues():\n
+ if state.title and state.id!=\'deleted\':\n
+ if not state_dict.has_key(state.id):\n
+ # we hide states without titles\n
+ item_list.append((state.title, state.id))\n
+ state_dict[state.id] = None\n
+return item_list\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>workflow_id_list</string> </value>
+ </item>
+ <item>
+ <key> <string>_proxy_roles</string> </key>
+ <value>
+ <tuple>
+ <string>Auditor</string>
+ <string>Manager</string>
+ <string>Member</string>
+ </tuple>
+ </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>workflow_id_list</string>
+ <string>Products.CMFCore.utils</string>
+ <string>getToolByName</string>
+ <string>same_type</string>
+ <string>state_dict</string>
+ <string>item_list</string>
+ <string>_getiter_</string>
+ <string>workflow_id</string>
+ <string>_getitem_</string>
+ <string>context</string>
+ <string>workflow</string>
+ <string>_getattr_</string>
+ <string>state</string>
+ <string>None</string>
+ <string>_write_</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>Base_getWorkflowStateItemList</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log?rev=24320&r1=24319&r2=24320&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/change_log Fri Oct 24 16:39:47 2008
@@ -1,3 +1,6 @@
+2008-10-24 yusei
+* Cleaned up Base_getTranslatedWorkflowStateItemList and separate generic function to Base_getWorkflowStateItemList.
+
2008-10-24 yusei
* Fixed Folder_generateWorkflowReport. This did not work if there is interaction workflow.
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=24320&r1=24319&r2=24320&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Fri Oct 24 16:39:47 2008
@@ -1,1 +1,1 @@
-1004
+1005
More information about the Erp5-report
mailing list