-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from eea/develop
Develop
- Loading branch information
Showing
6 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4 | ||
7.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters