<% # Begin the code... # ----------------- $STYLE = $in{style} || "Grid"; $VIEW = $in{view}; if (!$in{duration} && !$in{range} && !$in{startdate} && !$in{enddate}) { $VIEW ||= "Month"; } if ($VIEW eq "Month") { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); } elsif ($VIEW eq "Week") { &getEvents( { 'range'=>'week' } ); } elsif ($VIEW eq "Two-Week") { &getEvents( { 'range'=>'twoweek' } ); } elsif ($VIEW eq "Three-Week") { &getEvents( { 'range'=>'threeweek' } ); } elsif ($VIEW eq "Four-Week") { &getEvents( { 'range'=>'fourweek' } ); } elsif ($VIEW eq "Day") { &getEvents( { 'range'=>'day','startdate'=>$DATESTRING } ); } elsif ($VIEW eq "Event") { $EVENT->{'details'} = &getEvent($in{'event_id'}); $db = $main::DBEvents; $fields = &main::DBGetFieldsInDisplayOrder($db); } elsif ($VIEW eq "Search") { $db = $main::DBEvents; # Keep form values to populate form fields foreach (keys %in) {$name = $_; if ($name =~ s/^FIELD_//) { $search_params->{$name} = $in{$_}; } } } else { &getEvents( {'duration'=>$in{duration}, 'range'=>$in{range}, 'startdate'=>$in{startdate}, 'enddate'=>$in{enddate} } ); } if ($GRID_ROW_COUNT > 0) { $rowheight = "HEIGHT=\"".int(90/$GRID_ROW_COUNT)."%\""; } %> Calendar <% if ($_HEADER) { %><% } %> <%IF USER LOGGED IN%> <%/IF%> <% if ($_FOOTER) { %><% } %>
<%= $_HEADER %>
<% if ($VIEW eq "Month") { %> <% my ($monthabbrs) = $Config->get("month_abbreviations"); %> <% foreach $monthnum (0 .. 11) { %> <%if($MONTH==($monthnum+1)){%> <%}else{%> <%}%> <% } %>
< <%=$LAST_YEAR%><%=$monthabbrs->[$monthnum]%> <%=$YEAR%><%=$monthabbrs->[$monthnum]%><%=$NEXT_YEAR%> >
<% } elsif ($VIEW eq "Week" || $VIEW eq "Two-Week" || $VIEW eq "Three-Week" || $VIEW eq "Four-Week") { %>
< Previous Week COLOR="<%=$_NAVIGATION_TEXT_COLOR%>"><%=$RANGE_START%> - <%=$RANGE_END%> Next Week >
<% } elsif ($VIEW eq "Day") { %>
< Previous Day COLOR="<%=$_NAVIGATION_TEXT_COLOR%>"><%=$DAY->{'dayname'}%> <%=$DAY->{'monthabbreviation'}%> <%=$DATE%>, <%=$YEAR%> Next Day >
<% } elsif ($VIEW eq "Event") { %>
COLOR="<%=$_NAVIGATION_TEXT_COLOR%>"><%= EVENT FIELD(title) %>
<% } elsif ($VIEW eq "Search") { %>
COLOR="<%=$_NAVIGATION_TEXT_COLOR%>">Search
<% } %>
Logged in as: <%=($User->{name} || $User->{username})%>
">Grid
">List

Today
">Week
">2-Week
">3-Week
">4-Week
">Month
<% if ($_SHOW_COMMAND_LIST) { %>
<%if ($User->hasPermission($CALENDAR_KEY,"ADD_EVENT")) { %> <%}%> <%if ($User->hasPermission($CALENDAR_KEY,"EDIT_EVENTS") || $User->hasPermission($CALENDAR_KEY,"EDIT_OWN_EVENTS")) { %> <%}%> <%IF USER LOGGED IN%> <%if ($User->isCalendarAdmin($CALENDAR_KEY)) { %> <%}%> <%/IF%> <%IF USER LOGGED IN%> <%ELSE%> <%/IF%>
">Search
Add Event
Edit Events
Admin
Logout
Login
<% } %>
<% if ($VIEW eq "Month" || $VIEW eq "Week" || $VIEW eq "Two-Week" || $VIEW eq "Three-Week" || $VIEW eq "Four-Week") { %> <% if ($STYLE eq "Grid") { %> <%FOREACH GRID COLUMN%> <%/FOREACH%> <%FOREACH GRID ROW%> > <%FOREACH GRID COLUMN%> <% $i=0; %> <%/FOREACH%> <%/FOREACH%>
<%= $Grid->{'daynames'}->[$COL] %>
BGCOLOR="<%IF SELECTED%><%=$_GRID_CELL_SELECTED_BGCOLOR%><%ELSE%><%=$_GRID_CELL_BGCOLOR%><%/IF%>"> <%IF DISPLAY%>  <%if($DAY->{'dd'}==1&&$VIEW ne "Month"){%><%=$DAY->{'monthname'}%> <%}%><%=$DAY->{'dd'}%>  <%FOREACH EVENT%> <%$i++;%> • <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %> <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %> <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %> <%= EVENT FIELD(title) %>
<%/FOREACH%> <% if ($i==0) { %>
 
 <% } %> <%/IF%>  
<% } elsif ($STYLE eq "List") { %>
<%$total_events=0;%> <%FOREACH EVENTLIST%> <%IF EVENTS EXIST%> <%$total_events++;%>
<%=$DAY->{dayname}%>, <%=$DAY->{monthname}%> <%=$DAY->{dd}%>
<%FOREACH EVENT%> • <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %> <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %> <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %> <%= EVENT FIELD(title) %>
<%/FOREACH%> <%/IF%> <%/FOREACH%>
<%unless($total_events){%> No Events <% } %>
<% } %> <% } elsif ($VIEW eq "Day") { %> <% if ($STYLE eq "Grid") { %> <%FOREACH HOUR OF DAY%> <%/FOREACH%>
<% if ($HOUR == 99) { %> All Day Events <%ELSE%> <%=Date::formatTime(&Date::LZ($HOUR)."00",$Config->{'time_format'})%>  <%/IF%> <%FOREACH EVENT%> • <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %> <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %> <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %> <%= EVENT FIELD(title) %> [details]
<%/FOREACH%> <%IF NO EVENTS EXIST%> <%/IF%>
<% } else { %>
<%IF EVENTS EXIST%>
<%FOREACH EVENT%>
• <% if ($EVENT->{'schedule'}->{'start_time'}) { %><%= SCHEDULE FIELD(start_time) %><% } %> <% if ($EVENT->{'schedule'}->{'end_time'}) { %>-<%= SCHEDULE FIELD(end_time) %><% } %> <% if ($EVENT->{'schedule'}->{'start_time'}) { %> : <% } %> <%= EVENT FIELD(title) %> [details]
<%= EVENT FIELD(description) %> <%/FOREACH%>
<%ELSE%>
No Events
<%/IF%>
<% } %> <% } elsif ($VIEW eq "Event") { %> <% foreach (@$fields) { next unless ($db->{'properties'}->{$_}->{'display_details'}); %> <% } %>
<%=$db->{'properties'}->{$_}->{'name'}%>: <%=$EVENT->{details}->{$_}%>
<% } elsif ($VIEW eq "Search") { %>
<% if ($userMessage ne "") { %> <% } %> <% $fieldnames = &main::DBGetSearchFields($db); foreach $field (@$fieldnames) { %> <% } %> <% IF SEARCH RESULT %> <% /IF %>
<%= $userMessage %>
<%= $db->{'properties'}->{$field}->{'name'} || $field %> : <%= &main::GetSearchFieldInput($db->{'properties'}->{$field},$field,$search_params) %>
Between : and
Search Results
<% IF SEARCH RESULTS EXIST %> No Matches <% ELSE %> <% FOREACH SEARCH RESULT %> <% /FOREACH %>
First Occurrence Title Description
<% IF NEXT OCCURRENCE EXISTS %> <%=$MONTH_NAMES->[$EVENT->{schedule}->{nextoccurrence}->{month}-1]%> <%=$EVENT->{schedule}->{nextoccurrence}->{date}%>, <%=$EVENT->{schedule}->{nextoccurrence}->{year}%> <% ELSE %> None <% /IF %> <%= EVENT FIELD(title) %> <%= EVENT FIELD(description) %>
<% /IF %>
<% } %>
Powered by CalendarScript
<%= $_FOOTER %>