[CMF-checkins] CVS: Products/CMFCalendar - CalendarTool.py:1.8.10.7
Stefan H. Holek
stefan at epy.co.at
Thu Aug 5 17:01:19 EDT 2004
Update of /cvs-repository/Products/CMFCalendar
In directory cvs.zope.org:/tmp/cvs-serv15771/CMFCalendar
Modified Files:
Tag: CMF-1_4-branch
CalendarTool.py
Log Message:
Revert changes to the CalendarTool on CMF-1_4-branch. Sorry for the noise.
=== Products/CMFCalendar/CalendarTool.py 1.8.10.6 => 1.8.10.7 ===
--- Products/CMFCalendar/CalendarTool.py:1.8.10.6 Wed Aug 4 19:05:25 2004
+++ Products/CMFCalendar/CalendarTool.py Thu Aug 5 17:00:49 2004
@@ -33,10 +33,6 @@
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' }
,
@@ -54,11 +50,14 @@
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, show_states):
+ def edit_configuration(self, show_types, use_session):
""" Change the configuration of the calendar tool """
- self.calendar_types = tuple(show_types)
- self.calendar_states = tuple(show_states)
+ self.calendar_types = show_types
self.use_session = use_session
if hasattr(self.REQUEST, 'RESPONSE'):
self.REQUEST.RESPONSE.redirect('manage_configure')
@@ -68,11 +67,6 @@
""" 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 """
@@ -139,8 +133,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.getCalendarTypes(),
- review_state=self.getCalendarStates(),
+ query=self.portal_catalog(portal_type=self.calendar_types,
+ review_state='published',
start={'query': last_date,
'range': 'max'},
end={'query': first_date,
@@ -207,20 +201,20 @@
#last_date=DateTime(thisDay.Date()+" 23:59:59")
# Get all events that Start on this day
- query=self.portal_catalog(portal_type=self.getCalendarTypes(),
- review_state=self.getCalendarStates(),
+ query=self.portal_catalog(portal_type=self.calendar_types,
+ review_state='published',
start={'query': (first_date,last_date),
'range': 'min:max'})
# Get all events that End on this day
- query+=self.portal_catalog(portal_type=self.getCalendarTypes(),
- review_state=self.getCalendarStates(),
+ query+=self.portal_catalog(portal_type=self.calendar_types,
+ review_state='published',
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.getCalendarTypes(),
- review_state=self.getCalendarStates(),
+ query+=self.portal_catalog(portal_type=self.calendar_types,
+ review_state='published',
start={'query': first_date,
'range': 'max'},
end={'query': last_date,
More information about the CMF-checkins
mailing list