diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml index c963de2f8f17757c68b826e0bcfe0df254645969..a8cfcd2476666c539667e1618629f4b159b98461 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml @@ -93,6 +93,8 @@ # This script is intended to be overriden by creating an instance \n # in each section if necessary\n \n +from string import split\n +\n portal_catalog = container.portal_catalog\n \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 \n # Then find the publication categories referenced by the web section\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 def checkMember(x):\n the_categories = x.getCategoriesList()\n if the_categories:\n for the_category in the_categories:\n if the_category in section_categories:\n - if x.getValidationState()==\'published\':\n - return x\n + if split(the_category,"/")[0] in section_base_categories_disjunctive:\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 # 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 @@ -233,12 +247,16 @@ return my_clean_list\n <value> <tuple> <string>kw</string> + <string>string</string> + <string>split</string> <string>_getattr_</string> <string>container</string> <string>portal_catalog</string> <string>context</string> <string>current_node</string> <string>section_categories</string> + <string>section_base_categories_conjunctive</string> + <string>section_base_categories_disjunctive</string> <string>checkMember</string> <string>map</string> <string>reference_list</string> diff --git a/bt5/erp5_web/bt/change_log b/bt5/erp5_web/bt/change_log index 9aaa3fcd83344c8e00bb17415be31790e6da021a..b442cbf515e1ef213df8b3829d1384b013d75b8e 100644 --- a/bt5/erp5_web/bt/change_log +++ b/bt5/erp5_web/bt/change_log @@ -1,3 +1,7 @@ +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 * 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. diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision index f937f7e2b36014ad312ae68bba28b0ec7be25770..f71beab75f5697f6169cfd1d9147fcee958c1038 100644 --- a/bt5/erp5_web/bt/revision +++ b/bt5/erp5_web/bt/revision @@ -1 +1 @@ -233 \ No newline at end of file +237 \ No newline at end of file diff --git a/bt5/erp5_web/bt/version b/bt5/erp5_web/bt/version index ce4f5af9e805c123dff89c95c1f1c4d64371f21d..4209dba21a11539beeeec0cf8c9495c711b343e7 100644 --- a/bt5/erp5_web/bt/version +++ b/bt5/erp5_web/bt/version @@ -1 +1 @@ -0.3.7 \ No newline at end of file +0.3.8 \ No newline at end of file