[Zope-CMF] Issue with the calendar script.
Ian Ford
iford@US.NET
Fri, 3 Aug 2001 15:09:11 -0700
I am tring to get CMF Calendar to print out some items just like it
would for the events. But for some reason I am getting nothing when I
view the page.=20
I have used the calendar.dtml file located on cmf.zope.org but I am not
able to get the contents of the catalog to print out, unless I take out
the line of code that says:
start=3Ddate.latestTime()
If I remove the start=3Ddate.latestTime() I get all the timecards in all
the day datacells of the calendar instead of just getting the timecards
in the datacells of the corresponding day...=20
Here is the code I am currently using:
<dtml-var standard_html_header>
<dtml-if "not REQUEST.has_key('date-calendar')">
<dtml-let setdate=3D"ZopeTime()">
<dtml-call "REQUEST.set('date-calendar',('%s' % (setdate)))">
</dtml-let>
</dtml-if>
<dtml-calendar modes=3D"month" controls=3D"yes" date=3D"'%s' %
(REQUEST['date-calendar'])">
<dtml-call "setCalendar('valign','top')">
<dtml-call "setCalendar('daybgcolr','#CCCCCC')">
<dtml-let
d=3D"date.dd()"
m=3D"date.mm()"
y=3D"date.year()"
>
<font size=3D"1"><a
href=3D"&dtml-absolute_url;/timecard_cal?edate=3D&dtml-date;&mode-calenda=
r=3D&
dtml-mode;&date-calendar=3D&dtml-date-calendar;"><dtml-var d></a></font>
<dtml-in "portal_catalog.searchResults(meta_type=3D'CMF TimeCard'=20
, sort_on=3D'Date'
, review_state=3D'private'
, sort_order=3D'reverse'
, start=3Ddate.latestTime()
, start_usage=3D'range:max'
, end=3Ddate.earliestTime()
, end_usage=3D'range:min'
=20
)">
<br><font size=3D"1"><a href=3D"&dtml-getURL;"><dtml-var id></a></font>
</dtml-in>
</dtml-let>
</dtml-calendar>
<br>
<font size=3D"1"><a href=3D"&dtml-absolute_url;/folder_factories">Add a =
Time
Card</a></font>
<dtml-if edate>
<table>
<dtml-let esdate=3D"_.DateTime(edate)">
<tr>
<td align=3D"left">
</td>
</tr>
<dtml-in "portal_catalog.searchResults( meta_type=3D'CMF TimeCard'
, sort_on=3D'Date'
, sort_order=3D'reverse'
, review_state=3D'private'
, start=3Desdate.latestTime()
, start_usage=3D'range:max'
, end=3Desdate.earliestTime()
, end_usage=3D'range:min'
=20
)">
<tr>
<td valign=3D"top">
=20
<font size=3D"1"><b><a href=3D"<dtml-var "getURL()">"><dtml-var
id></a></b></font>
</td>
</tr>
<dtml-else><tr>
<td valign=3D"top">
<font size=3D"1"><b>A time card has not been entered for <dtml-var
esdate fmt=3D"%B %d, %Y"></b></font>
</td>
</tr>
</dtml-in>
</dtml-let>
</table>
</dtml-if>
<dtml-var standard_html_footer>
If anyone has any ideas let me know.
Thank you,
Ian Ford