From 758d27af85bf6d2dd325137079ad9a60a23d285b Mon Sep 17 00:00:00 2001 From: pbauer Date: Sun, 20 Sep 2015 17:29:27 +0200 Subject: [PATCH] [fc] Repository: plone.portlet.collection Branch: refs/heads/master Date: 2015-09-17T18:51:20+02:00 Author: esteele (esteele) Commit: https://github.com/plone/plone.portlet.collection/commit/f008aca65a72ddb5d7fba86302de2898656c6866 Use registry lookup for types_use_view_action_in_listings Files changed: M CHANGES.rst M plone/portlet/collection/collection.pt Repository: plone.portlet.collection Branch: refs/heads/master Date: 2015-09-18T09:53:02+02:00 Author: esteele (esteele) Commit: https://github.com/plone/plone.portlet.collection/commit/55aacdd27eb6b776abc1463fe17ceaae8a62df1d Fix registry id Files changed: M plone/portlet/collection/collection.pt Repository: plone.portlet.collection Branch: refs/heads/master Date: 2015-09-20T17:29:27+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/plone.portlet.collection/commit/ed93dbf8961dca89b1b19a54d96962804c6b0357 Merge pull request #9 from plone/portal-properties-cleanup Portal properties cleanup Files changed: M CHANGES.rst M plone/portlet/collection/collection.pt --- last_commit.txt | 1377 +++-------------------------------------------- 1 file changed, 80 insertions(+), 1297 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 9d6ca8392f..3778f2dc7a 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,1333 +1,116 @@ -Repository: Products.Archetypes +Repository: plone.portlet.collection Branch: refs/heads/master -Date: 2015-09-18T11:46:24+02:00 +Date: 2015-09-17T18:51:20+02:00 Author: esteele (esteele) -Commit: https://github.com/plone/Products.Archetypes/commit/2f82070a4f7f33bde2c78e826db37b5a495261c4 +Commit: https://github.com/plone/plone.portlet.collection/commit/f008aca65a72ddb5d7fba86302de2898656c6866 -Pull types_link_to_folder_contents values from the configuration registry. +Use registry lookup for types_use_view_action_in_listings Files changed: -M CHANGES.txt -M Products/Archetypes/Extensions/utils.py - -diff --git a/CHANGES.txt b/CHANGES.txt -index 5516afc..68adaef 100644 ---- a/CHANGES.txt -+++ b/CHANGES.txt -@@ -4,6 +4,9 @@ Changelog - 1.10.10 (unreleased) - -------------------- - -+- Pull types_link_to_folder_contents values from the configuration registry. +M CHANGES.rst +M plone/portlet/collection/collection.pt + +diff --git a/CHANGES.rst b/CHANGES.rst +index ded20c0..c84e2aa 100644 +--- a/CHANGES.rst ++++ b/CHANGES.rst +@@ -4,7 +4,8 @@ Changelog + 3.0.5 (unreleased) + ------------------ + +-- Nothing changed yet. ++- Use registry lookup for types_use_view_action_in_listings + [esteele] -+ - - Set calendar_starting_year and calendar_future_years_available in registry. - See https://github.com/plone/Products.CMFPlone/issues/872 - [pbauer] -diff --git a/Products/Archetypes/Extensions/utils.py b/Products/Archetypes/Extensions/utils.py -index dc5d535..9cf562a 100644 ---- a/Products/Archetypes/Extensions/utils.py -+++ b/Products/Archetypes/Extensions/utils.py -@@ -3,10 +3,13 @@ - - from App.Common import package_home - from OFS.ObjectManager import BadRequestException -+from zope.component import getUtility - from Products.CMFCore.ActionInformation import ActionInformation - from Products.CMFCore.DirectoryView import addDirectoryViews, \ - registerDirectory, manage_listAvailableDirectories - from Products.CMFCore.utils import getToolByName, getPackageName -+from Products.CMFPlone.interfaces import ITypesSchema -+from plone.registry.interfaces import IRegistry - from Products.Archetypes.config import REFERENCE_CATALOG - from Products.Archetypes.ArchetypeTool import fixActionsForType - from Products.Archetypes.ArchetypeTool import listTypes -@@ -148,15 +151,25 @@ def install_types(self, out, types, package_name): - sp = getattr(pt, 'site_properties', None) - if sp is None: - return None -- props = ('use_folder_tabs', 'typesLinkToFolderContentsInFC') -- for prop in props: -- folders = sp.getProperty(prop, None) -- if folders is None: -- continue -- folders = list(folders) -- folders.extend(folderish) -- folders = tuple(dict(zip(folders, folders)).keys()) -- sp._updateProperty(prop, folders) -+ -+ folders = sp.getProperty('use_folder_tabs', None) -+ if folders is None: -+ continue -+ folders = list(folders) -+ folders.extend(folderish) -+ folders = tuple(dict(zip(folders, folders)).keys()) -+ sp._updateProperty('use_folder_tabs', folders) -+ -+ registry = getUtility(IRegistry) -+ settings = registry.forInterface(ITypesSchema, prefix="plone") -+ folders = settings.types_link_to_folder_contents -+ if folders is None: -+ continue -+ folders = list(folders) -+ folders.extend(folderish) -+ folders = tuple(dict(zip(folders, folders)).keys()) -+ settings.types_link_to_folder_contents = folders -+ - def _getFtiAndDataFor(tool, typename, klassname, package_name): + 3.0.4 (2015-09-07) +diff --git a/plone/portlet/collection/collection.pt b/plone/portlet/collection/collection.pt +index bc42e2f..e28de26 100644 +--- a/plone/portlet/collection/collection.pt ++++ b/plone/portlet/collection/collection.pt +@@ -3,7 +3,7 @@ + tal:define="collection_url view/collection_url; + plone_view context/@@plone; + toLocalizedTime nocall:plone_view/toLocalizedTime; +- viewActions here/portal_properties/site_properties/typesUseViewActionInListings|python:();" ++ viewActions python:context.portal_registry.get('plone.types_view_action_in_listings', []);" + tal:attributes="class string:portlet portletCollection ${view/css_class}">
+ + -Repository: Products.Archetypes +Repository: plone.portlet.collection Branch: refs/heads/master -Date: 2015-09-19T16:37:43+02:00 +Date: 2015-09-18T09:53:02+02:00 Author: esteele (esteele) -Commit: https://github.com/plone/Products.Archetypes/commit/ad5939ad64ccb219cb8fdb68cd3a23cce815c1e5 +Commit: https://github.com/plone/plone.portlet.collection/commit/55aacdd27eb6b776abc1463fe17ceaae8a62df1d -Fix bad logic +Fix registry id Files changed: -M Products/Archetypes/Extensions/utils.py +M plone/portlet/collection/collection.pt -diff --git a/Products/Archetypes/Extensions/utils.py b/Products/Archetypes/Extensions/utils.py -index 9cf562a..b49dd12 100644 ---- a/Products/Archetypes/Extensions/utils.py -+++ b/Products/Archetypes/Extensions/utils.py -@@ -153,22 +153,20 @@ def install_types(self, out, types, package_name): - return None - - folders = sp.getProperty('use_folder_tabs', None) -- if folders is None: -- continue -- folders = list(folders) -- folders.extend(folderish) -- folders = tuple(dict(zip(folders, folders)).keys()) -- sp._updateProperty('use_folder_tabs', folders) -+ if folders is not None: -+ folders = list(folders) -+ folders.extend(folderish) -+ folders = tuple(dict(zip(folders, folders)).keys()) -+ sp._updateProperty('use_folder_tabs', folders) - - registry = getUtility(IRegistry) - settings = registry.forInterface(ITypesSchema, prefix="plone") - folders = settings.types_link_to_folder_contents -- if folders is None: -- continue -- folders = list(folders) -- folders.extend(folderish) -- folders = tuple(dict(zip(folders, folders)).keys()) -- settings.types_link_to_folder_contents = folders -+ if folders is not None: -+ folders = list(folders) -+ folders.extend(folderish) -+ folders = tuple(dict(zip(folders, folders)).keys()) -+ settings.types_link_to_folder_contents = folders - - - +diff --git a/plone/portlet/collection/collection.pt b/plone/portlet/collection/collection.pt +index e28de26..16eeb51 100644 +--- a/plone/portlet/collection/collection.pt ++++ b/plone/portlet/collection/collection.pt +@@ -3,7 +3,7 @@ + tal:define="collection_url view/collection_url; + plone_view context/@@plone; + toLocalizedTime nocall:plone_view/toLocalizedTime; +- viewActions python:context.portal_registry.get('plone.types_view_action_in_listings', []);" ++ viewActions python:context.portal_registry.get('plone.types_use_view_action_in_listings', []);" + tal:attributes="class string:portlet portletCollection ${view/css_class}">
+ + -Repository: Products.Archetypes +Repository: plone.portlet.collection Branch: refs/heads/master -Date: 2015-09-19T16:51:24+02:00 +Date: 2015-09-20T17:29:27+02:00 Author: Philip Bauer (pbauer) -Commit: https://github.com/plone/Products.Archetypes/commit/a6d0a2ee31d868cd9bd558885f565ca3c8fe168b - -allowRolesToAddKeywords -> roles_allowed_to_add_keywords - -Files changed: -M Products/Archetypes/Widget.py -M Products/Archetypes/skins/archetypes/widgets/keyword.pt -M Products/Archetypes/skins/archetypes/widgets/tests/keywordtests.html - -diff --git a/Products/Archetypes/Widget.py b/Products/Archetypes/Widget.py -index ad08aef..d9f9922 100644 ---- a/Products/Archetypes/Widget.py -+++ b/Products/Archetypes/Widget.py -@@ -24,8 +24,11 @@ - - from plone.app.widgets import base as base_widgets - from plone.app.widgets import utils -+from plone.registry.interfaces import IRegistry - from plone.uuid.interfaces import IUUID - -+from zope.component import getUtility -+ - import json - - _marker = [] -@@ -1215,18 +1218,13 @@ def _base_args(self, context, field, request): - membership = getToolByName(context, 'portal_membership') - user = membership.getAuthenticatedMember() - -- try: -- site_properties = getToolByName( -- context, 'portal_properties')['site_properties'] -- allowRolesToAddKeywords = site_properties.getProperty( -- 'allowRolesToAddKeywords', None) -- except AttributeError: -- allowRolesToAddKeywords = False -+ registry = getUtility(IRegistry) -+ roles_allowed_to_add_keywords = registry.get( -+ 'plone.roles_allowed_to_add_keywords', []) - - allowNewItems = False -- if allowRolesToAddKeywords and [ -- role for role in user.getRolesInContext(context) -- if role in allowRolesToAddKeywords]: -+ if [role for role in user.getRolesInContext(context) -+ if role in roles_allowed_to_add_keywords]: - allowNewItems = True - - args.setdefault('pattern_options', {}) -diff --git a/Products/Archetypes/skins/archetypes/widgets/keyword.pt b/Products/Archetypes/skins/archetypes/widgets/keyword.pt -index 089e341..2e9f95e 100644 ---- a/Products/Archetypes/skins/archetypes/widgets/keyword.pt -+++ b/Products/Archetypes/skins/archetypes/widgets/keyword.pt -@@ -28,9 +28,9 @@ - - -+ registry context/portal_registry; -+ roles_allowed_to_add_keywords python:registry['plone.roles_allowed_to_add_keywords'];"> - -
-@@ -120,7 +120,7 @@ -
-
- -- -+ -
-
-
- -- -- -+ -+ -
- -
-
--