Commit 31b40dba authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add support for base categories without sub-categories and choosing skin selections.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2244 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4d16fe7f
...@@ -173,6 +173,11 @@ class CategoryTemplateItem(ObjectTemplateItem): ...@@ -173,6 +173,11 @@ class CategoryTemplateItem(ObjectTemplateItem):
#if not object.cb_isCopyable(): #if not object.cb_isCopyable():
# raise CopyError, eNotSupported % escape(relative_url) # raise CopyError, eNotSupported % escape(relative_url)
category_copy = category._getCopy(context) category_copy = category._getCopy(context)
include_sub_categories = category.getProperty('business_template_include_sub_categories', 1)
if not include_sub_categories:
id_list = category_copy.objectIds()
if len(id_list) > 0:
category_copy.manage_delObjects(list(id_list))
self._archive[relative_url] = category_copy self._archive[relative_url] = category_copy
category_copy.wl_clearLocks() category_copy.wl_clearLocks()
# No store attributes for light install # No store attributes for light install
...@@ -223,8 +228,10 @@ class SkinTemplateItem(ObjectTemplateItem): ...@@ -223,8 +228,10 @@ class SkinTemplateItem(ObjectTemplateItem):
for skin_name, selection in ps.getSkinPaths(): for skin_name, selection in ps.getSkinPaths():
new_selection = [] new_selection = []
selection = selection.split(',') selection = selection.split(',')
for relative_url in self._archive.keys(): for relative_url, object in self._archive.items():
skin_id = relative_url.split('/')[-1] skin_id = relative_url.split('/')[-1]
selection_list = object.getProperty('business_template_registered_skin_selections', None)
if selection_list is None or skin_name in selection_list:
if skin_id not in selection: if skin_id not in selection:
new_selection.append(skin_id) new_selection.append(skin_id)
new_selection.extend(selection) new_selection.extend(selection)
......
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