Commit 1282f56f authored by Mayoro Diagne's avatar Mayoro Diagne

2008-08-30: mayoro

- addind script getAccessorMethodListboxVisibilityFromContext for disabling AccessorMethod listox in ODT mode

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23311 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent caaf4861
...@@ -66,12 +66,17 @@ ...@@ -66,12 +66,17 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>def getTitle(url=\'\'):\n <value> <string>def getTitle(url=\'\'):\n
return url.split(\'/\')[-1]\n obj = context.getPortalObject().restrictedTraverse(url)\n
if obj is None:\n
return url.split(\'/\')[-1]\n
else:\n
return obj.getTitle()\n
\n \n
from Products.ERP5Form.Report import ReportSection\n from Products.ERP5Form.Report import ReportSection\n
REQUEST = context.REQUEST\n REQUEST = context.REQUEST\n
REQUEST.set(\'is_documentation_report\', True)\n REQUEST.set(\'is_documentation_report\', True)\n
result = []\n result = []\n
root_class_name = REQUEST.get(\'class_name\')\n
documentation_helper = context.getDocumentationHelper(REQUEST.get(\'class_name\'), REQUEST.get(\'uri\'))\n documentation_helper = context.getDocumentationHelper(REQUEST.get(\'class_name\'), REQUEST.get(\'uri\'))\n
section_list = documentation_helper.getSectionList()\n section_list = documentation_helper.getSectionList()\n
result.append(\n result.append(\n
...@@ -119,7 +124,7 @@ for section in section_list:\n ...@@ -119,7 +124,7 @@ for section in section_list:\n
ReportSection(\n ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n path=context.getPortalObject().portal_classes.getRelativeUrl(),\n
level=3,\n level=3,\n
title= getTitle(uri.split(\'.\')[-1]),\n title= getTitle(uri),\n
form_id=\'\')\n form_id=\'\')\n
)\n )\n
result.append(\n result.append(\n
...@@ -140,9 +145,19 @@ for section in section_list:\n ...@@ -140,9 +145,19 @@ for section in section_list:\n
uri],\n uri],\n
listbox_display_mode=\'FlatListMode\')\n listbox_display_mode=\'FlatListMode\')\n
)\n )\n
for child_uri in uri_object.getSectionList():\n portal_skin = REQUEST.get(\'portal_skin\')\n
class_name = child_uri.getClassName()\n if portal_skin is None:\n
result += context.DocumentationHelper_getDocumentationSectionListParams(class_name, child_uri.uri_list)\n for child_uri in uri_object.getSectionList():\n
class_name = child_uri.getClassName()\n
result += context.DocumentationHelper_getDocumentationSectionListParams(class_name, child_uri.uri_list)\n
if root_class_name == "ERP5SiteDocumentationHelper":\n
for sub_child_uri in child_uri.getSectionList():\n
class_name = sub_child_uri.getClassName()\n
result += context.DocumentationHelper_getDocumentationSectionListParams(class_name, sub_child_uri.uri_list)\n
elif portal_skin == "ODT" and root_class_name == "ERP5SiteDocumentationHelper":\n
for child_uri in uri_object.getSectionList():\n
class_name = child_uri.getClassName()\n
result += context.DocumentationHelper_getDocumentationSectionListParams(class_name, child_uri.uri_list)\n
return result\n return result\n
</string> </value> </string> </value>
</item> </item>
...@@ -194,6 +209,7 @@ return result\n ...@@ -194,6 +209,7 @@ return result\n
<string>REQUEST</string> <string>REQUEST</string>
<string>True</string> <string>True</string>
<string>result</string> <string>result</string>
<string>root_class_name</string>
<string>documentation_helper</string> <string>documentation_helper</string>
<string>section_list</string> <string>section_list</string>
<string>dict</string> <string>dict</string>
...@@ -201,10 +217,12 @@ return result\n ...@@ -201,10 +217,12 @@ return result\n
<string>section</string> <string>section</string>
<string>uri</string> <string>uri</string>
<string>uri_object</string> <string>uri_object</string>
<string>_getitem_</string> <string>portal_skin</string>
<string>None</string>
<string>child_uri</string> <string>child_uri</string>
<string>class_name</string> <string>class_name</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>sub_child_uri</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<string>list_method</string> <string>list_method</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>url_columns</string> <string>url_columns</string>
<string>enabled</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -58,6 +59,20 @@ ...@@ -58,6 +59,20 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -66,10 +81,18 @@ ...@@ -66,10 +81,18 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -78,7 +101,7 @@ ...@@ -78,7 +101,7 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -109,7 +132,7 @@ ...@@ -109,7 +132,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -123,6 +146,10 @@ ...@@ -123,6 +146,10 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>accessor_method_listbox</string> </value> <value> <string>accessor_method_listbox</string> </value>
...@@ -132,9 +159,9 @@ ...@@ -132,9 +159,9 @@
<value> <string>DocumentationHelper_viewFieldLibrary</string> </value> <value> <string>DocumentationHelper_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -142,7 +169,7 @@ ...@@ -142,7 +169,7 @@
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -171,6 +198,22 @@ ...@@ -171,6 +198,22 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getAccessorMethodListboxVisibilityFromContext()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<string>list_method</string> <string>list_method</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>url_columns</string> <string>url_columns</string>
<string>enabled</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -58,6 +59,20 @@ ...@@ -58,6 +59,20 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -66,10 +81,18 @@ ...@@ -66,10 +81,18 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -78,7 +101,7 @@ ...@@ -78,7 +101,7 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -109,7 +132,7 @@ ...@@ -109,7 +132,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -123,6 +146,10 @@ ...@@ -123,6 +146,10 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>accessor_method_listbox</string> </value> <value> <string>accessor_method_listbox</string> </value>
...@@ -132,9 +159,9 @@ ...@@ -132,9 +159,9 @@
<value> <string>DocumentationHelper_viewFieldLibrary</string> </value> <value> <string>DocumentationHelper_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -142,7 +169,7 @@ ...@@ -142,7 +169,7 @@
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -171,6 +198,22 @@ ...@@ -171,6 +198,22 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getAccessorMethodListboxVisibilityFromContext()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
......
<?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>portal_skin = context.REQUEST.get(\'portal_skin\')\n
if portal_skin is None:\n
return True\n
else:\n
return False\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></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>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>_getattr_</string>
<string>context</string>
<string>portal_skin</string>
<string>None</string>
<string>True</string>
<string>False</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>getAccessorMethodListboxVisibilityFromContext</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
66 67
\ No newline at end of file \ 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