[Zope-CMF] Again: Proposal for CMF Calendar
Ignacio Dosil Lago
idosil at ccietic.usc.es
Tue Aug 5 14:43:17 EDT 2003
I support your proposal. At least it's useful for me.
On Jueves 03 Julio 2003 14:04, Rainer Thaden wrote:
> Hi,
>
> hm, either everyone's in holidays or nobody is interested. Once again
> a proposal for CMFCalendar to show not only events with review state =
> published but all events which the user is allowed to view:
>
> In CalendarTool.py:
>
> security.declarePublic('catalog_getevents')
> def catalog_getevents(self, year, month):
>
> last_date=first_date + last_day
>
> query=self.portal_catalog(portal_type=self.calendar_types,
> # remove this line review_state='published'
> start=(first_date, last_date),
> start_usage='range:min:max',
> sort_on='start')
>
> query+=self.portal_catalog(portal_type=self.calendar_types,
> # remove this line review_state='published'
> end=(first_date, last_date),
> end_usage='range:min:max',
> sort_on='end')
>
> #add next line
> query = ZTUtils.LazyFilter(query, skip='View')
>
>
> security.declarePublic('getEventsForThisDay')
> def getEventsForThisDay(self, thisDay):
> catalog = self.portal_catalog
>
> first_date, last_date = self.getBeginAndEndTimes(thisDay.day(),
> thisDay.month(), thisDay.year())
> query=self.portal_catalog(portal_type=self.calendar_types, # remove this
> line review_state='published'
> start=(first_date,last_date),
> start_usage='range:min:max')
>
> query+=self.portal_catalog(portal_type=self.calendar_types,
> # remove this line review_state='published'
> end=(first_date,last_date),
> end_usage='range:min:max')
>
> query+=self.portal_catalog(portal_type=self.calendar_types,
> # remove this line review_state='published'
> start=first_date,
> start_usage='range:max',
> end=last_date,
> end_usage='range:min')
> #add next line
> query = ZTUtils.LazyFilter(query, skip='View')
>
> Comments?
More information about the Zope-CMF
mailing list