Commit f12d3f83 authored by Kevin Deldycke's avatar Kevin Deldycke

(Stefan) Membership and Multimembership can be used simultaneously. The corresponding

base categories may not overlap. The results of both memberships are unified.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9464 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6fce02b7
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
# This script is intended to be overriden by creating an instance \n # This script is intended to be overriden by creating an instance \n
# in each section if necessary\n # in each section if necessary\n
\n \n
from string import split\n
\n
portal_catalog = container.portal_catalog\n portal_catalog = container.portal_catalog\n
\n \n
# First find the web section we are in\n # First find the web section we are in\n
...@@ -102,15 +104,27 @@ while not current_node.getPortalType() in (\'Web Section\', \'Web Site\'):\n ...@@ -102,15 +104,27 @@ while not current_node.getPortalType() in (\'Web Section\', \'Web Site\'):\n
\n \n
# Then find the publication categories referenced by the web section\n # Then find the publication categories referenced by the web section\n
section_categories = current_node.getMembershipCriterionCategoryList()\n section_categories = current_node.getMembershipCriterionCategoryList()\n
\n section_base_categories_conjunctive = current_node.getMembershipCriterionBaseCategoryList()\n
section_base_categories_disjunctive = current_node.getMultimembershipCriterionBaseCategoryList()\n
\n \n
def checkMember(x):\n def checkMember(x):\n
the_categories = x.getCategoriesList()\n the_categories = x.getCategoriesList()\n
if the_categories:\n if the_categories:\n
for the_category in the_categories:\n for the_category in the_categories:\n
if the_category in section_categories:\n if the_category in section_categories:\n
if x.getValidationState()==\'published\':\n if split(the_category,"/")[0] in section_base_categories_disjunctive:\n
return x\n if x.getValidationState()==\'published\':\n
return True # one disjunctive category was found\n
checker=False\n
for one_category in section_categories:\n
if split(one_category,"/")[0] in section_base_categories_conjunctive:\n
if one_category not in the_categories:\n
return False # one conjunctive category was not found\n
else:\n
checker=True\n
return checker # loop ends, so all conjunctive categories were found - If there were any.\n
else:\n
return False\n
\n \n
# get all web pages and check if their publication category is in the category list of the web section\n # get all web pages and check if their publication category is in the category list of the web section\n
# reference_list = map(lambda x:x.getReference(), context.getSourceValueList(portal_type="Web Page"))\n # reference_list = map(lambda x:x.getReference(), context.getSourceValueList(portal_type="Web Page"))\n
...@@ -233,12 +247,16 @@ return my_clean_list\n ...@@ -233,12 +247,16 @@ return my_clean_list\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>string</string>
<string>split</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>container</string> <string>container</string>
<string>portal_catalog</string> <string>portal_catalog</string>
<string>context</string> <string>context</string>
<string>current_node</string> <string>current_node</string>
<string>section_categories</string> <string>section_categories</string>
<string>section_base_categories_conjunctive</string>
<string>section_base_categories_disjunctive</string>
<string>checkMember</string> <string>checkMember</string>
<string>map</string> <string>map</string>
<string>reference_list</string> <string>reference_list</string>
......
2006-08-25 Stefan
* Membership and Multimembership can be used simultaneously. The corresponding
base categories may not overlap. The results of both memberships are unified.
2006-08-25 Kevin 2006-08-25 Kevin
* Move all scripts and forms in uncertain state to erp5_web_old skin folder. * Move all scripts and forms in uncertain state to erp5_web_old skin folder.
* Move all specific scripts and forms from erp5_web skin folder to brand new web widget libray folder. * Move all specific scripts and forms from erp5_web skin folder to brand new web widget libray folder.
......
233 237
\ No newline at end of file \ No newline at end of file
0.3.7 0.3.8
\ 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