summaryrefslogtreecommitdiff
path: root/templates/calendar.tpl
blob: 9ae5834ffcb6b866af72890065a7af126910ff84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{strip}
<div class="display calendar">
	<div class="header">
		<h1>{tr}Calendar{/tr}</h1>
	</div>
	<div class="body">
		{jstabs}
			{jstab title="Calendar"}
				{* this is used to keep stuff like sort_mode persistent in all links on this page *}
				{assign var=url_string value="sort_mode=`$smarty.request.sort_mode`&amp;user_id=`$smarty.request.user_id`"}
				{include file="bitpackage:calendar/calendar_nav_inc.tpl"}

				<table class="data caltable {$smarty.session.calendar.view_mode}">
					<caption>{tr}Selection: {$navigation.focus_date|cal_date_format:"%A %d of %B, %Y %Z"}{/tr}</caption>
					{if $smarty.session.calendar.view_mode eq 'day'}
						<tr>
							<th style="width:15%;">{tr}Time{/tr}</th>
							<th>{tr}Events{/tr}</th>
						</tr>
						{foreach item=time from=$calDay}
							<tr class="{cycle values="odd,even"}">
								<th>{$time.time|cal_date_format:"%H:%M"}</th>
								<td class="calitems">
									{foreach from=$time.items item=item}
										{assign var=over value=$item.over}
										<div class="cal{$item.content_type_guid}">
											<a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$item.content_id}">
												{capture assign=itemurl}{$smarty.const.CALENDAR_PKG_URL}box.php?content_id={$item.content_id}{/capture}
												<img style="padding:0px 4px;" src="/config/images/plus-sign.png" title="{tr}Detailed Information{/tr}" alt="{tr}Detailed Information{/tr}" {if $gBitSystem->isFeatureActive('calendar_ajax_popups')}{popup fullhtml=1 sticky=1 closeclick=1 target=$itemurl}{else}{popup fullhtml=1 text=$over|escape:"javascript"|escape:"html"}{/if} /> {$item.title|escape|default:"?"}
											</a>
										</div>
									{/foreach}
								</td>
							</tr>
						{/foreach}
					{elseif $smarty.session.calendar.view_mode eq 'weeklist'}
						{foreach from=$calMonth item=week}
							{counter assign=weekday print=false start=0}
							{foreach from=$week item=day}
								<tr>
									<th style="width:10%">
										<a href="{$baseCalendarUrl}?view_mode=day&amp;todate={$day.day}&amp;{$url_string}">
											{$dayNames.$weekday} - {$day.day|cal_date_format:"%d"}
										</a>
										{counter assign=weekday print=false}
									</th>
								</tr>
								<tr>
									<td class="calitems {if $day.day eq $navigation.display_focus_date} current{/if}{if $day.day eq $navigation.today} highlight{/if} {cycle values="odd,even"}">
										{if $day.day|cal_date_format:"%m" eq $navigation.focus_month || $smarty.session.calendar.view_mode eq "week"}
											{foreach from=$day.items item=item}
												{assign var=over value=$item.over}
												{capture assign=itemurl}{$smarty.const.CALENDAR_PKG_URL}box.php?content_id={$item.content_id}{/capture}
												<div class="cal{$item.content_type_guid}" style="float:left;width:50%;">
													<a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$item.content_id}">
														<img style="padding:0px 4px;" src="/config/images/plus-sign.png" title="{tr}Detailed Information{/tr}" alt="{tr}Detailed Information{/tr}" {if $gBitSystem->isFeatureActive('calendar_ajax_popups')}{popup fullhtml=1 sticky=1 closeclick=1 target=$itemurl}{else}{popup fullhtml=1 text=$over|escape:"javascript"|escape:"html"}{/if} /> {$item.title|escape|default:"?"}
													</a>
												</div>
											{/foreach}
										{else}
											&nbsp;
										{/if}
									</td>
								</tr>
							{/foreach}
						{/foreach}
					{else}
						<tr>
							<th style="width:2%;"></th>
							{foreach from=$dayNames item=dayName}
								<th style="width:14%">{$dayName}</th>
							{/foreach}
						</tr>

						{foreach from=$calMonth key=week_num item=week}
							<tr>
								<th><a href="{$baseCalendarUrl}?view_mode=week&amp;todate={$week.6.day}">{$week_num}</a></th>
								{foreach from=$week item=day}
									{if $smarty.session.calendar.view_mode eq "month"}
										{if $day.day|cal_date_format:"%m" eq $navigation.focus_month}
											{cycle values="odd,even" print=false advance=false}
										{else}
											{cycle values="notmonth" print=false advance=false}
										{/if}
									{else}
										{cycle values="odd,even" print=false advance=false}
									{/if}

									<td class="calitems {if $day.day eq $navigation.display_focus_date} current{/if}{if $day.day eq $navigation.today} highlight{/if} {cycle values="odd,even"}">
										{if $day.day|cal_date_format:"%m" eq $navigation.focus_month || $smarty.session.calendar.view_mode eq "week"}
											<div class="calnumber">
												<a href="{$baseCalendarUrl}?view_mode=day&amp;todate={$day.day}&amp;{$url_string}">{$day.day|cal_date_format:"%d"}</a>
											</div>

											{* - Cell Content - *}
											{foreach from=$day.items item=item}
												{assign var=over value=$item.over}
												{capture assign=itemurl}{$smarty.const.CALENDAR_PKG_URL}box.php?content_id={$item.content_id}{/capture}
												<div class="cal{$item.content_type_guid}">
													<a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$item.content_id}">
														<img style="padding:0px 4px;" src="/config/images/plus-sign.png" title="{tr}Detailed Information{/tr}" alt="{tr}Detailed Information{/tr}"
														{if $gBitSystem->isFeatureActive('calendar_ajax_popups')}
														{popup fullhtml=1 target=$itemurl sticky=1 closeclick=1}{else}
														{popup fullhtml=1 text=$over|escape:"javascript"|escape:"html"}{/if}
														/> 
														{$item.title|escape|truncate:$trunc:"..."|default:"?"}
													</a>
												</div>
											{/foreach}
										{else}
											&nbsp;
										{/if}
									</td>
								{/foreach}
							</tr>
						{/foreach}
					{/if}
				</table>
			{/jstab}
			{if $gBitUser->hasPermission('p_calendar_view') && !empty($calContentTypes)}
				{jstab title="Display Options"}
					{include file="bitpackage:calendar/calendar_options_inc.tpl"}
				{/jstab}
			{/if}
		{/jstabs}
	</div><!-- end .body -->
</div><!-- end .calendar -->
{/strip}