[Erp5-report] r23161 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Aug 26 13:27:27 CEST 2008


Author: jerome
Date: Tue Aug 26 13:27:21 2008
New Revision: 23161

URL: http://svn.erp5.org?rev=23161&view=rev
Log:
fix Folder_generateWorkflowReport, it was changing the portal type of temp objects, so in the case of sale orders, some interaction workflows were triggered.
Add some missing translations and allow outputing this report in the preferred report style

Added:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_format.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_portal_skin.xml
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_generateWorkflowReportDialog.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=23161&r1=23160&r2=23161&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 Tue Aug 26 13:27:21 2008
@@ -71,6 +71,8 @@
 content_type_list = context.allowedContentTypes()\n
 content_type_list.sort()\n
 \n
+translateString = context.Base_translateString\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\',\n
                             \'simulation_state\',\n
@@ -93,30 +95,42 @@
         portal_type_dict.update({result[0]: count})\n
         result_dict.update({content_type_id: portal_type_dict})\n
 \n
+\n
+def getStateTranslatedTitle(state, portal_type, saved_state_dict=dict()):\n
+  if state in saved_state_dict:\n
+    return saved_state_dict[state]\n
+  # XXX requires manager proxy role\n
+  workflow_for_ptype = portal_workflow.getWorkflowsFor(portal_type)\n
+  for workflow in workflow_for_ptype:\n
+    if hasattr(workflow, \'states\') and state in workflow.states.objectIds():\n
+      saved_state_dict[state] = translateString(getattr(workflow.states, state).title_or_id())\n
+      return saved_state_dict[state]\n
+\n
 state_list_dict = {}\n
 portal_type_list = result_dict.keys()\n
 portal_type_list.sort()\n
 for portal_type in portal_type_list:\n
-  listbox.append({\'portal_type\': portal_type,\n
+  listbox.append({\'translated_portal_type\': translateString(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
+    state_title = getStateTranslatedTitle(state, portal_type)\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
+    listbox.append({\'translated_portal_type\': \'\',\n
+                    \'state\'      : state_title,\n
                     \'count\'      : result_dict[portal_type][state]})\n
 \n
-listbox.append({\'portal_type\': \'All\',\n
+listbox.append({\'translated_portal_type\': translateString(\'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
+  listbox.append({\'translated_portal_type\': \'\',\n
+                  \'state\'      : getStateTranslatedTitle(state, None),\n
                   \'count\'      : state_list_dict[state]})\n
 \n
 context.Base_updateDialogForm(listbox=listbox, empty_line_number=0)\n
@@ -183,6 +197,7 @@
                             <string>context</string>
                             <string>portal_workflow</string>
                             <string>content_type_list</string>
+                            <string>translateString</string>
                             <string>possible_state_name_list</string>
                             <string>_getiter_</string>
                             <string>content_type</string>
@@ -195,11 +210,14 @@
                             <string>result</string>
                             <string>portal_type_dict</string>
                             <string>count</string>
+                            <string>dict</string>
+                            <string>getStateTranslatedTitle</string>
                             <string>state_list_dict</string>
                             <string>portal_type_list</string>
                             <string>portal_type</string>
                             <string>state_list</string>
                             <string>state</string>
+                            <string>state_title</string>
                           </tuple>
                         </value>
                     </item>
@@ -219,6 +237,12 @@
             <value> <string>Folder_generateWorkflowReport</string> </value>
         </item>
         <item>
+            <key> <string>uid</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog.xml?rev=23161&r1=23160&r2=23161&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog.xml Tue Aug 26 13:27:21 2008
@@ -37,6 +37,12 @@
             </value>
         </item>
         <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
             <key> <string>action</string> </key>
             <value> <string>Folder_generateWorkflowReport</string> </value>
         </item>
@@ -52,7 +58,7 @@
             <key> <string>group_list</string> </key>
             <value>
               <list>
-                <string>Default</string>
+                <string>left</string>
               </list>
             </value>
         </item>
@@ -61,9 +67,12 @@
             <value>
               <dictionary>
                 <item>
-                    <key> <string>Default</string> </key>
+                    <key>                 <string>left</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <string>your_format</string>
+                        <string>your_portal_skin</string>
+                      </list>
                     </value>
                 </item>
               </dictionary>

Added: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_format.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_format.xml?rev=23161&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_format.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_format.xml Tue Aug 26 13:27:21 2008
@@ -1,0 +1,107 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>your_format</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>description</string> </key>
+                    <value> <string>Printing format</string> </value>
+                </item>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>your_format</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewDialogFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string>Format</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_portal_skin.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_portal_skin.xml?rev=23161&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_portal_skin.xml (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_generateWorkflowReportDialog/your_portal_skin.xml Tue Aug 26 13:27:21 2008
@@ -1,0 +1,99 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>delegated_list</string> </key>
+            <value>
+              <list/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>your_portal_skin</string> </value>
+        </item>
+        <item>
+            <key> <string>message_values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>external_validator_failed</string> </key>
+                    <value> <string>The input failed the external validator.</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>overrides</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>tales</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string></string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string></string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+        <item>
+            <key> <string>values</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>field_id</string> </key>
+                    <value> <string>your_portal_skin</string> </value>
+                </item>
+                <item>
+                    <key> <string>form_id</string> </key>
+                    <value> <string>Base_viewDialogFieldLibrary</string> </value>
+                </item>
+                <item>
+                    <key> <string>target</string> </key>
+                    <value> <string>Click to edit the target</string> </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

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=23161&r1=23160&r2=23161&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 Tue Aug 26 13:27:21 2008
@@ -331,8 +331,8 @@
                     <value>
                       <list>
                         <tuple>
-                          <string>portal_type</string>
-                          <string>Portal Type</string>
+                          <string>translated_portal_type</string>
+                          <string>Type</string>
                         </tuple>
                         <tuple>
                           <string>state</string>
@@ -472,7 +472,12 @@
                 <item>
                     <key> <string>sort_columns</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <tuple>
+                          <string>None</string>
+                          <string>None</string>
+                        </tuple>
+                      </list>
                     </value>
                 </item>
                 <item>
@@ -492,7 +497,20 @@
                 <item>
                     <key> <string>url_columns</string> </key>
                     <value>
-                      <list/>
+                      <list>
+                        <tuple>
+                          <string>translated_portal_type</string>
+<string></string>
+                        </tuple>
+                        <tuple>
+                          <string>state</string>
+<string></string>
+                        </tuple>
+                        <tuple>
+                          <string>count</string>
+<string></string>
+                        </tuple>
+                      </list>
                     </value>
                 </item>
               </dictionary>

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=23161&r1=23160&r2=23161&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Tue Aug 26 13:27:21 2008
@@ -1,1 +1,1 @@
-938
+940




More information about the Erp5-report mailing list