[Erp5-report] r22558 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Jul 18 15:15:59 CEST 2008
Author: nicolas
Date: Fri Jul 18 15:15:56 2008
New Revision: 22558
URL: http://svn.erp5.org?rev=22558&view=rev
Log:
improve workflow_report
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_viewWorkflowReport/listbox.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.xml?rev=22558&r1=22557&r2=22558&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReport.xml Fri Jul 18 15:15:56 2008
@@ -66,29 +66,58 @@
<item>
<key> <string>_body</string> </key>
<value> <string>listbox = []\n
-\n
+result_dict = {}\n
portal_workflow = context.portal_workflow\n
content_type_list = context.allowedContentTypes()\n
+content_type_list.sort()\n
\n
# XXX better implementation is required, but I do not know how to get workflows related to a portal type\n
-possible_state_name_list = ["validation_state", "simulation_state"]\n
+possible_state_name_list = (\'validation_state\',\n
+ \'simulation_state\',\n
+ \'causality_state\',\n
+ \'invoice_state\',\n
+ \'payment_state\',\n
+ \'event_state\',\n
+ \'opportunity_state\',\n
+ \'immobilisation_state\',)\n
\n
for content_type in content_type_list:\n
content_type_id = content_type.id\n
-\n
for state_name in possible_state_name_list:\n
- result_list = context.Base_zCountByWorkflowState(portal_type=content_type_id, state_name=state_name)\n
-\n
+ result_list = context.Base_zCountByWorkflowState(portal_type=content_type_id,\n
+ state_name=state_name)\n
if not ((len(result_list) == 1) and (result_list[0][0] is None)):\n
for result in result_list:\n
-\n
- listbox.append({"portal_type":content_type_id,\n
- "state":result[0],\n
- "count":result[1] })\n
-\n
-context.Base_updateDialogForm(listbox = listbox,\n
- empty_line_number = 0)\n
-\n
+ portal_type_dict = result_dict.get(content_type_id, {})\n
+ count = portal_type_dict.get(result[0], 0) + result[1]\n
+ portal_type_dict.update({result[0]: count})\n
+ result_dict.update({content_type_id: portal_type_dict})\n
+\n
+state_list_dict = {}\n
+for portal_type in result_dict.keys():\n
+ listbox.append({\'portal_type\': portal_type,\n
+ \'state\' : \'\',\n
+ \'count\' : \'\'})\n
+ state_list = result_dict[portal_type].keys()\n
+ state_list.sort()\n
+ for state in state_list:\n
+ count = state_list_dict.get(state, 0) + result_dict[portal_type][state]\n
+ state_list_dict.update({state:count})\n
+ listbox.append({\'portal_type\': \'\',\n
+ \'state\' : state,\n
+ \'count\' : result_dict[portal_type][state]})\n
+\n
+listbox.append({\'portal_type\': \'All\',\n
+ \'state\' : \'\',\n
+ \'count\' : \'\'})\n
+state_list = state_list_dict.keys()\n
+state_list.sort()\n
+for state in state_list:\n
+ listbox.append({\'portal_type\': \'\',\n
+ \'state\' : state,\n
+ \'count\' : state_list_dict[state]})\n
+\n
+context.Base_updateDialogForm(listbox=listbox, empty_line_number=0)\n
return context.Folder_viewWorkflowReport()\n
</string> </value>
</item>
@@ -100,6 +129,12 @@
</item>
<item>
<key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_owner</string> </key>
<value>
<none/>
</value>
@@ -141,6 +176,7 @@
<value>
<tuple>
<string>listbox</string>
+ <string>result_dict</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_workflow</string>
@@ -155,6 +191,12 @@
<string>_getitem_</string>
<string>None</string>
<string>result</string>
+ <string>portal_type_dict</string>
+ <string>count</string>
+ <string>state_list_dict</string>
+ <string>portal_type</string>
+ <string>state_list</string>
+ <string>state</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_viewWorkflowReport/listbox.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_viewWorkflowReport/listbox.xml?rev=22558&r1=22557&r2=22558&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_viewWorkflowReport/listbox.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_viewWorkflowReport/listbox.xml Fri Jul 18 15:15:56 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.ERP5Form.ListBox</string>
- <string>ListBox</string>
- </tuple>
- <none/>
+ <global name="ListBox" module="Products.ERP5Form.ListBox"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -326,9 +323,17 @@
<value> <string></string> </value>
</item>
<item>
+ <key> <string>anchor</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
<key> <string>columns</string> </key>
<value>
<list>
+ <tuple>
+ <string>portal_type</string>
+ <string>Portal Type</string>
+ </tuple>
<tuple>
<string>state</string>
<string>State</string>
@@ -379,12 +384,7 @@
<item>
<key> <string>editable_columns</string> </key>
<value>
- <list>
- <tuple>
- <string>None</string>
- <string>None</string>
- </tuple>
- </list>
+ <list/>
</value>
</item>
<item>
@@ -426,6 +426,10 @@
</value>
</item>
<item>
+ <key> <string>page_template</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
<key> <string>portal_types</string> </key>
<value>
<list/>
@@ -457,7 +461,7 @@
</item>
<item>
<key> <string>selection_name</string> </key>
- <value> <string></string> </value>
+ <value> <string>folder_workflow_report_selection</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
@@ -474,12 +478,7 @@
<item>
<key> <string>stat_columns</string> </key>
<value>
- <list>
- <tuple>
- <string>None</string>
- <string>None</string>
- </tuple>
- </list>
+ <list/>
</value>
</item>
<item>
@@ -505,11 +504,8 @@
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
- <tuple>
- <string>Products.Formulator.MethodField</string>
- <string>Method</string>
- </tuple>
- <none/>
+ <global name="Method" module="Products.Formulator.MethodField"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
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=22558&r1=22557&r2=22558&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Fri Jul 18 15:15:56 2008
@@ -1,1 +1,1 @@
-877
+878
More information about the Erp5-report
mailing list