Commit 58401d97 authored by Jérome Perrin's avatar Jérome Perrin

restore enhanced function handling from r15620 and r15655

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15709 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 724c80d8
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: getattr(context.portal_categories.function, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))()</string> </value> <value> <string>python: getattr(context.portal_categories.function, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(filter_node=1)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -73,16 +73,22 @@ ...@@ -73,16 +73,22 @@
and extend it with all possible functions.\n and extend it with all possible functions.\n
"""\n """\n
\n \n
portal = context.getPortalObject()\n
category_child_item_list_method_id = portal.portal_preferences.getPreference(\n
\'preferred_category_child_item_list_method_id\',\n
\'getCategoryChildCompactLogicalPathItemList\')\n
result = []\n result = []\n
\n
if context.getSubordination():\n if context.getSubordination():\n
subordination_value = context.getSubordinationValue()\n subordination_value = context.getSubordinationValue()\n
if subordination_value is not None:\n if subordination_value is not None:\n
if subordination_value.getFunction():\n function_value = subordination_value.getFunctionValue()\n
function_value = subordination_value.getFunctionValue()\n if function_value is not None:\n
if function_value is not None:\n result.extend(getattr(function_value, category_child_item_list_method_id)(filter_node=1))\n
result.extend(function_value.getCategoryChildCompactLogicalPathItemList(filter_node=1))\n
\n \n
result.extend(context.portal_categories.function.getCategoryChildCompactLogicalPathItemList(filter_node=1))\n result.extend(getattr(\n
portal.portal_categories.function,\n
category_child_item_list_method_id)(filter_node=1))\n
\n \n
return result\n return result\n
</string> </value> </string> </value>
...@@ -127,12 +133,15 @@ return result\n ...@@ -127,12 +133,15 @@ return result\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>result</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string>
<string>category_child_item_list_method_id</string>
<string>result</string>
<string>subordination_value</string> <string>subordination_value</string>
<string>None</string> <string>None</string>
<string>function_value</string> <string>function_value</string>
<string>getattr</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The function assigned to the person.</string> </value> <value> <string>The function assigned to the person.</string> </value>
</item> </item>
<item> <item>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,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>title</string> </key> <key> <string>title</string> </key>
<value> <string>Function</string> </value> <value> <string>Function</string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: getattr(context.portal_categories.function, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))()</string> </value> <value> <string>here/Career_getFunctionItemList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The function of the organisation.</string> </value> <value> <string>The function of the organisation.</string> </value>
</item> </item>
<item> <item>
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>items</string> </key> <key> <string>items</string> </key>
<value> <value>
<list/> <list/>
</value> </value>
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,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>title</string> </key> <key> <string>title</string> </key>
<value> <string>Function</string> </value> <value> <string>Function</string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: getattr(context.portal_categories.function, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(filter_leaves=1)</string> </value> <value> <string>python: getattr(context.portal_categories.function, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(filter_leave=1)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
144 145
\ 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