Calendar events not showing up

Author Message

meriam santos

Sunday 30 August 2009 4:51:40 pm

Hi there,

i have used the calendar template and created my own event class named - event_maintenance.

originally its working so i thought all i need to change is the class name from event to event maintenance. after i have done this it wont show up the event on the calendar. would sombody please tell what i missed?

here are the settings that i have.

[events_maintenance_line]
Source=node/view/line.tpl
MatchFile=line/events_maint.tpl
Subdir=templates
Match[class_identifier]=event_maintenance

[events_maintenance_full]
Source=node/view/full.tpl
MatchFile=full/events_maint.tpl
Subdir=templates
Match[class_identifier]=event_maintenance

[is_calendar]
Source=node/view/full.tpl
MatchFile=is_calendar.tpl
Subdir=templates
Match[node]=147842

and here is the fetch statement that i used

is_calendar_month.tpl

{set $my_ts=makedate( $month, $number, $year )
$events=fetch( 'content', 'list', hash(
'parent_node_id', $events_node,
'attribute_filter', array( 'and',
array( 'event_maintenance/date_from', '<=', $my_ts ),
array( 'event_maintenance/date_to', '>=', $my_ts ) ) ) ) }

is_calendat_items.tpl

{*
a=fetch event starts before check day AND
end event ends after check day

b=fetch event starts on check day OR
event ends on check day
*}

{* condition a *}
{def $events=fetch( 'content', 'list',
hash( 'parent_node_id', $events_node, 'attribute_filter',
array( 'AND', array( 'event_maintenance/date_from', '<', $time_stamp),
array( 'event_maintenance/date_to', '>', $time_stamp )
)
)
)
}

{include uri="design:is_calendar_display.tpl"}


{* condition b *}
{def $events=fetch( 'content', 'list',
hash( 'parent_node_id', $events_node, 'attribute_filter',
array( 'or', array( 'event_maintenance/date_from', '=', $time_stamp),
array( 'event_maintenance/date_to', '=', $time_stamp )
)
)
)
}

{include uri="design:is_calendar_display.tpl"}

it does not display the event that i have created.

can somebody please tell me what i missed?

would really appreciate any reply..

cheers.......

meriam santos

Monday 31 August 2009 1:27:04 pm

Can somebody help me on this please...

André R.

Friday 04 September 2009 1:13:45 pm

Step back your steps and make sure you do one change at time.
Or debug your code by simplifing the filters (incl class and parent node filters) untill you see you actually get some data.

Use this for debugging:

{$some_variable|attribute('show', 2)}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

meriam santos

Sunday 20 September 2009 7:50:32 pm

Thanks Andre for the reply...

meriam santos

Moderated by: Nicolas Pastorino

Thursday 05 November 2009 7:16:28 pm

i have a question on your Agenda template. can you help me please on how to display only the weeks events rather that the whole months event.. really appreciate any reply. in case you need the code of agenda here it is. {* Agenda Folder override *}{set-block scope=root variable=cache_ttl}500{/set-block}{* Agenda v2.2.2 (C) 2006 by André R. Based on Agenda v1.0: (C) 2004 by Stefano Guandalini - nizan sg@nizan.net http://www.nizan.net And Agenda "v1.1":Modified 2006 by Per-Espen Kindblad This file may be distributed and/or modified under the terms of the "GNU General Public License" version 2 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. For changlog, install and other info see readme.txt in orginal package on ez.no: http://ez.no/community/contribs/applications/agenda_2_based_on_the_work_of_stefano_guandalini_and_per_espen_kindblad For discussion, problems and Contributions: http://ez.no/community/forum/developer/about_agenda_2_contribution*}{def$event_node=$node.node_id$curr_ts=currentdate()$curr_today=$curr_ts|datetime( custom, '%j')$curr_year=$curr_ts|datetime( custom, '%Y')$curr_month=$curr_ts|datetime( custom, '%n')$temp_ts=cond( and(ne($view_parameters.month, ''), ne($view_parameters.year, '')), makedate($view_parameters.month, cond(ne($view_parameters.day, ''),$view_parameters.day, eq($curr_month, $view_parameters.month), $curr_today, 1 ), $view_parameters.year), currentdate() )$datearray=gettime($temp_ts)$temp_month=$temp_ts|datetime( custom, '%n')$temp_year=$temp_ts|datetime( custom, '%Y')$temp_today=$temp_ts|datetime( custom, '%j')$days=$temp_ts|datetime( custom, '%t')$first_ts=makedate($temp_month, 1, $temp_year)$dayone=$first_ts|datetime( custom, '%w' )$last_ts=makedate($temp_month, $days, $temp_year)$daylast=$last_ts|datetime( custom, '%w' )$span1=$dayone$span2=sub( 7, $daylast )$dayofweek=0$day_array = " "$loop_dayone = 1$loop_daylast = 1$day_events = array()$loop_count = 0}{if ne($temp_month, 12)} {set $last_ts=makedate($temp_month|sum( 1 ), 1, $temp_year)}{else} {set $last_ts=makedate(1, 1, $temp_year|sum(1))}{/if}{def$events=fetch( 'content', 'list', hash('parent_node_id', $event_node,'sort_by', array( 'attribute', true(), 'event/from_time' ),'class_filter_type', 'include', 'class_filter_array', array( 'event' ),'main_node_only', true(), 'attribute_filter',array( 'or',array( 'event/from_time', 'between', array( sum($first_ts,1), sub($last_ts,1) )),array( 'event/to_time', 'between', array( sum($first_ts,1), sub($last_ts,1) )) )))$url_reload=concat("/content/view/full/", $event_node,"/day/",$temp_today,"/month/",$temp_month,"/year/",$temp_year, "/offset/2")$url_back=concat("/content/view/full/", $event_node, "/month/", sub($temp_month, 1), "/year/", $temp_year)$url_forward=concat("/content/view/full/", $event_node, "/month/", sum($temp_month, 1), "/year/", $temp_year)}{if eq($temp_month, 1)}{set $url_back=concat("/content/view/full/", $event_node,"/month/", "12", "/year/", sub($temp_year, 1))}{elseif eq($temp_month, 12)}{set $url_forward=concat("/content/view/full/", $event_node,"/month/", "1", "/year/", sum($temp_year, 1))}{/if}{foreach $events as $event}{if eq($temp_month|int(), $event.data_map.from_time.content.month|int())}{set $loop_dayone = $event.data_map.from_time.content.day}{else}{set $loop_dayone = 1}{/if}{if eq($temp_month|int(), $event.data_map.to_time.content.month|int())}{set $loop_daylast = $event.data_map.to_time.content.day}{else}{set $loop_daylast = $days}{/if}{for $loop_dayone|int() to $loop_daylast|int() as $counter}{set $day_array = concat($day_array, $counter, ', ')}{*check and add to day events while we already have the days*}{if eq($counter,$temp_today)}{set $day_events = $day_events|append($event)}{/if}{/for}{/foreach}

<< {$temp_ts|datetime( custom, '%F' )|upfirst()} {$temp_year} >>
Mon Tue Wed Thu Fri Sat Sun
   

{elseif eq( $number, $temp_today )}

{elseif and(eq( $number, $curr_today ), eq($curr_month, $temp_month))}

{else}

{/if}{if $day_array|contains(concat(' ', $number, ',')) } {$number}{else} {$number}{/if}

{if and( eq( $number, $days ), $span2|gt( 0 ), $span2|ne(7))}

{/if}{if or( eq( $dayofweek, 0 ), eq( $number, $days ) )}

Selected DayToday

{$temp_ts|datetime( custom, '%F %Y' )|upfirst()}:

{foreach $events as $event}{if and( ne($view_parameters.offset, 2), eq($loop_count, 8))}Show All Events..{/if}{if gt($curr_ts , $event.object.data_map.to_time.content.timestamp)}

{$event.name|wash}

{$event.data_map.category.class_content.options[$event.data_map.category.value[0]].name}
{$event.object.data_map.from_time.content.timestamp|datetime(custom,"%j %M")|shorten( 6 , '')}{if and($event.object.data_map.to_time.has_content, ne( $event.object.data_map.to_time.content.timestamp|datetime(custom,"%j %M"), $event.object.data_map.from_time.content.timestamp|datetime(custom,"%j %M") ))} - {$event.object.data_map.to_time.content.timestamp|datetime(custom,"%j %M")|shorten( 6 , '')}{/if}
{section show=$event.object.data_map.text.has_content} {$event.object.data_map.text.content|shorten( 110 , '...' )}{/section}

{/if}

{if eq($curr_ts|datetime( custom, '%j'),$temp_ts|datetime( custom, '%j'))}

Today:

{else}

{$temp_ts|datetime( custom, '%M %j')|upfirst()}:

{/if} {foreach $day_events as $day_event}{if gt($curr_ts , $day_event.object.data_map.to_time.content.timestamp)}{else}{/if}

{$day_event.name|wash}

Category: {$day_event.data_map.category.class_content.options[$day_event.data_map.category.value[0]].name}
{$day_event.object.data_map.from_time.content.timestamp|datetime(custom,"%j %M %H:%i")} {if $day_event.object.data_map.to_time.has_content} - {$day_event.object.data_map.to_time.content.timestamp|datetime(custom,"%j %M %H:%i")}{/if}{/foreach}

{undef $events $day_events}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 03:11:08
Script start
Timing: Jan 18 2025 03:11:08
Module start 'layout'
Timing: Jan 18 2025 03:11:08
Module start 'content'
Timing: Jan 18 2025 03:11:09
Module end 'content'
Timing: Jan 18 2025 03:11:09
Script end

Main resources:

Total runtime0.7930 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.0469152.6250
Module start 'layout' 0.00470.0022 741.671939.4453
Module start 'content' 0.00700.7845 781.1172623.7266
Module end 'content' 0.79150.0014 1,404.843824.1641
Script end 0.7929  1,429.0078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4004160.0002
Check MTime0.00130.1639160.0001
Mysql Total
Database connection0.00070.086310.0007
Mysqli_queries0.696487.8172650.0107
Looping result0.00060.0702630.0000
Template Total0.766196.620.3830
Template load0.00200.251420.0010
Template processing0.764196.353720.3820
Template load and register function0.00020.020210.0002
states
state_id_array0.00070.091310.0007
state_identifier_array0.00120.145320.0006
Override
Cache load0.00200.25371260.0000
Sytem overhead
Fetch class attribute can translate value0.00100.125520.0005
Fetch class attribute name0.00150.185460.0002
XML
Image XML parsing0.00060.078120.0003
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00100.1204170.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/th.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/th.tplEdit templateOverride template
7content/datatype/view/ezxmltags/tr.tpl<No override>extension/community/design/community/templates/content/datatype/view/ezxmltags/tr.tplEdit templateOverride template
8content/datatype/view/ezxmltags/td.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/td.tplEdit templateOverride template
3content/datatype/view/ezxmltags/table.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/table.tplEdit templateOverride template
4content/datatype/view/ezxmltags/header.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/header.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 59
 Number of unique templates used: 12

Time used to render debug report: 0.0001 secs