root/trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

Revision 391 (checked in by johnsa, 7 years ago)

added sharing information to edit event for personal client user interface. Needs some implementation on back-end (xml output, etc).

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output
4   method="html"
5   indent="yes"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/html4/loose.dtd"
9   standalone="yes"
10 />
11    <!-- ======================================== -->
12   <!--  Rensselaer PERSONAL CALENDAR STYLESHEET  -->
13   <!-- ========================================= -->
14
15   <!-- DEFINE INCLUDES -->
16   <xsl:include href="errors.xsl"/>
17   <xsl:include href="messages.xsl"/>
18
19   <!-- DEFINE GLOBAL CONSTANTS -->
20   <!-- URL of html resources (images, css, other html); by default this is
21        set to the application root, but for the personal calendar
22        this should be changed to point to a
23        web server over https to avoid mixed content errors, e.g.,
24   <xsl:variable name="resourcesRoot" select="'https://mywebserver.edu/myresourcesdir'"/>
25     -->
26   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
27
28   <!-- URL of the XSL template directory -->
29   <!-- The approot is an appropriate place to put
30        included stylesheets and xml fragments. These are generally
31        referenced relatively (like errors.xsl and messages.xsl above);
32        this variable is here for your convenience if you choose to
33        reference it explicitly.  It is not used in this stylesheet, however,
34        and can be safely removed if you so choose. -->
35   <xsl:variable name="appRoot" select="/bedework/approot"/>
36
37   <!-- Properly encoded prefixes to the application actions; use these to build
38        urls; allows the application to be used without cookies or within a portal. -->
39   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
40   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/setSelection"/>
41   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/setViewPeriod"/>
42   <xsl:variable name="eventView" select="/bedework/urlPrefixes/eventView"/>
43   <xsl:variable name="initEvent" select="/bedework/urlPrefixes/initEvent"/>
44   <xsl:variable name="addEvent" select="/bedework/urlPrefixes/addEvent"/>
45   <xsl:variable name="addEventUsingPage" select="/bedework/urlPrefixes/addEventUsingPage"/>
46   <xsl:variable name="event-setAccess" select="/bedework/urlPrefixes/event/setAccess/a/@href"/>
47   <xsl:variable name="editEvent" select="/bedework/urlPrefixes/editEvent"/>
48   <xsl:variable name="delEvent" select="/bedework/urlPrefixes/delEvent"/>
49   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
50   <xsl:variable name="export" select="/bedework/urlPrefixes/export"/>
51   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
52   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
53   <xsl:variable name="manageLocations" select="/bedework/urlPrefixes/manageLocations"/>
54   <xsl:variable name="addLocation" select="/bedework/urlPrefixes/addLocation"/>
55   <xsl:variable name="editLocation" select="/bedework/urlPrefixes/editLocation"/>
56   <xsl:variable name="delLocation" select="/bedework/urlPrefixes/delLocation"/>
57   <xsl:variable name="initEventAlarm" select="/bedework/urlPrefixes/initEventAlarm"/>
58   <xsl:variable name="setAlarm" select="/bedework/urlPrefixes/setAlarm"/>
59   <xsl:variable name="initUpload" select="/bedework/urlPrefixes/initUpload"/>
60   <xsl:variable name="upload" select="/bedework/urlPrefixes/upload"/>
61   <xsl:variable name="getFreeBusy" select="/bedework/urlPrefixes/getFreeBusy/a/@href"/>
62   <!-- calendars -->
63   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
64   <xsl:variable name="calendar-fetch" select="/bedework/urlPrefixes/calendar/fetch/a/@href"/><!-- used -->
65   <xsl:variable name="calendar-fetchDescriptions" select="/bedework/urlPrefixes/calendar/fetchDescriptions/a/@href"/><!-- used -->
66   <xsl:variable name="calendar-initAdd" select="/bedework/urlPrefixes/calendar/initAdd/a/@href"/><!-- used -->
67   <xsl:variable name="calendar-delete" select="/bedework/urlPrefixes/calendar/delete/a/@href"/>
68   <xsl:variable name="calendar-fetchForDisplay" select="/bedework/urlPrefixes/calendar/fetchForDisplay/a/@href"/>
69   <xsl:variable name="calendar-fetchForUpdate" select="/bedework/urlPrefixes/calendar/fetchForUpdate/a/@href"/><!-- used -->
70   <xsl:variable name="calendar-update" select="/bedework/urlPrefixes/calendar/update/a/@href"/><!-- used -->
71   <xsl:variable name="calendar-setAccess" select="/bedework/urlPrefixes/calendar/setAccess/a/@href"/>
72   <!-- subscriptions -->
73   <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/>
74   <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/>
75   <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/>
76   <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/>
77
78   <!-- URL of the web application - includes web context
79   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/> -->
80
81   <!-- Other generally useful global variables -->
82   <xsl:variable name="confId" select="/bedework/confirmationid"/>
83   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
84   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
85   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
86   <xsl:variable name="skin">default</xsl:variable>
87   <xsl:variable name="publicCal">/cal</xsl:variable>
88
89  <!-- BEGIN MAIN TEMPLATE -->
90   <xsl:template match="/">
91     <html lang="en">
92       <head>
93         <xsl:call-template name="headSection"/>
94       </head>
95       <body>
96         <xsl:call-template name="headBar"/>
97         <xsl:if test="/bedework/message">
98           <div id="messages">
99             <xsl:apply-templates select="/bedework/message"/>
100           </div>
101         </xsl:if>
102         <xsl:if test="/bedework/error">
103           <div id="errors">
104             <xsl:apply-templates select="/bedework/error"/>
105           </div>
106         </xsl:if>
107         <table id="bodyBlock" cellspacing="0">
108           <tr>
109             <xsl:choose>
110               <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
111                 <td id="sideBarClosed">
112                   <img src="{$resourcesRoot}/resources/spacer.gif" width="1" height="1" border="0" alt="*"/>
113                 </td>
114               </xsl:when>
115               <xsl:otherwise>
116                 <td id="sideBar">
117                   <xsl:call-template name="sideBar"/>
118                 </td>
119               </xsl:otherwise>
120             </xsl:choose>
121             <td id="bodyContent">
122               <xsl:call-template name="tabs"/>
123               <xsl:call-template name="navigation"/>
124               <xsl:choose>
125                 <xsl:when test="/bedework/page='event'">
126                   <!-- show an event -->
127                   <xsl:apply-templates select="/bedework/event"/>
128                 </xsl:when>
129                 <xsl:when test="/bedework/page='addEvent'">
130                   <xsl:call-template name="addEvent"/>
131                 </xsl:when>
132                 <xsl:when test="/bedework/page='editEvent'">
133                   <!-- edit an event -->
134                   <xsl:apply-templates select="/bedework/formElements" mode="editEvent"/>
135                 </xsl:when>
136                 <xsl:when test="/bedework/page='alarmOptions'">
137                   <xsl:call-template name="alarmOptions" />
138                 </xsl:when>
139                 <xsl:when test="/bedework/page='upload'">
140                   <xsl:call-template name="upload" />
141                 </xsl:when>
142                 <xsl:when test="/bedework/page='manageLocations'">
143                   <xsl:call-template name="manageLocations" />
144                 </xsl:when>
145                 <xsl:when test="/bedework/page='editLocation'">
146                   <!-- edit an event -->
147                   <xsl:apply-templates select="/bedework/formElements" mode="editLocation"/>
148                 </xsl:when>
149                 <xsl:when test="/bedework/page='subscriptions' or /bedework/page='modSubscription'">
150                   <xsl:apply-templates select="/bedework/subscriptions"/>
151                 </xsl:when>
152                 <xsl:when test="/bedework/page='calendarList' or
153                                 /bedework/page='calendarDescriptions' or
154                                 /bedework/page='displayCalendar' or
155                                 /bedework/page='modCalendar' or
156                                 /bedework/page='deleteCalendarConfirm' or
157                                 /bedework/page='calendarReferenced'">
158                   <xsl:apply-templates select="/bedework/calendars"/>
159                 </xsl:when>
160                 <xsl:when test="/bedework/page='freeBusy'">
161                   <xsl:apply-templates select="/bedework/freebusy"/>
162                 </xsl:when>
163                 <xsl:when test="/bedework/page='other'">
164                   <!-- show an arbitrary page -->
165                   <xsl:call-template name="selectPage"/>
166                 </xsl:when>
167                 <xsl:otherwise>
168                   <!-- otherwise, show the eventsCalendar -->
169                   <xsl:call-template name="utilBar"/>
170                   <!-- main eventCalendar content -->
171                   <xsl:choose>
172                     <xsl:when test="/bedework/periodname='Day'">
173                       <xsl:call-template name="listView"/>
174                     </xsl:when>
175                     <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
176                       <xsl:choose>
177                         <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
178                           <xsl:call-template name="listView"/>
179                         </xsl:when>
180                         <xsl:otherwise>
181                           <xsl:call-template name="weekView"/>
182                         </xsl:otherwise>
183                       </xsl:choose>
184                     </xsl:when>
185                     <xsl:when test="/bedework/periodname='Month'">
186                       <xsl:choose>
187                         <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
188                           <xsl:call-template name="listView"/>
189                         </xsl:when>
190                         <xsl:otherwise>
191                           <xsl:call-template name="monthView"/>
192                         </xsl:otherwise>
193                       </xsl:choose>
194                     </xsl:when>
195                     <xsl:otherwise>
196                       <xsl:call-template name="yearView"/>
197                     </xsl:otherwise>
198                   </xsl:choose>
199                 </xsl:otherwise>
200               </xsl:choose>
201             </td>
202           </tr>
203         </table>
204         <!-- footer -->
205         <xsl:call-template name="footer"/>
206       </body>
207     </html>
208   </xsl:template>
209
210   <!--==== HEAD SECTION  ====-->
211
212   <xsl:template name="headSection">
213     <title>Bedework: Personal Calendar Client</title>
214     <meta name="robots" content="noindex,nofollow"/>
215     <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
216     <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
217     <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
218     <xsl:if test="/bedework/page='addEvent' or /bedework/page='editEvent'">
219       <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
220       <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js"></script>
221       <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
222       <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
223       <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
224       <script type="text/javascript" src="{$resourcesRoot}/resources/browserSniffer.js"></script>
225     </xsl:if>
226   </xsl:template>
227
228   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
229
230   <xsl:template name="headBar">
231     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
232       <tr>
233         <td colspan="3" id="logoCell"><a href="http://www.bedework.org/"><img src="{$resourcesRoot}/resources/bedeworkLogo.gif" width="292" height="75" border="0" alt="Bedework"/></a></td>
234         <td colspan="2" id="schoolLinksCell">
235           <h2>Personal Calendar</h2>
236           <a href="{$publicCal}">Public Calendar</a> |
237           <a href="http://www.yourschoolhere.edu">School Home</a> |
238           <a href="http://www.bedework.org/">Other Link</a> |
239           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
240             Example Calendar Help
241           </a>
242         </td>
243       </tr>
244     </table>
245     <!--<table width="100%" border="0" cellpadding="0" cellspacing="0">
246       <tr>
247         <td width="50%"><img alt="" src="{$resourcesRoot}/resources/metacal-topBorder.gif" width="100%" height="23" border="0"/></td>
248         <td><img src="{$resourcesRoot}/resources/metacal-topTitlePersonal.gif" width="221" height="23" border="0" alt="Bedework Personal Events Calendar"/></td>
249         <td width="50%"><img alt="" src="{$resourcesRoot}/resources/metacal-topBorder.gif" width="100%" height="23" border="0"/></td>
250       </tr>
251     </table>-->
252     <table id="curDateRangeTable"  cellspacing="0">
253       <td class="sideBarOpenCloseIcon">
254         <xsl:choose>
255           <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
256             <a href="?setappvar=sidebar(opened)">
257               <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
258             </a>
259           </xsl:when>
260           <xsl:otherwise>
261             <a href="?setappvar=sidebar(closed)">
262               <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
263             </a>
264           </xsl:otherwise>
265         </xsl:choose>
266       </td>
267       <td class="date">
268         <xsl:value-of select="/bedework/firstday/longdate"/>
269         <xsl:if test="/bedework/periodname!='Day'">
270           -
271           <xsl:value-of select="/bedework/lastday/longdate"/>
272         </xsl:if>
273       </td>
274       <td class="rssPrint">
275         <a href="javascript:window.print()" title="print this view">
276           <img alt="print this view" src="{$resourcesRoot}/resources/std-print-icon.gif" width="20" height="14" border="0"/> print
277         </a>
278         <a class="rss" href="{$setSelection}?calId=&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
279       </td>
280     </table>
281   </xsl:template>
282
283   <xsl:template name="sideBar">
284     <h3>
285       <img alt="manage views" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/> views
286     </h3>
287     <ul id="myViews">
288       <xsl:choose>
289         <xsl:when test="/bedework/views/view">
290           <xsl:for-each select="/bedework/views/view">
291             <xsl:variable name="viewName" select="name"/>
292             <xsl:choose>
293               <xsl:when test="/bedework/selectionState/selectionType = 'view'
294                               and name=/bedework/selectionState/view/name">
295                 <li class="selected"><a href="{$setSelection}?viewName={$viewName}"><xsl:value-of select="name"/></a></li>
296               </xsl:when>
297               <xsl:otherwise>
298                 <li><a href="{$setSelection}?viewName={$viewName}"><xsl:value-of select="name"/></a></li>
299               </xsl:otherwise>
300             </xsl:choose>
301           </xsl:for-each>
302         </xsl:when>
303         <xsl:otherwise>
304           <li class="none">no subscriptions</li>
305         </xsl:otherwise>
306       </xsl:choose>
307     </ul>
308
309     <h3>
310       <a href="{$calendar-fetch}">
311         <img alt="manage calendars" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/> calendars
312       </a>
313     </h3>
314     <ul class="calendarTree">
315       <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="myCalendars"/>
316     </ul>
317
318     <h3>
319       <a href="{$subscriptions-fetch}" title="manage subscriptions">
320         <img alt="manage subscriptions" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/>
321         subscriptions
322       </a>
323     </h3>
324     <ul class="calendarTree">
325       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
326       <xsl:choose>
327         <xsl:when test="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]">
328           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]" mode="mySubscriptions"/>
329         </xsl:when>
330         <xsl:otherwise>
331           <li class="none">no subscriptions</li>
332         </xsl:otherwise>
333       </xsl:choose>
334     </ul>
335
336     <h3>options</h3>
337     <ul id="sideBarMenu">
338       <li><a href="{$getFreeBusy}">Show Free/Busy</a></li>
339       <li><a href="{$manageLocations}">Manage Locations</a></li>
340       <li>Preferences</li>
341     </ul>
342   </xsl:template>
343
344   <xsl:template name="tabs">
345     <xsl:choose>
346       <xsl:when test="/bedework/page='eventscalendar'">
347         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
348           <tr>
349             <td>
350               <xsl:choose>
351                 <xsl:when test="/bedework/periodname='Day'">
352                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-on.gif" width="91" height="20" border="0" alt="DAY"/></a>
353                 </xsl:when>
354                 <xsl:otherwise>
355                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
356                 </xsl:otherwise>
357               </xsl:choose>
358             </td>
359             <td>
360               <xsl:choose>
361                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
362                   <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-on.gif" width="92" height="20" border="0" alt="WEEK"/></a>
363                  </xsl:when>
364                 <xsl:otherwise>
365                   <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
366                  </xsl:otherwise>
367               </xsl:choose>
368             </td>
369             <td>
370               <xsl:choose>
371                 <xsl:when test="/bedework/periodname='Month'">
372                   <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-on.gif" width="90" height="20" border="0" alt="MONTH"/></a>
373                 </xsl:when>
374                 <xsl:otherwise>
375                   <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
376                 </xsl:otherwise>
377               </xsl:choose>
378             </td>
379             <td>
380               <xsl:choose>
381                 <xsl:when test="/bedework/periodname='Year'">
382                   <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-on.gif" width="92" height="20" border="0" alt="YEAR"/></a>
383                 </xsl:when>
384                 <xsl:otherwise>
385                   <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
386                 </xsl:otherwise>
387               </xsl:choose>
388             </td>
389             <td class="rightCell">
390               welcome
391               <xsl:text> </xsl:text>
392               <strong><xsl:value-of select="/bedework/userid"/></strong>
393               <xsl:text> </xsl:text>
394               <span class="logout"><a href="{$setup}?logout=true">logout</a></span>
395             </td>
396           </tr>
397         </table>
398       </xsl:when>
399       <xsl:otherwise>
400         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
401           <tr>
402             <td>
403               <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
404             </td>
405             <td>
406               <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
407             </td>
408             <td>
409               <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
410             </td>
411             <td>
412               <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
413             </td>
414             <td class="rightCell">
415               welcome
416               <xsl:text> </xsl:text>
417               <strong><xsl:value-of select="/bedework/userid"/></strong>
418               <xsl:text> </xsl:text>
419               <span class="logout"><a href="{$setup}?logout=true">logout</a></span>
420             </td>
421           </tr>
422         </table>
423       </xsl:otherwise>
424     </xsl:choose>
425   </xsl:template>
426
427   <xsl:template name="navigation">
428     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
429       <tr>
430         <td class="leftCell">
431           <a href="{$setViewPeriod}?date={$prevdate}"><img src="{$resourcesRoot}/resources/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
432           <a href="{$setViewPeriod}?date={$nextdate}"><img src="{$resourcesRoot}/resources/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
433           <xsl:choose>
434             <xsl:when test="/bedework/periodname='Year'">
435               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
436             </xsl:when>
437             <xsl:when test="/bedework/periodname='Month'">
438               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
439             </xsl:when>
440             <xsl:when test="/bedework/periodname='Week'">
441               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
442             </xsl:when>
443             <xsl:otherwise>
444               <xsl:value-of select="/bedework/firstday/longdate"/>
445             </xsl:otherwise>
446           </xsl:choose>
447         </td>
448         <td class="todayButton">
449           <a href="{$setViewPeriod}?viewType=todayView&amp;date={$curdate}">
450             <img src="{$resourcesRoot}/resources/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
451           </a>
452         </td>
453         <td align="right" class="gotoForm">
454           <form name="calForm" method="get" action="{$setViewPeriod}">
455              <table border="0" cellpadding="0" cellspacing="0">
456               <tr>
457                 <xsl:if test="/bedework/periodname!='Year'">
458                   <td>
459                     <select name="viewStartDate.month">
460                       <xsl:for-each select="/bedework/monthvalues/val">
461                         <xsl:variable name="temp" select="."/>
462                         <xsl:variable name="pos" select="position()"/>
463                         <xsl:choose>
464                           <xsl:when test="/bedework/monthvalues[start=$temp]">
465                             <option value="{$temp}" selected="selected">
466                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
467                             </option>
468                           </xsl:when>
469                           <xsl:otherwise>
470                             <option value="{$temp}">
471                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
472                             </option>
473                           </xsl:otherwise>
474                         </xsl:choose>
475                       </xsl:for-each>
476                     </select>
477                   </td>
478                   <xsl:if test="/bedework/periodname!='Month'">
479                     <td>
480                       <select name="viewStartDate.day">
481                         <xsl:for-each select="/bedework/dayvalues/val">
482                           <xsl:variable name="temp" select="."/>
483                           <xsl:variable name="pos" select="position()"/>
484                           <xsl:choose>
485                             <xsl:when test="/bedework/dayvalues[start=$temp]">
486                               <option value="{$temp}" selected="selected">
487                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
488                               </option>
489                             </xsl:when>
490                             <xsl:otherwise>
491                               <option value="{$temp}">
492                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
493                               </option>
494                             </xsl:otherwise>
495                           </xsl:choose>
496                         </xsl:for-each>
497                       </select>
498                     </td>
499                   </xsl:if>
500                 </xsl:if>
501                 <td>
502                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
503                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
504                 </td>
505                 <td>
506                   <input name="submit" type="submit" value="go"/>
507                 </td>
508               </tr>
509             </table>
510           </form>
511         </td>
512       </tr>
513     </table>
514   </xsl:template>
515
516   <xsl:template name="utilBar">
517     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="utilBarTable">
518        <tr>
519          <td class="leftCell">
520            <xsl:choose>
521              <xsl:when test="/bedework/periodname = 'day'">
522                <xsl:variable name="date" select="/bedework/firstday/date"/>
523                <a href="{$initEvent}?startdate={$date}" title="add event">
524                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
525                   add event
526                </a>
527              </xsl:when>
528              <xsl:otherwise>
529                <a href="{$initEvent}" title="add event">
530                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
531                   add event
532                </a>
533              </xsl:otherwise>
534            </xsl:choose>
535            <a href="{$initUpload}" title="upload event">
536               <img src="{$resourcesRoot}/resources/std-icalUpload-icon-small.gif" width="12" height="16" border="0" alt="upload event"/>
537               upload
538            </a>
539          </td>
540          <td class="rightCell">
541            <xsl:choose>
542             <xsl:when test="/bedework/periodname='Day'">
543               <img src="{$resourcesRoot}/resources/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
544             </xsl:when>
545             <xsl:when test="/bedework/periodname='Year'">
546               <img src="{$resourcesRoot}/resources/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
547             </xsl:when>
548             <xsl:when test="/bedework/periodname='Month'">
549               <xsl:choose>
550                 <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
551                   <a href="{$setup}?setappvar=monthViewMode(cal)" title="toggle list/calendar view">
552                     <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
553                   </a>
554                 </xsl:when>
555                 <xsl:otherwise>
556                   <a href="{$setup}?setappvar=monthViewMode(list)" title="toggle list/calendar view">
557                     <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
558                   </a>
559                 </xsl:otherwise>
560               </xsl:choose>
561             </xsl:when>
562             <xsl:otherwise>
563               <xsl:choose>
564                 <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
565                   <a href="{$setup}?setappvar=weekViewMode(cal)" title="toggle list/calendar view">
566                     <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
567                   </a>
568                 </xsl:when>
569                 <xsl:otherwise>
570                   <a href="{$setup}?setappvar=weekViewMode(list)" title="toggle list/calendar view">
571                     <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
572                   </a>
573                 </xsl:otherwise>
574               </xsl:choose>
575             </xsl:otherwise>
576           </xsl:choose>
577            <xsl:choose>
578               <xsl:when test="/bedework/periodname='Year' or
579                               (/bedework/periodname='Month' and
580                               (/bedework/appvar[key='monthViewMode']/value='cal' or
581                                not(/bedework/appvar[key='monthViewMode']))) or
582                               (/bedework/periodname='Week' and
583                               (/bedework/appvar[key='weekViewMode']/value='cal' or
584                                not(/bedework/appvar[key='weekViewMode'])))">
585                 <xsl:choose>
586                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
587                     <img src="{$resourcesRoot}/resources/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
588                   </xsl:when>
589                   <xsl:otherwise>
590                     <img src="{$resourcesRoot}/resources/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
591                   </xsl:otherwise>
592                 </xsl:choose>
593               </xsl:when>
594               <xsl:otherwise>
595                 <xsl:choose>
596                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
597                     <a href="{$setup}?setappvar=summaryMode(summary)" title="toggle summary/detailed view">
598                       <img src="{$resourcesRoot}/resources/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
599                     </a>
600                   </xsl:when>
601                   <xsl:otherwise>
602                     <a href="{$setup}?setappvar=summaryMode(details)" title="toggle summary/detailed view">
603                       <img src="{$resourcesRoot}/resources/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
604                     </a>
605                   </xsl:otherwise>
606                 </xsl:choose>
607               </xsl:otherwise>
608             </xsl:choose>
609             <a href="setup.do"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
610          </td>
611        </tr>
612     </table>
613   </xsl:template>
614
615   <!--==== LIST VIEW  (for day, week, and month) ====-->
616   <xsl:template name="listView">
617     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
618       <xsl:choose>
619         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
620           <tr>
621             <td class="noEventsCell">
622               There are no events posted
623               <xsl:choose>
624                 <xsl:when test="/bedework/periodname='Day'">
625                   today<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
626                 </xsl:when>
627                 <xsl:when test="/bedework/periodname='Month'">
628                   this month<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
629                 </xsl:when>
630                 <xsl:otherwise>
631                   this week<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
632                 </xsl:otherwise>
633               </xsl:choose>
634             </td>
635           </tr>
636         </xsl:when>
637         <xsl:otherwise>
638           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
639             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
640               <tr>
641                 <td colspan="6" class="dateRow">
642                    <xsl:variable name="date" select="date"/>
643                    <a href="{$initEvent}?startdate={$date}" class="listAdd">
644                      add event
645                    </a>
646                    <a href="{$setViewPeriod}?viewType=dayView&amp;date={$date}">
647                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
648                    </a>
649                  </td>
650               </tr>
651             </xsl:if>
652             <xsl:for-each select="event">
653               <xsl:variable name="id" select="id"/>
654               <xsl:variable name="subscriptionId" select="subscription/id"/>
655               <xsl:variable name="calendarId" select="calendar/id"/>
656               <xsl:variable name="guid" select="guid"/>
657               <xsl:variable name="recurrenceId" select="recurrenceId"/>
658               <tr>
659                 <xsl:variable name="dateRangeStyle">
660                   <xsl:choose>
661                     <xsl:when test="start/shortdate = parent::day/shortdate">
662                       <xsl:choose>
663                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
664                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
665                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
666                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
667                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
668                       </xsl:choose>
669                     </xsl:when>
670                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
671                   </xsl:choose>
672                 </xsl:variable>
673                 <xsl:choose>
674                   <xsl:when test="start/allday = 'true' and
675                                   start/shortdate = end/shortdate">
676                     <td class="{$dateRangeStyle} center" colspan="3">
677                       all day
678                     </td>
679                   </xsl:when>
680                   <xsl:otherwise>
681                     <td class="{$dateRangeStyle} right">
682                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
683                       <xsl:choose>
684                         <xsl:when test="start/allday = 'true' and
685                                         parent::day/shortdate = start/shortdate">
686                           today
687                         </xsl:when>
688                         <xsl:when test="parent::day/shortdate != start/shortdate">
689                           <span class="littleArrow">&#171;</span>&#160;
690                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
691                         </xsl:when>
692                         <xsl:otherwise>
693                           <xsl:value-of select="start/time"/>
694                         </xsl:otherwise>
695                       </xsl:choose>
696                       </a>
697                     </td>
698                     <td class="{$dateRangeStyle} center">
699                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
700                     </td>
701                     <td class="{$dateRangeStyle} left">
702                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
703                       <xsl:choose>
704                         <xsl:when test="end/allday = 'true' and
705                                         parent::day/shortdate = end/shortdate">
706                           today
707                         </xsl:when>
708                         <xsl:when test="parent::day/shortdate != end/shortdate">
709                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
710                           &#160;<span class="littleArrow">&#187;</span>
711                         </xsl:when>
712                         <xsl:otherwise>
713                           <xsl:value-of select="end/time"/>
714                         </xsl:otherwise>
715                       </xsl:choose>
716                       </a>
717                     </td>
718                   </xsl:otherwise>
719                 </xsl:choose>
720                 <xsl:variable name="descriptionClass">
721                   <xsl:choose>
722                     <xsl:when test="priority='cancelled'">description cancelled</xsl:when>
723                     <xsl:otherwise>description</xsl:otherwise>
724                   </xsl:choose>
725                 </xsl:variable>
726                 <td class="{$descriptionClass}">
727                   <xsl:choose>
728                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
729                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
730                         <strong><xsl:value-of select="summary"/>: </strong>
731                         <xsl:value-of select="description"/>&#160;
732                         <em>
733                           <xsl:value-of select="location/address"/>
734                           <xsl:if test="location/subaddress != ''">
735                             , <xsl:value-of select="location/subaddress"/>
736                           </xsl:if>.&#160;
737                           <xsl:if test="cost!=''">
738                             <xsl:value-of select="cost"/>.&#160;
739                           </xsl:if>
740                           <xsl:if test="sponsor/name!='none'">
741                             Contact: <xsl:value-of select="sponsor/name"/>
742                           </xsl:if>
743                         </em>
744                       </a>
745                       <xsl:if test="link != ''">
746                         <xsl:variable name="link" select="link"/>
747                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
748                       </xsl:if>
749                     </xsl:when>
750                     <xsl:otherwise>
751                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
752                         <xsl:value-of select="summary"/>
753                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
754                       </a>
755                     </xsl:otherwise>
756                   </xsl:choose>
757                 </td>
758                 <td class="eventLinks">
759                   <xsl:call-template name="eventLinks"/>
760                 </td>
761                 <td class="smallIcon">
762                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
763                   <a href="{$export}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
764                     <img src="{$resourcesRoot}/resources/std-ical_icon_small.gif" width="12" height="16" border="0" alt="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars"/>
765                   </a>
766                 </td>
767               </tr>
768             </xsl:for-each>
769           </xsl:for-each>
770         </xsl:otherwise>
771       </xsl:choose>
772     </table>
773   </xsl:template>
774
775   <xsl:template name="eventLinks">
776     <xsl:variable name="subscriptionId" select="subscription/id"/>
777           <xsl:variable name="calendarId" select="calendar/id"/>
778     <xsl:variable name="guid" select="guid"/>
779     <xsl:variable name="recurrenceId" select="recurrenceId"/>
780     <xsl:choose>
781       <xsl:when test="isAnnotation">
782         <xsl:choose>
783           <xsl:when test="recurring=true">
784             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">Remove All</a>
785           </xsl:when>
786           <xsl:otherwise>
787             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Remove</a>
788           </xsl:otherwise>
789         </xsl:choose>
790       </xsl:when>
791       <xsl:when test="calendar/owner = /bedework/userid">
792         <a href="{$editEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">Edit</a> |
793         <xsl:choose>
794           <xsl:when test="recurring=true">
795             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete All</a>
796           </xsl:when>
797           <xsl:otherwise>
798             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete</a>
799           </xsl:otherwise>
800         </xsl:choose>
801       </xsl:when>
802       <xsl:otherwise>
803         <a href="{$subscriptions-fetch}">Subscription</a>
804       </xsl:otherwise>
805     </xsl:choose>
806   </xsl:template>
807
808   <!--==== WEEK CALENDAR VIEW ====-->
809   <xsl:template name="weekView">
810     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
811       <tr>
812         <xsl:for-each select="/bedework/daynames/val">
813           <th class="dayHeading"><xsl:value-of select="."/></th>
814         </xsl:for-each>
815       </tr>
816       <tr>
817         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
818           <xsl:variable name="dayPos" select="position()"/>
819           <xsl:if test="filler='false'">
820             <td>
821               <xsl:variable name="dayDate" select="date"/>
822               <a href="{$initEvent}?startdate={$dayDate}" class="gridAdd" title="add event">
823                 <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="10" height="10" border="0" alt="add event"/>
824               </a>
825               <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
826                 <xsl:value-of select="value"/>
827               </a>
828               <ul>
829                 <xsl:apply-templates select="event" mode="calendarLayout">
830                   <xsl:with-param name="dayPos" select="$dayPos"/>
831                 </xsl:apply-templates>
832               </ul>
833             </td>
834           </xsl:if>
835         </xsl:for-each>
836       </tr>
837     </table>
838   </xsl:template>
839
840   <!--==== MONTH CALENDAR VIEW ====-->
841   <xsl:template name="monthView">
842     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
843       <tr>
844         <xsl:for-each select="/bedework/daynames/val">
845           <th class="dayHeading"><xsl:value-of select="."/></th>
846         </xsl:for-each>
847       </tr>
848       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
849         <tr>
850           <xsl:for-each select="day">
851             <xsl:variable name="dayPos" select="position()"/>
852             <xsl:choose>
853               <xsl:when test="filler='true'">
854                 <td class="filler">&#160;</td>
855               </xsl:when>
856               <xsl:otherwise>
857                 <td>
858                   <xsl:variable name="dayDate" select="date"/>
859                   <a href="{$initEvent}?startdate={$dayDate}" class="gridAdd" title="add event">
860                     <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="10" height="10" border="0" alt="add event"/>
861                   </a>
862                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
863                     <xsl:value-of select="value"/>
864                   </a>
865                   <ul>
866                     <xsl:apply-templates select="event" mode="calendarLayout">
867                       <xsl:with-param name="dayPos" select="$dayPos"/>
868                     </xsl:apply-templates>
869                   </ul>
870                 </td>
871               </xsl:otherwise>
872             </xsl:choose>
873           </xsl:for-each>
874         </tr>
875       </xsl:for-each>
876     </table>
877   </xsl:template>
878
879   <xsl:template match="event" mode="calendarLayout">
880     <xsl:param name="dayPos"/>
881     <xsl:variable name="subscriptionId" select="subscription/id"/>
882     <xsl:variable name="calendarId" select="calendar/id"/>
883     <xsl:variable name="guid" select="guid"/>
884     <xsl:variable name="recurrenceId" select="recurrenceId"/>
885     <xsl:variable name="eventClass">
886       <xsl:choose>
887         <!-- Special styles for the month grid -->
888         <xsl:when test="status='cancelled'">eventCancelled</xsl:when>
889         <xsl:when test="calendar/name='Holidays'">holiday</xsl:when>
890         <!-- Alternating colors for all standard events -->
891         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
892         <xsl:otherwise>eventLinkB</xsl:otherwise>
893       </xsl:choose>
894     </xsl:variable>
895     <li>
896       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass}">
897         <xsl:value-of select="summary"/>
898         <xsl:variable name="eventTipClass">
899           <xsl:choose>
900             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
901             <xsl:otherwise>eventTip</xsl:otherwise>
902           </xsl:choose>
903         </xsl:variable>
904         <span class="{$eventTipClass}">
905           <strong><xsl:value-of select="summary"/></strong><br/>
906           Time:
907           <xsl:choose>
908             <xsl:when test="start/allday = 'false'">
909               <xsl:value-of select="start/time"/>
910                - <xsl:value-of select="end/time"/>
911             </xsl:when>
912             <xsl:otherwise>
913               all day
914             </xsl:otherwise>
915           </xsl:choose><br/>
916           <xsl:if test="location/address">
917             Location: <xsl:value-of select="location/address"/><br/>
918           </xsl:if>
919           Calendar: <xsl:value-of select="calendar/name"/>
920           Type:
921           <xsl:choose>
922             <xsl:when test="isAnnotation">
923               public event
924             </xsl:when>
925             <xsl:when test="calendar/owner = /bedework/userid">
926               personal event, editable
927             </xsl:when>
928             <xsl:otherwise>
929               subscription
930             </xsl:otherwise>
931           </xsl:choose>
932         </span>
933       </a>
934     </li>
935   </xsl:template>
936
937   <!--==== YEAR VIEW ====-->
938   <xsl:template name="yearView">
939     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
940       <tr>
941         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
942       </tr>
943       <tr>
944         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
945       </tr>
946       <tr>
947         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
948       </tr>
949       <tr>
950         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
951       </tr>
952     </table>
953   </xsl:template>
954
955   <!-- year view month tables -->
956   <xsl:template match="month">
957     <td>
958       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
959         <tr>
960           <td colspan="8" class="monthName">
961             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
962             <a href="{$setViewPeriod}?viewType=monthView&amp;date={$firstDayOfMonth}">
963               <xsl:value-of select="longname"/>
964             </a>
965           </td>
966         </tr>
967         <tr>
968           <th>&#160;</th>
969           <xsl:for-each select="/bedework/shortdaynames/val">
970             <th><xsl:value-of select="."/></th>
971           </xsl:for-each>
972         </tr>
973         <xsl:for-each select="week">
974           <tr>
975             <td class="weekCell">
976               <xsl:variable name="firstDayOfWeek" select="day/date"/>
977               <a href="{$setViewPeriod}?viewType=weekView&amp;date={$firstDayOfWeek}">
978                 <xsl:value-of select="value"/>
979               </a>
980             </td>
981             <xsl:for-each select="day">
982               <xsl:choose>
983                 <xsl:when test="filler='true'">
984                   <td class="filler">&#160;</td>
985                 </xsl:when>
986                 <xsl:otherwise>
987                   <td>
988                     <xsl:variable name="dayDate" select="date"/>
989                     <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}">
990                       <xsl:value-of select="value"/>
991                     </a>
992                   </td>
993                 </xsl:otherwise>
994               </xsl:choose>
995             </xsl:for-each>
996           </tr>
997         </xsl:for-each>
998       </table>
999     </td>
1000   </xsl:template>
1001
1002   <!--==== SINGLE EVENT ====-->
1003   <xsl:template match="event">
1004     <xsl:variable name="subscriptionId" select="subscription/id"/>
1005     <xsl:variable name="calendarId" select="calendar/id"/>
1006     <xsl:variable name="guid" select="guid"/>
1007     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1008     <h2>
1009       <xsl:choose>
1010         <xsl:when test="link != ''">
1011           <xsl:variable name="link" select="link"/>
1012           <a href="{$link}">
1013             <xsl:value-of select="summary"/>
1014           </a>
1015         </xsl:when>
1016         <xsl:otherwise>
1017           <xsl:value-of select="summary"/>
1018         </xsl:otherwise>
1019       </xsl:choose>
1020     </h2>
1021     <table class="common" cellspacing="0">
1022       <tr>
1023         <th colspan="3" class="commonHeader">
1024           <div id="eventActions">
1025             <xsl:choose>
1026               <xsl:when test="isAnnotation">
1027                 <xsl:choose>
1028                   <xsl:when test="recurring=true">
1029                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">
1030                       Remove All (recurring)
1031                     </a>
1032                   </xsl:when>
1033                   <xsl:otherwise>
1034                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1035                       Remove
1036                     </a>
1037                   </xsl:otherwise>
1038                 </xsl:choose>
1039               </xsl:when>
1040               <xsl:when test="calendar/owner = /bedework/userid">
1041                 <a href="{$editEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1042                   Edit Event
1043                 </a> |
1044                 <xsl:choose>
1045                   <xsl:when test="recurring=true">
1046                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">
1047                       Delete All (recurring)
1048                     </a>
1049                   </xsl:when>
1050                   <xsl:otherwise>
1051                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1052                       Delete Event
1053                     </a>
1054                   </xsl:otherwise>
1055                 </xsl:choose>
1056               </xsl:when>
1057               <xsl:otherwise>
1058                 <a href="{$subscriptions-fetch}">
1059                   Manage Subscriptions
1060                 </a>
1061               </xsl:otherwise>
1062             </xsl:choose>
1063           </div>
1064           <xsl:choose>
1065             <xsl:when test="isAnnotation">
1066               Public Event
1067             </xsl:when>
1068             <xsl:when test="calendar/owner = /bedework/userid">
1069               Personal Event
1070             </xsl:when>
1071             <xsl:otherwise>
1072               Public Event from Subscription
1073             </xsl:otherwise>
1074           </xsl:choose>
1075         </th>
1076       </tr>
1077       <!--<tr>
1078         <td class="fieldname">Title:</td>
1079         <td class="fieldval">
1080           <strong>
1081             <xsl:choose>
1082               <xsl:when test="link != ''">
1083                 <xsl:variable name="link" select="link"/>
1084                 <a href="{$link}">
1085                   <xsl:value-of select="summary"/>
1086                 </a>
1087               </xsl:when>
1088               <xsl:otherwise>
1089                 <xsl:value-of select="summary"/>
1090               </xsl:otherwise>
1091             </xsl:choose>
1092           </strong>
1093         </td>
1094       </tr>-->
1095       <tr>
1096         <td class="fieldname">When:</td>
1097         <td class="fieldval">
1098           <!-- was using abbrev dayname: substring(start/dayname,1,3) -->
1099           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
1100           <span class="time"><xsl:value-of select="start/time"/></span>
1101           <xsl:if test="end/time != '' or end/longdate != start/longdate"> - </xsl:if>
1102           <xsl:if test="end/longdate != start/longdate"><xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text></xsl:if>
1103           <xsl:if test="end/time != ''"><span class="time"><xsl:value-of select="end/time"/></span></xsl:if>
1104         </td>
1105         <th class="icon" rowspan="2">
1106           <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
1107           <a href="{$export}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
1108             <img src="{$resourcesRoot}/resources/std-ical-icon.gif" width="20" height="26" border="0" align="left" alt="Download this event"/>
1109           </a><!-- <br />
1110           [<a href="">help</a>] -->
1111         </th>
1112       </tr>
1113       <tr>
1114         <td class="fieldname">Where:</td>
1115         <td colspan="3" class="fieldval">
1116           <xsl:choose>
1117             <xsl:when test="location/link=''">
1118               <xsl:value-of select="location/address"/>
1119             </xsl:when>
1120             <xsl:otherwise>
1121               <xsl:variable name="locationLink" select="location/link"/>
1122               <a href="{$locationLink}">
1123                 <xsl:value-of select="location/address"/>
1124               </a>
1125             </xsl:otherwise>
1126           </xsl:choose>
1127           <xsl:if test="location/subaddress!=''">
1128             <br/><xsl:value-of select="location/subaddress"/>
1129           </xsl:if>
1130         </td>
1131       </tr>
1132       <tr>
1133         <td class="fieldname">Description:</td>
1134         <td colspan="3" class="fieldval">
1135           <xsl:call-template name="replace">
1136             <xsl:with-param name="string" select="description"/>
1137             <xsl:with-param name="pattern" select="'&#xA;'"/>
1138             <xsl:with-param name="replacement"><br/></xsl:with-param>
1139           </xsl:call-template>
1140         </td>
1141       </tr>
1142       <xsl:if test="organizer">
1143         <tr>
1144           <td class="fieldname">Organizer:</td>
1145           <xsl:variable name="organizerUri" select="organizer/organizerUri"/>
1146           <td colspan="2" class="fieldval">
1147             <strong>
1148               <a href="{$organizerUri}">
1149                 <xsl:value-of select="organizer/cn"/>
1150               </a>
1151             </strong>
1152           </td>
1153         </tr>
1154       </xsl:if>
1155       <xsl:if test="attendee">
1156         <tr>
1157           <td class="fieldname">Attendees:</td>
1158           <td colspan="3" class="fieldval">
1159             <table id="attendees" cellspacing="0">
1160               <tr>
1161                 <th>role</th>
1162                 <th>status</th>
1163                 <th>attendee</th>
1164               </tr>
1165               <xsl:for-each select="attendee">
1166                 <xsl:sort select="cn" order="ascending" case-order="upper-first"/>
1167                 <tr>
1168                   <td class="role">
1169                     <xsl:value-of select="role"/>
1170                   </td>
1171                   <td class="status">
1172                     <xsl:value-of select="partstat"/>
1173                   </td>
1174                   <td>
1175                     <xsl:variable name="attendeeUri" select="attendeeUri"/>
1176                     <a href="{$attendeeUri}"><xsl:value-of select="cn"/></a>
1177                   </td>
1178                 </tr>
1179               </xsl:for-each>
1180             </table>
1181           </td>
1182         </tr>
1183       </xsl:if>
1184       <xsl:if test="cost!=''">
1185         <tr>
1186           <td class="fieldname">Cost:</td>
1187           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
1188         </tr>
1189       </xsl:if>
1190       <xsl:if test="link != ''">
1191         <tr>
1192           <td class="fieldname">See:</td>
1193           <td colspan="3" class="fieldval">
1194             <xsl:variable name="link" select="link"/>
1195             <a href="{$link}"><xsl:value-of select="link"/></a>
1196           </td>
1197         </tr>
1198       </xsl:if>
1199       <xsl:if test="sponsor/name!='none'">
1200         <tr>
1201           <td class="fieldname">Contact:</td>
1202           <td colspan="3" class="fieldval">
1203             <xsl:choose>
1204               <xsl:when test="sponsor/link=''">
1205                 <xsl:value-of select="sponsor/name"/>
1206               </xsl:when>
1207               <xsl:otherwise>
1208                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
1209                 <a href="{$sponsorLink}">
1210                   <xsl:value-of select="sponsor/name"/>
1211                 </a>
1212               </xsl:otherwise>
1213             </xsl:choose>
1214             <xsl:if test="sponsor/phone!=''">
1215               <br /><xsl:value-of select="sponsor/phone"/>
1216             </xsl:if>
1217             <xsl:if test="sponsor/email!=''">
1218               <br />
1219               <xsl:variable name="email" select="sponsor/email"/>
1220               <xsl:variable name="subject" select="summary"/>
1221               <a href="mailto:{$email}?subject={$subject}">
1222                 <xsl:value-of select="sponsor/email"/>
1223               </a>
1224             </xsl:if>
1225           </td>
1226         </tr>
1227       </xsl:if>
1228       <xsl:if test="calendar/name!=''">
1229         <tr>
1230           <td class="fieldname">Calendar:</td>
1231           <td class="fieldval">
1232             <xsl:variable name="calUrl" select="calendar/path"/>
1233             <a href="{$setSelection}?calUrl={$calUrl}">
1234               <xsl:value-of select="calendar/name"/>
1235             </a>
1236           </td>
1237         </tr>
1238       </xsl:if>
1239       <tr>
1240         <td class="fieldname filler">&#160;</td>
1241         <td class="fieldval">&#160;</td>
1242       </tr>
1243     </table>
1244   </xsl:template>
1245
1246  <!--==== ADD EVENT ====-->
1247   <xsl:template name="addEvent">
1248     <form name="eventForm" method="post" action="{$addEventUsingPage}" id="standardForm">
1249       <input type="hidden" name="confirmationid" value="{$confId}"/>
1250       <input type="hidden" name="endType" value="date"/>
1251       <h2>Add Event</h2>
1252       <table class="common" cellspacing="0">
1253         <tr>
1254           <td class="fieldname">
1255             Title:
1256           </td>
1257           <td class="fieldval">
1258             <xsl:variable name="title" select="/bedework/formElements/form/title/input/@value"/>
1259             <input type="text" name="newEvent.summary" size="80" value="{$title}"/>
1260           </td>
1261         </tr>
1262         <tr>
1263           <td class="fieldname">
1264             Calendar:
1265           </td>
1266           <td class="fieldval">
1267             <select name="calId">
1268               <option value="-1">
1269                 Select:
1270               </option>
1271               <!--<xsl:copy-of select="/bedework/formElements/form/calendar/select/*"/>-->
1272               <!-- the following calendar select box is temporary.  Should be
1273                    replaced with the xml from the line above. -->
1274               <xsl:for-each select="/bedework/myCalendars/calendars//calendar[calendarCollection='true']">
1275                 <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
1276                   <xsl:variable name="calid" select="id"/>
1277                   <xsl:choose>
1278                     <xsl:when test="id = /bedework/formElements/calendarId">
1279                       <option value="{$calid}" selected="selected"><xsl:value-of select="name"/></option>
1280                     </xsl:when>
1281                     <xsl:otherwise>
1282                       <option value="{$calid}"><xsl:value-of select="name"/></option>
1283                     </xsl:otherwise>
1284                   </xsl:choose>
1285                 </xsl:if>
1286               </xsl:for-each>
1287             </select>
1288           </td>
1289         </tr>
1290         <tr>
1291           <td class="fieldname">
1292             Date &amp; Time:
1293           </td>
1294           <td class="fieldval">
1295             <!-- Set the timefields class for the first load of the page;
1296                  subsequent changes will take place using javascript without a
1297                  page reload. -->
1298             <xsl:variable name="timeFieldsClass">
1299               <xsl:choose>
1300                 <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1301                 <xsl:otherwise>timeFields</xsl:otherwise>
1302               </xsl:choose>
1303             </xsl:variable>
1304             <xsl:choose>
1305               <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">
1306                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1307                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1308                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1309               </xsl:when>
1310               <xsl:otherwise>
1311                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1312                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1313                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1314               </xsl:otherwise>
1315             </xsl:choose>
1316             all day event<br/>
1317             <div class="dateStartEndBox">
1318               <strong>Start:</strong>
1319               <div class="dateFields">
1320                 <span class="startDateLabel">Date </span>
1321                 <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
1322                 <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
1323                 <xsl:choose>
1324                   <xsl:when test="/bedework/creating = 'true'">
1325                     <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
1326                   </xsl:when>
1327                   <xsl:otherwise>
1328                     <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
1329                   </xsl:otherwise>
1330                 </xsl:choose>
1331               </div>
1332               <script language="JavaScript" type="text/javascript">
1333               <xsl:comment>
1334                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback');
1335               </xsl:comment>
1336               </script>
1337               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1338               <div class="{$timeFieldsClass}" id="startTimeFields">
1339                 <span id="calWidgetStartTimeHider" class="show">
1340                   <xsl:copy-of select="/bedework/formElements/form/start/hour/*"/>
1341                   <xsl:copy-of select="/bedework/formElements/form/start/minute/*"/>
1342                   <xsl:if test="/bedework/formElements/form/start/ampm">
1343                     <xsl:copy-of select="/bedework/formElements/form/start/ampm/*"/>
1344                   </xsl:if>
1345                   <xsl:text> </xsl:text>
1346                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1347                 </span>
1348               </div>
1349             </div>
1350             <div class="dateStartEndBox">
1351               <strong>End:</strong>
1352               <xsl:choose>
1353                 <xsl:when test="/bedework/formElements/form/end/type='E'">
1354                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1355                 </xsl:when>
1356                 <xsl:otherwise>
1357                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1358                 </xsl:otherwise>
1359               </xsl:choose>
1360               Date
1361               <xsl:variable name="endDateTimeClass">
1362                 <xsl:choose>
1363                   <xsl:when test="/bedework/formElements/form/end/type='E'">shown</xsl:when>
1364                   <xsl:otherwise>invisible</xsl:otherwise>
1365                 </xsl:choose>
1366               </xsl:variable>
1367               <div class="{$endDateTimeClass}" id="endDateTime">
1368                 <div class="dateFields">
1369                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
1370                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
1371                   <xsl:choose>
1372                     <xsl:when test="/bedework/creating = 'true'">
1373                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
1374                     </xsl:when>
1375                     <xsl:otherwise>
1376                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
1377                     </xsl:otherwise>
1378                   </xsl:choose>
1379                 </div>
1380                 <script language="JavaScript" type="text/javascript">
1381                 <xsl:comment>
1382                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback');
1383                 </xsl:comment>
1384                 </script>
1385                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1386                 <div class="{$timeFieldsClass}" id="endTimeFields">
1387                   <span id="calWidgetEndTimeHider" class="show">
1388                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/hour/*"/>
1389                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/minute/*"/>
1390                     <xsl:if test="/bedework/formElements/form/end/dateTime/ampm">
1391                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/ampm/*"/>
1392                     </xsl:if>
1393                     <xsl:text> </xsl:text>
1394                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1395                   </span>
1396                 </div>
1397               </div><br/>
1398               <div id="clock" class="invisible">
1399                 <xsl:call-template name="clock"/>
1400               </div>
1401               <div class="dateFields">
1402                 <xsl:choose>
1403                   <xsl:when test="/bedework/formElements/form/end/type='D'">
1404                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1405                   </xsl:when>
1406                   <xsl:otherwise>
1407                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1408                   </xsl:otherwise>
1409                 </xsl:choose>
1410                 Duration
1411                 <xsl:variable name="endDurationClass">
1412                   <xsl:choose>
1413                     <xsl:when test="/bedework/formElements/form/end/type='D'">shown</xsl:when>
1414                     <xsl:otherwise>invisible</xsl:otherwise>
1415                   </xsl:choose>
1416                 </xsl:variable>
1417                 <xsl:variable name="durationHrMinClass">
1418                   <xsl:choose>
1419                     <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1420                     <xsl:otherwise>shown</xsl:otherwise>
1421                   </xsl:choose>
1422                 </xsl:variable>
1423                 <div class="{$endDurationClass}" id="endDuration">
1424                   <xsl:choose>
1425                     <xsl:when test="/bedework/formElements/form/end/duration/weeks/input/@value = '0'">
1426                     <!-- we are using day, hour, minute format -->
1427                     <!-- must send either no week value or week value of 0 (zero) -->
1428                       <div class="durationBox">
1429                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1430                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1431                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1432                         <span id="durationHrMin" class="{$durationHrMinClass}">
1433                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1434                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1435                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1436                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1437                         </span>
1438                       </div>
1439                       <span class="durationSpacerText">or</span>
1440                       <div class="durationBox">
1441                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1442                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1443                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1444                       </div>
1445                     </xsl:when>
1446                     <xsl:otherwise>
1447                       <!-- we are using week format -->
1448                       <div class="durationBox">
1449                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1450                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1451                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1452                         <span id="durationHrMin" class="{$durationHrMinClass}">
1453                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1454                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1455                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1456                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1457                         </span>
1458                       </div>
1459                       <span class="durationSpacerText">or</span>
1460                       <div class="durationBox">
1461                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1462                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1463                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1464                       </div>
1465                     </xsl:otherwise>
1466                   </xsl:choose>
1467                 </div>
1468               </div><br/>
1469               <div class="dateFields" id="noDuration">
1470                 <xsl:choose>
1471                   <xsl:when test="/bedework/formElements/form/end/type='N'">
1472                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1473                   </xsl:when>
1474                   <xsl:otherwise>
1475                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1476                   </xsl:otherwise>
1477                 </xsl:choose>
1478                 This event has no duration / end date
1479               </div>
1480             </div>
1481           </td>
1482         </tr>
1483         <!--  Status  -->
1484         <tr>
1485           <td class="fieldname">
1486             Status:
1487           </td>
1488           <td class="fieldval">
1489             <xsl:choose>
1490               <xsl:when test="/bedework/formElements/form/status = 'TENTATIVE'">
1491                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1492               </xsl:when>
1493               <xsl:when test="/bedework/formElements/form/status = 'CANCELLED'">
1494                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED" checked="checked"/>cancelled
1495               </xsl:when>
1496               <xsl:otherwise>
1497                 <input type="radio" name="event.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1498               </xsl:otherwise>
1499             </xsl:choose>
1500           </td>
1501         </tr>
1502         <tr>
1503           <td class="fieldname">Description:</td>
1504           <td class="fieldval">
1505             <textarea name="newEvent.description" cols="60" rows="4">
1506               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
1507             </textarea>
1508           </td>
1509         </tr>
1510         <tr>
1511           <td class="fieldname">Location:</td>
1512           <td class="fieldval" align="left">
1513             <span class="std-text">choose: </span>
1514             <span id="eventFormLocationList">
1515               <select name="locationId">
1516                 <option value="-1">select...</option>
1517                 <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
1518               </select>
1519             </span>
1520             <span class="std-text"> or add new: </span>
1521             <input type="text" name="newLocation.address" value="" />
1522           </td>
1523         </tr>
1524         <tr>
1525           <td class="fieldname">Event Link:</td>
1526           <td class="fieldval">
1527             <xsl:variable name="link" select="/bedework/formElements/form/link/input/@value"/>
1528             <input type="text" name="newEvent.link" size="80" value="{$link}"/>
1529           </td>
1530         </tr>
1531         <tr>
1532           <td class="fieldname">&#160;</td>
1533           <td class="fieldval">
1534             <input name="submit" type="submit" value="Submit Event"/>&#160;
1535             <input name="cancelled" type="submit" value="Cancel"/>
1536           </td>
1537         </tr>
1538       </table>
1539     </form>
1540   </xsl:template>
1541
1542   <xsl:template name="clock">
1543     <div id="bwClock">
1544       <!-- Bedework 24-Hour Clock time selection widget
1545            used with resources/bwClock.js and resources/bwClock.css -->
1546       <div id="bwClockClock">
1547         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="" usemap="#bwClockMap" />
1548       </div>
1549       <div id="bwClockCover">
1550         <!-- this is a special effect div used simply to cover the pixelated edge
1551              where the clock meets the clock box title -->
1552       </div>
1553       <div id="bwClockBox">
1554         <h2>
1555           Bedework 24-Hour Clock
1556         </h2>
1557         <div id="bwClockDateTypeIndicator">
1558           type
1559         </div>
1560         <div id="bwClockTime">
1561           select time
1562         </div>
1563         <div id="bwClockCloseText">
1564           close
1565         </div>
1566         <div id="bwClockCloseButton">
1567           <a href="javascript:bwClockClose();">X</a>
1568         </div>
1569       </div>
1570       <map name="bwClockMap" id="bwClockMap">
1571         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1572         <area shape="poly" alt="minute 00:55" title="minute 00:55" coords="156,164, 169,155, 156,107, 123,128" href="javascript:bwClockUpdateDateTimeForm('minute','55')" />
1573         <area shape="poly" alt="minute 00:50" title="minute 00:50" coords="150,175, 156,164, 123,128, 103,161" href="javascript:bwClockUpdateDateTimeForm('minute','50')" />
1574         <area shape="poly" alt="minute 00:45" title="minute 00:45" coords="150,191, 150,175, 103,161, 103,206" href="javascript:bwClockUpdateDateTimeForm('minute','45')" />
1575         <area shape="poly" alt="minute 00:40" title="minute 00:40" coords="158,208, 150,191, 105,206, 123,237" href="javascript:bwClockUpdateDateTimeForm('minute','40')" />
1576         <area shape="poly" alt="minute 00:35" title="minute 00:35" coords="171,218, 158,208, 123,238, 158,261" href="javascript:bwClockUpdateDateTimeForm('minute','35')" />
1577         <area shape="poly" alt="minute 00:30" title="minute 00:30" coords="193,218, 172,218, 158,263, 209,263" href="javascript:bwClockUpdateDateTimeForm('minute','30')" />
1578         <area shape="poly" alt="minute 00:25" title="minute 00:25" coords="209,210, 193,218, 209,261, 241,240" href="javascript:bwClockUpdateDateTimeForm('minute','25')" />
1579         <area shape="poly" alt="minute 00:20" title="minute 00:20" coords="216,196, 209,210, 241,240, 261,206" href="javascript:bwClockUpdateDateTimeForm('minute','20')" />
1580         <area shape="poly" alt="minute 00:15" title="minute 00:15" coords="216,178, 216,196, 261,206, 261,159" href="javascript:bwClockUpdateDateTimeForm('minute','15')" />
1581         <area shape="poly" alt="minute 00:10" title="minute 00:10" coords="209,164, 216,178, 261,159, 240,126" href="javascript:bwClockUpdateDateTimeForm('minute','10')" />
1582         <area shape="poly" alt="minute 00:05" title="minute 00:05" coords="196,155, 209,164, 238,126, 206,107" href="javascript:bwClockUpdateDateTimeForm('minute','05')" />
1583         <area shape="poly" alt="minute 00:00" title="minute 00:00" coords="169,155, 196,155, 206,105, 156,105" href="javascript:bwClockUpdateDateTimeForm('minute','00')" />
1584         <area shape="poly" alt="11 PM, 2300 hour" title="11 PM, 2300 hour" coords="150,102, 172,96, 158,1, 114,14" href="javascript:bwClockUpdateDateTimeForm('hour','23')" />
1585         <area shape="poly" alt="10 PM, 2200 hour" title="10 PM, 2200 hour" coords="131,114, 150,102, 114,14, 74,36" href="javascript:bwClockUpdateDateTimeForm('hour','22')" />
1586         <area shape="poly" alt="9 PM, 2100 hour" title="9 PM, 2100 hour" coords="111,132, 131,114, 74,36, 40,69" href="javascript:bwClockUpdateDateTimeForm('hour','21')" />
1587         <area shape="poly" alt="8 PM, 2000 hour" title="8 PM, 2000 hour" coords="101,149, 111,132, 40,69, 15,113" href="javascript:bwClockUpdateDateTimeForm('hour','20')" />
1588         <area shape="poly" alt="7 PM, 1900 hour" title="7 PM, 1900 hour" coords="95,170, 101,149, 15,113, 1,159" href="javascript:bwClockUpdateDateTimeForm('hour','19')" />
1589         <area shape="poly" alt="6 PM, 1800 hour" title="6 PM, 1800 hour" coords="95,196, 95,170, 0,159, 0,204" href="javascript:bwClockUpdateDateTimeForm('hour','18')" />
1590         <area shape="poly" alt="5 PM, 1700 hour" title="5 PM, 1700 hour" coords="103,225, 95,196, 1,205, 16,256" href="javascript:bwClockUpdateDateTimeForm('hour','17')" />
1591         <area shape="poly" alt="4 PM, 1600 hour" title="4 PM, 1600 hour" coords="116,245, 103,225, 16,256, 41,298" href="javascript:bwClockUpdateDateTimeForm('hour','16')" />
1592         <area shape="poly" alt="3 PM, 1500 hour" title="3 PM, 1500 hour" coords="134,259, 117,245, 41,298, 76,332" href="javascript:bwClockUpdateDateTimeForm('hour','15')" />
1593         <area shape="poly" alt="2 PM, 1400 hour" title="2 PM, 1400 hour" coords="150,268, 134,259, 76,333, 121,355" href="javascript:bwClockUpdateDateTimeForm('hour','14')" />
1594         <area shape="poly" alt="1 PM, 1300 hour" title="1 PM, 1300 hour" coords="169,273, 150,268, 120,356, 165,365" href="javascript:bwClockUpdateDateTimeForm('hour','13')" />
1595         <area shape="poly" alt="Noon, 1200 hour" title="Noon, 1200 hour" coords="193,273, 169,273, 165,365, 210,364" href="javascript:bwClockUpdateDateTimeForm('hour','12')" />
1596         <area shape="poly" alt="11 AM, 1100 hour" title="11 AM, 1100 hour" coords="214,270, 193,273, 210,363, 252,352" href="javascript:bwClockUpdateDateTimeForm('hour','11')" />
1597         <area shape="poly" alt="10 AM, 1000 hour" title="10 AM, 1000 hour" coords="232,259, 214,270, 252,352, 291,330" href="javascript:bwClockUpdateDateTimeForm('hour','10')" />
1598         <area shape="poly" alt="9 AM, 0900 hour" title="9 AM, 0900 hour" coords="251,240, 232,258, 291,330, 323,301" href="javascript:bwClockUpdateDateTimeForm('hour','09')" />
1599         <area shape="poly" alt="8 AM, 0800 hour" title="8 AM, 0800 hour" coords="263,219, 251,239, 323,301, 349,261" href="javascript:bwClockUpdateDateTimeForm('hour','08')" />
1600         <area shape="poly" alt="7 AM, 0700 hour" title="7 AM, 0700 hour" coords="269,194, 263,219, 349,261, 363,212" href="javascript:bwClockUpdateDateTimeForm('hour','07')" />
1601         <area shape="poly" alt="6 AM, 0600 hour" title="6 AM, 0600 hour" coords="269,172, 269,193, 363,212, 363,155" href="javascript:bwClockUpdateDateTimeForm('hour','06')" />
1602         <area shape="poly" alt="5 AM, 0500 hour" title="5 AM, 0500 hour" coords="263,150, 269,172, 363,155, 351,109" href="javascript:bwClockUpdateDateTimeForm('hour','05')" />
1603         <area shape="poly" alt="4 AM, 0400 hour" title="4 AM, 0400 hour" coords="251,130, 263,150, 351,109, 325,68" href="javascript:bwClockUpdateDateTimeForm('hour','04')" />
1604         <area shape="poly" alt="3 AM, 0300 hour" title="3 AM, 0300 hour" coords="234,112, 251,130, 325,67, 295,37" href="javascript:bwClockUpdateDateTimeForm('hour','03')" />
1605         <area shape="poly" alt="2 AM, 0200 hour" title="2 AM, 0200 hour" coords="221,102, 234,112, 295,37, 247,11" href="javascript:bwClockUpdateDateTimeForm('hour','02')" />
1606         <area shape="poly" alt="1 AM, 0100 hour" title="1 AM, 0100 hour" coords="196,96, 221,102, 247,10, 209,-1, 201,61, 206,64, 205,74, 199,75" href="javascript:bwClockUpdateDateTimeForm('hour','01')" />
1607         <area shape="poly" alt="Midnight, 0000 hour" title="Midnight, 0000 hour" coords="172,96, 169,74, 161,73, 161,65, 168,63, 158,-1, 209,-1, 201,61, 200,62, 206,64, 205,74, 198,75, 196,96, 183,95" href="javascript:bwClockUpdateDateTimeForm('hour','00')" />
1608       </map>
1609     </div>
1610   </xsl:template>
1611
1612   <!--==== EDIT EVENT ====-->
1613   <xsl:template match="formElements" mode="editEvent">
1614     <xsl:variable name="subscriptionId" select="subscriptionId"/>
1615     <xsl:variable name="calendarId" select="calendarId"/>
1616     <xsl:variable name="guid" select="guid"/>
1617     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1618     <form name="eventForm" method="post" action="{$editEvent}" id="standardForm">
1619       <input type="hidden" name="updateEvent" value="true"/>
1620       <input type="hidden" name="confirmationid" value="{$confId}"/>
1621       <input type="hidden" name="endType" value="date"/>
1622       <h2>Edit Event</h2>
1623       <table class="common" cellspacing="0">
1624         <tr>
1625           <th colspan="2" class="commonHeader">
1626             <div id="eventActions">
1627               <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1628                 View Event
1629               </a> |
1630               <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1631                 Delete Event
1632               </a>
1633             </div>
1634             Personal Event
1635           </th>
1636         </tr>
1637         <tr>
1638           <td class="fieldname">
1639             Title:
1640           </td>
1641           <td class="fieldval">
1642             <xsl:variable name="title" select="form/title/input/@value"/>
1643             <input type="text" name="editEvent.summary" size="80" value="{$title}"/>
1644           </td>
1645         </tr>
1646         <tr>
1647           <td class="fieldname">
1648             Calendar:
1649           </td>
1650           <td class="fieldval">
1651             <select name="calId">
1652               <option value="-1">
1653                 Select:
1654               </option>
1655               <!--<xsl:copy-of select="/bedework/formElements/form/calendar/select/*"/>-->
1656               <!-- the following calendar select box is temporary.  Should be
1657                    replaced with the xml from the line above. -->
1658               <xsl:for-each select="/bedework/myCalendars/calendars//calendar[calendarCollection='true']">
1659                 <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
1660                   <xsl:variable name="calid" select="id"/>
1661                   <xsl:choose>
1662                     <xsl:when test="id = /bedework/formElements/calendarId">
1663                       <option value="{$calid}" selected="selected"><xsl:value-of select="name"/></option>
1664                     </xsl:when>
1665                     <xsl:otherwise>
1666                       <option value="{$calid}"><xsl:value-of select="name"/></option>
1667                     </xsl:otherwise>
1668                   </xsl:choose>
1669                 </xsl:if>
1670               </xsl:for-each>
1671             </select>
1672           </td>
1673         </tr>
1674         <tr>
1675           <td class="fieldname">
1676             Date &amp; Time:
1677           </td>
1678           <td class="fieldval">
1679             <!-- Set the timefields class for the first load of the page;
1680                  subsequent changes will take place using javascript without a
1681                  page reload. -->
1682             <xsl:variable name="timeFieldsClass">
1683               <xsl:choose>
1684                 <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1685                 <xsl:otherwise>timeFields</xsl:otherwise>
1686               </xsl:choose>
1687             </xsl:variable>
1688             <xsl:choose>
1689               <xsl:when test="form/allDay/input/@checked='checked'">
1690                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1691                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1692                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1693               </xsl:when>
1694               <xsl:otherwise>
1695                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1696                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1697                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1698               </xsl:otherwise>
1699             </xsl:choose>
1700             all day event<br/>
1701             <div class="dateStartEndBox">
1702               <strong>Start:</strong>
1703               <div class="dateFields">
1704                 <span class="startDateLabel">Date </span>
1705                 <xsl:copy-of select="form/start/month/*"/>
1706                 <xsl:copy-of select="form/start/day/*"/>
1707                 <xsl:choose>
1708                   <xsl:when test="/bedework/creating = 'true'">
1709                     <xsl:copy-of select="form/start/year/*"/>
1710                   </xsl:when>
1711                   <xsl:otherwise>
1712                     <xsl:copy-of select="form/start/yearText/*"/>
1713                   </xsl:otherwise>
1714                 </xsl:choose>
1715               </div>
1716               <script language="JavaScript" type="text/javascript">
1717               <xsl:comment>
1718                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback');
1719               </xsl:comment>
1720               </script>
1721               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1722               <div class="{$timeFieldsClass}" id="startTimeFields">
1723                 <span id="calWidgetStartTimeHider" class="show">
1724                   <xsl:copy-of select="form/start/hour/*"/>
1725                   <xsl:copy-of select="form/start/minute/*"/>
1726                   <xsl:if test="form/start/ampm">
1727                     <xsl:copy-of select="form/start/ampm/*"/>
1728                   </xsl:if>
1729                   <xsl:text> </xsl:text>
1730                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1731                 </span>
1732               </div>
1733             </div>
1734             <div class="dateStartEndBox">
1735               <strong>End:</strong>
1736               <xsl:choose>
1737                 <xsl:when test="form/end/type='E'">
1738                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1739                 </xsl:when>
1740                 <xsl:otherwise>
1741                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1742                 </xsl:otherwise>
1743               </xsl:choose>
1744               Date
1745               <xsl:variable name="endDateTimeClass">
1746                 <xsl:choose>
1747                   <xsl:when test="form/end/type='E'">shown</xsl:when>
1748                   <xsl:otherwise>invisible</xsl:otherwise>
1749                 </xsl:choose>
1750               </xsl:variable>
1751               <div class="{$endDateTimeClass}" id="endDateTime">
1752                 <div class="dateFields">
1753                   <xsl:copy-of select="form/end/dateTime/month/*"/>
1754                   <xsl:copy-of select="form/end/dateTime/day/*"/>
1755                   <xsl:choose>
1756                     <xsl:when test="/bedework/creating = 'true'">
1757                       <xsl:copy-of select="form/end/dateTime/year/*"/>
1758                     </xsl:when>
1759                     <xsl:otherwise>
1760                       <xsl:copy-of select="form/end/dateTime/yearText/*"/>
1761                     </xsl:otherwise>
1762                   </xsl:choose>
1763                 </div>
1764                 <script language="JavaScript" type="text/javascript">
1765                 <xsl:comment>
1766                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback');
1767                 </xsl:comment>
1768                 </script>
1769                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1770                 <div class="{$timeFieldsClass}" id="endTimeFields">
1771                   <span id="calWidgetEndTimeHider" class="show">
1772                     <xsl:copy-of select="form/end/dateTime/hour/*"/>
1773                     <xsl:copy-of select="form/end/dateTime/minute/*"/>
1774                     <xsl:if test="form/end/dateTime/ampm">
1775                       <xsl:copy-of select="form/end/dateTime/ampm/*"/>
1776                     </xsl:if>
1777                     <xsl:text> </xsl:text>
1778                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1779                   </span>
1780                 </div>
1781               </div><br/>
1782               <div id="clock" class="invisible">
1783                 <xsl:call-template name="clock"/>
1784               </div>
1785               <div class="dateFields">
1786                 <xsl:choose>
1787                   <xsl:when test="form/end/type='D'">
1788                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1789                   </xsl:when>
1790                   <xsl:otherwise>
1791                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1792                   </xsl:otherwise>
1793                 </xsl:choose>
1794                 Duration
1795                 <xsl:variable name="endDurationClass">
1796                   <xsl:choose>
1797                     <xsl:when test="form/end/type='D'">shown</xsl:when>
1798                     <xsl:otherwise>invisible</xsl:otherwise>
1799                   </xsl:choose>
1800                 </xsl:variable>
1801                 <xsl:variable name="durationHrMinClass">
1802                   <xsl:choose>
1803                     <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1804                     <xsl:otherwise>shown</xsl:otherwise>
1805                   </xsl:choose>
1806                 </xsl:variable>
1807                 <div class="{$endDurationClass}" id="endDuration">
1808                   <xsl:choose>
1809                     <xsl:when test="form/end/duration/weeks/input/@value = '0'">
1810                     <!-- we are using day, hour, minute format -->
1811                     <!-- must send either no week value or week value of 0 (zero) -->
1812                       <div class="durationBox">
1813                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1814                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1815                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1816                         <span id="durationHrMin" class="{$durationHrMinClass}">
1817                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1818                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1819                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1820                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1821                         </span>
1822                       </div>
1823                       <span class="durationSpacerText">or</span>
1824                       <div class="durationBox">
1825                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1826                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1827                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1828                       </div>
1829                     </xsl:when>
1830                     <xsl:otherwise>
1831                       <!-- we are using week format -->
1832                       <div class="durationBox">
1833                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1834                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1835                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1836                         <span id="durationHrMin" class="{$durationHrMinClass}">
1837                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1838                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1839                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1840                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1841                         </span>
1842                       </div>
1843                       <span class="durationSpacerText">or</span>
1844                       <div class="durationBox">
1845                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1846                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1847                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1848                       </div>
1849                     </xsl:otherwise>
1850                   </xsl:choose>
1851                 </div>
1852               </div><br/>
1853               <div class="dateFields" id="noDuration">
1854                 <xsl:choose>
1855                   <xsl:when test="form/end/type='N'">
1856                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1857                   </xsl:when>
1858                   <xsl:otherwise>
1859                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1860                   </xsl:otherwise>
1861                 </xsl:choose>
1862                 This event has no duration / end date
1863               </div>
1864             </div>
1865           </td>
1866         </tr>
1867         <!--  Status  -->
1868         <tr>
1869           <td class="fieldname">
1870             Status:
1871           </td>
1872           <td class="fieldval">
1873             <xsl:choose>
1874               <xsl:when test="form/status = 'TENTATIVE'">
1875                 <input type="radio" name="editEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED"/>cancelled
1876               </xsl:when>
1877               <xsl:when test="form/status = 'CANCELLED'">
1878                 <input type="radio" name="editEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED" checked="checked"/>cancelled
1879               </xsl:when>
1880               <xsl:otherwise>
1881                 <input type="radio" name="editEvent.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED"/>cancelled
1882               </xsl:otherwise>
1883             </xsl:choose>
1884           </td>
1885         </tr>
1886         <tr>
1887           <td class="fieldname">Description:</td>
1888           <td class="fieldval">
1889             <textarea name="editEvent.description" cols="60" rows="4">
1890               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
1891             </textarea>
1892           </td>
1893         </tr>
1894         <tr>
1895           <td class="fieldname">Location:</td>
1896           <td class="fieldval" align="left">
1897             <span class="std-text">choose: </span>
1898             <span id="eventFormLocationList">
1899               <select name="locationId">
1900                 <option value="-1">select...</option>
1901                 <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
1902               </select>
1903             </span>
1904             <span class="std-text"> or add new: </span>
1905             <input type="text" name="laddress" value="" />
1906           </td>
1907         </tr>
1908         <tr>
1909           <td class="fieldname">Event Link:</td>
1910           <td class="fieldval">
1911             <xsl:variable name="link" select="form/link/input/@value"/>
1912             <input type="text" name="editEvent.link" size="80" value="{$link}"/>
1913           </td>
1914         </tr>
1915         <tr>
1916           <td class="fieldname">&#160;</td>
1917           <td class="fieldval">
1918             <input name="submit" type="submit" value="Submit Event"/>&#160;
1919             <input name="cancelled" type="submit" value="Cancel"/>
1920           </td>
1921         </tr>
1922       </table>
1923     </form>
1924
1925     <div id="sharingBox">
1926       <h3>Sharing</h3>
1927       <table class="common">
1928         <tr>
1929           <th class="commonHeader" colspan="2">Current access:</th>
1930         </tr>
1931         <tr>
1932           <th>Owner:</th>
1933           <!-- NOTE: we are currently getting the acl information from the
1934                calendar listing NOT from the current calendar (which does not
1935                have the means of producing it out of the action form just now.
1936                We'll fix this soon. -->
1937           <td class="fieldval">
1938             <xsl:value-of select="name(acl/ace[principal/property/owner]/grant/*)"/>
1939           </td>
1940         </tr>
1941         <xsl:if test="acl/ace/principal/href">
1942           <tr>
1943             <th>Users:</th>
1944             <td>
1945               <xsl:for-each select="acl/ace[principal/href]">
1946                 <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
1947               </xsl:for-each>
1948             </td>
1949           </tr>
1950         </xsl:if>
1951       </table>
1952       <form name="eventShareForm" action="{$event-setAccess}" id="shareForm">
1953         <input type="hidden" name="calId" value="{$calendarId}"/>
1954         <input type="hidden" name="guid" value="{$guid}"/>
1955         <input type="hidden" name="recurid" value="{$recurrenceId}"/>
1956         <p>
1957           Share this event with:<br/>
1958           <input type="text" name="who" size="20"/>
1959           <input type="radio" value="user" name="whoType" checked="checked"/> user
1960           <input type="radio" value="group" name="whoType"/> group
1961         </p>
1962         <p>
1963           Access rights:<br/>
1964           <input type="radio" value="r" name="how" checked="checked"/> read<br/>
1965           <input type="radio" value="w" name="how"/> write<br/>
1966           <input type="radio" value="f" name="how"/> free/busy only<br/>
1967           <input type="radio" value="d" name="how"/> default (reset access)
1968         </p>
1969         <input type="submit" name="submit" value="Submit"/>
1970       </form>
1971     </div>
1972   </xsl:template>
1973
1974   <!--+++++++++++++++ Free / Busy ++++++++++++++++++++-->
1975   <xsl:template match="freebusy">
1976     <h2>Free / Busy</h2>
1977     <table id="freeBusy">
1978       <tr>
1979         <td>&#160;</td>
1980         <xsl:for-each select="day[position()=1]/period">
1981           <th>
1982             <xsl:choose>
1983               <xsl:when test="number(start) mod 200 = 0">
1984                 <xsl:apply-templates select="start" mode="timeDisplay"/>
1985               </xsl:when>
1986               <xsl:otherwise>
1987                 &#160;
1988               </xsl:otherwise>
1989             </xsl:choose>
1990           </th>
1991         </xsl:for-each>
1992       </tr>
1993       <xsl:for-each select="day">
1994         <tr>
1995           <th>
1996             <xsl:value-of select="substring(start,1,4)"/>-<xsl:value-of select="substring(start,5,2)"/>-<xsl:value-of select="substring(start,7,2)"/>
1997           </th>
1998           <xsl:for-each select="period">
1999             <xsl:variable name="startTime"><xsl:apply-templates  select="start" mode="timeDisplay"/></xsl:variable>
2000             <!-- the start date for the add event link is a concat of the day's date plus the period's time (+ seconds)-->
2001             <xsl:variable name="startDate"><xsl:value-of select="substring(../start,1,8)"/>T<xsl:value-of select="start"/>00</xsl:variable>
2002             <xsl:choose>
2003               <xsl:when test="fbtype = '0'">
2004                 <td class="busy">
2005                   <a href="{$initEvent}?startdate={$startDate}" title="{$startTime}">*</a>
2006                 </td>
2007               </xsl:when>
2008               <xsl:otherwise>
2009                 <td class="free">
2010                   <a href="{$initEvent}?startdate={$startDate}" title="{$startTime}">*</a>
2011                 </td>
2012               </xsl:otherwise>
2013             </xsl:choose>
2014           </xsl:for-each>
2015         </tr>
2016       </xsl:for-each>
2017     </table>
2018
2019     <table id="freeBusyKey">
2020       <tr>
2021         <td class="free">*</td>
2022         <td>free</td>
2023         <td>&#160;</td>
2024         <td class="busy">*</td>
2025         <td>busy</td>
2026       </tr>
2027     </table>
2028   </xsl:template>
2029
2030   <xsl:template match="start" mode="timeDisplay">
2031     <xsl:choose>
2032       <xsl:when test="node()=0000">12am</xsl:when>
2033       <xsl:when test="node()=0100">1am</xsl:when>
2034       <xsl:when test="node()=0200">2am</xsl:when>
2035       <xsl:when test="node()=0300">3am</xsl:when>
2036       <xsl:when test="node()=0400">4am</xsl:when>
2037       <xsl:when test="node()=0500">5am</xsl:when>
2038       <xsl:when test="node()=0600">6am</xsl:when>
2039       <xsl:when test="node()=0700">7am</xsl:when>
2040       <xsl:when test="node()=0800">8am</xsl:when>
2041       <xsl:when test="node()=0900">9am</xsl:when>
2042       <xsl:when test="node()=1000">10am</xsl:when>
2043       <xsl:when test="node()=1100">11am</xsl:when>
2044       <xsl:when test="node()=1200">NOON</xsl:when>
2045       <xsl:when test="node()=1300">1pm</xsl:when>
2046       <xsl:when test="node()=1400">2pm</xsl:when>
2047       <xsl:when test="node()=1500">3pm</xsl:when>
2048       <xsl:when test="node()=1600">4pm</xsl:when>
2049       <xsl:when test="node()=1700">5pm</xsl:when>
2050       <xsl:when test="node()=1800">6pm</xsl:when>
2051       <xsl:when test="node()=1900">7pm</xsl:when>
2052       <xsl:when test="node()=2000">8pm</xsl:when>
2053       <xsl:when test="node()=2100">9pm</xsl:when>
2054       <xsl:when test="node()=2200">10pm</xsl:when>
2055       <xsl:when test="node()=2300">11pm</xsl:when>
2056       <xsl:when test="node()=2400">12am</xsl:when>
2057       <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2058     </xsl:choose>
2059   </xsl:template>
2060
2061   <!--+++++++++++++++ Calendars ++++++++++++++++++++-->
2062   <xsl:template match="calendars">
2063     <h2>Manage Calendars</h2>
2064     <table id="calendarTable">
2065       <tr>
2066         <td class="cals">
2067           <h3>Calendars</h3>
2068           <ul class="calendarTree">
2069             <xsl:choose>
2070               <xsl:when test="/bedework/page='calendarDescriptions' or
2071                               /bedework/page='displayCalendar'">
2072                 <xsl:apply-templates select="calendar" mode="listForDisplay"/>
2073               </xsl:when>
2074               <xsl:otherwise>
2075                 <xsl:apply-templates select="calendar" mode="listForUpdate"/>
2076               </xsl:otherwise>
2077             </xsl:choose>
2078           </ul>
2079         </td>
2080         <td class="calendarContent">
2081           <xsl:choose>
2082             <xsl:when test="/bedework/page='calendarList' or
2083                             /bedework/page='calendarReferenced'">
2084               <xsl:call-template name="calendarList"/>
2085             </xsl:when>
2086             <xsl:when test="/bedework/page='calendarDescriptions'">
2087               <xsl:call-template name="calendarDescriptions"/>
2088             </xsl:when>
2089             <xsl:when test="/bedework/page='displayCalendar'">
2090               <xsl:apply-templates select="/bedework/currentCalendar" mode="displayCalendar"/>
2091             </xsl:when>
2092             <xsl:when test="/bedework/page='deleteCalendarConfirm'">
2093               <xsl:apply-templates select="/bedework/currentCalendar" mode="deleteCalendarConfirm"/>
2094             </xsl:when>
2095             <xsl:when test="/bedework/creating='true'">
2096               <xsl:apply-templates select="/bedework/currentCalendar" mode="addCalendar"/>
2097             </xsl:when>
2098             <xsl:otherwise>
2099               <xsl:apply-templates select="/bedework/currentCalendar" mode="modCalendar"/>
2100             </xsl:otherwise>
2101           </xsl:choose>
2102         </td>
2103       </tr>
2104     </table>
2105   </xsl:template>
2106
2107   <xsl:template match="calendar" mode="listForUpdate">
2108     <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
2109       <xsl:variable name="id" select="id"/>
2110       <xsl:variable name="itemClass">
2111         <xsl:choose>
2112           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2113           <xsl:otherwise>calendar</xsl:otherwise>
2114         </xsl:choose>
2115       </xsl:variable>
2116       <li class="{$itemClass}">
2117         <a href="{$calendar-fetchForUpdate}&amp;calId={$id}" title="update">
2118           <xsl:value-of select="name"/>
2119         </a>
2120         <xsl:if test="calendarCollection='false'">
2121           <xsl:text> </xsl:text>
2122           <a href="{$calendar-initAdd}&amp;calId={$id}" title="add a calendar or folder">
2123             <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/>
2124           </a>
2125         </xsl:if>
2126         <xsl:if test="calendar">
2127           <ul>
2128             <xsl:apply-templates select="calendar" mode="listForUpdate">
2129               <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2130             </xsl:apply-templates>
2131           </ul>
2132         </xsl:if>
2133       </li>
2134     </xsl:if>
2135   </xsl:template>
2136
2137   <xsl:template match="calendar" mode="listForDisplay">
2138     <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
2139       <xsl:variable name="id" select="id"/>
2140       <xsl:variable name="itemClass">
2141         <xsl:choose>
2142           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2143           <xsl:otherwise>calendar</xsl:otherwise>
2144         </xsl:choose>
2145       </xsl:variable>
2146       <li class="{$itemClass}">
2147         <a href="{$calendar-fetchForDisplay}&amp;calId={$id}" title="display">
2148           <xsl:value-of select="name"/>
2149         </a>
2150         <xsl:if test="calendar">
2151           <ul>
2152             <xsl:apply-templates select="calendar" mode="listForDisplay">
2153               <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2154             </xsl:apply-templates>
2155           </ul>
2156         </xsl:if>
2157       </li>
2158     </xsl:if>
2159   </xsl:template>
2160
2161   <xsl:template match="currentCalendar" mode="addCalendar">
2162     <h3>Add Calendar / Folder</h3>
2163     <form name="addCalForm" action="{$calendar-update}">
2164       <table class="common">
2165         <tr>
2166           <th>Name:</th>
2167           <td>
2168             <xsl:variable name="curCalName" select="name"/>
2169             <input name="calendar.name" value="{$curCalName}" size="40"/>
2170           </td>
2171         </tr>
2172         <tr>
2173           <th>Summary:</th>
2174           <td>
2175             <xsl:variable name="curCalSummary" select="summary"/>
2176             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2177           </td>
2178         </tr>
2179         <tr>
2180           <th>Description:</th>
2181           <td>
2182             <textarea name="calendar.description" cols="40" rows="4">
2183               <xsl:value-of select="desc"/>
2184             </textarea>
2185           </td>
2186         </tr>
2187         <tr>
2188           <th>Calendar/Folder:</th>
2189           <td>
2190             <xsl:choose>
2191               <xsl:when test="calendarCollection='true'">
2192                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2193                 <input type="radio" value="false" name="calendarCollection"/> Folder
2194               </xsl:when>
2195               <xsl:otherwise>
2196                 <input type="radio" value="true" name="calendarCollection"/> Calendar
2197                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
2198               </xsl:otherwise>
2199             </xsl:choose>
2200           </td>
2201         </tr>
2202       </table>
2203
2204       <table border="0" id="submitTable">
2205         <tr>
2206           <td>
2207             <input type="submit" name="addCalendar" value="Add Calendar/Folder"/>
2208             <input type="submit" name="cancelled" value="Cancel"/>
2209             <input type="reset" value="Clear"/>
2210           </td>
2211         </tr>
2212       </table>
2213     </form>
2214
2215     <div id="sharingBox">
2216       <h3>Sharing</h3>
2217       Sharing may be added to a calendar once created.
2218     </div>
2219
2220   </xsl:template>
2221
2222   <xsl:template match="currentCalendar" mode="modCalendar">
2223     <xsl:choose>
2224       <xsl:when test="calendarCollection='true'">
2225         <h3>Modify Calendar</h3>
2226       </xsl:when>
2227       <xsl:otherwise>
2228         <h3>Modify Folder</h3>
2229       </xsl:otherwise>
2230     </xsl:choose>
2231     <xsl:variable name="id" select="id"/>
2232     <form name="modCalForm" action="{$calendar-update}">
2233       <table class="common">
2234         <tr>
2235           <th class="commonHeader" colspan="2">
2236             <div id="eventActions">
2237               key: <xsl:value-of select="id"/>
2238             </div>
2239             <xsl:value-of select="path"/>
2240           </th>
2241         </tr>
2242         <tr>
2243           <th>Name:</th>
2244           <td>
2245             <xsl:value-of select="name"/>
2246           </td>
2247         </tr>
2248         <tr>
2249           <th>Mailing List ID:</th>
2250           <td>
2251             <xsl:value-of select="mailListId"/>
2252           </td>
2253         </tr>
2254         <tr>
2255           <th>Summary:</th>
2256           <td>
2257             <xsl:variable name="curCalSummary" select="summary"/>
2258             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2259           </td>
2260         </tr>
2261         <tr>
2262           <th>Description:</th>
2263           <td>
2264             <textarea name="calendar.description" cols="40" rows="4">
2265               <xsl:value-of select="desc"/>
2266             </textarea>
2267           </td>
2268         </tr>
2269         <tr>
2270           <th>Calendar/Folder:</th>
2271           <td>
2272             <xsl:choose>
2273               <xsl:when test="calendarCollection='true'">
2274                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2275                 <input type="radio" value="false" name="calendarCollection"/> Folder
2276               </xsl:when>
2277               <xsl:otherwise>
2278                 <input type="radio" value="true" name="calendarCollection"/> Calendar
2279                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
2280               </xsl:otherwise>
2281             </xsl:choose>
2282           </td>
2283         </tr>
2284       </table>
2285
2286       <table border="0" id="submitTable">
2287         <tr>
2288           <td>
2289             <xsl:choose>
2290               <xsl:when test="calendarCollection='true'">
2291                 <input type="submit" name="updateCalendar" value="Update Calendar"/>
2292               </xsl:when>
2293               <xsl:otherwise>
2294                 <input type="submit" name="updateCalendar" value="Update Folder"/>
2295               </xsl:otherwise>
2296             </xsl:choose>
2297             <input type="submit" name="cancelled" value="Cancel"/>
2298             <input type="reset" value="Reset"/>
2299           </td>
2300           <td align="right">
2301             <xsl:choose>
2302               <xsl:when test="calendarCollection='true'">
2303                 <input type="submit" name="delete" value="Delete Calendar"/>
2304               </xsl:when>
2305               <xsl:otherwise>
2306                 <input type="submit" name="delete" value="Delete Folder"/>
2307               </xsl:otherwise>
2308             </xsl:choose>
2309           </td>
2310         </tr>
2311       </table>
2312     </form>
2313     <div id="sharingBox">
2314       <h3>Sharing</h3>
2315       <table class="common">
2316         <tr>
2317           <th class="commonHeader" colspan="2">Current access:</th>
2318         </tr>
2319         <tr>
2320           <th>Owner:</th>
2321           <!-- NOTE: we are currently getting the acl information from the
2322                calendar listing NOT from the current calendar (which does not
2323                have the means of producing it out of the action form just now.
2324                We'll fix this soon. -->
2325           <td>
2326             <xsl:value-of select="name(/bedework/calendars//calendar[id=$id]/acl/ace[principal/property/owner]/grant/*)"/>
2327           </td>
2328         </tr>
2329         <xsl:if test="/bedework/calendars//calendar[id=$id]/acl/ace/principal/href">
2330           <tr>
2331             <th>Users:</th>
2332             <td>
2333               <xsl:for-each select="/bedework/calendars//calendar[id=$id]/acl/ace[principal/href]">
2334                 <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
2335               </xsl:for-each>
2336             </td>
2337           </tr>
2338         </xsl:if>
2339       </table>
2340       <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm">
2341         <input type="hidden" name="calId" value="{$id}"/>
2342         <p>
2343           Share this calendar with:<br/>
2344           <input type="text" name="who" size="20"/>
2345           <input type="radio" value="user" name="whoType" checked="checked"/> user
2346           <input type="radio" value="group" name="whoType"/> group
2347         </p>
2348         <p>
2349           Access rights:<br/>
2350           <input type="radio" value="r" name="how" checked="checked"/> read<br/>
2351           <input type="radio" value="w" name="how"/> write<br/>
2352           <input type="radio" value="f" name="how"/> free/busy only<br/>
2353           <input type="radio" value="d" name="how"/> default (reset access)
2354         </p>
2355         <input type="submit" name="submit" value="Submit"/>
2356       </form>
2357     </div>
2358   </xsl:template>
2359
2360   <xsl:template name="calendarList">
2361     <h3>Managing Calendars</h3>
2362     <ul>
2363       <li>Select an item from the calendar list on the left to modify
2364       a calendar or folder.</li>
2365       <li>Select the
2366       <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="true" border="0"/>
2367       icon to add a new calendar or folder to the tree.
2368         <ul>
2369           <li>Folders may only contain calendars and subfolders.</li>
2370           <li>Calendars may only contain events (and other calendar items).</li>
2371           <li>
2372             If a calendar is empty, it may be converted to a folder and vice
2373             versa.  If a calendar or folder are not empty, it may not be
2374             converted.
2375           </li>
2376         </ul>
2377       </li>
2378     </ul>
2379   </xsl:template>
2380
2381   <xsl:template name="calendarDescriptions">
2382     <h2>Calendar Information</h2>
2383     <ul>
2384       <li>Select an item from the calendar tree on the left to view all information
2385       about that calendar or folder.  The tree on the left represents the calendar
2386       heirarchy.</li>
2387     </ul>
2388
2389     <p><strong>All Calendar Descriptions:</strong></p>
2390     <table id="flatCalendarDescriptions" cellspacing="0">
2391       <tr>
2392         <th>Name</th>
2393         <th>Description</th>
2394       </tr>
2395       <xsl:for-each select="//calendar">
2396         <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
2397           <xsl:variable name="descClass">
2398             <xsl:choose>
2399               <xsl:when test="position() mod 2 = 0">even</xsl:when>
2400               <xsl:otherwise>odd</xsl:otherwise>
2401             </xsl:choose>
2402           </xsl:variable>
2403           <tr class="{$descClass}">
2404             <td>
2405               <xsl:value-of select="name"/>
2406             </td>
2407             <td>
2408               <xsl:value-of select="desc"/>
2409             </td>
2410           </tr>
2411         </xsl:if>
2412       </xsl:for-each>
2413     </table>
2414   </xsl:template>
2415
2416   <xsl:template match="currentCalendar" mode="displayCalendar">
2417     <h2>Calendar Information</h2>
2418     <table class="common">
2419       <tr>
2420         <th>Name:</th>
2421         <td>
2422           <xsl:value-of select="name"/>
2423         </td>
2424       </tr>
2425       <tr>
2426         <th>Path:</th>
2427         <td>
2428           <xsl:value-of select="path"/>
2429         </td>
2430       </tr>
2431       <tr>
2432         <th>Summary:</th>
2433         <td>
2434           <xsl:value-of select="summary"/>
2435         </td>
2436       </tr>
2437       <tr>
2438         <th>Description:</th>
2439         <td>
2440           <xsl:value-of select="desc"/>
2441         </td>
2442       </tr>
2443     </table>
2444   </xsl:template>
2445
2446   <xsl:template match="currentCalendar" mode="deleteCalendarConfirm">
2447     <xsl:choose>
2448       <xsl:when test="calendarCollection='true'">
2449         <h3>Delete Calendar</h3>
2450         <p>
2451           The following calendar will be deleted.  Continue?
2452         </p>
2453       </xsl:when>
2454       <xsl:otherwise>
2455         <h3>Delete Folder</h3>
2456         <p>
2457           The following folder <em>and all its contents</em> will be deleted.
2458           Continue?
2459         </p>
2460       </xsl:otherwise>
2461     </xsl:choose>
2462
2463     <form name="delCalForm" action="{$calendar-delete}">
2464       <table class="common">
2465         <tr>
2466           <th>Path:</th>
2467           <td>
2468             <xsl:value-of select="path"/>
2469           </td>
2470         </tr>
2471         <tr>
2472           <th>Name:</th>
2473           <td>
2474             <xsl:value-of select="name"/>
2475           </td>
2476         </tr>
2477         <tr>
2478           <th>Summary:</th>
2479           <td>
2480             <xsl:value-of select="summary"/>
2481           </td>
2482         </tr>
2483         <tr>
2484           <th>Description:</th>
2485           <td>
2486             <xsl:value-of select="desc"/>
2487           </td>
2488         </tr>
2489       </table>
2490
2491       <table border="0" id="submitTable">
2492         <tr>
2493           <td>
2494             <input type="submit" name="cancelled" value="Cancel"/>
2495           </td>
2496           <td align="right">
2497             <xsl:choose>
2498               <xsl:when test="calendarCollection='true'">
2499                 <input type="submit" name="delete" value="Yes: Delete Calendar!"/>
2500               </xsl:when>
2501               <xsl:otherwise>
2502                 <input type="submit" name="delete" value="Yes: Delete Folder!"/>
2503               </xsl:otherwise>
2504             </xsl:choose>
2505           </td>
2506         </tr>
2507       </table>
2508     </form>
2509
2510   </xsl:template>
2511
2512   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
2513   <xsl:template match="subscriptions">
2514     <h2>Manage Subscriptions</h2>
2515     <table id="subsTable">
2516       <tr>
2517         <td class="cals">
2518           <h3>Public calendars</h3>
2519           <p class="smaller">
2520             Select a calendar below to add a <em><strong>new</strong></em>
2521             internal subscription. <!-- or
2522             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
2523             subscribe to an external calendar</a>.-->
2524           </p>
2525           <ul class="calendarTree">
2526             <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar" mode="subscribe"/>
2527           </ul>
2528         </td>
2529         <td class="subs">
2530           <xsl:choose>
2531             <xsl:when test="/bedework/page='subscriptions'">
2532               <xsl:call-template name="subscriptionList"/>
2533             </xsl:when>
2534             <xsl:when test="/bedework/creating='true'">
2535               <xsl:apply-templates select="subscription" mode="addSubscription"/>
2536             </xsl:when>
2537             <xsl:otherwise>
2538               <xsl:apply-templates select="subscription" mode="modSubscription"/>
2539             </xsl:otherwise>
2540           </xsl:choose>
2541         </td>
2542       </tr>
2543     </table>
2544   </xsl:template>
2545
2546   <xsl:template match="calendar" mode="subscribe">
2547     <xsl:variable name="id" select="id"/>
2548     <xsl:variable name="itemClass">
2549       <xsl:choose>
2550         <xsl:when test="calendarCollection='false'">folder</xsl:when>
2551         <xsl:otherwise>calendar</xsl:otherwise>
2552       </xsl:choose>
2553     </xsl:variable>
2554     <li class="{$itemClass}">
2555       <a href="{$subscriptions-initAdd}&amp;calId={$id}">
2556         <xsl:value-of select="name"/>
2557       </a>
2558       <xsl:if test="calendar">
2559         <ul>
2560           <xsl:apply-templates select="calendar" mode="subscribe">
2561             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2562           </xsl:apply-templates>
2563         </ul>
2564       </xsl:if>
2565     </li>
2566   </xsl:template>
2567
2568   <xsl:template match="calendar" mode="myCalendars">
2569     <!-- supress Inbox and Outbox for the moment -->
2570     <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
2571       <xsl:variable name="id" select="id"/>
2572       <xsl:variable name="itemClass">
2573         <xsl:choose>
2574           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2575                           and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when>
2576           <xsl:when test="name='Trash'">trash</xsl:when>
2577           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2578           <xsl:otherwise>calendar</xsl:otherwise>
2579         </xsl:choose>
2580       </xsl:variable>
2581       <li class="{$itemClass}">
2582         <xsl:variable name="url" select="path"/>
2583         <a href="{$setSelection}?calUrl={$url}">
2584           <xsl:value-of select="name"/>
2585         </a>
2586         <xsl:if test="calendar">
2587           <ul>
2588             <xsl:apply-templates select="calendar" mode="myCalendars"/>
2589           </ul>
2590         </xsl:if>
2591       </li>
2592     </xsl:if>
2593   </xsl:template>
2594
2595   <xsl:template match="subscription" mode="addSubscription">
2596     <h3>Add New Subscription</h3>
2597     <p class="note">*the subsciption name must be unique</p>
2598     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
2599       <table class="common" cellspacing="0">
2600         <tr>
2601           <td class="fieldname">Name:</td>
2602           <td>
2603             <xsl:variable name="subName" select="name"/>
2604             <input type="text" value="{$subName}" name="subscription.name" size="60"/>
2605           </td>
2606         </tr>
2607         <xsl:if test="internal='false'">
2608           <tr>
2609             <td class="fieldname">Uri:</td>
2610             <td>
2611               <xsl:variable name="subUri" select="uri"/>
2612               <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
2613             </td>
2614           </tr>
2615         </xsl:if>
2616         <tr>
2617           <td class="fieldname">Display:</td>
2618           <td>
2619             <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
2620             <input type="radio" value="false" name="subscription.display"/> no
2621           </td>
2622         </tr>
2623         <tr>
2624           <td class="fieldname">Style:</td>
2625           <td>
2626             <xsl:variable name="subStyle" select="style"/>
2627             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
2628           </td>
2629         </tr>
2630         <!--<tr>
2631           <td class="fieldname">Unremovable:</td>
2632           <td>
2633             <input type="radio" value="true" name="unremoveable" size="60"/> true
2634             <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
2635           </td>
2636         </tr>-->
2637       </table>
2638       <table border="0" id="submitTable">
2639         <tr>
2640           <td>
2641             <input type="submit" name="addSubscription" value="Add Subscription"/>
2642             <input type="submit" name="cancelled" value="Cancel"/>
2643             <input type="reset" value="Clear"/>
2644           </td>
2645         </tr>
2646       </table>
2647     </form>
2648   </xsl:template>
2649
2650   <xsl:template match="subscription" mode="modSubscription">
2651     <h3>Modify Subscription</h3>
2652     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
2653       <table class="common" cellspacing="0">
2654         <tr>
2655           <td class="fieldname">Name:</td>
2656           <td>
2657             <xsl:value-of select="name"/>
2658             <xsl:variable name="subName" select="name"/>
2659             <input type="hidden" value="{$subName}" name="name"/>
2660           </td>
2661         </tr>
2662         <xsl:choose>
2663           <xsl:when test="internal='false'">
2664             <tr>
2665               <td class="fieldname">Uri:</td>
2666               <td>
2667                 <xsl:variable name="subUri" select="uri"/>
2668                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
2669               </td>
2670             </tr>
2671           </xsl:when>
2672           <xsl:otherwise>
2673             <tr>
2674               <td class="fieldname">Uri:</td>
2675               <td>
2676                 <xsl:value-of select="uri"/>
2677               </td>
2678             </tr>
2679           </xsl:otherwise>
2680         </xsl:choose>
2681         <tr>
2682           <td class="fieldname">Display:</td>
2683           <td>
2684             <xsl:choose>
2685               <xsl:when test="display='true'">
2686                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
2687                 <input type="radio" value="false" name="subscription.display"/> no
2688               </xsl:when>
2689               <xsl:otherwise>
2690                 <input type="radio" value="true" name="subscription.display"/> yes
2691                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
2692               </xsl:otherwise>
2693             </xsl:choose>
2694           </td>
2695         </tr>
2696         <tr>
2697           <td class="fieldname">Style:</td>
2698           <td>
2699             <xsl:variable name="subStyle" select="style"/>
2700             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
2701           </td>
2702         </tr>
2703         <!--<tr>
2704           <td class="fieldname">Unremovable:</td>
2705           <td>
2706             <xsl:choose>
2707               <xsl:when test="unremoveable='true'">
2708                 <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
2709                 <input type="radio" value="false" name="unremoveable" size="60"/> false
2710               </xsl:when>
2711               <xsl:otherwise>
2712                 <input type="radio" value="true" name="unremoveable" size="60"/> true
2713                 <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
2714               </xsl:otherwise>
2715             </xsl:choose>
2716           </td>
2717         </tr>-->
2718       </table>
2719       <table border="0" id="submitTable">
2720         <tr>
2721           <td>
2722             <input type="submit" name="updateSubscription" value="Update Subscription"/>
2723             <input type="submit" name="cancelled" value="Cancel"/>
2724             <input type="reset" value="Reset"/>
2725           </td>
2726           <td align="right">
2727             <input type="submit" name="delete" value="Delete Subscription"/>
2728           </td>
2729         </tr>
2730       </table>
2731     </form>
2732   </xsl:template>
2733
2734   <xsl:template name="subscriptionList">
2735     <h3>Current subscriptions</h3>
2736     <table class="common" cellspacing="0">
2737       <tr>
2738         <th>Name</th>
2739         <th>URI</th>
2740         <th>Style</th>
2741         <th>Display</th>
2742         <!--<th>Unremovable</th>
2743         <th>External</th>
2744         <th>Deleted?</th>-->
2745       </tr>
2746       <xsl:for-each select="subscription">
2747         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
2748         <tr>
2749           <td>
2750             <xsl:variable name="subname" select="name"/>
2751             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
2752               <xsl:value-of select="name"/>
2753             </a>
2754           </td>
2755           <td>
2756             <xsl:value-of select="uri"/>
2757           </td>
2758           <td>
2759             <xsl:value-of select="style"/>
2760           </td>
2761           <td class="center">
2762             <xsl:if test="display='true'">
2763               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2764             </xsl:if>
2765           </td>
2766           <!--<td class="center">
2767             <xsl:if test="unremoveable='true'">
2768               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2769             </xsl:if>
2770           </td>
2771           <td class="center">
2772             <xsl:if test="internal='false'">
2773               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2774             </xsl:if>
2775           </td>
2776           <td class="center">
2777             <xsl:if test="calendarDeleted='true'">
2778               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2779             </xsl:if>
2780           </td>-->
2781         </tr>
2782       </xsl:for-each>
2783     </table>
2784     <!--<h4><a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>-->
2785   </xsl:template>
2786
2787   <xsl:template match="subscription" mode="mySubscriptions">
2788     <xsl:variable name="itemClass">
2789       <xsl:choose>
2790         <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2791                         and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when>
2792         <xsl:otherwise>calendar</xsl:otherwise>
2793       </xsl:choose>
2794     </xsl:variable>
2795     <li class="{$itemClass}">
2796       <xsl:variable name="subUri" select="uri"/>
2797       <a href="{$setSelection}?calUrl={$subUri}">
2798         <xsl:value-of select="name"/>
2799       </a>
2800     </li>
2801   </xsl:template>
2802
2803   <!--==== ALARM OPTIONS ====-->
2804   <xsl:template name="alarmOptions">
2805     <form method="get" action="{$setAlarm}" id="standardForm">
2806       <input type="hidden" name="updateAlarmOptions" value="true"/>
2807       <table class="common" cellspacing="0">
2808         <tr>
2809           <th colspan="2" class="commonHeader">Alarm options</th>
2810         </tr>
2811         <tr>
2812           <td class="fieldname">
2813             Alarm Date/Time:
2814             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDate/*"/>
2815           </td>
2816           <td class="fieldval">
2817             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmdate/*"/>
2818             <span class="std-text">at  </span>
2819             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmtime/*"/>
2820           </td>
2821         </tr>
2822         <tr>
2823           <td class="fieldname">
2824             or Before/After event:
2825             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDuration/*"/>
2826           </td>
2827           <td align="left">
2828             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/days/*"/>
2829             days
2830             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/hours/*"/>
2831             hours
2832             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/minutes/*"/>
2833             minutes
2834             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/seconds/*"/>
2835             seconds OR:
2836             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/weeks/*"/>
2837             weeks
2838             &#160;
2839             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationBefore/*"/>
2840             before
2841             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationAfter/*"/>
2842             after
2843             &#160;
2844             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelStart/*"/>
2845             start
2846             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelEnd/*"/>
2847             end
2848           </td>
2849         </tr>
2850         <tr>
2851           <td>
2852             Email Address:
2853           </td>
2854           <td align="left">
2855             <xsl:copy-of select="/bedework/alarmoptionsform/form/email/*"/>
2856           </td>
2857         </tr>
2858         <tr>
2859           <td>
2860             Subject:
2861           </td>
2862           <td align="left">
2863             <xsl:copy-of select="/bedework/alarmoptionsform/form/subject/*"/>
2864           </td>
2865         </tr>
2866         <tr>
2867           <td>&#160;</td>
2868           <td>
2869             <input name="submit" type="submit" value="Continue"/>&#160;
2870             <input name="cancelled" type="submit" value="Cancel"/>
2871           </td>
2872         </tr>
2873       </table>
2874     </form>
2875   </xsl:template>
2876
2877   <!--==== UPLOAD ====-->
2878   <xsl:template name="upload">
2879     <form method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
2880       <h2>Upload iCAL File</h2>
2881       <table class="common" cellspacing="0">
2882         <tr>
2883           <td class="fieldname">
2884             Filename:
2885           </td>
2886           <td align="left">
2887             <input type="file" name="uploadFile" size="80" />
2888           </td>
2889         </tr>
2890         <tr>
2891           <td>&#160;</td>
2892           <td>
2893             <input name="submit" type="submit" value="Continue"/>&#160;
2894             <input name="cancelled" type="submit" value="Cancel"/>
2895           </td>
2896         </tr>
2897       </table>
2898     </form>
2899   </xsl:template>
2900
2901   <!--==== EMAIL OPTIONS ====-->
2902   <xsl:template name="emailOptions">
2903     <form method="get" action="{$mailEvent}" id="standardForm">
2904       <input type="hidden" name="updateEmailOptions" value="true"/>
2905       <table class="common" cellspacing="0">
2906         <tr>
2907           <th colspan="2" class="commonHeader">Update email options</th>
2908         </tr>
2909         <tr>
2910           <td>
2911
2912             Email Address:
2913           </td>
2914           <td align="left">
2915             <xsl:copy-of select="/bedework/emailoptionsform/form/email/*"/>
2916           </td>
2917         </tr>
2918         <tr>
2919           <td>
2920             Subject:
2921           </td>
2922           <td align="left">
2923             <xsl:copy-of select="/bedework/emailoptionsform/form/subject/*"/>
2924           </td>
2925         </tr>
2926         <tr>
2927           <td>&#160;</td>
2928           <td>
2929             <input name="submit" type="submit" value="Continue"/>&#160;
2930             <input name="cancelled" type="submit" value="Cancel"/>
2931           </td>
2932         </tr>
2933       </table>
2934     </form>
2935   </xsl:template>
2936
2937   <!--==== MANAGE LOCATIONS ====-->
2938   <xsl:template name="manageLocations">
2939     <form name="addLocationForm" method="post" action="{$addLocation}" id="standardForm">
2940       <input type="hidden" name="confirmationid" value="{$confId}"/>
2941       <h2>Manage Locations</h2>
2942       <table class="common" cellspacing="0">
2943         <tr>
2944           <th class="commonHeader" colspan="2">Add Location</th>
2945         </tr>
2946         <tr>
2947           <td class="fieldname">
2948             Main Address:
2949           </td>
2950           <td>
2951             <input size="60" name="newLocation.address" type="text"/>
2952           </td>
2953         </tr>
2954         <tr>
2955           <td class="fieldname">
2956             Subaddress:
2957           </td>
2958           <td>
2959             <input size="60" name="newLocation.subaddress" type="text"/>
2960           </td>
2961         </tr>
2962         <tr>
2963           <td class="fieldname">
2964             Location Link:
2965           </td>
2966           <td>
2967             <input size="60" name="newLocation.link" type="text"/>
2968           </td>
2969         </tr>
2970         <tr>
2971           <td></td>
2972           <td class="padMe">
2973             <input name="submit" type="submit" value="Submit Location"/>&#160;
2974             <input name="cancelled" type="submit" value="Cancel"/>
2975           </td>
2976         </tr>
2977         <tr>
2978           <th class="commonHeader" colspan="2">Edit/Delete Locations</th>
2979         </tr>
2980         <td colspan="2" class="plain">
2981           <ul>
2982             <xsl:for-each select="/bedework/formElements/form/location/locationmenu/select/option[@value>'3']">
2983               <xsl:sort select="."/>
2984               <li>
2985                 <xsl:variable name="locationId" select="@value"/>
2986                 <a href="{$editLocation}?locationId={$locationId}"><xsl:value-of select="."/></a>
2987               </li>
2988             </xsl:for-each>
2989           </ul>
2990         </td>
2991       </table>
2992     </form>
2993   </xsl:template>
2994
2995   <!--==== EDIT LOCATION ====-->
2996   <xsl:template match="formElements" mode="editLocation">
2997     <form name="editLocationForm" method="post" action="{$editLocation}" id="standardForm">
2998       <input type="hidden" name="updateLocation" value="true"/>
2999       <input type="hidden" name="confirmationid" value="{$confId}"/>
3000       <h2>Manage Locations</h2>
3001       <table class="common" cellspacing="0">
3002         <tr>
3003           <th colspan="2" class="commonHeader">
3004             <xsl:variable name="locId" select="form/id"/>
3005             <div id="eventActions">
3006               <a href="{$delLocation}?locationId={$locId}">Delete Location</a>
3007             </div>
3008             Edit Location
3009           </th>
3010         </tr>
3011         <tr>
3012           <td class="fieldname">
3013             Address:
3014           </td>
3015           <td align="left">
3016             <xsl:copy-of select="form/address/*"/>
3017           </td>
3018         </tr>
3019         <tr>
3020           <td class="fieldname">
3021             Subaddress:
3022           </td>
3023           <td align="left">
3024             <xsl:copy-of select="form/subaddress/*"/>
3025           </td>
3026         </tr>
3027         <tr>
3028           <td class="fieldname">
3029             Location's URL:
3030           </td>
3031           <td>
3032             <xsl:copy-of select="form/link/*"/>
3033           </td>
3034         </tr>
3035         <tr>
3036           <td>&#160;</td>
3037           <td class="padMe">
3038             <input name="submit" type="submit" value="Submit Location"/>&#160;
3039             <input name="cancelled" type="submit" value="Cancel"/>
3040           </td>
3041         </tr>
3042       </table>
3043     </form>
3044   </xsl:template>
3045
3046   <!--==== SIDE CALENDAR MENU ====-->
3047   <xsl:template match="calendar" mode="sideList">
3048     <xsl:variable name="id" select="id"/>
3049     <div class="std-text">
3050       <a href="{$setSelection}?calId={$id}"><xsl:value-of select="title"/></a>
3051     </div>
3052   </xsl:template>
3053
3054   <!--==== STAND-ALONE PAGES ====-->
3055   <!-- not currently in use -->
3056   <xsl:template name="selectPage">
3057     <!-- <xsl:choose>
3058       <xsl:when test="/bedework/appvar[key='page']">
3059         <xsl:choose>
3060           <xsl:otherwise>
3061             <xsl:call-template name="noPage"/>
3062           </xsl:otherwise>
3063         </xsl:choose>
3064       </xsl:when>
3065       <xsl:otherwise> -->
3066         <xsl:call-template name="noPage"/>
3067       <!--</xsl:otherwise>
3068     </xsl:choose>-->
3069   </xsl:template>
3070
3071   <xsl:template name="noPage">
3072     <p>
3073       Error: there is no page with that name.  Please select a navigational
3074       link to continue.
3075     </p>
3076   </xsl:template>
3077
3078   <!--==== UTILITY TEMPLATES ====-->
3079
3080   <!-- search and replace template taken from
3081        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
3082   <xsl:template name="replace">
3083     <xsl:param name="string" select="''"/>
3084     <xsl:param name="pattern" select="''"/>
3085     <xsl:param name="replacement" select="''"/>
3086     <xsl:choose>
3087       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
3088         <xsl:value-of select="substring-before($string, $pattern)"/>
3089         <xsl:copy-of select="$replacement"/>
3090         <xsl:call-template name="replace">
3091           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
3092           <xsl:with-param name="pattern" select="$pattern"/>
3093           <xsl:with-param name="replacement" select="$replacement"/>
3094         </xsl:call-template>
3095       </xsl:when>
3096       <xsl:otherwise>
3097         <xsl:value-of select="$string"/>
3098       </xsl:otherwise>
3099     </xsl:choose>
3100   </xsl:template>
3101
3102   <!--==== FOOTER ====-->
3103   <xsl:template name="footer">
3104     <div id="footer">
3105       Demonstration calendar; place footer information here.
3106     </div>
3107     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
3108       <tr>
3109         <td class="leftCell">
3110           <a href="http://www.bedework.org/">Bedework Calendar</a> |
3111           <a href="?noxslt=yes">show XML</a> |
3112           <a href="?refreshXslt=yes">refresh XSLT</a>
3113         </td>
3114         <td class="rightCell">
3115           <!--<form name="skinSelectForm" method="get" action="{$setup}">
3116             skin selector:
3117             <select name="skinNameSticky" onChange="submit()">
3118               <option>select a skin</option>
3119               <option value="default">Demo Calendar</option>
3120               <option value="rensselaer">Rensselaer</option>
3121               <option value="washington">Washington</option>
3122             </select>
3123           </form>-->
3124         </td>
3125       </tr>
3126     </table>
3127   </xsl:template>
3128 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.