Skip to content

Commit

Permalink
Merge pull request #78 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
erral authored Feb 16, 2023
2 parents 190329a + 369da1b commit 95f370d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 1 deletion.
1 change: 1 addition & 0 deletions clms/addon/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
<include package=".contentrules" />
<include package=".patches" />
<include package=".adapters" />
<include package=".subscribers" />

</configure>
Empty file.
22 changes: 22 additions & 0 deletions clms/addon/subscribers/configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="eea"
>

<subscriber
for="plone.app.contenttypes.interfaces.IDocument
zope.lifecycleevent.interfaces.IObjectAddedEvent"
handler=".hide_public_folder_in_events.set_folder_expired"
/>

<subscriber
for="plone.app.contenttypes.interfaces.IFolder
zope.lifecycleevent.interfaces.IObjectAddedEvent"
handler=".hide_public_folder_in_events.set_folder_expired"
/>




</configure>
24 changes: 24 additions & 0 deletions clms/addon/subscribers/hide_public_folder_in_events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
""" Subscriber to set expiration date of the 'public' folder
that is automatically created in Meetings
"""
from logging import getLogger

from Acquisition import aq_parent
from DateTime import DateTime
from zope.event import notify
from zope.lifecycleevent import ObjectModifiedEvent


def set_folder_expired(context, event):
"""subscriber implementation"""
log = getLogger(__name__)
parent = aq_parent(context)
if context.Title() == "Public" and parent.portal_type == "eea.meeting":
context.effective = DateTime("1990-01-01T09:00:00Z")
context.setEffectiveDate(DateTime("1990-01-01T09:00:00Z"))
context.expires = DateTime("1990-01-01T10:00:00Z")
context.setExpirationDate(DateTime("1990-01-01T10:00:00Z"))
notify(ObjectModifiedEvent(context))
log.info(
"Expiration date set for public folder in event %s", parent.id
)
2 changes: 1 addition & 1 deletion clms/addon/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4
7.5
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

7.5 - (2023-02-16)
---------------------------
* Change: Develop
[erral]

7.4 - (2023-02-13)
---------------------------
* Change: Develop
Expand Down

0 comments on commit 95f370d

Please sign in to comment.