Forums / Developer / Calendar events not showing up

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}

eZ debug

Timing: Jan 18 2025 01:04:50
Script start
Timing: Jan 18 2025 01:04:50
Module start 'content'
Timing: Jan 18 2025 01:04:51
Module end 'content'
Timing: Jan 18 2025 01:04:51
Script end

Main resources:

Total runtime0.8740 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.7109180.8359
Module start 'content' 0.00650.7426 768.5469628.8047
Module end 'content' 0.74920.1248 1,397.3516345.0625
Script end 0.8739  1,742.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4697210.0002
Check MTime0.00160.1859210.0001
Mysql Total
Database connection0.00070.084210.0007
Mysqli_queries0.761187.07412020.0038
Looping result0.00190.22212000.0000
Template Total0.845596.720.4227
Template load0.00220.247420.0011
Template processing0.843396.480720.4216
Template load and register function0.00040.044610.0004
states
state_id_array0.00080.096810.0008
state_identifier_array0.00090.104920.0005
Override
Cache load0.00220.25351260.0000
Sytem overhead
Fetch class attribute can translate value0.00160.184230.0005
Fetch class attribute name0.00160.188060.0003
XML
Image XML parsing0.00080.093530.0003
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00550.6271280.0002
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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