## $Header: /cvs/sakai2/legacy/tools/src/webapp/vm/calendar/chef_calendar_viewActivity.vm,v 1.7 2005/05/28 03:04:35 ggolden.umich.edu Exp $

<script language="JavaScript" type="text/JavaScript">
<!--
	function openCopyrightWindow(theURL,winName,winSettings) 
	{ 
	  window.open(theURL,winName,winSettings);
	  return false;
	}
//-->
</script>

<div class="portletBody">
	#if($menu)#toolbar($menu)#end
	#if ($alertMessage)
		<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div>
		<div style="display:block;clear:both"></div>
	#end
	#if ($noEvent=="true")
		## this event doesn't exist. show nothing.
	#else
	<form name="navigatorform" action="#toolForm("$action")" method="post">
		<div class="navPanel">
			<div class="itemNav" >
				#if ($!prevAct)
					<input type="submit" name="eventSubmit_doPrev_activity" value="$tlang.getString('det.lasact')" />
				#else
					<input type="submit" name="eventSubmit_doPrev_activity" value="$tlang.getString('det.lasact')" disabled="disabled" />
				#end
				<input type="submit" name="eventSubmit_doToday" value="$tlang.getString('view.gotoday')" />
				<a href="#" onclick="location='#toolLink("$action" "doOk")';return false;"><input type="button" value="$tlang.getString("gen.backtolist")" /></a>
				#if ($!nextAct)
				<input type="submit" name="eventSubmit_doNext_activity" value="$tlang.getString('det.nexact')" />
				#else
				<input type="submit" name="eventSubmit_doNext_activity" value="$tlang.getString('det.nexact')" disabled="disabled" />
				#end
			</div>
		</div>	
	</form>
	<h3>$validator.escapeHtml($event.getDisplayName())</h3>
	<table class="itemSummary" cellspacing="0" border="0" summary="layout">
		<tr>
			<th>$tlang.getString("gen.date")</th> 
			<td>$event.getRange().firstTime().toStringLocalDate()</td>
		</tr>
		<tr>
			<th>$tlang.getString("gen.time")</th>
			<td>
					#set ($startTime = $event.getRange().firstTime().toStringLocalShort())
					#set ($endTime = $event.getRange().lastTime().toStringLocalShort())
						#if ($startTime == $endTime)
							$startTime
						#else
							$startTime - $endTime
						#end
						$timezone
					</td>
			</tr>
			#if (!$event.DescriptionFormatted.equals(""))
				<tr>
					<th>
						$tlang.getString("gen.descr")
					</th>
					<td>
						$validator.escapeHtmlFormattedText($event.DescriptionFormatted)
					</td>
				</tr>	
			#end
			#if (!$event.Attachments.isEmpty())
				<tr>
				<th>$tlang.getString("gen.attach")</th>
				#set ($size = 0)
				#set ($props = false)
				#set ($size = $event.Attachments.size())
				<td>
					<ul class="attachList">
						#foreach ($attachment in $event.Attachments)
							#set ($props = $attachment.Properties)
							#if (!$props)
									#if ($size > 0) #set ($size = $size - 1) #end
							#else
								
								#if ($props.getBooleanProperty($props.NamePropIsCollection))
									<li><img src = "#imageLink($contentTypeImageService.getContentTypeImage("folder"))" border="0" alt="folder" />
								#else
									<li><img src = "#imageLink($contentTypeImageService.getContentTypeImage($props.getProperty($props.NamePropContentType)))" border="0" alt="$validator.escapeHtml($props.getProperty($props.NamePropContentType))" />
								#end
								
								#set ($copyflag = false)
								#if ($props.getProperty("CHEF:copyrightalert"))
									#if ($props.getBooleanProperty("CHEF:copyrightalert"))
										#set ($copyflag = true)
									#end
								#end
	
								#if ($copyflag)
									## if there is a copyright alert, show the alert page first
									<a href="" onclick="openCopyrightWindow('${attachment.url}','copyrightAlertWindow','scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes');return false">
									$validator.escapeHtml($attachment.Properties.getPropertyFormatted("DAV:displayname"))</a>&#169;
								#else
									<a href="$attachment.Url" target="_blank">
									$validator.escapeHtml($attachment.Properties.getPropertyFormatted("DAV:displayname"))</a>
								#end
								
								#if (!$props.getBooleanProperty($props.NamePropIsCollection))
									($props.getPropertyFormatted($props.NamePropContentLength))
								#end
									</li>
							#end
							#set ($props = false)
						#end
					</ul>
				</td>
			</tr>	
			#end
			<tr>     
				 <th>$tlang.getString("gen.freq")</th> 
				 <td>
					#if ($rule)
							$tlang.getString("new.every") $rule.Interval $freq(s)
							#if (!($rule.Count == 0)) , $tlang.getString("new.number") $rule.Count $tlang.getString("new.times") <br />#end
							#if ($rule.Until) , $tlang.getString("new.endson") $rule.Until.breakdownLocal().Month/$rule.Until.breakdownLocal().Day/$rule.Until.breakdownLocal().year <br />#end
					#else
							$tlang.getString("new.oneocc")
					#end
					</td>
			</tr>
			<tr>
				<th>$tlang.getString("new.itemtype")</th>
				<td>
					#if ($event.getType()=="")
					#elseif($event.getType()=="Academic Calendar")
						<img src = "#imageLink("sakai/academic_calendar.gif")" border="0" alt ="$tlang.getString('del.acad')" /> $tlang.getString("del.acad") 
					#elseif ($event.getType()=="Activity")
						<img src = "#imageLink("sakai/activity.gif")" border="0" alt="$tlang.getString('del.activ')"  /> $tlang.getString("del.activ")
					#elseif($event.getType()=="Cancellation")
						<img src = "#imageLink("sakai/cancelled.gif")" border="0" alt="$tlang.getString('del.cancell')" /> $tlang.getString("del.cancell")  
					#elseif ($event.getType()=="Class section - Discussion")
						<img src = "#imageLink("sakai/class_dis.gif")" border="0" alt="$tlang.getString('del.class') - $tlang.getString('del.disc')" /> $tlang.getString("del.class") - $tlang.getString("del.disc")
					#elseif ($event.getType()=="Class section - Lab")
						<img src = "#imageLink("sakai/class_lab.gif")" border="0" alt="$tlang.getString('del.class') - $tlang.getString('del.lab')" /> $tlang.getString("del.class") - $tlang.getString("del.lab")
					#elseif ($event.getType()=="Class section - Lecture")
						<img src = "#imageLink("sakai/class_lec.gif")" border="0" alt="$tlang.getString('del.class') - $tlang.getString('del.lect')" /> $tlang.getString("del.class") - $tlang.getString("del.lect")
					#elseif ($event.getType()=="Class section - Small Group")
						<img src = "#imageLink("sakai/class_sma.gif")" border="0" alt="$tlang.getString('del.class') - $tlang.getString('del.small')" /> $tlang.getString("del.class") - $tlang.getString("del.small")
					#elseif ($event.getType()=="Class session")
						<img src = "#imageLink("sakai/class_session.gif")" border="0" alt="$tlang.getString('del.classsession')" /> $tlang.getString("del.classsession")
					#elseif($event.getType()=="Computer Session")
						<img src = "#imageLink("sakai/computersession.gif")" border="0" alt="$tlang.getString('del.computer')" /> $tlang.getString("del.computer") 
					#elseif($event.getType()=="Deadline")
						<img src = "#imageLink("sakai/deadline.gif")" border="0" alt="$tlang.getString('del.dead')" /> $tlang.getString("del.dead") 
					#elseif($event.getType()=="Exam")
						<img src = "#imageLink("sakai/exam.gif")" border="0" alt="$tlang.getString('del.exam')" /> $tlang.getString("del.exam") 
					#elseif ($event.getType()=="Meeting")
						<img src = "#imageLink("sakai/meeting.gif")" border="0" alt="$tlang.getString('del.meet')" /> $tlang.getString("del.meet")
					#elseif($event.getType()=="Quiz")
						<img src = "#imageLink("sakai/quiz.gif")" border="0" alt="$tlang.getString('del.quiz')" /> $tlang.getString("del.quiz") 
					#elseif($event.getType()=="Special event")
						<img src = "#imageLink("sakai/special_event.gif")" border="0" alt="$tlang.getString('del.special')" /> $tlang.getString("del.special") 
					#elseif($event.getType()=="Web Assignment")
						<img src = "#imageLink("sakai/webassignment.gif")" border="0" alt="$tlang.getString('del.web')" /> $tlang.getString("del.web") 
					#elseif($event.getType()=="Multidisciplinary Conference")
						<img src = "#imageLink("sakai/multi-conference.gif")" border="0" alt="$tlang.getString('del.multi')" />$tlang.getString("del.multi") 
					#end
				</td>	
			</tr>
			#if($owner_name && $owner_name !="")
			<tr>
				<th>$tlang.getString("gen.owner")</th>
				<td>$owner_name</td>
         </tr>
			#end
			#if($event.Location && $event.Location !="")
				<tr> 
					 <th>$tlang.getString("new.location")</th>
					 <td>$validator.escapeHtml($event.Location)</td>
				</tr>
			#end
			#set ($calObj = $CalendarService.getCalendar($event.CalendarReference))
			#if ($calObj.getContext() != $PortalService.CurrentSiteId )
				<tr> 
					<th>$tlang.getString("gen.fromsite")</th>
					<td>$SiteService.getSiteDisplay($calObj.getContext())</td>
				</tr>
			#end

			#foreach ($fieldEntry in $addFieldsCalendarsCollection)
			<tr>
				<th>$validator.escapeHtml($fieldEntry)</th>
				<td>$validator.escapeHtml($event.getField($fieldEntry))</td>
			</tr>
			#end
			
			#if ($!groupRange && !($!groupRange == ""))
			<tr>
				<th class="chefLabel">$tlang.getString("groups")</th>
				<td>$!groupRange</td>
			</tr>
			#end
		</table>
			<div class="navPanel">
				<div class="act">
					<form name="form" action="#toolForm("$action")" method="post" class="inlineForm">
						#if ($!allowRevise)
						<input type="submit" name="eventSubmit_doRevise" value="$tlang.getString('gen.revise')" accesskey="e" />
						#end
						#if ($!allowDelete)
						<input type="submit" name="eventSubmit_doDelete" value="$tlang.getString('gen.delete')" accesskey="x" />
						#end
					</form>
				</div>
				<div class="itemNav" >
					<form name="navigatorform" action="#toolForm("$action")" method="post" class="inlineForm">
						#if ($!prevAct)
						<input type="submit" name="eventSubmit_doPrev_activity" value="$tlang.getString('det.lasact')" />
						#else
						<input type="submit" name="eventSubmit_doPrev_activity" value="$tlang.getString('det.lasact')" disabled="disabled" />
						#end

						<a href="#" onclick="location='#toolLink("$action" "doOk")';return false;"><input type="button" value="$tlang.getString("gen.backtolist")" /></a>
						#if ($!nextAct)
						<input type="submit" name="eventSubmit_doNext_activity" value="$tlang.getString('det.nexact')" />
						#else
						<input type="submit" name="eventSubmit_doNext_activity" value="$tlang.getString('det.nexact')" disabled="disabled" />
						#end
					</form>	
				</div>

			</div>
	#end ## if noEvent == true
</div>
