[CMF-checkins] CVS: Products/CMFCalendar - CalendarTool.py:1.8.10.6
Stefan H. Holek
stefan at epy.co.at
Wed Aug 4 19:05:55 EDT 2004
Update of /cvs-repository/Products/CMFCalendar
In directory cvs.zope.org:/tmp/cvs-serv20599/CMFCalendar
Modified Files:
Tag: CMF-1_4-branch
CalendarTool.py
Log Message:
Implemented parts of #110 by making workflow states configurable TTW.
=== Products/CMFCalendar/CalendarTool.py 1.8.10.5 => 1.8.10.6 ===
--- Products/CMFCalendar/CalendarTool.py:1.8.10.5 Tue Aug 3 06:26:46 2004
+++ Products/CMFCalendar/CalendarTool.py Wed Aug 4 19:05:25 2004
@@ -33,6 +33,10 @@
security = ClassSecurityInfo()
plone_tool = 1
+ calendar_types = ('Event',)
+ calendar_states = ('published',)
+ use_session = ''
+
manage_options = ( ({ 'label' : 'Overview', 'action' : 'manage_overview' }
, { 'label' : 'Configure', 'action' : 'manage_configure' }
,
@@ -50,14 +54,11 @@
manage_configure = PageTemplateFile('www/configureCalendarTool', globals(),
__name__='manage_configure')
- def __init__(self):
- self.calendar_types = ['Event']
- self.use_session = ""
-
security.declareProtected( ManagePortal, 'edit_configuration' )
- def edit_configuration(self, show_types, use_session):
+ def edit_configuration(self, show_types, use_session, show_states):
""" Change the configuration of the calendar tool """
- self.calendar_types = show_types
+ self.calendar_types = tuple(show_types)
+ self.calendar_states = tuple(show_states)
self.use_session = use_session
if hasattr(self.REQUEST, 'RESPONSE'):
self.REQUEST.RESPONSE.redirect('manage_configure')
@@ -67,6 +68,11 @@
""" Returns a list of type that will show in the calendar """
return self.calendar_types
+ security.declarePublic('getCalendarStates')
+ def getCalendarStates(self):
+ """ Returns a list of workflow states that will show in the calendar """
+ return self.calendar_states
+
security.declarePublic('getUseSession')
def getUseSession(self):
""" Returns the Use_Session option """
@@ -133,8 +139,8 @@
first_date=self.getBeginAndEndTimes(1, month, year)[0]
last_date=self.getBeginAndEndTimes(last_day, month, year)[1]
- query=self.portal_catalog(portal_type=self.calendar_types,
- review_state='published',
+ query=self.portal_catalog(portal_type=self.getCalendarTypes(),
+ review_state=self.getCalendarStates(),
start={'query': last_date,
'range': 'max'},
end={'query': first_date,
@@ -201,20 +207,20 @@
#last_date=DateTime(thisDay.Date()+" 23:59:59")
# Get all events that Start on this day
- query=self.portal_catalog(portal_type=self.calendar_types,
- review_state='published',
+ query=self.portal_catalog(portal_type=self.getCalendarTypes(),
+ review_state=self.getCalendarStates(),
start={'query': (first_date,last_date),
'range': 'min:max'})
# Get all events that End on this day
- query+=self.portal_catalog(portal_type=self.calendar_types,
- review_state='published',
+ query+=self.portal_catalog(portal_type=self.getCalendarTypes(),
+ review_state=self.getCalendarStates(),
end={'query': (first_date,last_date),
'range': 'min:max'})
# Get all events that Start before this day AND End after this day
- query+=self.portal_catalog(portal_type=self.calendar_types,
- review_state='published',
+ query+=self.portal_catalog(portal_type=self.getCalendarTypes(),
+ review_state=self.getCalendarStates(),
start={'query': first_date,
'range': 'max'},
end={'query': last_date,
More information about the CMF-checkins
mailing list