Commit efed45a6 authored by Jérome Perrin's avatar Jérome Perrin

similar to:

URL: http://svn.erp5.org?rev=22514&view=rev
Log:
only add visible and not invalidated organisations in Delivery_get*SectionItemList

... this is a duplicated script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22529 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 54d928ca
......@@ -75,14 +75,18 @@ if section is not None:\n
section_value = context.portal_categories.resolveCategory(section)\n
\n
if section_value is not None:\n
result = section_value.getGroupRelatedValueList(portal_type=\'Organisation\')\n
result = section_value.getGroupRelatedValueList(portal_type=\'Organisation\',\n
checked_permission=\'View\')\n
result = [r for r in result\n
if r.getProperty(\'validation_state\') not in (\'invalidated\', \'deleted\')]\n
\n
\n
current_destination_section = context.getDestinationSectionValue()\n
\n
if current_destination_section is not None and current_destination_section not in result:\n
result.append(current_destination_section)\n
\n
return [(\'\', \'\')]+[(i.getTitle(), i.getRelativeUrl()) for i in result]\n
return [(\'\', \'\')] + [(i.getTitle(), i.getRelativeUrl()) for i in result]\n
</string> </value>
</item>
<item>
......@@ -131,10 +135,11 @@ return [(\'\', \'\')]+[(i.getTitle(), i.getRelativeUrl()) for i in result]\n
<string>None</string>
<string>section_value</string>
<string>result</string>
<string>current_destination_section</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>r</string>
<string>current_destination_section</string>
<string>i</string>
</tuple>
</value>
......
......@@ -77,14 +77,17 @@ if section_cat is not None:\n
section_cat_obj = context.portal_categories.resolveCategory(section_cat)\n
\n
if section_cat_obj is not None:\n
result = section_cat_obj.getGroupRelatedValueList(portal_type=\'Organisation\')\n
result = section_cat_obj.getGroupRelatedValueList(portal_type=\'Organisation\',\n
checked_permission=\'View\')\n
result = [r for r in result\n
if r.getProperty(\'validation_state\') not in (\'invalidated\', \'deleted\')]\n
\n
current_source_section = context.getSourceSectionValue()\n
if current_source_section is not None and current_source_section not in result:\n
result.append(current_source_section)\n
\n
# convert to ListField format\n
return [(\'\', \'\')]+[(i.getTitle(), i.getRelativeUrl()) for i in result]\n
return [(\'\', \'\')] + [(i.getTitle(), i.getRelativeUrl()) for i in result]\n
</string> </value>
</item>
<item>
......@@ -133,10 +136,11 @@ return [(\'\', \'\')]+[(i.getTitle(), i.getRelativeUrl()) for i in result]\n
<string>None</string>
<string>section_cat_obj</string>
<string>result</string>
<string>current_source_section</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>r</string>
<string>current_source_section</string>
<string>i</string>
</tuple>
</value>
......
726
\ No newline at end of file
727
\ 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