[Erp5-report] r23111 - in /erp5/trunk/bt5/erp5_project: ActionTemplateItem/portal_types/Req...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 22 14:18:11 CEST 2008


Author: jerome
Date: Fri Aug 22 14:18:02 2008
New Revision: 23111

URL: http://svn.erp5.org?rev=23111&view=rev
Log:
An action to cleanup descriptions on requirements

Added:
    erp5/trunk/bt5/erp5_project/ActionTemplateItem/portal_types/Requirement%20Document/cleanup_descriptions.xml
    erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/RequirementDocument_cleanupDescription.xml
Modified:
    erp5/trunk/bt5/erp5_project/bt/revision
    erp5/trunk/bt5/erp5_project/bt/template_action_path_list

Added: erp5/trunk/bt5/erp5_project/ActionTemplateItem/portal_types/Requirement%20Document/cleanup_descriptions.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/ActionTemplateItem/portal_types/Requirement%2520Document/cleanup_descriptions.xml?rev=23111&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_project/ActionTemplateItem/portal_types/Requirement%20Document/cleanup_descriptions.xml (added)
+++ erp5/trunk/bt5/erp5_project/ActionTemplateItem/portal_types/Requirement%20Document/cleanup_descriptions.xml Fri Aug 22 14:18:02 2008
@@ -1,0 +1,83 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>action</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>category</string> </key>
+            <value> <string>object_action</string> </value>
+        </item>
+        <item>
+            <key> <string>condition</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>icon</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>cleanup_descriptions</string> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>Modify portal content</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>priority</string> </key>
+            <value> <float>8.0</float> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Cleanup Descriptions</string> </value>
+        </item>
+        <item>
+            <key> <string>visible</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>string:${object_url}/RequirementDocument_cleanupDescription</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/RequirementDocument_cleanupDescription.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/RequirementDocument_cleanupDescription.xml?rev=23111&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/RequirementDocument_cleanupDescription.xml (added)
+++ erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/RequirementDocument_cleanupDescription.xml Fri Aug 22 14:18:02 2008
@@ -1,0 +1,176 @@
+<?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>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </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 encoding="cdata"><![CDATA[
+
+def cleanupDescription(requirement):\n
+  description = requirement.getDescription(\'\').replace(\'\\r\\n\', \'\\n\')\n
+  new_description = \'\'\n
+  for i, char in enumerate(description):\n
+    if char == \' \':\n
+      # strip double spaces\n
+      if len(description) > i and description[i + 1] == \' \':\n
+        continue\n
+    # replace \\n between words by spaces\n
+    if char == \'\\n\' and i > 1 and description[i - 1] != \'.\':\n
+      new_description += \' \'\n
+      continue\n
+\n
+    new_description += char\n
+\n
+  requirement.edit(description=new_description)\n
+  \n
+  # continue recursively\n
+  for sub_requirement in requirement.contentValues(\n
+               checked_permission=\'Modify portal content\'):\n
+    cleanupDescription(sub_requirement)\n
+\n
+cleanupDescription(context)\n
+\n
+return context.Base_redirect(form_id,\n
+  keep_items=dict(portal_status_message=\n
+                     context.Base_translateString(\'Descriptions cleaned up\')))\n
+
+
+]]></string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>form_id=\'view\', **kw</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>form_id</string>
+                            <string>kw</string>
+                            <string>cleanupDescription</string>
+                            <string>context</string>
+                            <string>_getattr_</string>
+                            <string>dict</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <string>view</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>RequirementDocument_cleanupDescription</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_project/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/bt/revision?rev=23111&r1=23110&r2=23111&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_project/bt/revision (original)
+++ erp5/trunk/bt5/erp5_project/bt/revision Fri Aug 22 14:18:02 2008
@@ -1,1 +1,1 @@
-560
+561

Modified: erp5/trunk/bt5/erp5_project/bt/template_action_path_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/bt/template_action_path_list?rev=23111&r1=23110&r2=23111&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_project/bt/template_action_path_list (original)
+++ erp5/trunk/bt5/erp5_project/bt/template_action_path_list Fri Aug 22 14:18:02 2008
@@ -32,6 +32,7 @@
 Project | task_list
 Project | task_report_list
 Project | view
+Requirement Document | cleanup_descriptions
 Requirement Document | detailed_report
 Requirement Document | fast_input
 Requirement Document | orphaned




More information about the Erp5-report mailing list