[Zope-CMF] Again: Proposal for CMF Calendar

Sidnei da Silva sidnei@redesul.com.br
Thu, 3 Jul 2003 09:12:39 -0300


On Thu, Jul 03, 2003 at 02:04:09PM +0200, 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?

Sounds good to me, as long as its a switch on the tool and its turned
off by default.


-- 
Sidnei da Silva (dreamcatcher) <sidnei@x3ng.com.br>
X3ng Web Technology <http://www.x3ng.com.br>
GNU/Linux user 257852
Debian GNU/Linux 3.0 (Sid) 2.4.20-powerpc ppc

Trap full -- please empty.
-----------------------------------------------------------------------
Verified for virus by mail.redesul.com.br
Scanner: clamscan / ClamAV - Version 0.54 - Updated 01/07/2003