root/trunk/deployment/webuser/portlet/resources/demoskins/default/default/default.xsl

Revision 1170 (checked in by douglm, 6 years ago)

Little functional change here.

Created definitions for all error codes generated by the web code.
Created new errors.xsl common to all web apps
Copy dojo code into new common web directory for inclusion by web apps.
Copy new errors.xsl into same directory.

Delete all old errors.xsl

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   <!--       PERSONAL CALENDAR STYLESHEET        -->
13   <!-- ========================================= -->
14
15   <!-- **********************************************************************
16     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
17
18     Redistribution and use of this distribution in source and binary forms,
19     with or without modification, are permitted provided that:
20        The above copyright notice and this permission notice appear in all
21         copies and supporting documentation;
22
23         The name, identifiers, and trademarks of Rensselaer Polytechnic
24         Institute are not used in advertising or publicity without the
25         express prior written permission of Rensselaer Polytechnic Institute;
26
27     DISCLAIMER: The software is distributed" AS IS" without any express or
28     implied warranty, including but not limited to, any implied warranties
29     of merchantability or fitness for a particular purpose or any warrant)'
30     of non-infringement of any current or pending patent rights. The authors
31     of the software make no representations about the suitability of this
32     software for any particular purpose. The entire risk as to the quality
33     and performance of the software is with the user. Should the software
34     prove defective, the user assumes the cost of all necessary servicing,
35     repair or correction. In particular, neither Rensselaer Polytechnic
36     Institute, nor the authors of the software are liable for any indirect,
37     special, consequential, or incidental damages related to the software,
38     to the maximum extent the law permits. -->
39
40   <!-- DEFINE INCLUDES -->
41   <xsl:include href="/bedework-common/default/default/errors.xsl"/>
42   <xsl:include href="messages.xsl"/>
43
44   <!-- DEFINE GLOBAL CONSTANTS -->
45   <!-- URL of html resources (images, css, other html); by default this is
46        set to the application root, but for the personal calendar
47        this should be changed to point to a
48        web server over https to avoid mixed content errors, e.g.,
49   <xsl:variable name="resourcesRoot">https://mywebserver.edu/myresourcesdir</xsl:variable>
50     -->
51   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
52
53   <!-- URL of the XSL template directory -->
54   <!-- The approot is an appropriate place to put
55        included stylesheets and xml fragments. These are generally
56        referenced relatively (like errors.xsl and messages.xsl above);
57        this variable is here for your convenience if you choose to
58        reference it explicitly.  It is not used in this stylesheet, however,
59        and can be safely removed if you so choose. -->
60   <xsl:variable name="appRoot" select="/bedework/approot"/>
61
62   <!-- Properly encoded prefixes to the application actions; use these to build
63        urls; allows the application to be used without cookies or within a portal.
64        These urls are rewritten in header.jsp and simply passed through for use
65        here. Every url includes a query string (either ?b=de or a real query
66        string) so that all links constructed in this stylesheet may begin the
67        query string with an ampersand. -->
68   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
69   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/setSelection"/>
70   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/setViewPeriod"/>
71   <xsl:variable name="eventView" select="/bedework/urlPrefixes/eventView"/>
72   <xsl:variable name="initEvent" select="/bedework/urlPrefixes/initEvent"/>
73   <xsl:variable name="addEvent" select="/bedework/urlPrefixes/addEvent"/>
74   <xsl:variable name="addEventUsingPage" select="/bedework/urlPrefixes/addEventUsingPage"/>
75   <xsl:variable name="event-addEventRefComplete" select="/bedework/urlPrefixes/event/addEventRefComplete/a/@href"/>
76   <xsl:variable name="event-setAccess" select="/bedework/urlPrefixes/event/setAccess/a/@href"/>
77   <xsl:variable name="event-selectCalForEvent" select="/bedework/urlPrefixes/event/selectCalForEvent/a/@href"/>
78   <xsl:variable name="editEvent" select="/bedework/urlPrefixes/editEvent"/>
79   <xsl:variable name="delEvent" select="/bedework/urlPrefixes/delEvent"/>
80   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
81   <xsl:variable name="export" select="/bedework/urlPrefixes/export/a/@href"/>
82   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
83   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
84   <xsl:variable name="manageLocations" select="/bedework/urlPrefixes/manageLocations"/>
85   <xsl:variable name="addLocation" select="/bedework/urlPrefixes/addLocation"/>
86   <xsl:variable name="editLocation" select="/bedework/urlPrefixes/editLocation"/>
87   <xsl:variable name="delLocation" select="/bedework/urlPrefixes/delLocation"/>
88   <xsl:variable name="initEventAlarm" select="/bedework/urlPrefixes/initEventAlarm"/>
89   <xsl:variable name="setAlarm" select="/bedework/urlPrefixes/setAlarm"/>
90   <xsl:variable name="initUpload" select="/bedework/urlPrefixes/initUpload"/>
91   <xsl:variable name="upload" select="/bedework/urlPrefixes/upload"/>
92   <xsl:variable name="freeBusy-fetch" select="/bedework/urlPrefixes/freeBusy/fetch/a/@href"/>
93   <xsl:variable name="freeBusy-setAccess" select="/bedework/urlPrefixes/freeBusy/setAccess/a/@href"/>
94   <!-- calendars -->
95   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
96   <xsl:variable name="calendar-fetch" select="/bedework/urlPrefixes/calendar/fetch/a/@href"/><!-- used -->
97   <xsl:variable name="calendar-fetchDescriptions" select="/bedework/urlPrefixes/calendar/fetchDescriptions/a/@href"/><!-- used -->
98   <xsl:variable name="calendar-initAdd" select="/bedework/urlPrefixes/calendar/initAdd/a/@href"/><!-- used -->
99   <xsl:variable name="calendar-delete" select="/bedework/urlPrefixes/calendar/delete/a/@href"/>
100   <xsl:variable name="calendar-fetchForDisplay" select="/bedework/urlPrefixes/calendar/fetchForDisplay/a/@href"/>
101   <xsl:variable name="calendar-fetchForUpdate" select="/bedework/urlPrefixes/calendar/fetchForUpdate/a/@href"/><!-- used -->
102   <xsl:variable name="calendar-update" select="/bedework/urlPrefixes/calendar/update/a/@href"/><!-- used -->
103   <xsl:variable name="calendar-setAccess" select="/bedework/urlPrefixes/calendar/setAccess/a/@href"/>
104   <!-- subscriptions -->
105   <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/>
106   <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/>
107   <xsl:variable name="subscriptions-addSubByUri" select="/bedework/urlPrefixes/subscriptions/addSubByUri/a/@href"/>
108   <xsl:variable name="subscriptions-subscribeByUri" select="/bedework/urlPrefixes/subscriptions/subscribeByUri/a/@href"/>
109   <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/>
110   <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/>
111   <!-- preferences -->
112   <xsl:variable name="prefs-fetchForUpdate" select="/bedework/urlPrefixes/prefs/fetchForUpdate/a/@href"/>
113   <xsl:variable name="prefs-update" select="/bedework/urlPrefixes/prefs/update/a/@href"/>
114
115   <!-- URL of the web application - includes web context
116   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/> -->
117
118   <!-- Other generally useful global variables -->
119   <xsl:variable name="confId" select="/bedework/confirmationid"/>
120   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
121   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
122   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
123   <xsl:variable name="skin">default</xsl:variable>
124   <xsl:variable name="publicCal">/cal</xsl:variable>
125
126  <!-- BEGIN MAIN TEMPLATE -->
127   <xsl:template match="/">
128     <html lang="en">
129       <head>
130         <xsl:call-template name="headSection"/>
131       </head>
132       <body>
133       <xsl:choose>
134         <xsl:when test="/bedework/page='selectCalForEvent'">
135           <xsl:call-template name="selectCalForEvent"/>
136         </xsl:when>
137         <xsl:otherwise>
138             <xsl:call-template name="headBar"/>
139             <xsl:if test="/bedework/message">
140               <div id="messages">
141                 <xsl:apply-templates select="/bedework/message"/>
142               </div>
143             </xsl:if>
144             <xsl:if test="/bedework/error">
145               <div id="errors">
146                 <xsl:apply-templates select="/bedework/error"/>
147               </div>
148             </xsl:if>
149             <table id="bodyBlock" cellspacing="0">
150               <tr>
151                 <xsl:choose>
152                   <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
153                     <td id="sideBarClosed">
154                       <img src="{$resourcesRoot}/resources/spacer.gif" width="1" height="1" border="0" alt="*"/>
155                     </td>
156                   </xsl:when>
157                   <xsl:otherwise>
158                     <td id="sideBar">
159                       <xsl:call-template name="sideBar"/>
160                     </td>
161                   </xsl:otherwise>
162                 </xsl:choose>
163                 <td id="bodyContent">
164                   <xsl:call-template name="tabs"/>
165                   <xsl:call-template name="navigation"/>
166                   <xsl:choose>
167                     <xsl:when test="/bedework/page='event'">
168                       <!-- show an event -->
169                       <xsl:apply-templates select="/bedework/event"/>
170                     </xsl:when>
171                     <xsl:when test="/bedework/page='addEvent'">
172                       <xsl:call-template name="addEvent"/>
173                     </xsl:when>
174                     <xsl:when test="/bedework/page='addEventRef'">
175                       <xsl:apply-templates select="/bedework/event" mode="addEventRef"/>
176                     </xsl:when>
177                     <xsl:when test="/bedework/page='editEvent'">
178                       <!-- edit an event -->
179                       <xsl:apply-templates select="/bedework/formElements" mode="editEvent"/>
180                     </xsl:when>
181                     <xsl:when test="/bedework/page='alarmOptions'">
182                       <xsl:call-template name="alarmOptions" />
183                     </xsl:when>
184                     <xsl:when test="/bedework/page='upload'">
185                       <xsl:call-template name="upload" />
186                     </xsl:when>
187                     <xsl:when test="/bedework/page='manageLocations'">
188                       <xsl:call-template name="manageLocations" />
189                     </xsl:when>
190                     <xsl:when test="/bedework/page='editLocation'">
191                       <xsl:apply-templates select="/bedework/formElements" mode="editLocation"/>
192                     </xsl:when>
193                     <xsl:when test="/bedework/page='subscriptions' or
194                                     /bedework/page='modSubscription' or
195                                     /bedework/page='addSubByUri'">
196                       <xsl:apply-templates select="/bedework/subscriptions"/>
197                     </xsl:when>
198                     <xsl:when test="/bedework/page='calendarList' or
199                                     /bedework/page='calendarDescriptions' or
200                                     /bedework/page='displayCalendar' or
201                                     /bedework/page='modCalendar' or
202                                     /bedework/page='deleteCalendarConfirm' or
203                                     /bedework/page='calendarReferenced'">
204                       <xsl:apply-templates select="/bedework/calendars"/>
205                     </xsl:when>
206                     <xsl:when test="/bedework/page='freeBusy'">
207                       <xsl:call-template name="utilBar"/>
208                       <xsl:apply-templates select="/bedework/freebusy"/>
209                     </xsl:when>
210                     <xsl:when test="/bedework/page='modPrefs'">
211                       <xsl:apply-templates select="/bedework/prefs"/>
212                     </xsl:when>
213                     <xsl:when test="/bedework/page='other'">
214                       <!-- show an arbitrary page -->
215                       <xsl:call-template name="selectPage"/>
216                     </xsl:when>
217                     <xsl:otherwise>
218                       <!-- otherwise, show the eventsCalendar -->
219                       <xsl:call-template name="utilBar"/>
220                       <!-- main eventCalendar content -->
221                       <xsl:choose>
222                         <xsl:when test="/bedework/periodname='Day'">
223                           <xsl:call-template name="listView"/>
224                         </xsl:when>
225                         <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
226                           <xsl:choose>
227                             <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
228                               <xsl:call-template name="listView"/>
229                             </xsl:when>
230                             <xsl:otherwise>
231                               <xsl:call-template name="weekView"/>
232                             </xsl:otherwise>
233                           </xsl:choose>
234                         </xsl:when>
235                         <xsl:when test="/bedework/periodname='Month'">
236                           <xsl:choose>
237                             <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
238                               <xsl:call-template name="listView"/>
239                             </xsl:when>
240                             <xsl:otherwise>
241                               <xsl:call-template name="monthView"/>
242                             </xsl:otherwise>
243                           </xsl:choose>
244                         </xsl:when>
245                         <xsl:otherwise>
246                           <xsl:call-template name="yearView"/>
247                         </xsl:otherwise>
248                       </xsl:choose>
249                     </xsl:otherwise>
250                   </xsl:choose>
251                 </td>
252               </tr>
253             </table>
254             <!-- footer -->
255             <xsl:call-template name="footer"/>
256           </xsl:otherwise>
257         </xsl:choose>
258       </body>
259     </html>
260   </xsl:template>
261
262   <!--==== HEAD SECTION  ====-->
263
264   <xsl:template name="headSection">
265     <title>Bedework: Personal Calendar Client</title>
266     <meta name="robots" content="noindex,nofollow"/>
267     <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
268     <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/>
269     <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
270     <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
271     <xsl:if test="/bedework/page='addEvent' or
272                   /bedework/page='addEventRef' or
273                   /bedework/page='editEvent' or
274                   /bedework/page='selectCalForEvent' or
275                   /bedework/page='upload' or
276                   /bedework/page='addSubByUri' or
277                   /bedework/page='modPrefs'">
278       <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
279     </xsl:if>
280     <xsl:if test="/bedework/page='addEvent' or
281                   /bedework/page='editEvent'">
282       <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js"></script>
283       <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
284       <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
285       <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
286       <script type="text/javascript" src="{$resourcesRoot}/resources/browserSniffer.js"></script>
287     </xsl:if>
288   </xsl:template>
289
290   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
291
292   <xsl:template name="headBar">
293     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
294       <tr>
295         <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>
296         <td colspan="2" id="schoolLinksCell">
297           <h2>Personal Calendar</h2>
298           <a href="{$publicCal}">Public Calendar</a> |
299           <a href="http://www.yourschoolhere.edu">School Home</a> |
300           <a href="http://www.bedework.org/">Other Link</a> |
301           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
302             Example Calendar Help
303           </a>
304         </td>
305       </tr>
306     </table>
307     <table id="curDateRangeTable"  cellspacing="0">
308       <tr>
309         <td class="sideBarOpenCloseIcon">
310           <xsl:choose>
311             <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
312               <a href="?setappvar=sidebar(opened)">
313                 <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
314               </a>
315             </xsl:when>
316             <xsl:otherwise>
317               <a href="?setappvar=sidebar(closed)">
318                 <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
319               </a>
320             </xsl:otherwise>
321           </xsl:choose>
322         </td>
323         <td class="date">
324           <xsl:value-of select="/bedework/firstday/longdate"/>
325           <xsl:if test="/bedework/periodname!='Day'">
326             -
327             <xsl:value-of select="/bedework/lastday/longdate"/>
328           </xsl:if>
329         </td>
330         <td class="rssPrint">
331           <a href="javascript:window.print()" title="print this view">
332             <img alt="print this view" src="{$resourcesRoot}/resources/std-print-icon.gif" width="20" height="14" border="0"/> print
333           </a>
334           <a class="rss" href="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
335         </td>
336       </tr>
337     </table>
338   </xsl:template>
339
340   <xsl:template name="sideBar">
341     <h3>
342       <!--<img alt="manage views" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/>-->
343       views
344     </h3>
345     <ul id="myViews">
346       <xsl:choose>
347         <xsl:when test="/bedework/views/view">
348           <xsl:for-each select="/bedework/views/view">
349             <xsl:variable name="viewName" select="name"/>
350             <xsl:choose>
351               <xsl:when test="/bedework/selectionState/selectionType = 'view'
352                               and name=/bedework/selectionState/view/name">
353                 <li class="selected"><a href="{$setSelection}&amp;viewName={$viewName}"><xsl:value-of select="name"/></a></li>
354               </xsl:when>
355               <xsl:otherwise>
356                 <li><a href="{$setSelection}&amp;viewName={$viewName}"><xsl:value-of select="name"/></a></li>
357               </xsl:otherwise>
358             </xsl:choose>
359           </xsl:for-each>
360         </xsl:when>
361         <xsl:otherwise>
362           <li class="none">no views</li>
363         </xsl:otherwise>
364       </xsl:choose>
365     </ul>
366
367     <h3>
368       <a href="{$calendar-fetch}">
369         <img alt="manage calendars" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/> calendars
370       </a>
371     </h3>
372     <ul class="calendarTree">
373       <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="myCalendars"/>
374     </ul>
375
376     <h3>
377       <a href="{$subscriptions-fetch}" title="manage subscriptions">
378         <img alt="manage subscriptions" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/>
379         subscriptions
380       </a>
381     </h3>
382     <ul class="calendarTree">
383       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
384       <xsl:choose>
385         <xsl:when test="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]">
386           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]" mode="mySubscriptions"/>
387         </xsl:when>
388         <xsl:otherwise>
389           <li class="none">no subscriptions</li>
390         </xsl:otherwise>
391       </xsl:choose>
392     </ul>
393
394     <h3>options</h3>
395     <ul id="sideBarMenu">
396       <li><a href="{$manageLocations}">Manage Locations</a></li>
397       <li><a href="{$prefs-fetchForUpdate}">Preferences</a></li>
398     </ul>
399   </xsl:template>
400
401   <xsl:template name="tabs">
402     <xsl:choose>
403       <xsl:when test="/bedework/page='eventscalendar' or /bedework/page='freeBusy'">
404         <xsl:variable name="navAction">
405           <xsl:choose>
406             <xsl:when test="/bedework/page='freeBusy'"><xsl:value-of select="$freeBusy-fetch"/></xsl:when>
407             <xsl:otherwise><xsl:value-of select="$setViewPeriod"/></xsl:otherwise>
408           </xsl:choose>
409         </xsl:variable>
410         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
411           <tr>
412             <td>
413               <xsl:choose>
414                 <xsl:when test="/bedework/periodname='Day'">
415                   <a href="{$navAction}&amp;viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-on.gif" width="91" height="20" border="0" alt="DAY"/></a>
416                 </xsl:when>
417                 <xsl:otherwise>
418                   <a href="{$navAction}&amp;viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
419                 </xsl:otherwise>
420               </xsl:choose>
421             </td>
422             <td>
423               <xsl:choose>
424                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
425                   <a href="{$navAction}&amp;viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-on.gif" width="92" height="20" border="0" alt="WEEK"/></a>
426                  </xsl:when>
427                 <xsl:otherwise>
428                   <a href="{$navAction}&amp;viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
429                  </xsl:otherwise>
430               </xsl:choose>
431             </td>
432             <td>
433               <xsl:choose>
434                 <xsl:when test="/bedework/periodname='Month'">
435                   <a href="{$navAction}&amp;viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-on.gif" width="90" height="20" border="0" alt="MONTH"/></a>
436                 </xsl:when>
437                 <xsl:otherwise>
438                   <a href="{$navAction}&amp;viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
439                 </xsl:otherwise>
440               </xsl:choose>
441             </td>
442             <td>
443               <xsl:choose>
444                 <!-- don't allow switching to year for free busy view, so only use setViewPeriod action -->
445                 <xsl:when test="/bedework/periodname='Year'">
446                   <a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-on.gif" width="92" height="20" border="0" alt="YEAR"/></a>
447                 </xsl:when>
448                 <xsl:otherwise>
449                   <a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
450                 </xsl:otherwise>
451               </xsl:choose>
452             </td>
453             <td class="rightCell">
454               logged in as
455               <xsl:text> </xsl:text>
456               <strong><xsl:value-of select="/bedework/userid"/></strong>
457               <xsl:text> </xsl:text>
458               <span class="logout"><a href="{$setup}&amp;logout=true">logout</a></span>
459             </td>
460           </tr>
461         </table>
462       </xsl:when>
463       <xsl:otherwise>
464         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
465           <tr>
466             <td>
467               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
468             </td>
469             <td>
470               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
471             </td>
472             <td>
473               <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
474             </td>
475             <td>
476               <a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
477             </td>
478             <td class="rightCell">
479               logged in as
480               <xsl:text> </xsl:text>
481               <strong><xsl:value-of select="/bedework/userid"/></strong>
482               <xsl:text> </xsl:text>
483               <span class="logout"><a href="{$setup}&amp;logout=true">logout</a></span>
484             </td>
485           </tr>
486         </table>
487       </xsl:otherwise>
488     </xsl:choose>
489   </xsl:template>
490
491   <xsl:template name="navigation">
492     <xsl:variable name="navAction">
493       <xsl:choose>
494         <xsl:when test="/bedework/page='freeBusy'"><xsl:value-of select="$freeBusy-fetch"/></xsl:when>
495         <xsl:otherwise><xsl:value-of select="$setViewPeriod"/></xsl:otherwise>
496       </xsl:choose>
497     </xsl:variable>
498     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
499       <tr>
500         <td class="leftCell">
501           <a href="{$navAction}&amp;date={$prevdate}"><img src="{$resourcesRoot}/resources/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
502           <a href="{$navAction}&amp;date={$nextdate}"><img src="{$resourcesRoot}/resources/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
503           <xsl:choose>
504             <xsl:when test="/bedework/periodname='Year'">
505               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
506             </xsl:when>
507             <xsl:when test="/bedework/periodname='Month'">
508               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
509             </xsl:when>
510             <xsl:when test="/bedework/periodname='Week'">
511               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
512             </xsl:when>
513             <xsl:otherwise>
514               <xsl:value-of select="/bedework/firstday/longdate"/>
515             </xsl:otherwise>
516           </xsl:choose>
517         </td>
518         <td class="todayButton">
519           <a href="{$navAction}&amp;viewType=todayView&amp;date={$curdate}">
520             <img src="{$resourcesRoot}/resources/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
521           </a>
522         </td>
523         <td align="right" class="gotoForm">
524           <form name="calForm" method="post" action="{$navAction}">
525              <table border="0" cellpadding="0" cellspacing="0">
526               <tr>
527                 <xsl:if test="/bedework/periodname!='Year'">
528                   <td>
529                     <select name="viewStartDate.month">
530                       <xsl:for-each select="/bedework/monthvalues/val">
531                         <xsl:variable name="temp" select="."/>
532                         <xsl:variable name="pos" select="position()"/>
533                         <xsl:choose>
534                           <xsl:when test="/bedework/monthvalues[start=$temp]">
535                             <option value="{$temp}" selected="selected">
536                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
537                             </option>
538                           </xsl:when>
539                           <xsl:otherwise>
540                             <option value="{$temp}">
541                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
542                             </option>
543                           </xsl:otherwise>
544                         </xsl:choose>
545                       </xsl:for-each>
546                     </select>
547                   </td>
548                   <xsl:if test="/bedework/periodname!='Month'">
549                     <td>
550                       <select name="viewStartDate.day">
551                         <xsl:for-each select="/bedework/dayvalues/val">
552                           <xsl:variable name="temp" select="."/>
553                           <xsl:variable name="pos" select="position()"/>
554                           <xsl:choose>
555                             <xsl:when test="/bedework/dayvalues[start=$temp]">
556                               <option value="{$temp}" selected="selected">
557                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
558                               </option>
559                             </xsl:when>
560                             <xsl:otherwise>
561                               <option value="{$temp}">
562                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
563                               </option>
564                             </xsl:otherwise>
565                           </xsl:choose>
566                         </xsl:for-each>
567                       </select>
568                     </td>
569                   </xsl:if>
570                 </xsl:if>
571                 <td>
572                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
573                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
574                 </td>
575                 <td>
576                   <input name="submit" type="submit" value="go"/>
577                 </td>
578               </tr>
579             </table>
580           </form>
581         </td>
582       </tr>
583     </table>
584   </xsl:template>
585
586   <xsl:template name="utilBar">
587     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="utilBarTable">
588        <tr>
589          <td class="leftCell">
590            <xsl:choose>
591              <xsl:when test="/bedework/periodname = 'day'">
592                <xsl:variable name="date" select="/bedework/firstday/date"/>
593                <a href="{$initEvent}&amp;startdate={$date}" title="add event">
594                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
595                   add event
596                </a>
597              </xsl:when>
598              <xsl:otherwise>
599                <a href="{$initEvent}" title="add event">
600                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
601                   add event
602                </a>
603              </xsl:otherwise>
604            </xsl:choose>
605            <a href="{$initUpload}" title="upload event">
606               <img src="{$resourcesRoot}/resources/std-icalUpload-icon-small.gif" width="12" height="16" border="0" alt="upload event"/>
607               upload
608            </a>
609          </td>
610          <td class="rightCell">
611
612            <!-- show free / busy -->
613            <xsl:choose>
614              <xsl:when test="/bedework/periodname!='Year'">
615                <xsl:choose>
616                  <xsl:when test="/bedework/page='freeBusy'">
617                    <a href="{$setViewPeriod}&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-button-events.gif" width="70" height="21" border="0" alt="show events"/></a>
618                  </xsl:when>
619                  <xsl:otherwise>
620                    <a href="{$freeBusy-fetch}&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-button-freebusy.gif" width="70" height="21" border="0" alt="show free/busy"/></a>
621                  </xsl:otherwise>
622                </xsl:choose>
623              </xsl:when>
624              <xsl:otherwise>
625                <img src="{$resourcesRoot}/resources/std-button-freebusy-off.gif" width="70" height="21" border="0" alt="show free/busy"/>
626              </xsl:otherwise>
627            </xsl:choose>
628
629            <!-- toggle list / calendar view -->
630            <xsl:choose>
631              <xsl:when test="/bedework/periodname='Day'">
632                <img src="{$resourcesRoot}/resources/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
633              </xsl:when>
634              <xsl:when test="/bedework/periodname='Year'">
635                <img src="{$resourcesRoot}/resources/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
636              </xsl:when>
637              <xsl:when test="/bedework/periodname='Month'">
638                <xsl:choose>
639                  <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
640                    <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="toggle list/calendar view">
641                      <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
642                    </a>
643                  </xsl:when>
644                  <xsl:otherwise>
645                    <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="toggle list/calendar view">
646                      <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
647                    </a>
648                  </xsl:otherwise>
649                </xsl:choose>
650              </xsl:when>
651              <xsl:otherwise>
652                <xsl:choose>
653                  <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
654                    <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="toggle list/calendar view">
655                      <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
656                    </a>
657                  </xsl:when>
658                  <xsl:otherwise>
659                    <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="toggle list/calendar view">
660                      <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
661                    </a>
662                  </xsl:otherwise>
663                </xsl:choose>
664              </xsl:otherwise>
665            </xsl:choose>
666
667            <!-- summary / detailed mode toggle -->
668            <xsl:choose>
669              <xsl:when test="/bedework/periodname='Year' or
670                               (/bedework/periodname='Month' and
671                               (/bedework/appvar[key='monthViewMode']/value='cal' or
672                                not(/bedework/appvar[key='monthViewMode']))) or
673                               (/bedework/periodname='Week' and
674                               (/bedework/appvar[key='weekViewMode']/value='cal' or
675                                not(/bedework/appvar[key='weekViewMode'])))">
676                <xsl:choose>
677                  <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
678                    <img src="{$resourcesRoot}/resources/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
679                  </xsl:when>
680                  <xsl:otherwise>
681                    <img src="{$resourcesRoot}/resources/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
682                  </xsl:otherwise>
683                </xsl:choose>
684              </xsl:when>
685              <xsl:otherwise>
686                <xsl:choose>
687                  <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
688                    <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="toggle summary/detailed view">
689                      <img src="{$resourcesRoot}/resources/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
690                    </a>
691                  </xsl:when>
692                  <xsl:otherwise>
693                    <a href="{$setup}&amp;setappvar=summaryMode(details)" title="toggle summary/detailed view">
694                      <img src="{$resourcesRoot}/resources/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
695                    </a>
696                  </xsl:otherwise>
697                </xsl:choose>
698              </xsl:otherwise>
699            </xsl:choose>
700
701            <!-- refresh button -->
702            <a href="{$setup}"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
703          </td>
704        </tr>
705     </table>
706   </xsl:template>
707
708   <!--==== LIST VIEW  (for day, week, and month) ====-->
709   <xsl:template name="listView">
710     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
711       <xsl:choose>
712         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
713           <tr>
714             <td class="noEventsCell">
715               No events to display.
716             </td>
717           </tr>
718         </xsl:when>
719         <xsl:otherwise>
720           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
721             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
722               <tr>
723                 <td colspan="6" class="dateRow">
724                    <xsl:variable name="date" select="date"/>
725                    <a href="{$initEvent}&amp;startdate={$date}" class="listAdd">
726                      add event
727                    </a>
728                    <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
729                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
730                    </a>
731                  </td>
732               </tr>
733             </xsl:if>
734             <xsl:for-each select="event">
735               <xsl:variable name="id" select="id"/>
736               <xsl:variable name="subscriptionId" select="subscription/id"/>
737               <xsl:variable name="calPath" select="calendar/encodedPath"/>
738               <xsl:variable name="guid" select="guid"/>
739               <xsl:variable name="recurrenceId" select="recurrenceId"/>
740               <tr>
741                 <xsl:variable name="dateRangeStyle">
742                   <xsl:choose>
743                     <xsl:when test="start/shortdate = parent::day/shortdate">
744                       <xsl:choose>
745                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
746                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
747                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
748                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
749                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
750                       </xsl:choose>
751                     </xsl:when>
752                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
753                   </xsl:choose>
754                 </xsl:variable>
755                 <xsl:choose>
756                   <xsl:when test="start/allday = 'true' and
757                                   start/shortdate = end/shortdate">
758                     <td class="{$dateRangeStyle} center" colspan="3">
759                       all day
760                     </td>
761                   </xsl:when>
762                   <xsl:when test="start/shortdate = end/shortdate and
763                                   start/time = end/time">
764                     <td class="{$dateRangeStyle} center" colspan="3">
765                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
766                         <xsl:value-of select="start/time"/>
767                       </a>
768                     </td>
769                   </xsl:when>
770                   <xsl:otherwise>
771                     <td class="{$dateRangeStyle} right">
772                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
773                       <xsl:choose>
774                         <xsl:when test="start/allday = 'true' and
775                                         parent::day/shortdate = start/shortdate">
776                           today
777                         </xsl:when>
778                         <xsl:when test="parent::day/shortdate != start/shortdate">
779                           <span class="littleArrow">&#171;</span>&#160;
780                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
781                         </xsl:when>
782                         <xsl:otherwise>
783                           <xsl:value-of select="start/time"/>
784                         </xsl:otherwise>
785                       </xsl:choose>
786                       </a>
787                     </td>
788                     <td class="{$dateRangeStyle} center">
789                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
790                     </td>
791                     <td class="{$dateRangeStyle} left">
792                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
793                       <xsl:choose>
794                         <xsl:when test="end/allday = 'true' and
795                                         parent::day/shortdate = end/shortdate">
796                           today
797                         </xsl:when>
798                         <xsl:when test="parent::day/shortdate != end/shortdate">
799                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
800                           &#160;<span class="littleArrow">&#187;</span>
801                         </xsl:when>
802                         <xsl:otherwise>
803                           <xsl:value-of select="end/time"/>
804                         </xsl:otherwise>
805                       </xsl:choose>
806                       </a>
807                     </td>
808                   </xsl:otherwise>
809                 </xsl:choose>
810                 <xsl:variable name="descriptionClass">
811                   <xsl:choose>
812                     <xsl:when test="status='CANCELLED'">description bwStatusCancelled</xsl:when>
813                     <xsl:when test="status='TENTATIVE'">description bwStatusTentative</xsl:when>
814                     <xsl:otherwise>description</xsl:otherwise>
815                   </xsl:choose>
816                 </xsl:variable>
817                 <xsl:variable name="subStyle" select="subscription/style"/>
818                 <td class="{$descriptionClass} {$subStyle}">
819                   <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if>
820                   <xsl:choose>
821                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
822                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
823                         <strong>
824                           <xsl:value-of select="summary"/>:
825                         </strong>
826                         <xsl:value-of select="description"/>&#160;
827                         <em>
828                           <xsl:value-of select="location/address"/>
829                           <xsl:if test="location/subaddress != ''">
830                             , <xsl:value-of select="location/subaddress"/>
831                           </xsl:if>.&#160;
832                           <xsl:if test="cost!=''">
833                             <xsl:value-of select="cost"/>.&#160;
834                           </xsl:if>
835                           <xsl:if test="sponsor/name!='none'">
836                             Contact: <xsl:value-of select="sponsor/name"/>
837                           </xsl:if>
838                         </em>
839                       </a>
840                       <xsl:if test="link != ''">
841                         <xsl:variable name="link" select="link"/>
842                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
843                       </xsl:if>
844                     </xsl:when>
845                     <xsl:otherwise>
846                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
847                         <xsl:value-of select="summary"/>
848                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
849                       </a>
850                     </xsl:otherwise>
851                   </xsl:choose>
852                 </td>
853                 <td class="eventLinks">
854                   <xsl:call-template name="eventLinks"/>
855                 </td>
856                 <td class="smallIcon">
857                   <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
858                   <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&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">
859                     <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"/>
860                   </a>
861                 </td>
862               </tr>
863             </xsl:for-each>
864           </xsl:for-each>
865         </xsl:otherwise>
866       </xsl:choose>
867     </table>
868   </xsl:template>
869
870   <xsl:template name="eventLinks">
871     <xsl:variable name="subscriptionId" select="subscription/id"/>
872     <xsl:variable name="calPath" select="calendar/encodedPath"/>
873     <xsl:variable name="guid" select="guid"/>
874     <xsl:variable name="recurrenceId" select="recurrenceId"/>
875     <xsl:choose>
876       <xsl:when test="isAnnotation">
877         <xsl:choose>
878           <xsl:when test="recurring=true">
879             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;confirmationid={$confId}">Remove All</a>
880           </xsl:when>
881           <xsl:otherwise>
882             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Remove</a>
883           </xsl:otherwise>
884         </xsl:choose>
885       </xsl:when>
886       <xsl:when test="calendar/owner = /bedework/userid">
887         <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">Edit</a> |
888         <xsl:choose>
889           <xsl:when test="recurring=true">
890             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete All</a>
891           </xsl:when>
892           <xsl:otherwise>
893             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete</a>
894           </xsl:otherwise>
895         </xsl:choose>
896       </xsl:when>
897       <xsl:otherwise>
898         <a href="{$subscriptions-fetch}">Subscription</a>
899       </xsl:otherwise>
900     </xsl:choose>
901   </xsl:template>
902
903   <!--==== WEEK CALENDAR VIEW ====-->
904   <xsl:template name="weekView">
905     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
906       <tr>
907         <xsl:for-each select="/bedework/daynames/val">
908           <th class="dayHeading"><xsl:value-of select="."/></th>
909         </xsl:for-each>
910       </tr>
911       <tr>
912         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
913           <xsl:variable name="dayPos" select="position()"/>
914           <xsl:if test="filler='false'">
915             <td>
916               <xsl:variable name="dayDate" select="date"/>
917               <a href="{$initEvent}&amp;startdate={$dayDate}" class="gridAdd" title="add event">
918                 <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="9" height="10" border="0" alt="add event"/>
919               </a>
920               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
921                 <xsl:value-of select="value"/>
922               </a>
923               <ul>
924                 <xsl:apply-templates select="event" mode="calendarLayout">
925                   <xsl:with-param name="dayPos" select="$dayPos"/>
926                 </xsl:apply-templates>
927               </ul>
928             </td>
929           </xsl:if>
930         </xsl:for-each>
931       </tr>
932     </table>
933   </xsl:template>
934
935   <!--==== MONTH CALENDAR VIEW ====-->
936   <xsl:template name="monthView">
937     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
938       <tr>
939         <xsl:for-each select="/bedework/daynames/val">
940           <th class="dayHeading"><xsl:value-of select="."/></th>
941         </xsl:for-each>
942       </tr>
943       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
944         <tr>
945           <xsl:for-each select="day">
946             <xsl:variable name="dayPos" select="position()"/>
947             <xsl:choose>
948               <xsl:when test="filler='true'">
949                 <td class="filler">&#160;</td>
950               </xsl:when>
951               <xsl:otherwise>
952                 <td>
953                   <xsl:variable name="dayDate" select="date"/>
954                   <a href="{$initEvent}&amp;startdate={$dayDate}" class="gridAdd" title="add event">
955                     <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="10" height="10" border="0" alt="add event"/>
956                   </a>
957                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
958                     <xsl:value-of select="value"/>
959                   </a>
960                   <ul>
961                     <xsl:apply-templates select="event" mode="calendarLayout">
962                       <xsl:with-param name="dayPos" select="$dayPos"/>
963                     </xsl:apply-templates>
964                   </ul>
965                 </td>
966               </xsl:otherwise>
967             </xsl:choose>
968           </xsl:for-each>
969         </tr>
970       </xsl:for-each>
971     </table>
972   </xsl:template>
973
974   <xsl:template match="event" mode="calendarLayout">
975     <xsl:param name="dayPos"/>
976     <xsl:variable name="subscriptionId" select="subscription/id"/>
977     <xsl:variable name="calPath" select="calendar/encodedPath"/>
978     <xsl:variable name="guid" select="guid"/>
979     <xsl:variable name="recurrenceId" select="recurrenceId"/>
980     <xsl:variable name="eventRootClass">
981       <xsl:choose>
982         <!-- Otherwise: Alternating colors for all standard events -->
983         <xsl:when test="position() = 1">event firstEvent</xsl:when>
984         <xsl:otherwise>event</xsl:otherwise>
985       </xsl:choose>
986     </xsl:variable>
987     <xsl:variable name="eventClass">
988       <xsl:choose>
989         <!-- Special styles for the month grid -->
990         <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when>
991         <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when>
992         <!-- Otherwise: Alternating colors for all standard events -->
993         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
994         <xsl:otherwise>eventLinkB</xsl:otherwise>
995       </xsl:choose>
996     </xsl:variable>
997     <!-- User defined subscription styles.
998          These are set in the add/modify subscription forms which
999          rely (in this stylesheet) on subColors.css; if present, these
1000          override the background-color set by eventClass. User styles should
1001          not be used for cancelled events (tentative is ok). -->
1002     <xsl:variable name="subColor">
1003       <xsl:choose>
1004          <xsl:when test="status != 'CANCELLED' and
1005                         subscription/style != '' and
1006                         subscription/style != 'default'"><xsl:value-of select="subscription/style"/></xsl:when>
1007         <xsl:otherwise></xsl:otherwise>
1008       </xsl:choose>
1009     </xsl:variable>
1010     <li>
1011       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"
1012         class="{$eventRootClass} {$eventClass} {$subColor}">
1013         <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
1014         <xsl:value-of select="summary"/>
1015         <xsl:variable name="eventTipClass">
1016           <xsl:choose>
1017             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
1018             <xsl:otherwise>eventTip</xsl:otherwise>
1019           </xsl:choose>
1020         </xsl:variable>
1021         <span class="{$eventTipClass}">
1022           <xsl:if test="status='CANCELLED'"><span class="eventTipStatusCancelled">CANCELLED</span></xsl:if>
1023           <xsl:if test="status='TENTATIVE'"><span class="eventTipStatusTentative">TENTATIVE</span></xsl:if>
1024           <strong><xsl:value-of select="summary"/></strong><br/>
1025           Time:
1026           <xsl:choose>
1027             <xsl:when test="start/allday = 'false'">
1028               <xsl:value-of select="start/time"/>
1029               <xsl:if test="start/time != end/time">
1030                 - <xsl:value-of select="end/time"/>
1031               </xsl:if>
1032             </xsl:when>
1033             <xsl:otherwise>
1034               all day
1035             </xsl:otherwise>
1036           </xsl:choose><br/>
1037           <xsl:if test="location/address">
1038             Location: <xsl:value-of select="location/address"/><br/>
1039           </xsl:if>
1040           Calendar:
1041             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1042             <xsl:choose>
1043               <xsl:when test="contains(calendar/path,$userPath)">
1044                 <xsl:value-of select="substring-after(calendar/path,$userPath)"/>
1045               </xsl:when>
1046               <xsl:otherwise>
1047                 <xsl:value-of select="calendar/path"/>
1048               </xsl:otherwise>
1049             </xsl:choose><br/>
1050           Type:
1051           <xsl:choose>
1052             <xsl:when test="isAnnotation">
1053               public event
1054             </xsl:when>
1055             <xsl:when test="calendar/owner = /bedework/userid">
1056               personal event, editable
1057             </xsl:when>
1058             <xsl:otherwise>
1059               subscription
1060             </xsl:otherwise>
1061           </xsl:choose>
1062         </span>
1063       </a>
1064     </li>
1065   </xsl:template>
1066
1067   <!--==== YEAR VIEW ====-->
1068   <xsl:template name="yearView">
1069     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
1070       <tr>
1071         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
1072       </tr>
1073       <tr>
1074         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
1075       </tr>
1076       <tr>
1077         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
1078       </tr>
1079       <tr>
1080         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
1081       </tr>
1082     </table>
1083   </xsl:template>
1084
1085   <!-- year view month tables -->
1086   <xsl:template match="month">
1087     <td>
1088       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
1089         <tr>
1090           <td colspan="8" class="monthName">
1091             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
1092             <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">
1093               <xsl:value-of select="longname"/>
1094             </a>
1095           </td>
1096         </tr>
1097         <tr>
1098           <th>&#160;</th>
1099           <xsl:for-each select="/bedework/shortdaynames/val">
1100             <th><xsl:value-of select="."/></th>
1101           </xsl:for-each>
1102         </tr>
1103         <xsl:for-each select="week">
1104           <tr>
1105             <td class="weekCell">
1106               <xsl:variable name="firstDayOfWeek" select="day/date"/>
1107               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}">
1108                 <xsl:value-of select="value"/>
1109               </a>
1110             </td>
1111             <xsl:for-each select="day">
1112               <xsl:choose>
1113                 <xsl:when test="filler='true'">
1114                   <td class="filler">&#160;</td>
1115                 </xsl:when>
1116                 <xsl:otherwise>
1117                   <td>
1118                     <xsl:variable name="dayDate" select="date"/>
1119                     <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}">
1120                       <xsl:value-of select="value"/>
1121                     </a>
1122                   </td>
1123                 </xsl:otherwise>
1124               </xsl:choose>
1125             </xsl:for-each>
1126           </tr>
1127         </xsl:for-each>
1128       </table>
1129     </td>
1130   </xsl:template>
1131
1132   <!--==== SINGLE EVENT ====-->
1133   <xsl:template match="event">
1134     <xsl:variable name="subscriptionId" select="subscription/id"/>
1135     <xsl:variable name="calPath" select="calendar/encodedPath"/>
1136     <xsl:variable name="guid" select="guid"/>
1137     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1138     <xsl:variable name="statusClass">
1139       <xsl:choose>
1140         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
1141         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
1142         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
1143       </xsl:choose>
1144     </xsl:variable>
1145     <h2 class="{$statusClass}">
1146       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
1147       <xsl:choose>
1148         <xsl:when test="link != ''">
1149           <xsl:variable name="link" select="link"/>
1150           <a href="{$link}">
1151             <xsl:value-of select="summary"/>
1152           </a>
1153         </xsl:when>
1154         <xsl:otherwise>
1155           <xsl:value-of select="summary"/>
1156         </xsl:otherwise>
1157       </xsl:choose>
1158     </h2>
1159     <table class="common" cellspacing="0">
1160       <tr>
1161         <th colspan="2" class="commonHeader">
1162           <div id="eventActions">
1163             <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
1164             <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&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">
1165               <img src="{$resourcesRoot}/resources/std-icalDownload-icon-small.gif" width="12" height="16" border="0" alt="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars"/>
1166               Download
1167             </a> |
1168             <xsl:choose>
1169               <xsl:when test="isAnnotation">
1170                 <xsl:choose>
1171                   <xsl:when test="recurring=true">
1172                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;confirmationid={$confId}">
1173                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1174                       Remove All (recurring)
1175                     </a>
1176                   </xsl:when>
1177                   <xsl:otherwise>
1178                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1179                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1180                       Remove
1181                     </a>
1182                   </xsl:otherwise>
1183                 </xsl:choose>
1184               </xsl:when>
1185               <xsl:when test="currentAccess/current-user-privilege-set/privilege/write-content">
1186                 <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1187                   <img src="{$resourcesRoot}/resources/std-ical_iconEditDkGray.gif" width="12" height="16" border="0" alt="edit"/>
1188                   Edit
1189                 </a>
1190               </xsl:when>
1191               <xsl:otherwise>
1192                 <a href="{$subscriptions-fetch}">
1193                   <img src="{$resourcesRoot}/resources/std-ical_iconSubsDkGray.gif" width="12" height="16" border="0" alt="edit"/>
1194                   Manage Subscriptions
1195                 </a>
1196               </xsl:otherwise>
1197             </xsl:choose>
1198             <xsl:if test="currentAccess/current-user-privilege-set/privilege/unbind and not(isAnnotation)">
1199                |
1200               <xsl:choose>
1201                 <xsl:when test="recurring=true">
1202                   <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;confirmationid={$confId}">
1203                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1204                     Delete All (recurring)
1205                   </a>
1206                 </xsl:when>
1207                 <xsl:otherwise>
1208                   <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1209                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1210                     Delete
1211                   </a>
1212                 </xsl:otherwise>
1213               </xsl:choose>
1214             </xsl:if>
1215           </div>
1216           <xsl:choose>
1217             <xsl:when test="calendar/owner = /bedework/userid">
1218               Personal Event
1219             </xsl:when>
1220             <xsl:when test="starts-with(calendar/path,'/user/')">
1221               User Event (<xsl:value-of select="calendar/owner"/>)
1222             </xsl:when>
1223             <xsl:when test="isAnnotation">
1224               Public Event
1225             </xsl:when>
1226             <xsl:otherwise>
1227               <xsl:choose>
1228                 <xsl:when test="starts-with(calendar/path,'/public/')">
1229                   Public Event from Subscription
1230                 </xsl:when>
1231                 <xsl:otherwise>
1232                   Event from Subscription
1233                 </xsl:otherwise>
1234               </xsl:choose>
1235             </xsl:otherwise>
1236           </xsl:choose>
1237         </th>
1238       </tr>
1239       <tr>
1240         <td class="fieldname">When:</td>
1241         <td class="fieldval">
1242           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
1243           <xsl:if test="start/allday = 'false'">
1244             <span class="time"><xsl:value-of select="start/time"/></span>
1245           </xsl:if>
1246           <xsl:if test="(end/longdate != start/longdate) or
1247                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
1248           <xsl:if test="end/longdate != start/longdate">
1249             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
1250           </xsl:if>
1251           <xsl:choose>
1252             <xsl:when test="start/allday = 'true'">
1253               <span class="time"><em>(all day)</em></span>
1254             </xsl:when>
1255             <xsl:when test="end/longdate != start/longdate">
1256               <span class="time"><xsl:value-of select="end/time"/></span>
1257             </xsl:when>
1258             <xsl:when test="end/time != start/time">
1259               <span class="time"><xsl:value-of select="end/time"/></span>
1260             </xsl:when>
1261           </xsl:choose>
1262         </td>
1263         <!--<th class="icon" rowspan="2">
1264           <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
1265           <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&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">
1266             <img src="{$resourcesRoot}/resources/std-ical-icon.gif" width="20" height="26" border="0" align="left" alt="Download this event"/>
1267           </a>
1268         </th>-->
1269       </tr>
1270       <tr>
1271         <td class="fieldname">Where:</td>
1272         <td class="fieldval">
1273           <xsl:choose>
1274             <xsl:when test="location/link=''">
1275               <xsl:value-of select="location/address"/>
1276             </xsl:when>
1277             <xsl:otherwise>
1278               <xsl:variable name="locationLink" select="location/link"/>
1279               <a href="{$locationLink}">
1280                 <xsl:value-of select="location/address"/>
1281               </a>
1282             </xsl:otherwise>
1283           </xsl:choose>
1284           <xsl:if test="location/subaddress!=''">
1285             <br/><xsl:value-of select="location/subaddress"/>
1286           </xsl:if>
1287         </td>
1288       </tr>
1289       <tr>
1290         <td class="fieldname">Description:</td>
1291         <td class="fieldval">
1292           <xsl:call-template name="replace">
1293             <xsl:with-param name="string" select="description"/>
1294             <xsl:with-param name="pattern" select="'&#xA;'"/>
1295             <xsl:with-param name="replacement"><br/></xsl:with-param>
1296           </xsl:call-template>
1297         </td>
1298       </tr>
1299       <xsl:if test="status !='' and status != 'CONFIRMED'">
1300         <tr>
1301           <td class="fieldname">Status:</td>
1302           <td class="fieldval">
1303             <xsl:value-of select="status"/>
1304           </td>
1305         </tr>
1306       </xsl:if>
1307       <xsl:if test="organizer">
1308         <tr>
1309           <td class="fieldname">Organizer:</td>
1310           <xsl:variable name="organizerUri" select="organizer/organizerUri"/>
1311           <td class="fieldval">
1312             <strong>
1313               <a href="{$organizerUri}">
1314                 <xsl:value-of select="organizer/cn"/>
1315               </a>
1316             </strong>
1317           </td>
1318         </tr>
1319       </xsl:if>
1320       <xsl:if test="attendee">
1321         <tr>
1322           <td class="fieldname">Attendees:</td>
1323           <td class="fieldval">
1324             <table id="attendees" cellspacing="0">
1325               <tr>
1326                 <th>role</th>
1327                 <th>status</th>
1328                 <th>attendee</th>
1329               </tr>
1330               <xsl:for-each select="attendee">
1331                 <xsl:sort select="cn" order="ascending" case-order="upper-first"/>
1332                 <tr>
1333                   <td class="role">
1334                     <xsl:value-of select="role"/>
1335                   </td>
1336                   <td class="status">
1337                     <xsl:value-of select="partstat"/>
1338                   </td>
1339                   <td>
1340                     <xsl:variable name="attendeeUri" select="attendeeUri"/>
1341                     <a href="{$attendeeUri}"><xsl:value-of select="cn"/></a>
1342                   </td>
1343                 </tr>
1344               </xsl:for-each>
1345             </table>
1346           </td>
1347         </tr>
1348       </xsl:if>
1349       <xsl:if test="cost!=''">
1350         <tr>
1351           <td class="fieldname">Cost:</td>
1352           <td class="fieldval"><xsl:value-of select="cost"/></td>
1353         </tr>
1354       </xsl:if>
1355       <xsl:if test="link != ''">
1356         <tr>
1357           <td class="fieldname">See:</td>
1358           <td class="fieldval">
1359             <xsl:variable name="link" select="link"/>
1360             <a href="{$link}"><xsl:value-of select="link"/></a>
1361           </td>
1362         </tr>
1363       </xsl:if>
1364       <xsl:if test="sponsor/name!='none'">
1365         <tr>
1366           <td class="fieldname">Contact:</td>
1367           <td class="fieldval">
1368             <xsl:choose>
1369               <xsl:when test="sponsor/link=''">
1370                 <xsl:value-of select="sponsor/name"/>
1371               </xsl:when>
1372               <xsl:otherwise>
1373                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
1374                 <a href="{$sponsorLink}">
1375                   <xsl:value-of select="sponsor/name"/>
1376                 </a>
1377               </xsl:otherwise>
1378             </xsl:choose>
1379             <xsl:if test="sponsor/phone!=''">
1380               <br /><xsl:value-of select="sponsor/phone"/>
1381             </xsl:if>
1382             <xsl:if test="sponsor/email!=''">
1383               <br />
1384               <xsl:variable name="email" select="sponsor/email"/>
1385               <xsl:variable name="subject" select="summary"/>
1386               <a href="mailto:{$email}&amp;subject={$subject}">
1387                 <xsl:value-of select="sponsor/email"/>
1388               </a>
1389             </xsl:if>
1390           </td>
1391         </tr>
1392       </xsl:if>
1393       <xsl:if test="calendar/path!=''">
1394         <tr>
1395           <td class="fieldname">Calendar:</td>
1396           <td class="fieldval">
1397             <xsl:variable name="calUrl" select="calendar/encodedPath"/>
1398             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1399             <a href="{$setSelection}&amp;calUrl={$calUrl}">
1400               <xsl:choose>
1401                 <xsl:when test="contains(calendar/path,$userPath)">
1402                   <xsl:value-of select="substring-after(calendar/path,$userPath)"/>
1403                 </xsl:when>
1404                 <xsl:otherwise>
1405                   <xsl:value-of select="calendar/path"/>
1406                 </xsl:otherwise>
1407               </xsl:choose>
1408             </a>
1409           </td>
1410         </tr>
1411       </xsl:if>
1412       <tr>
1413         <td class="fieldname filler">&#160;</td>
1414         <td class="fieldval">&#160;</td>
1415       </tr>
1416     </table>
1417   </xsl:template>
1418
1419  <!--==== ADD EVENT ====-->
1420   <xsl:template name="addEvent">
1421   <!-- The name "eventForm" is referenced by several javascript functions. Do not
1422     change it without modifying includes.js -->
1423     <form name="eventForm" method="post" action="{$addEventUsingPage}" id="standardForm">
1424       <input type="hidden" name="confirmationid" value="{$confId}"/>
1425       <input type="hidden" name="endType" value="date"/>
1426       <h2>Add Event</h2>
1427       <table class="common" cellspacing="0">
1428         <tr>
1429           <td class="fieldname">
1430             Title:
1431           </td>
1432           <td class="fieldval">
1433             <xsl:variable name="title" select="/bedework/formElements/form/title/input/@value"/>
1434             <input type="text" name="newEvent.summary" size="80" value="{$title}"/>
1435           </td>
1436         </tr>
1437         <tr>
1438           <td class="fieldname">
1439             Calendar:
1440           </td>
1441           <td class="fieldval">
1442             <xsl:variable name="newCalPath" select="/bedework/formElements/form/calendar/path"/>
1443             <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
1444             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1445             <span id="bwEventCalDisplay">
1446               <xsl:choose>
1447                 <xsl:when test="contains(/bedework/formElements/form/calendar/path,$userPath)">
1448                   <xsl:value-of select="substring-after(/bedework/formElements/form/calendar/path,$userPath)"/>
1449                 </xsl:when>
1450                 <xsl:otherwise>
1451                   <xsl:value-of select="/bedework/formElements/form/calendar/path"/>
1452                 </xsl:otherwise>
1453               </xsl:choose>
1454             </span>
1455             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
1456           </td>
1457         </tr>
1458         <tr>
1459           <td class="fieldname">
1460             Date &amp; Time:
1461           </td>
1462           <td class="fieldval">
1463             <!-- Set the timefields class for the first load of the page;
1464                  subsequent changes will take place using javascript without a
1465                  page reload. -->
1466             <xsl:variable name="timeFieldsClass">
1467               <xsl:choose>
1468                 <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1469                 <xsl:otherwise>timeFields</xsl:otherwise>
1470               </xsl:choose>
1471             </xsl:variable>
1472             <xsl:choose>
1473               <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">
1474                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1475                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1476                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1477               </xsl:when>
1478               <xsl:otherwise>
1479                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1480                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1481                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1482               </xsl:otherwise>
1483             </xsl:choose>
1484             all day event<br/>
1485             <div class="dateStartEndBox">
1486               <strong>Start:</strong>
1487               <div class="dateFields">
1488                 <span class="startDateLabel">Date </span>
1489                 <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
1490                 <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
1491                 <xsl:choose>
1492                   <xsl:when test="/bedework/creating = 'true'">
1493                     <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
1494                   </xsl:when>
1495                   <xsl:otherwise>
1496                     <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
1497                   </xsl:otherwise>
1498                 </xsl:choose>
1499               </div>
1500               <script language="JavaScript" type="text/javascript">
1501               <xsl:comment>
1502                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(/bedework/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedework/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback');
1503               </xsl:comment>
1504               </script>
1505               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1506               <div class="{$timeFieldsClass}" id="startTimeFields">
1507                 <span id="calWidgetStartTimeHider" class="show">
1508                   <xsl:copy-of select="/bedework/formElements/form/start/hour/*"/>
1509                   <xsl:copy-of select="/bedework/formElements/form/start/minute/*"/>
1510                   <xsl:if test="/bedework/formElements/form/start/ampm">
1511                     <xsl:copy-of select="/bedework/formElements/form/start/ampm/*"/>
1512                   </xsl:if>
1513                   <xsl:text> </xsl:text>
1514                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1515                 </span>
1516               </div>
1517             </div>
1518             <div class="dateStartEndBox">
1519               <strong>End:</strong>
1520               <xsl:choose>
1521                 <xsl:when test="/bedework/formElements/form/end/type='E'">
1522                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1523                 </xsl:when>
1524                 <xsl:otherwise>
1525                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1526                 </xsl:otherwise>
1527               </xsl:choose>
1528               Date
1529               <xsl:variable name="endDateTimeClass">
1530                 <xsl:choose>
1531                   <xsl:when test="/bedework/formElements/form/end/type='E'">shown</xsl:when>
1532                   <xsl:otherwise>invisible</xsl:otherwise>
1533                 </xsl:choose>
1534               </xsl:variable>
1535               <div class="{$endDateTimeClass}" id="endDateTime">
1536                 <div class="dateFields">
1537                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
1538                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
1539                   <xsl:choose>
1540                     <xsl:when test="/bedework/creating = 'true'">
1541                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
1542                     </xsl:when>
1543                     <xsl:otherwise>
1544                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
1545                     </xsl:otherwise>
1546                   </xsl:choose>
1547                 </div>
1548                 <script language="JavaScript" type="text/javascript">
1549                 <xsl:comment>
1550                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(/bedework/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedework/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback');
1551                 </xsl:comment>
1552                 </script>
1553                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1554                 <div class="{$timeFieldsClass}" id="endTimeFields">
1555                   <span id="calWidgetEndTimeHider" class="show">
1556                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/hour/*"/>
1557                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/minute/*"/>
1558                     <xsl:if test="/bedework/formElements/form/end/dateTime/ampm">
1559                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/ampm/*"/>
1560                     </xsl:if>
1561                     <xsl:text> </xsl:text>
1562                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1563                   </span>
1564                 </div>
1565               </div><br/>
1566               <div id="clock" class="invisible">
1567                 <xsl:call-template name="clock"/>
1568               </div>
1569               <div class="dateFields">
1570                 <xsl:choose>
1571                   <xsl:when test="/bedework/formElements/form/end/type='D'">
1572                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1573                   </xsl:when>
1574                   <xsl:otherwise>
1575                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1576                   </xsl:otherwise>
1577                 </xsl:choose>
1578                 Duration
1579                 <xsl:variable name="endDurationClass">
1580                   <xsl:choose>
1581                     <xsl:when test="/bedework/formElements/form/end/type='D'">shown</xsl:when>
1582                     <xsl:otherwise>invisible</xsl:otherwise>
1583                   </xsl:choose>
1584                 </xsl:variable>
1585                 <xsl:variable name="durationHrMinClass">
1586                   <xsl:choose>
1587                     <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1588                     <xsl:otherwise>shown</xsl:otherwise>
1589                   </xsl:choose>
1590                 </xsl:variable>
1591                 <div class="{$endDurationClass}" id="endDuration">
1592                   <xsl:choose>
1593                     <xsl:when test="/bedework/formElements/form/end/duration/weeks/input/@value = '0'">
1594                     <!-- we are using day, hour, minute format -->
1595                     <!-- must send either no week value or week value of 0 (zero) -->
1596                       <div class="durationBox">
1597                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1598                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1599                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1600                         <span id="durationHrMin" class="{$durationHrMinClass}">
1601                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1602                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1603                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1604                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1605                         </span>
1606                       </div>
1607                       <span class="durationSpacerText">or</span>
1608                       <div class="durationBox">
1609                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1610                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1611                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1612                       </div>
1613                     </xsl:when>
1614                     <xsl:otherwise>
1615                       <!-- we are using week format -->
1616                       <div class="durationBox">
1617                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1618                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1619                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1620                         <span id="durationHrMin" class="{$durationHrMinClass}">
1621                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1622                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1623                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1624                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1625                         </span>
1626                       </div>
1627                       <span class="durationSpacerText">or</span>
1628                       <div class="durationBox">
1629                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1630                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1631                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1632                       </div>
1633                     </xsl:otherwise>
1634                   </xsl:choose>
1635                 </div>
1636               </div><br/>
1637               <div class="dateFields" id="noDuration">
1638                 <xsl:choose>
1639                   <xsl:when test="/bedework/formElements/form/end/type='N'">
1640                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1641                   </xsl:when>
1642                   <xsl:otherwise>
1643                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1644                   </xsl:otherwise>
1645                 </xsl:choose>
1646                 This event has no duration / end date
1647               </div>
1648             </div>
1649           </td>
1650         </tr>
1651         <!--  Status  -->
1652         <tr>
1653           <td class="fieldname">
1654             Status:
1655           </td>
1656           <td class="fieldval">
1657             <xsl:choose>
1658               <xsl:when test="/bedework/formElements/form/status = 'TENTATIVE'">
1659                 <input type="radio" name="newEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="newEvent.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="newEvent.status" value="CANCELLED"/>cancelled
1660               </xsl:when>
1661               <xsl:when test="/bedework/formElements/form/status = 'CANCELLED'">
1662                 <input type="radio" name="newEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="newEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="newEvent.status" value="CANCELLED" checked="checked"/>cancelled
1663               </xsl:when>
1664               <xsl:otherwise>
1665                 <input type="radio" name="newEvent.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="newEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="newEvent.status" value="CANCELLED"/>cancelled
1666               </xsl:otherwise>
1667             </xsl:choose>
1668           </td>
1669         </tr>
1670         <!--  Transparency  -->
1671         <tr>
1672           <td class="fieldname">
1673             Effects free/busy:
1674           </td>
1675           <td class="fieldval">
1676             <input type="radio" name="newEvent.transparency" value="OPAQUE" checked="checked"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
1677             <input type="radio" name="newEvent.transparency" value="TRANSPARENT"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
1678           </td>
1679         </tr>
1680         <!--  Description  -->
1681         <tr>
1682           <td class="fieldname">Description:</td>
1683           <td class="fieldval">
1684             <textarea name="newEvent.description" cols="60" rows="4">
1685               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
1686             </textarea>
1687           </td>
1688         </tr>
1689         <tr>
1690           <td class="fieldname">Location:</td>
1691           <td class="fieldval" align="left">
1692             <span class="std-text">choose: </span>
1693             <span id="eventFormLocationList">
1694               <select name="locationId">
1695                 <option value="-1">select...</option>
1696                 <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
1697               </select>
1698             </span>
1699             <span class="std-text"> or add new: </span>
1700             <input type="text" name="newLocation.address" value="" />
1701           </td>
1702         </tr>
1703         <tr>
1704           <td class="fieldname">Event Link:</td>
1705           <td class="fieldval">
1706             <xsl:variable name="link" select="/bedework/formElements/form/link/input/@value"/>
1707             <input type="text" name="newEvent.link" size="80" value="{$link}"/>
1708           </td>
1709         </tr>
1710         <tr>
1711           <td class="fieldname">&#160;</td>
1712           <td class="fieldval">
1713             <input name="submit" type="submit" value="Submit Event"/>&#160;
1714             <input name="cancelled" type="submit" value="Cancel"/>
1715           </td>
1716         </tr>
1717       </table>
1718     </form>
1719   </xsl:template>
1720
1721   <xsl:template name="clock">
1722     <div id="bwClock">
1723       <!-- Bedework 24-Hour Clock time selection widget
1724            used with resources/bwClock.js and resources/bwClock.css -->
1725       <div id="bwClockClock">
1726         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="" usemap="#bwClockMap" />
1727       </div>
1728       <div id="bwClockCover">
1729         <!-- this is a special effect div used simply to cover the pixelated edge
1730              where the clock meets the clock box title -->
1731       </div>
1732       <div id="bwClockBox">
1733         <h2>
1734           Bedework 24-Hour Clock
1735         </h2>
1736         <div id="bwClockDateTypeIndicator">
1737           type
1738         </div>
1739         <div id="bwClockTime">
1740           select time
1741         </div>
1742         <div id="bwClockCloseText">
1743           close
1744         </div>
1745         <div id="bwClockCloseButton">
1746           <a href="javascript:bwClockClose();">X</a>
1747         </div>
1748       </div>
1749       <map name="bwClockMap" id="bwClockMap">
1750         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1751         <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')" />
1752         <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')" />
1753         <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')" />
1754         <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')" />
1755         <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')" />
1756         <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')" />
1757         <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')" />
1758         <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')" />
1759         <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')" />
1760         <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')" />
1761         <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')" />
1762         <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')" />
1763         <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')" />
1764         <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')" />
1765         <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')" />
1766         <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')" />
1767         <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')" />
1768         <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')" />
1769         <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')" />
1770         <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')" />
1771         <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')" />
1772         <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')" />
1773         <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')" />
1774         <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')" />
1775         <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')" />
1776         <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')" />
1777         <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')" />
1778         <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')" />
1779         <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')" />
1780         <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')" />
1781         <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')" />
1782         <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')" />
1783         <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')" />
1784         <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')" />
1785         <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')" />
1786         <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')" />
1787       </map>
1788     </div>
1789   </xsl:template>
1790
1791   <!--==== EDIT EVENT ====-->
1792   <xsl:template match="formElements" mode="editEvent">
1793     <xsl:variable name="subscriptionId" select="subscriptionId"/>
1794     <xsl:variable name="calPathEncoded" select="form/calendar/encodedPath"/>
1795     <xsl:variable name="calPath" select="form/calendar/path"/>
1796     <xsl:variable name="guid" select="guid"/>
1797     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1798     <!-- The name "eventForm" is referenced by several javascript functions. Do not
1799     change it without modifying includes.js -->
1800     <form name="eventForm" method="post" action="{$editEvent}" id="standardForm">
1801       <input type="hidden" name="updateEvent" value="true"/>
1802       <input type="hidden" name="confirmationid" value="{$confId}"/>
1803       <input type="hidden" name="endType" value="date"/>
1804       <h2>Edit Event</h2>
1805       <table class="common" cellspacing="0">
1806         <tr>
1807           <th colspan="2" class="commonHeader">
1808             <div id="eventActions">
1809               <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1810                 <img src="{$resourcesRoot}/resources/glassFill-icon-viewGray.gif" width="13" height="13" border="0" alt="view"/>
1811                 View
1812               </a>
1813               <xsl:if test="currentAccess/current-user-privilege-set/privilege/unbind">
1814                 |
1815                 <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPathEncoded}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1816                   <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1817                   Delete
1818                 </a>
1819               </xsl:if>
1820             </div>
1821             Personal Event
1822           </th>
1823         </tr>
1824         <tr>
1825           <td class="fieldname">
1826             Title:
1827           </td>
1828           <td class="fieldval">
1829             <xsl:variable name="title" select="form/title/input/@value"/>
1830             <input type="text" name="editEvent.summary" size="80" value="{$title}"/>
1831           </td>
1832         </tr>
1833         <tr>
1834           <td class="fieldname">
1835             Calendar:
1836           </td>
1837           <td class="fieldval">
1838             <xsl:variable name="newCalPath" select="/bedework/formElements/form/calendar/path"/>
1839             <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
1840             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1841             <span id="bwEventCalDisplay">
1842               <xsl:choose>
1843                 <xsl:when test="contains(/bedework/formElements/form/calendar/path,$userPath)">
1844                   <xsl:value-of select="substring-after(/bedework/formElements/form/calendar/path,$userPath)"/>
1845                 </xsl:when>
1846                 <xsl:otherwise>
1847                   <xsl:value-of select="/bedework/formElements/form/calendar/path"/>
1848                 </xsl:otherwise>
1849               </xsl:choose>
1850             </span>
1851             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
1852           </td>
1853         </tr>
1854         <tr>
1855           <td class="fieldname">
1856             Date &amp; Time:
1857           </td>
1858           <td class="fieldval">
1859             <!-- Set the timefields class for the first load of the page;
1860                  subsequent changes will take place using javascript without a
1861                  page reload. -->
1862             <xsl:variable name="timeFieldsClass">
1863               <xsl:choose>
1864                 <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1865                 <xsl:otherwise>timeFields</xsl:otherwise>
1866               </xsl:choose>
1867             </xsl:variable>
1868             <xsl:choose>
1869               <xsl:when test="form/allDay/input/@checked='checked'">
1870                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1871                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1872                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1873               </xsl:when>
1874               <xsl:otherwise>
1875                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1876                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1877                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1878               </xsl:otherwise>
1879             </xsl:choose>
1880             all day event<br/>
1881             <div class="dateStartEndBox">
1882               <strong>Start:</strong>
1883               <div class="dateFields">
1884                 <span class="startDateLabel">Date </span>
1885                 <xsl:copy-of select="form/start/month/*"/>
1886                 <xsl:copy-of select="form/start/day/*"/>
1887                 <xsl:choose>
1888                   <xsl:when test="/bedework/creating = 'true'">
1889                     <xsl:copy-of select="form/start/year/*"/>
1890                   </xsl:when>
1891                   <xsl:otherwise>
1892                     <xsl:copy-of select="form/start/yearText/*"/>
1893                   </xsl:otherwise>
1894                 </xsl:choose>
1895               </div>
1896               <script language="JavaScript" type="text/javascript">
1897               <xsl:comment>
1898                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(/bedework/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedework/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback');
1899               </xsl:comment>
1900               </script>
1901               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1902               <div class="{$timeFieldsClass}" id="startTimeFields">
1903                 <span id="calWidgetStartTimeHider" class="show">
1904                   <xsl:copy-of select="form/start/hour/*"/>
1905                   <xsl:copy-of select="form/start/minute/*"/>
1906                   <xsl:if test="form/start/ampm">
1907                     <xsl:copy-of select="form/start/ampm/*"/>
1908                   </xsl:if>
1909                   <xsl:text> </xsl:text>
1910                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1911                 </span>
1912               </div>
1913             </div>
1914             <div class="dateStartEndBox">
1915               <strong>End:</strong>
1916               <xsl:choose>
1917                 <xsl:when test="form/end/type='E'">
1918                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1919                 </xsl:when>
1920                 <xsl:otherwise>
1921                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1922                 </xsl:otherwise>
1923               </xsl:choose>
1924               Date
1925               <xsl:variable name="endDateTimeClass">
1926                 <xsl:choose>
1927                   <xsl:when test="form/end/type='E'">shown</xsl:when>
1928                   <xsl:otherwise>invisible</xsl:otherwise>
1929                 </xsl:choose>
1930               </xsl:variable>
1931               <div class="{$endDateTimeClass}" id="endDateTime">
1932                 <div class="dateFields">
1933                   <xsl:copy-of select="form/end/dateTime/month/*"/>
1934                   <xsl:copy-of select="form/end/dateTime/day/*"/>
1935                   <xsl:choose>
1936                     <xsl:when test="/bedework/creating = 'true'">
1937                       <xsl:copy-of select="form/end/dateTime/year/*"/>
1938                     </xsl:when>
1939                     <xsl:otherwise>
1940                       <xsl:copy-of select="form/end/dateTime/yearText/*"/>
1941                     </xsl:otherwise>
1942                   </xsl:choose>
1943                 </div>
1944                 <script language="JavaScript" type="text/javascript">
1945                 <xsl:comment>
1946                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(/bedework/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedework/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback');
1947                 </xsl:comment>
1948                 </script>
1949                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1950                 <div class="{$timeFieldsClass}" id="endTimeFields">
1951                   <span id="calWidgetEndTimeHider" class="show">
1952                     <xsl:copy-of select="form/end/dateTime/hour/*"/>
1953                     <xsl:copy-of select="form/end/dateTime/minute/*"/>
1954                     <xsl:if test="form/end/dateTime/ampm">
1955                       <xsl:copy-of select="form/end/dateTime/ampm/*"/>
1956                     </xsl:if>
1957                     <xsl:text> </xsl:text>
1958                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1959                   </span>
1960                 </div>
1961               </div><br/>
1962               <div id="clock" class="invisible">
1963                 <xsl:call-template name="clock"/>
1964               </div>
1965               <div class="dateFields">
1966                 <xsl:choose>
1967                   <xsl:when test="form/end/type='D'">
1968                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1969                   </xsl:when>
1970                   <xsl:otherwise>
1971                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1972                   </xsl:otherwise>
1973                 </xsl:choose>
1974                 Duration
1975                 <xsl:variable name="endDurationClass">
1976                   <xsl:choose>
1977                     <xsl:when test="form/end/type='D'">shown</xsl:when>
1978                     <xsl:otherwise>invisible</xsl:otherwise>
1979                   </xsl:choose>
1980                 </xsl:variable>
1981                 <xsl:variable name="durationHrMinClass">
1982                   <xsl:choose>
1983                     <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1984                     <xsl:otherwise>shown</xsl:otherwise>
1985                   </xsl:choose>
1986                 </xsl:variable>
1987                 <div class="{$endDurationClass}" id="endDuration">
1988                   <xsl:choose>
1989                     <xsl:when test="form/end/duration/weeks/input/@value = '0'">
1990                     <!-- we are using day, hour, minute format -->
1991                     <!-- must send either no week value or week value of 0 (zero) -->
1992                       <div class="durationBox">
1993                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1994                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1995                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1996                         <span id="durationHrMin" class="{$durationHrMinClass}">
1997                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1998                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1999                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
2000                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
2001                         </span>
2002                       </div>
2003                       <span class="durationSpacerText">or</span>
2004                       <div class="durationBox">
2005                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
2006                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
2007                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
2008                       </div>
2009                     </xsl:when>
2010                     <xsl:otherwise>
2011                       <!-- we are using week format -->
2012                       <div class="durationBox">
2013                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
2014                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
2015                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
2016                         <span id="durationHrMin" class="{$durationHrMinClass}">
2017                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
2018                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
2019                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
2020                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
2021                         </span>
2022                       </div>
2023                       <span class="durationSpacerText">or</span>
2024                       <div class="durationBox">
2025                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
2026                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
2027                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
2028                       </div>
2029                     </xsl:otherwise>
2030                   </xsl:choose>
2031                 </div>
2032               </div><br/>
2033               <div class="dateFields" id="noDuration">
2034                 <xsl:choose>
2035                   <xsl:when test="form/end/type='N'">
2036                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
2037                   </xsl:when>
2038                   <xsl:otherwise>
2039                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
2040                   </xsl:otherwise>
2041                 </xsl:choose>
2042                 This event has no duration / end date
2043               </div>
2044             </div>
2045           </td>
2046         </tr>
2047         <!--  Status  -->
2048         <tr>
2049           <td class="fieldname">
2050             Status:
2051           </td>
2052           <td class="fieldval">
2053             <xsl:choose>
2054               <xsl:when test="form/status = 'TENTATIVE'">
2055                 <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
2056               </xsl:when>
2057               <xsl:when test="form/status = 'CANCELLED'">
2058                 <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
2059               </xsl:when>
2060               <xsl:otherwise>
2061                 <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
2062               </xsl:otherwise>
2063             </xsl:choose>
2064           </td>
2065         </tr>
2066         <!--  Transparency  -->
2067         <tr>
2068           <td class="fieldname">
2069             Effects free/busy:
2070           </td>
2071           <td class="fieldval">
2072             <xsl:choose>
2073               <xsl:when test="form/transparency = 'TRANSPARENT'">
2074                 <input type="radio" name="editEvent.transparency" value="OPAQUE"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
2075                 <input type="radio" name="editEvent.transparency" value="TRANSPARENT" checked="checked"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
2076               </xsl:when>
2077               <xsl:otherwise>
2078                 <input type="radio" name="editEvent.transparency" value="OPAQUE" checked="checked"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
2079                 <input type="radio" name="editEvent.transparency" value="TRANSPARENT"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
2080               </xsl:otherwise>
2081             </xsl:choose>
2082           </td>
2083         </tr>
2084         <!--  Description  -->
2085         <tr>
2086           <td class="fieldname">Description:</td>
2087           <td class="fieldval">
2088             <textarea name="editEvent.description" cols="60" rows="4">
2089               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
2090             </textarea>
2091           </td>
2092         </tr>
2093         <tr>
2094           <td class="fieldname">Location:</td>
2095           <td class="fieldval" align="left">
2096             <span class="std-text">choose: </span>
2097             <span id="eventFormLocationList">
2098               <select name="eventLocationId">
2099                 <option value="-1">select...</option>
2100                 <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
2101               </select>
2102             </span>
2103             <span class="std-text"> or add new: </span>
2104             <input type="text" name="laddress" value="" />
2105           </td>
2106         </tr>
2107         <tr>
2108           <td class="fieldname">Event Link:</td>
2109           <td class="fieldval">
2110             <xsl:variable name="link" select="form/link/input/@value"/>
2111             <input type="text" name="editEvent.link" size="80" value="{$link}"/>
2112           </td>
2113         </tr>
2114         <tr>
2115           <td class="fieldname">&#160;</td>
2116           <td class="fieldval">
2117             <input name="submit" type="submit" value="Submit Event"/>&#160;
2118             <input name="cancelled" type="submit" value="Cancel"/>
2119           </td>
2120         </tr>
2121       </table>
2122     </form>
2123
2124     <div id="sharingBox">
2125       <h3>Sharing</h3>
2126       <table class="common">
2127         <tr>
2128           <th class="commonHeader" colspan="2">Current access:</th>
2129         </tr>
2130         <tr>
2131           <th>Owner:</th>
2132           <td class="fieldval">
2133             <xsl:value-of select="name(/bedework/access/acl/ace[principal/property/owner]/grant/*)"/>
2134           </td>
2135         </tr>
2136         <xsl:if test="/bedework/access/acl/ace/principal/href">
2137           <tr>
2138             <th>Users:</th>
2139             <td>
2140               <xsl:for-each select="/bedework/access/acl/ace[principal/href]">
2141                 <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
2142               </xsl:for-each>
2143             </td>
2144           </tr>
2145         </xsl:if>
2146       </table>
2147       <form name="eventShareForm" action="{$event-setAccess}" id="shareForm">
2148         <input type="hidden" name="calPath" value="{$calPath}"/>
2149         <input type="hidden" name="guid" value="{$guid}"/>
2150         <input type="hidden" name="recurid" value="{$recurrenceId}"/>
2151         <p>
2152           Share this event with:<br/>
2153           <input type="text" name="who" size="20"/>
2154           <input type="radio" value="user" name="whoType" checked="checked"/> user
2155           <input type="radio" value="group" name="whoType"/> group
2156         </p>
2157         <p>
2158           Access rights:<br/>
2159           <input type="radio" value="R" name="how" checked="checked"/> read<br/>
2160           <input type="radio" value="Rc" name="how"/> read/write content<br/>
2161           <input type="radio" value="f" name="how"/> read free/busy only<br/>
2162           <input type="radio" value="d" name="how"/> default (reset access)
2163         </p>
2164         <input type="submit" name="submit" value="Submit"/>
2165       </form>
2166     </div>
2167   </xsl:template>
2168
2169   <xsl:template match="event" mode="addEventRef">
2170   <!-- The name "eventForm" is referenced by several javascript functions. Do not
2171     change it without modifying includes.js -->
2172     <form name="eventForm" method="post" action="{$event-addEventRefComplete}" id="standardForm"  enctype="multipart/form-data">
2173       <xsl:variable name="subscriptionId" select="subscription/id"/>
2174       <xsl:variable name="calPath" select="calendar/path"/>
2175       <xsl:variable name="guid" select="guid"/>
2176       <xsl:variable name="recurrenceId" select="recurrenceId"/>
2177       <input type="hidden" name="subid" value="{$subscriptionId}"/>
2178       <input type="hidden" name="calPath" value="{$calPath}"/>
2179       <input type="hidden" name="guid" value="{$guid}"/>
2180       <input type="hidden" name="recurrenceId" value="{$recurrenceId}"/>
2181       <!-- newCalPath is the path to the calendar in which the reference
2182            should be placed.  If no value, then default calendar. -->
2183       <input type="hidden" name="newCalPath" value=""/>
2184
2185       <h2>Add Event Reference</h2>
2186       <table class="common" cellspacing="0">
2187         <tr>
2188           <td class="fieldname">
2189             Event:
2190           </td>
2191           <td>
2192             <xsl:value-of select="summary"/>
2193           </td>
2194         </tr>
2195         <tr>
2196           <td class="fieldname">
2197             Into calendar:
2198           </td>
2199           <td align="left">
2200             <span id="bwEventCalDisplay">
2201               <em>default calendar</em>
2202             </span>
2203             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
2204           </td>
2205         </tr>
2206         <tr>
2207           <td class="fieldname">
2208             Affects Free/busy:
2209           </td>
2210           <td align="left">
2211             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
2212             <input type="radio" value="TRANSPARENT" name="transparency" checked="checked"/> no <span class="note">(transparent: event status does not affect your free/busy)</span>
2213           </td>
2214         </tr>
2215       </table>
2216       <table border="0" id="submitTable">
2217         <tr>
2218           <td>
2219             <input name="submit" type="submit" value="Continue"/>
2220             <input name="cancelled" type="submit" value="Cancel"/>
2221           </td>
2222         </tr>
2223       </table>
2224     </form>
2225   </xsl:template>
2226
2227   <!--+++++++++++++++ Free / Busy ++++++++++++++++++++-->
2228   <xsl:template match="freebusy">
2229     <h2>Free / Busy</h2>
2230     <div id="freeBusyWho">for <xsl:value-of select="day/who"/></div>
2231     <table id="freeBusy">
2232       <tr>
2233         <td>&#160;</td>
2234         <xsl:for-each select="day[position()=1]/period">
2235           <th>
2236             <xsl:choose>
2237               <xsl:when test="number(start) mod 200 = 0">
2238                 <xsl:apply-templates select="start" mode="timeDisplay"/>
2239               </xsl:when>
2240               <xsl:otherwise>
2241                 &#160;
2242               </xsl:otherwise>
2243             </xsl:choose>
2244           </th>
2245         </xsl:for-each>
2246       </tr>
2247       <xsl:for-each select="day">
2248         <tr>
2249           <th>
2250             <xsl:value-of select="substring(start,1,4)"/>-<xsl:value-of select="substring(start,5,2)"/>-<xsl:value-of select="substring(start,7,2)"/>
2251           </th>
2252           <xsl:for-each select="period">
2253             <xsl:variable name="startTime"><xsl:apply-templates  select="start" mode="timeDisplay"/></xsl:variable>
2254             <!-- the start date for the add event link is a concat of the day's date plus the period's time (+ seconds)-->
2255             <xsl:variable name="startDate"><xsl:value-of select="substring(../start,1,8)"/>T<xsl:value-of select="start"/>00</xsl:variable>
2256             <xsl:variable name="minutes" select="length"/>
2257             <xsl:variable name="fbClass">
2258               <xsl:choose>
2259                 <xsl:when test="fbtype = '0'">busy</xsl:when>
2260                 <xsl:when test="fbtype = '3'">tentative</xsl:when>
2261                 <xsl:otherwise>free</xsl:otherwise>
2262               </xsl:choose>
2263             </xsl:variable>
2264             <td class="{$fbClass}">
2265               <a href="{$initEvent}&amp;startdate={$startDate}&amp;minutes={$minutes}" title="{$startTime}">*</a>
2266             </td>
2267           </xsl:for-each>
2268         </tr>
2269       </xsl:for-each>
2270     </table>
2271
2272     <table id="freeBusyKey">
2273       <tr>
2274         <td class="free">*</td>
2275         <td>free</td>
2276         <td>&#160;</td>
2277         <td class="busy">*</td>
2278         <td>busy</td>
2279         <td>&#160;</td>
2280         <td class="tentative">*</td>
2281         <td>tentative</td>
2282         <td>&#160;</td>
2283         <td>
2284           <form name="calendarShareForm" action="{$freeBusy-fetch}">
2285             View user's free/busy:<br/>
2286             <input type="text" name="userid" size="20"/>
2287             <input type="submit" name="submit" value="Submit"/>
2288           </form>
2289         </td>
2290       </tr>
2291     </table>
2292
2293     <div id="sharingBox">
2294       <h3>Sharing</h3>
2295       <table class="common">
2296         <tr>
2297           <th class="commonHeader" colspan="2">Current access:</th>
2298         </tr>
2299         <tr>
2300           <th>Users:</th>
2301           <td>
2302             <xsl:choose>
2303               <xsl:when test="/bedework/myCalendars/calendars/calendar/acl/ace/principal/href">
2304                 <xsl:for-each select="/bedework/myCalendars/calendars/calendar/acl/ace[principal/href]">
2305                   <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
2306                 </xsl:for-each>
2307               </xsl:when>
2308               <xsl:otherwise>
2309                 free/busy not shared
2310               </xsl:otherwise>
2311             </xsl:choose>
2312           </td>
2313         </tr>
2314       </table>
2315       <form name="calendarShareForm" action="{$freeBusy-setAccess}" id="shareForm">
2316         <xsl:variable name="calPath" select="/bedework/myCalendars/calendars/calendar/path"/>
2317         <input type="hidden" name="calPath" value="{$calPath}"/>
2318         <p>
2319           Share my free/busy with:<br/>
2320           <input type="text" name="who" size="20"/>
2321           <input type="radio" value="user" name="whoType" checked="checked"/> user
2322           <input type="radio" value="group" name="whoType"/> group
2323         </p>
2324         <p>
2325           Access rights:<br/>
2326           <input type="radio" value="F" name="how" checked="checked"/> view my free/busy<br/>
2327           <input type="radio" value="d" name="how"/> default (reset access)
2328         </p>
2329         <input type="submit" name="submit" value="Submit"/>
2330       </form>
2331     </div>
2332   </xsl:template>
2333
2334   <xsl:template match="start" mode="timeDisplay">
2335     <xsl:choose>
2336       <xsl:when test="node()=0000">12am</xsl:when>
2337       <xsl:when test="node()=0100">1am</xsl:when>
2338       <xsl:when test="node()=0200">2am</xsl:when>
2339       <xsl:when test="node()=0300">3am</xsl:when>
2340       <xsl:when test="node()=0400">4am</xsl:when>
2341       <xsl:when test="node()=0500">5am</xsl:when>
2342       <xsl:when test="node()=0600">6am</xsl:when>
2343       <xsl:when test="node()=0700">7am</xsl:when>
2344       <xsl:when test="node()=0800">8am</xsl:when>
2345       <xsl:when test="node()=0900">9am</xsl:when>
2346       <xsl:when test="node()=1000">10am</xsl:when>
2347       <xsl:when test="node()=1100">11am</xsl:when>
2348       <xsl:when test="node()=1200">NOON</xsl:when>
2349       <xsl:when test="node()=1300">1pm</xsl:when>
2350       <xsl:when test="node()=1400">2pm</xsl:when>
2351       <xsl:when test="node()=1500">3pm</xsl:when>
2352       <xsl:when test="node()=1600">4pm</xsl:when>
2353       <xsl:when test="node()=1700">5pm</xsl:when>
2354       <xsl:when test="node()=1800">6pm</xsl:when>
2355       <xsl:when test="node()=1900">7pm</xsl:when>
2356       <xsl:when test="node()=2000">8pm</xsl:when>
2357       <xsl:when test="node()=2100">9pm</xsl:when>
2358       <xsl:when test="node()=2200">10pm</xsl:when>
2359       <xsl:when test="node()=2300">11pm</xsl:when>
2360       <xsl:when test="node()=2400">12am</xsl:when>
2361       <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2362     </xsl:choose>
2363   </xsl:template>
2364
2365   <!--+++++++++++++++ Calendars ++++++++++++++++++++-->
2366   <xsl:template match="calendars">
2367     <h2>Manage Calendars</h2>
2368     <table id="calendarTable">
2369       <tr>
2370         <td class="cals">
2371           <h3>Calendars</h3>
2372           <ul class="calendarTree">
2373             <xsl:choose>
2374               <xsl:when test="/bedework/page='calendarDescriptions' or
2375                               /bedework/page='displayCalendar'">
2376                 <xsl:apply-templates select="calendar" mode="listForDisplay"/>
2377               </xsl:when>
2378               <xsl:otherwise>
2379                 <xsl:apply-templates select="calendar" mode="listForUpdate"/>
2380               </xsl:otherwise>
2381             </xsl:choose>
2382           </ul>
2383         </td>
2384         <td class="calendarContent">
2385           <xsl:choose>
2386             <xsl:when test="/bedework/page='calendarList' or
2387                             /bedework/page='calendarReferenced'">
2388               <xsl:call-template name="calendarList"/>
2389             </xsl:when>
2390             <xsl:when test="/bedework/page='calendarDescriptions'">
2391               <xsl:call-template name="calendarDescriptions"/>
2392             </xsl:when>
2393             <xsl:when test="/bedework/page='displayCalendar'">
2394               <xsl:apply-templates select="/bedework/currentCalendar" mode="displayCalendar"/>
2395             </xsl:when>
2396             <xsl:when test="/bedework/page='deleteCalendarConfirm'">
2397               <xsl:apply-templates select="/bedework/currentCalendar" mode="deleteCalendarConfirm"/>
2398             </xsl:when>
2399             <xsl:when test="/bedework/creating='true'">
2400               <xsl:apply-templates select="/bedework/currentCalendar" mode="addCalendar"/>
2401             </xsl:when>
2402             <xsl:otherwise>
2403               <xsl:apply-templates select="/bedework/currentCalendar" mode="modCalendar"/>
2404             </xsl:otherwise>
2405           </xsl:choose>
2406         </td>
2407       </tr>
2408     </table>
2409   </xsl:template>
2410
2411   <xsl:template match="calendar" mode="myCalendars">
2412     <!-- supress Inbox and Outbox for the moment -->
2413     <xsl:if test="(name != 'Inbox') and (name != 'Outbox') and (name != 'Deleted')">
2414       <xsl:variable name="id" select="id"/>
2415       <xsl:variable name="itemClass">
2416         <xsl:choose>
2417           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2418                           and path = /bedework/selectionState/subscriptions/subscription/calendar/path">selected</xsl:when>
2419           <xsl:when test="name='Trash'">trash</xsl:when>
2420           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2421           <xsl:otherwise>calendar</xsl:otherwise>
2422         </xsl:choose>
2423       </xsl:variable>
2424       <li class="{$itemClass}">
2425         <xsl:variable name="calPath" select="path"/>
2426         <a href="{$setSelection}&amp;calUrl={$calPath}">
2427           <xsl:value-of select="name"/>
2428         </a>
2429         <xsl:if test="calendar">
2430           <ul>
2431             <xsl:apply-templates select="calendar" mode="myCalendars"/>
2432           </ul>
2433         </xsl:if>
2434         <xsl:if test="calendarCollection='true'">
2435           <!-- set the start date for adding an event to the first day of the
2436                given period, the hour of "now", and give a duration of 60 minutes -->
2437           <xsl:variable name="startDate"><xsl:value-of select="/bedework/firstday/date"/>T<xsl:value-of select="substring(/bedework/now/time,1,2)"/>0000</xsl:variable>
2438           <!-- skip setting duration for now; this should be set in the user's prefs-->
2439           <!-- <a href="{$initEvent}&amp;startdate={$startDate}&amp;newCalPath={$calPath}&amp;minutes=60" class="calendarAdd" title="add event"> -->
2440           <a href="{$initEvent}&amp;startdate={$startDate}&amp;newCalPath={$calPath}" class="calendarAdd" title="add event">
2441             <img src="{$resourcesRoot}/resources/addEvent-forCals-icon.gif" width="9" height="12" border="0" alt="add event"/>
2442           </a>
2443         </xsl:if>
2444       </li>
2445     </xsl:if>
2446   </xsl:template>
2447
2448   <xsl:template match="calendar" mode="listForUpdate">
2449     <xsl:if test="(name != 'Inbox') and (name != 'Outbox') and (name != 'Deleted')">
2450       <xsl:variable name="calPath" select="encodedPath"/>
2451       <xsl:variable name="itemClass">
2452         <xsl:choose>
2453           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2454           <xsl:otherwise>calendar</xsl:otherwise>
2455         </xsl:choose>
2456       </xsl:variable>
2457       <li class="{$itemClass}">
2458         <a href="{$calendar-fetchForUpdate}&amp;calPath={$calPath}" title="update">
2459           <xsl:value-of select="name"/>
2460         </a>
2461         <xsl:if test="calendarCollection='false'">
2462           <xsl:text> </xsl:text>
2463           <a href="{$calendar-initAdd}&amp;calPath={$calPath}" title="add a calendar or folder">
2464             <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/>
2465           </a>
2466         </xsl:if>
2467         <xsl:if test="calendar">
2468           <ul>
2469             <xsl:apply-templates select="calendar" mode="listForUpdate">
2470               <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2471             </xsl:apply-templates>
2472           </ul>
2473         </xsl:if>
2474       </li>
2475     </xsl:if>
2476   </xsl:template>
2477
2478   <xsl:template match="calendar" mode="listForDisplay">
2479     <xsl:if test="(name != 'Inbox') and (name != 'Outbox') and (name != 'Deleted')">
2480       <xsl:variable name="calPath" select="encodedPath"/>
2481       <xsl:variable name="itemClass">
2482         <xsl:choose>
2483           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2484           <xsl:otherwise>calendar</xsl:otherwise>
2485         </xsl:choose>
2486       </xsl:variable>
2487       <li class="{$itemClass}">
2488         <a href="{$calendar-fetchForDisplay}&amp;calPath={$calPath}" title="display">
2489           <xsl:value-of select="name"/>
2490         </a>
2491         <xsl:if test="calendar">
2492           <ul>
2493             <xsl:apply-templates select="calendar" mode="listForDisplay">
2494               <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2495             </xsl:apply-templates>
2496           </ul>
2497         </xsl:if>
2498       </li>
2499     </xsl:if>
2500   </xsl:template>
2501
2502   <!-- the selectCalForEvent listing creates a calendar tree in a pop-up window
2503        from myCalendars and mySubscriptions -->
2504   <xsl:template name="selectCalForEvent">
2505     <h2>Select a calendar</h2>
2506     <form name="toggleCals" action="{$event-selectCalForEvent}">
2507       <xsl:choose>
2508         <xsl:when test="/bedework/appvar[key='showAllCalsForEvent']/value = 'true'">
2509           <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" onclick="submit()"/>
2510           show only writable calendars
2511           <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" checked="checked" onclick="submit()"/>
2512           show all calendars
2513         </xsl:when>
2514         <xsl:otherwise>
2515           <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" checked="checked" onclick="submit()"/>
2516           show only writable calendars
2517           <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" onclick="submit()"/>
2518           show all calendars
2519         </xsl:otherwise>
2520       </xsl:choose>
2521     </form>
2522     <h4>My Calendars</h4>
2523     <ul class="calendarTree">
2524       <xsl:choose>
2525         <xsl:when test="/bedework/appvar[key='showAllCalsForEvent']/value = 'true'">
2526           <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="selectCalForEventCalTree"/>
2527         </xsl:when>
2528         <xsl:otherwise>
2529           <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar[currentAccess/current-user-privilege-set/privilege/write-content]" mode="selectCalForEventCalTree"/>
2530         </xsl:otherwise>
2531       </xsl:choose>
2532     </ul>
2533     <h4>Subscribed Calendars</h4>
2534     <ul class="calendarTree">
2535       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
2536       <xsl:choose>
2537         <xsl:when test="/bedework/appvar[key='showAllCalsForEvent']/value = 'true'">
2538           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]/calendars/calendar" mode="selectCalForEventCalTree"/>
2539         </xsl:when>
2540         <xsl:otherwise>
2541           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]/calendars/calendar[currentAccess/current-user-privilege-set/privilege/write-content]" mode="selectCalForEventCalTree"/>
2542         </xsl:otherwise>
2543       </xsl:choose>
2544     </ul>
2545   </xsl:template>
2546
2547   <xsl:template match="calendar" mode="selectCalForEventCalTree">
2548   <!-- supress Inbox and Outbox for the moment -->
2549     <xsl:if test="(name != 'Inbox') and (name != 'Outbox') and (name != 'Deleted')">
2550       <xsl:variable name="id" select="id"/>
2551       <xsl:variable name="itemClass">
2552         <xsl:choose>
2553           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2554                           and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when>
2555           <xsl:when test="name='Trash'">trash</xsl:when>
2556           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2557           <xsl:otherwise>calendar</xsl:otherwise>
2558         </xsl:choose>
2559       </xsl:variable>
2560       <li class="{$itemClass}">
2561         <xsl:variable name="calPath" select="path"/>
2562         <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
2563         <xsl:variable name="calDisplay">
2564           <xsl:choose>
2565             <xsl:when test="contains(path,$userPath)">
2566               <xsl:value-of select="substring-after(path,$userPath)"/>
2567             </xsl:when>
2568             <xsl:otherwise>
2569               <xsl:value-of select="path"/>
2570             </xsl:otherwise>
2571           </xsl:choose>
2572         </xsl:variable>
2573         <xsl:choose>
2574           <xsl:when test="currentAccess/current-user-privilege-set/privilege/write-content and (calendarCollection = 'true')">
2575             <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}')">
2576               <strong><xsl:value-of select="name"/></strong>
2577             </a>
2578           </xsl:when>
2579           <xsl:otherwise>
2580             <xsl:value-of select="name"/>
2581           </xsl:otherwise>
2582         </xsl:choose>
2583         <xsl:if test="calendar">
2584           <ul>
2585             <xsl:apply-templates select="calendar" mode="selectCalForEventCalTree"/>
2586           </ul>
2587         </xsl:if>
2588       </li>
2589     </xsl:if>
2590   </xsl:template>
2591
2592   <xsl:template match="currentCalendar" mode="addCalendar">
2593     <h3>Add Calendar / Folder</h3>
2594     <form name="addCalForm" action="{$calendar-update}">
2595       <table class="common">
2596         <tr>
2597           <th>Name:</th>
2598           <td>
2599             <xsl:variable name="curCalName" select="name"/>
2600             <input name="calendar.name" value="{$curCalName}" size="40"/>
2601           </td>
2602         </tr>
2603         <tr>
2604           <th>Summary:</th>
2605           <td>
2606             <xsl:variable name="curCalSummary" select="summary"/>
2607             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2608           </td>
2609         </tr>
2610         <tr>
2611           <th>Description:</th>
2612           <td>
2613             <textarea name="calendar.description" cols="40" rows="4">
2614               <xsl:value-of select="desc"/>
2615             </textarea>
2616           </td>
2617         </tr>
2618         <tr>
2619           <th>Calendar/Folder:</th>
2620           <td>
2621             <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2622             <input type="radio" value="false" name="calendarCollection"/> Folder
2623           </td>
2624         </tr>
2625       </table>
2626
2627       <table border="0" id="submitTable">
2628         <tr>
2629           <td>
2630             <input type="submit" name="addCalendar" value="Add Calendar/Folder"/>
2631             <input type="submit" name="cancelled" value="Cancel"/>
2632             <input type="reset" value="Clear"/>
2633           </td>
2634         </tr>
2635       </table>
2636     </form>
2637
2638     <div id="sharingBox">
2639       <h3>Sharing</h3>
2640       Sharing may be added to a calendar once created.
2641     </div>
2642
2643   </xsl:template>
2644
2645   <xsl:template match="currentCalendar" mode="modCalendar">
2646     <xsl:choose>
2647       <xsl:when test="calendarCollection='true'">
2648         <h3>Modify Calendar</h3>
2649       </xsl:when>
2650       <xsl:otherwise>
2651         <h3>Modify Folder</h3>
2652       </xsl:otherwise>
2653     </xsl:choose>
2654     <xsl:variable name="calPath" select="path"/>
2655     <form name="modCalForm" action="{$calendar-update}">
2656       <table class="common">
2657         <tr>
2658           <th class="commonHeader" colspan="2">
2659             <xsl:value-of select="path"/>
2660           </th>
2661         </tr>
2662         <tr>
2663           <th>Name:</th>
2664           <td>
2665             <xsl:value-of select="name"/>
2666           </td>
2667         </tr>
2668         <tr>
2669           <th>Mailing List ID:</th>
2670           <td>
2671             <xsl:value-of select="mailListId"/>
2672           </td>
2673         </tr>
2674         <tr>
2675           <th>Summary:</th>
2676           <td>
2677             <xsl:variable name="curCalSummary" select="summary"/>
2678             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2679           </td>
2680         </tr>
2681         <tr>
2682           <th>Description:</th>
2683           <td>
2684             <textarea name="calendar.description" cols="40" rows="4">
2685               <xsl:value-of select="desc"/>
2686             </textarea>
2687           </td>
2688         </tr>
2689         <tr>
2690           <th>Calendar/Folder:</th>
2691           <td>
2692             <xsl:choose>
2693               <xsl:when test="calendarCollection='true'">
2694                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2695                 <input type="radio" value="false" name="calendarCollection"/> Folder
2696               </xsl:when>
2697               <xsl:otherwise>
2698                 <input type="radio" value="true" name="calendarCollection"/> Calendar
2699                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
2700               </xsl:otherwise>
2701             </xsl:choose>
2702           </td>
2703         </tr>
2704       </table>
2705
2706       <table border="0" id="submitTable">
2707         <tr>
2708           <td>
2709             <xsl:choose>
2710               <xsl:when test="calendarCollection='true'">
2711                 <input type="submit" name="updateCalendar" value="Update Calendar"/>
2712               </xsl:when>
2713               <xsl:otherwise>
2714                 <input type="submit" name="updateCalendar" value="Update Folder"/>
2715               </xsl:otherwise>
2716             </xsl:choose>
2717             <input type="submit" name="cancelled" value="Cancel"/>
2718             <input type="reset" value="Reset"/>
2719           </td>
2720           <td align="right">
2721             <xsl:choose>
2722               <xsl:when test="calendarCollection='true'">
2723                 <input type="submit" name="delete" value="Delete Calendar"/>
2724               </xsl:when>
2725               <xsl:otherwise>
2726                 <input type="submit" name="delete" value="Delete Folder"/>
2727               </xsl:otherwise>
2728             </xsl:choose>
2729           </td>
2730         </tr>
2731       </table>
2732     </form>
2733     <div id="sharingBox">
2734       <h3>Sharing</h3>
2735       <table class="common">
2736         <tr>
2737           <th class="commonHeader" colspan="2">Current access:</th>
2738         </tr>
2739         <tr>
2740           <th>Owner:</th>
2741           <td>
2742             <xsl:value-of select="name(acl/ace[principal/property/owner]/grant/*)"/>
2743           </td>
2744         </tr>
2745         <xsl:if test="acl/ace/principal/href">
2746           <tr>
2747             <th>Users:</th>
2748             <td>
2749               <xsl:for-each select="acl/ace[principal/href]">
2750                 <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
2751               </xsl:for-each>
2752             </td>
2753           </tr>
2754         </xsl:if>
2755       </table>
2756       <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm">
2757         <input type="hidden" name="calPath" value="{$calPath}"/>
2758         <p>
2759           Share with:<br/>
2760           <input type="text" name="who" size="20"/>
2761           <input type="radio" value="user" name="whoType" checked="checked"/> user
2762           <input type="radio" value="group" name="whoType"/> group
2763         </p>
2764         <p>
2765           Access rights:<br/>
2766           <input type="radio" value="R" name="how" checked="checked"/> read<br/>
2767           <input type="radio" value="Rc" name="how"/> read/write content<br/>
2768           <input type="radio" value="f" name="how"/> read free/busy only<br/>
2769           <input type="radio" value="d" name="how"/> default (reset access)
2770         </p>
2771         <input type="submit" name="submit" value="Submit"/>
2772       </form>
2773     </div>
2774   </xsl:template>
2775
2776   <xsl:template name="calendarList">
2777     <h3>Managing Calendars</h3>
2778     <ul>
2779       <li>Select an item from the calendar list on the left to modify
2780       a calendar or folder.</li>
2781       <li>Select the
2782       <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="true" border="0"/>
2783       icon to add a new calendar or folder to the tree.
2784         <ul>
2785           <li>Folders may only contain calendars and subfolders.</li>
2786           <li>Calendars may only contain events (and other calendar items).</li>
2787           <li>
2788             If a calendar is empty, it may be converted to a folder and vice
2789             versa.  If a calendar or folder are not empty, it may not be
2790             converted.
2791           </li>
2792         </ul>
2793       </li>
2794     </ul>
2795   </xsl:template>
2796
2797   <xsl:template name="calendarDescriptions">
2798     <h2>Calendar Information</h2>
2799     <ul>
2800       <li>Select an item from the calendar tree on the left to view all information
2801       about that calendar or folder.  The tree on the left represents the calendar
2802       heirarchy.</li>
2803     </ul>
2804
2805     <p><strong>All Calendar Descriptions:</strong></p>
2806     <table id="flatCalendarDescriptions" cellspacing="0">
2807       <tr>
2808         <th>Name</th>
2809         <th>Description</th>
2810       </tr>
2811       <xsl:for-each select="//calendar">
2812         <xsl:if test="(name != 'Inbox') and (name != 'Outbox') and (name != 'Deleted')">
2813           <xsl:variable name="descClass">
2814             <xsl:choose>
2815               <xsl:when test="position() mod 2 = 0">even</xsl:when>
2816               <xsl:otherwise>odd</xsl:otherwise>
2817             </xsl:choose>
2818           </xsl:variable>
2819           <tr class="{$descClass}">
2820             <td>
2821               <xsl:value-of select="name"/>
2822             </td>
2823             <td>
2824               <xsl:value-of select="desc"/>
2825             </td>
2826           </tr>
2827         </xsl:if>
2828       </xsl:for-each>
2829     </table>
2830   </xsl:template>
2831
2832   <xsl:template match="currentCalendar" mode="displayCalendar">
2833     <h2>Calendar Information</h2>
2834     <table class="common">
2835       <tr>
2836         <th>Name:</th>
2837         <td>
2838           <xsl:value-of select="name"/>
2839         </td>
2840       </tr>
2841       <tr>
2842         <th>Path:</th>
2843         <td>
2844           <xsl:value-of select="path"/>
2845         </td>
2846       </tr>
2847       <tr>
2848         <th>Summary:</th>
2849         <td>
2850           <xsl:value-of select="summary"/>
2851         </td>
2852       </tr>
2853       <tr>
2854         <th>Description:</th>
2855         <td>
2856           <xsl:value-of select="desc"/>
2857         </td>
2858       </tr>
2859     </table>
2860   </xsl:template>
2861
2862   <xsl:template match="currentCalendar" mode="deleteCalendarConfirm">
2863     <xsl:choose>
2864       <xsl:when test="calendarCollection='true'">
2865         <h3>Delete Calendar</h3>
2866         <p>
2867           The following calendar will be deleted.  Continue?
2868         </p>
2869       </xsl:when>
2870       <xsl:otherwise>
2871         <h3>Delete Folder</h3>
2872         <p>
2873           The following folder <em>and all its contents</em> will be deleted.
2874           Continue?
2875         </p>
2876       </xsl:otherwise>
2877     </xsl:choose>
2878
2879     <form name="delCalForm" action="{$calendar-delete}">
2880       <table class="common">
2881         <tr>
2882           <th>Path:</th>
2883           <td>
2884             <xsl:value-of select="path"/>
2885           </td>
2886         </tr>
2887         <tr>
2888           <th>Name:</th>
2889           <td>
2890             <xsl:value-of select="name"/>
2891           </td>
2892         </tr>
2893         <tr>
2894           <th>Summary:</th>
2895           <td>
2896             <xsl:value-of select="summary"/>
2897           </td>
2898         </tr>
2899         <tr>
2900           <th>Description:</th>
2901           <td>
2902             <xsl:value-of select="desc"/>
2903           </td>
2904         </tr>
2905       </table>
2906
2907       <table border="0" id="submitTable">
2908         <tr>
2909           <td>
2910             <input type="submit" name="cancelled" value="Cancel"/>
2911           </td>
2912           <td align="right">
2913             <xsl:choose>
2914               <xsl:when test="calendarCollection='true'">
2915                 <input type="submit" name="delete" value="Yes: Delete Calendar!"/>
2916               </xsl:when>
2917               <xsl:otherwise>
2918                 <input type="submit" name="delete" value="Yes: Delete Folder!"/>
2919               </xsl:otherwise>
2920             </xsl:choose>
2921           </td>
2922         </tr>
2923       </table>
2924     </form>
2925
2926   </xsl:template>
2927
2928   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
2929   <xsl:template match="subscriptions">
2930     <h2>Manage Subscriptions</h2>
2931     <table id="subsTable">
2932       <tr>
2933         <td class="cals">
2934           <p class="smaller">
2935             Select a calendar below to add a <em><strong>new</strong></em>
2936             internal subscription. <!-- or
2937             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
2938             subscribe to an external calendar</a>.-->
2939           </p>
2940           <h3>My calendars</h3>
2941           <ul class="calendarTree">
2942             <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="subscribe"/>
2943           </ul>
2944           <h3>Public calendars</h3>
2945           <ul class="calendarTree">
2946             <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar" mode="subscribe"/>
2947           </ul>
2948         </td>
2949         <td class="subs">
2950           <xsl:choose>
2951             <xsl:when test="/bedework/page='subscriptions'">
2952               <xsl:call-template name="subscriptionList"/>
2953             </xsl:when>
2954             <xsl:when test="/bedework/page='addSubByUri'">
2955               <xsl:call-template name="addSubByUri"/>
2956             </xsl:when>
2957             <xsl:when test="/bedework/creating='true'">
2958               <xsl:apply-templates select="subscription" mode="addSystemSubscription"/>
2959             </xsl:when>
2960             <xsl:otherwise>
2961               <xsl:apply-templates select="subscription" mode="modSubscription"/>
2962             </xsl:otherwise>
2963           </xsl:choose>
2964         </td>
2965       </tr>
2966     </table>
2967   </xsl:template>
2968
2969   <xsl:template match="calendar" mode="subscribe">
2970     <xsl:if test="(name != 'Inbox') and (name != 'Outbox') and (name != 'Deleted')">
2971       <xsl:variable name="calPath" select="encodedPath"/>
2972       <xsl:variable name="itemClass">
2973         <xsl:choose>
2974           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2975           <xsl:otherwise>calendar</xsl:otherwise>
2976         </xsl:choose>
2977       </xsl:variable>
2978       <li class="{$itemClass}">
2979         <a href="{$subscriptions-initAdd}&amp;calPath={$calPath}">
2980           <xsl:value-of select="name"/>
2981         </a>
2982         <xsl:if test="calendar">
2983           <ul>
2984             <xsl:apply-templates select="calendar" mode="subscribe">
2985               <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2986             </xsl:apply-templates>
2987           </ul>
2988         </xsl:if>
2989       </li>
2990     </xsl:if>
2991   </xsl:template>
2992
2993   <!-- add a subscription to a user calendar by user and path; this is actually
2994        a subscription to an arbitrary URI (which we can expose later) -->
2995   <xsl:template name="addSubByUri">
2996     <h3>Add Subscription to User Calendar</h3>
2997     <p class="note">*the subsciption name must be unique</p>
2998     <form name="subscribeForm" action="{$subscriptions-initAdd}" onsubmit="return setSubscriptionUri(this)" method="post">
2999       <table class="common" cellspacing="0">
3000         <tr>
3001           <td class="fieldname">Name:</td>
3002           <td>
3003             <input type="text" value="" name="name" size="60"/>
3004           </td>
3005         </tr>
3006         <!-- the following would be for an arbitrary URI.  We'll add this later.
3007         <tr>
3008           <td class="fieldname">Uri:</td>
3009           <td>
3010             <input type="text" value="" name="calUri" size="60"/>
3011           </td>
3012         </tr>-->
3013         <tr>
3014           <td class="fieldname">User ID:</td>
3015           <td>
3016             <input type="hidden" value="" name="calUri"/>
3017             <input type="text" value="" name="userId" size="20"/>
3018             <span class="note">ex: douglm</span>
3019           </td>
3020         </tr>
3021         <tr>
3022           <td class="fieldname">User path:</td>
3023           <td>
3024             <input type="text" value="" name="userPath" size="20"/>
3025             <span class="note">(optional) ex: someDept/meetings</span>
3026           </td>
3027         </tr>
3028         <!--<tr>
3029           <td class="fieldname">Display:</td>
3030           <td>
3031             <input type="radio" value="true" name="display" checked="checked"/> yes
3032             <input type="radio" value="false" name="display"/> no
3033           </td>
3034         </tr>-->
3035         <tr>
3036           <td class="fieldname">Affects Free/Busy:</td>
3037           <td>
3038             <input type="radio" value="true" name="affectsFreeBusy"/> yes
3039             <input type="radio" value="false" name="affectsFreeBusy" checked="checked"/> no
3040           </td>
3041         </tr>
3042         <tr>
3043           <td class="fieldname">Style:</td>
3044           <td>
3045             <select name="style">
3046               <option value="default">default</option>
3047               <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
3048                 <xsl:variable name="subColor" select="."/>
3049                 <option value="{$subColor}" class="{$subColor}">
3050                   <xsl:value-of select="@name"/>
3051                 </option>
3052               </xsl:for-each>
3053             </select>
3054           </td>
3055         </tr>
3056         <!--<tr>
3057           <td class="fieldname">Unremovable:</td>
3058           <td>
3059             <input type="radio" value="true" name="unremoveable" size="60"/> true
3060             <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
3061           </td>
3062         </tr>-->
3063       </table>
3064       <table border="0" id="submitTable">
3065         <tr>
3066           <td>
3067             <input type="submit" name="addSubscription" value="Add Subscription"/>
3068             <input type="submit" name="cancelled" value="Cancel"/>
3069             <input type="reset" value="Clear"/>
3070           </td>
3071         </tr>
3072       </table>
3073     </form>
3074   </xsl:template>
3075
3076   <!-- add a subscription to a public calendar within the system -->
3077   <xsl:template match="subscription" mode="addSystemSubscription">
3078     <h3>Add New Subscription</h3>
3079     <p class="note">*the subsciption name must be unique</p>
3080     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
3081       <table class="common" cellspacing="0">
3082         <tr>
3083           <td class="fieldname">Name:</td>
3084           <td>
3085             <xsl:variable name="subName" select="name"/>
3086             <input type="text" value="{$subName}" name="name" size="60"/>
3087           </td>
3088         </tr>
3089         <xsl:if test="internal='false'">
3090           <tr>
3091             <td class="fieldname">Uri:</td>
3092             <td>
3093               <xsl:variable name="calPath" select="uri"/>
3094               <input type="text" value="{$calPath}" name="calPath" size="60"/>
3095             </td>
3096           </tr>
3097         </xsl:if>
3098         <!--<tr>
3099           <td class="fieldname">Display:</td>
3100           <td>
3101             <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
3102             <input type="radio" value="false" name="subscription.display"/> no
3103           </td>
3104         </tr>-->
3105         <tr>
3106           <td class="fieldname">Affects Free/Busy:</td>
3107           <td>
3108             <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes
3109             <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no
3110           </td>
3111         </tr>
3112         <tr>
3113           <td class="fieldname">Style:</td>
3114           <td>
3115             <select name="subscription.style">
3116               <option value="default">default</option>
3117               <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
3118                 <xsl:variable name="subColor" select="."/>
3119                 <option value="{$subColor}" class="{$subColor}">
3120                   <xsl:value-of select="@name"/>
3121                 </option>
3122               </xsl:for-each>
3123             </select>
3124           </td>
3125         </tr>
3126         <!--<tr>
3127           <td class="fieldname">Unremovable:</td>
3128           <td>
3129             <input type="radio" value="true" name="subscription.unremoveable" size="60"/> true
3130             <input type="radio" value="false" name="subscription.unremoveable" size="60" checked="checked"/> false
3131           </td>
3132         </tr>-->
3133       </table>
3134       <table border="0" id="submitTable">
3135         <tr>
3136           <td>
3137             <input type="submit" name="addSubscription" value="Add Subscription"/>
3138             <input type="submit" name="cancelled" value="Cancel"/>
3139             <input type="reset" value="Clear"/>
3140           </td>
3141         </tr>
3142       </table>
3143     </form>
3144   </xsl:template>
3145
3146   <xsl:template match="subscription" mode="modSubscription">
3147     <h3>Modify Subscription</h3>
3148     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
3149       <table class="common" cellspacing="0">
3150         <tr>
3151           <td class="fieldname">Name:</td>
3152           <td>
3153             <xsl:value-of select="name"/>
3154             <xsl:variable name="subName" select="name"/>
3155             <input type="hidden" value="{$subName}" name="name"/>
3156           </td>
3157         </tr>
3158         <xsl:choose>
3159           <xsl:when test="internal='false'">
3160             <tr>
3161               <td class="fieldname">Uri:</td>
3162               <td>
3163                 <xsl:variable name="subUri" select="uri"/>
3164                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
3165               </td>
3166             </tr>
3167           </xsl:when>
3168           <xsl:otherwise>
3169             <tr>
3170               <td class="fieldname">Uri:</td>
3171               <td>
3172                 <xsl:value-of select="uri"/>
3173               </td>
3174             </tr>
3175           </xsl:otherwise>
3176         </xsl:choose>
3177         <!-- <tr>
3178           <td class="fieldname">Display:</td>
3179           <td>
3180             <xsl:choose>
3181               <xsl:when test="display='true'">
3182                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
3183                 <input type="radio" value="false" name="subscription.display"/> no
3184               </xsl:when>
3185               <xsl:otherwise>
3186                 <input type="radio" value="true" name="subscription.display"/> yes
3187                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
3188               </xsl:otherwise>
3189             </xsl:choose>
3190           </td>
3191         </tr> -->
3192         <tr>
3193           <td class="fieldname">Affects Free/Busy:</td>
3194           <td>
3195             <xsl:choose>
3196               <xsl:when test="affectsFreeBusy='true'">
3197                 <input type="radio" value="true" name="subscription.affectsFreeBusy" checked="checked"/> yes
3198                 <input type="radio" value="false" name="subscription.affectsFreeBusy"/> no
3199               </xsl:when>
3200               <xsl:otherwise>
3201                 <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes
3202                 <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no
3203               </xsl:otherwise>
3204             </xsl:choose>
3205           </td>
3206         </tr>
3207         <tr>
3208           <td class="fieldname">Style:</td>
3209           <td>
3210             <xsl:variable name="subStyle" select="style"/>
3211             <select name="subscription.style">
3212               <option value="default">default</option>
3213               <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
3214                 <xsl:variable name="subColor" select="."/>
3215                 <xsl:choose>
3216                   <xsl:when test="$subStyle = $subColor">
3217                     <option value="{$subColor}" class="{$subColor}" selected="selected">
3218                       <xsl:value-of select="@name"/>
3219                     </option>
3220                   </xsl:when>
3221                   <xsl:otherwise>
3222                     <option value="{$subColor}" class="{$subColor}">
3223                       <xsl:value-of select="@name"/>
3224                     </option>
3225                   </xsl:otherwise>
3226                 </xsl:choose>
3227               </xsl:for-each>
3228             </select>
3229           </td>
3230         </tr>
3231         <!--<tr>
3232           <td class="fieldname">Unremovable:</td>
3233           <td>
3234             <xsl:choose>
3235               <xsl:when test="unremoveable='true'">
3236                 <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
3237                 <input type="radio" value="false" name="unremoveable" size="60"/> false
3238               </xsl:when>
3239               <xsl:otherwise>
3240                 <input type="radio" value="true" name="unremoveable" size="60"/> true
3241                 <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
3242               </xsl:otherwise>
3243             </xsl:choose>
3244           </td>
3245         </tr>-->
3246       </table>
3247       <table border="0" id="submitTable">
3248         <tr>
3249           <td>
3250             <input type="submit" name="updateSubscription" value="Update Subscription"/>
3251             <input type="submit" name="cancelled" value="Cancel"/>
3252             <input type="reset" value="Reset"/>
3253           </td>
3254           <td align="right">
3255             <input type="submit" name="delete" value="Delete Subscription"/>
3256           </td>
3257         </tr>
3258       </table>
3259     </form>
3260   </xsl:template>
3261
3262   <xsl:template name="subscriptionList">
3263     <h3>Current subscriptions</h3>
3264     <table class="common" cellspacing="0">
3265       <tr>
3266         <th>Name</th>
3267         <th>URI</th>
3268         <th>Style</th>
3269         <!--<th>Display</th>-->
3270         <th>Free/Busy</th>
3271         <!--<th>Unremovable</th>
3272         <th>External</th>
3273         <th>Deleted?</th>-->
3274       </tr>
3275       <xsl:for-each select="subscription">
3276         <xsl:variable name="style" select="style"/>
3277         <tr>
3278           <td>
3279             <xsl:variable name="subname" select="name"/>
3280             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
3281               <xsl:value-of select="name"/>
3282             </a>
3283           </td>
3284           <td>
3285             <xsl:value-of select="uri"/>
3286           </td>
3287           <td class="{$style}" style="border: none;">
3288             &#160; <!-- just make room and let the style show -->
3289           </td>
3290           <!-- <td class="center">
3291             <xsl:if test="display='true'">
3292               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3293             </xsl:if>
3294           </td> -->
3295           <td class="center">
3296             <xsl:if test="affectsFreeBusy='true'">
3297               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3298             </xsl:if>
3299           </td>
3300           <!--<td class="center">
3301             <xsl:if test="unremoveable='true'">
3302               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3303             </xsl:if>
3304           </td>
3305           <td class="center">
3306             <xsl:if test="internal='false'">
3307               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3308             </xsl:if>
3309           </td>
3310           <td class="center">
3311             <xsl:if test="calendarDeleted='true'">
3312               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3313             </xsl:if>
3314           </td>-->
3315         </tr>
3316       </xsl:for-each>
3317     </table>
3318     <h4><a href="{$subscriptions-addSubByUri}">Subscribe to another user's calendar</a></h4>
3319   </xsl:template>
3320
3321   <xsl:template match="subscription" mode="mySubscriptions">
3322     <xsl:variable name="itemClass">
3323       <xsl:choose>
3324         <xsl:when test="/bedework/selectionState/selectionType = 'subscription'
3325                         and /bedework/selectionState/subscriptions/subscription/name = name">selected</xsl:when>
3326         <xsl:otherwise>calendar</xsl:otherwise>
3327       </xsl:choose>
3328     </xsl:variable>
3329     <li class="{$itemClass}">
3330       <xsl:variable name="subName" select="name"/>
3331       <xsl:if test="style != '' and style != 'default'">
3332         <!-- the spacer gif approach allows us to avoid some IE misbehavior -->
3333         <xsl:variable name="subStyle" select="style"/>
3334         <img src="{$resourcesRoot}/resources/spacer.gif" width="6" height="6" alt="subscription style" class="subStyle {$subStyle}"/>
3335       </xsl:if>
3336       <a href="{$setSelection}&amp;subname={$subName}">
3337         <xsl:value-of select="name"/>
3338       </a>
3339       <xsl:if test="calendars/calendar/calendarCollection='true' and
3340                     calendars/calendar/currentAccess/current-user-privilege-set/privilege/write-content">
3341         <!-- set the start date for adding an event to the first day of the
3342              given period, the hour of "now", and give a duration of 60 minutes -->
3343         <xsl:variable name="calPath" select="calendars/calendar/encodedPath"/>
3344         <xsl:variable name="startDate"><xsl:value-of select="/bedework/firstday/date"/>T<xsl:value-of select="substring(/bedework/now/time,1,2)"/>0000</xsl:variable>
3345         <a href="{$initEvent}&amp;startdate={$startDate}&amp;newCalPath={$calPath}&amp;minutes=60" class="calendarAdd" title="add event">
3346           <img src="{$resourcesRoot}/resources/addEvent-forCals-icon.gif" width="9" height="12" border="0" alt="add event"/>
3347         </a>
3348       </xsl:if>
3349     </li>
3350   </xsl:template>
3351
3352   <!--==== ALARM OPTIONS ====-->
3353   <xsl:template name="alarmOptions">
3354     <form method="post" action="{$setAlarm}" id="standardForm">
3355       <input type="hidden" name="updateAlarmOptions" value="true"/>
3356       <table class="common" cellspacing="0">
3357         <tr>
3358           <th colspan="2" class="commonHeader">Alarm options</th>
3359         </tr>
3360         <tr>
3361           <td class="fieldname">
3362             Alarm Date/Time:
3363             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDate/*"/>
3364           </td>
3365           <td class="fieldval">
3366             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmdate/*"/>
3367             <span class="std-text">at  </span>
3368             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmtime/*"/>
3369           </td>
3370         </tr>
3371         <tr>
3372           <td class="fieldname">
3373             or Before/After event:
3374             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDuration/*"/>
3375           </td>
3376           <td align="left">
3377             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/days/*"/>
3378             days
3379             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/hours/*"/>
3380             hours
3381             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/minutes/*"/>
3382             minutes
3383             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/seconds/*"/>
3384             seconds OR:
3385             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/weeks/*"/>
3386             weeks
3387             &#160;
3388             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationBefore/*"/>
3389             before
3390             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationAfter/*"/>
3391             after
3392             &#160;
3393             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelStart/*"/>
3394             start
3395             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelEnd/*"/>
3396             end
3397           </td>
3398         </tr>
3399         <tr>
3400           <td>
3401             Email Address:
3402           </td>
3403           <td align="left">
3404             <xsl:copy-of select="/bedework/alarmoptionsform/form/email/*"/>
3405           </td>
3406         </tr>
3407         <tr>
3408           <td>
3409             Subject:
3410           </td>
3411           <td align="left">
3412             <xsl:copy-of select="/bedework/alarmoptionsform/form/subject/*"/>
3413           </td>
3414         </tr>
3415         <tr>
3416           <td>&#160;</td>
3417           <td>
3418             <input name="submit" type="submit" value="Continue"/>&#160;
3419             <input name="cancelled" type="submit" value="Cancel"/>
3420           </td>
3421         </tr>
3422       </table>
3423     </form>
3424   </xsl:template>
3425
3426   <!--==== UPLOAD ====-->
3427   <xsl:template name="upload">
3428   <!-- The name "eventForm" is referenced by several javascript functions. Do not
3429     change it without modifying includes.js -->
3430     <form name="eventForm" method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
3431       <h2>Upload iCAL File</h2>
3432       <table class="common" cellspacing="0">
3433         <tr>
3434           <td class="fieldname">
3435             Filename:
3436           </td>
3437           <td align="left">
3438             <input type="file" name="uploadFile" size="60" />
3439           </td>
3440         </tr>
3441         <tr>
3442           <td class="fieldname padMeTop">
3443             Into calendar:
3444           </td>
3445           <td align="left" class="padMeTop">
3446             <input type="hidden" name="newCalPath" value=""/>
3447             <span id="bwEventCalDisplay">
3448               <em>default calendar</em>
3449             </span>
3450             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
3451           </td>
3452         </tr>
3453         <tr>
3454           <td class="fieldname padMeTop">
3455             Effects free/busy:
3456           </td>
3457           <td align="left" class="padMeTop">
3458             <input type="radio" value="" name="transparency" checked="checked"/> accept event's settings<br/>
3459             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
3460             <input type="radio" value="TRANSPARENT" name="transparency"/> no <span class="note">(transparent: event status does not affect your free/busy)</span><br/>
3461           </td>
3462         </tr>
3463         <tr>
3464           <td class="fieldname padMeTop">
3465             Status:
3466           </td>
3467           <td align="left" class="padMeTop">
3468             <input type="radio" value="" name="status" checked="checked"/> accept event's status<br/>
3469             <input type="radio" value="CONFIRMED" name="status"/> confirmed<br/>
3470             <input type="radio" value="TENTATIVE" name="status"/> tentative<br/>
3471             <input type="radio" value="CANCELLED" name="status"/> cancelled<br/>
3472           </td>
3473         </tr>
3474       </table>
3475       <table border="0" id="submitTable">
3476         <tr>
3477           <td>
3478             <input name="submit" type="submit" value="Continue"/>
3479             <input name="cancelled" type="submit" value="Cancel"/>
3480           </td>
3481         </tr>
3482       </table>
3483     </form>
3484   </xsl:template>
3485
3486   <!--==== EMAIL OPTIONS ====-->
3487   <xsl:template name="emailOptions">
3488     <form method="post" action="{$mailEvent}" id="standardForm">
3489       <input type="hidden" name="updateEmailOptions" value="true"/>
3490       <table class="common" cellspacing="0">
3491         <tr>
3492           <th colspan="2" class="commonHeader">Update email options</th>
3493         </tr>
3494         <tr>
3495           <td>
3496
3497             Email Address:
3498           </td>
3499           <td align="left">
3500             <xsl:copy-of select="/bedework/emailoptionsform/form/email/*"/>
3501           </td>
3502         </tr>
3503         <tr>
3504           <td>
3505             Subject:
3506           </td>
3507           <td align="left">
3508             <xsl:copy-of select="/bedework/emailoptionsform/form/subject/*"/>
3509           </td>
3510         </tr>
3511         <tr>
3512           <td>&#160;</td>
3513           <td>
3514             <input name="submit" type="submit" value="Continue"/>&#160;
3515             <input name="cancelled" type="submit" value="Cancel"/>
3516           </td>
3517         </tr>
3518       </table>
3519     </form>
3520   </xsl:template>
3521
3522   <!--==== MANAGE LOCATIONS ====-->
3523   <xsl:template name="manageLocations">
3524     <form name="addLocationForm" method="post" action="{$addLocation}" id="standardForm">
3525       <input type="hidden" name="confirmationid" value="{$confId}"/>
3526       <h2>Manage Locations</h2>
3527       <table class="common" cellspacing="0">
3528         <tr>
3529           <th class="commonHeader" colspan="2">Add Location</th>
3530         </tr>
3531         <tr>
3532           <td class="fieldname">
3533             Main Address:
3534           </td>
3535           <td>
3536             <input size="60" name="newLocation.address" type="text"/>
3537           </td>
3538         </tr>
3539         <tr>
3540           <td class="fieldname">
3541             Subaddress:
3542           </td>
3543           <td>
3544             <input size="60" name="newLocation.subaddress" type="text"/>
3545           </td>
3546         </tr>
3547         <tr>
3548           <td class="fieldname">
3549             Location Link:
3550           </td>
3551           <td>
3552             <input size="60" name="newLocation.link" type="text"/>
3553           </td>
3554         </tr>
3555       </table>
3556       <table border="0" id="submitTable">
3557         <tr>
3558           <td>
3559             <input name="submit" type="submit" value="Submit Location"/>
3560             <input name="cancelled" type="submit" value="Cancel"/>
3561           </td>
3562         </tr>
3563       </table>
3564     </form>
3565     <div style="margin-bottom: 1em;">&#160;</div>
3566     <xsl:call-template name="editLocationList"/>
3567   </xsl:template>
3568
3569   <!--==== EDIT LOCATION ====-->
3570   <xsl:template match="formElements" mode="editLocation">
3571     <form name="editLocationForm" method="post" action="{$editLocation}" id="standardForm">
3572       <input type="hidden" name="updateLocation" value="true"/>
3573       <input type="hidden" name="confirmationid" value="{$confId}"/>
3574       <h2>Manage Locations</h2>
3575       <table class="common" cellspacing="0">
3576         <tr>
3577           <th colspan="2" class="commonHeader">
3578             Edit Location
3579           </th>
3580         </tr>
3581         <tr>
3582           <td class="fieldname">
3583             Main Address:
3584           </td>
3585           <td align="left">
3586             <xsl:variable name="addr" select="form/address/input/@value"/>
3587             <input size="60" name="editLocation.address" value="{$addr}" type="text"/>
3588           </td>
3589         </tr>
3590         <tr>
3591           <td class="fieldname">
3592             Subaddress:
3593           </td>
3594           <td align="left">
3595             <xsl:variable name="subaddr" select="form/subaddress/textarea"/>
3596             <input size="60" name="editLocation.subaddress" value="{$subaddr}" type="text"/>
3597           </td>
3598         </tr>
3599         <tr>
3600           <td class="fieldname">
3601             Location Link:
3602           </td>
3603           <td>
3604             <xsl:variable name="link" select="form/link/input/@value"/>
3605             <input size="60" name="editLocation.link" value="{$link}" type="text"/>
3606           </td>
3607         </tr>
3608       </table>
3609       <table border="0" id="submitTable">
3610         <tr>
3611           <td>
3612             <input name="submit" type="submit" value="Submit Location"/>
3613             <input name="cancelled" type="submit" value="Cancel"/>
3614             <input type="reset" value="Reset"/>
3615           </td>
3616           <td align="right">
3617             <xsl:variable name="locId" select="form/id"/>
3618             <a href="{$delLocation}&amp;locationId={$locId}">
3619               <input type="button" name="delete" value="Delete Location"/>
3620             </a>
3621           </td>
3622         </tr>
3623       </table>
3624     </form>
3625     <div style="margin-bottom: 1em;">&#160;</div>
3626     <xsl:call-template name="editLocationList"/>
3627   </xsl:template>
3628
3629   <xsl:template name="editLocationList">
3630     <table class="common" cellspacing="0">
3631       <tr>
3632         <th class="commonHeader" colspan="2">Edit/Delete Locations</th>
3633       </tr>
3634       <td colspan="2" class="plain">
3635         <ul>
3636           <xsl:for-each select="/bedework/formElements/form/locationmenu/select/option[@value>'3']">
3637             <xsl:sort select="."/>
3638             <li>
3639               <xsl:variable name="locationId" select="@value"/>
3640               <a href="{$editLocation}&amp;locationId={$locationId}"><xsl:value-of select="."/></a>
3641             </li>
3642           </xsl:for-each>
3643         </ul>
3644       </td>
3645     </table>
3646   </xsl:template>
3647
3648   <!--==== PREFERENCES ====-->
3649   <xsl:template match="prefs">
3650     <h2>Manage Preferences</h2>
3651     <!-- The name "eventForm" is referenced by several javascript functions. Do not
3652     change it without modifying includes.js -->
3653     <form name="eventForm" method="post" action="{$prefs-update}" onSubmit="setWorkDays(this)">
3654       <table class="common">
3655         <tr><td colspan="2" class="fill">User settings:</td></tr>
3656         <tr>
3657           <td class="fieldname">
3658             User:
3659           </td>
3660           <td>
3661             <xsl:value-of select="user"/>
3662             <xsl:variable name="user" select="user"/>
3663             <input type="hidden" name="user" value="{$user}"/>
3664           </td>
3665         </tr>
3666         <tr>
3667           <td class="fieldname">
3668             Email address:
3669           </td>
3670           <td>
3671             <xsl:variable name="email" select="email"/>
3672             <input type="text" name="email" value="{$email}" size="40"/>
3673           </td>
3674         </tr>
3675         <tr><td colspan="2">&#160;</td></tr>
3676         <tr><td colspan="2" class="fill">Adding events:</td></tr>
3677         <!-- hide if only one calendar to select -->
3678         <xsl:if test="count(/bedework/myCalendars/calendars//calendar[currentAccess/current-user-privilege-set/privilege/write-content and calType = '1']) &gt; 1">
3679           <tr>
3680             <td class="fieldname">
3681               Default calendar:
3682             </td>
3683             <td>
3684               <xsl:variable name="newCalPath" select="defaultCalendar/path"/>
3685               <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
3686               <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
3687               <span id="bwEventCalDisplay">
3688                 <xsl:choose>
3689                   <xsl:when test="contains(defaultCalendar,$userPath)">
3690                     <xsl:value-of select="substring-after(defaultCalendar,$userPath)"/>
3691                   </xsl:when>
3692                   <xsl:otherwise>
3693                     <xsl:value-of select="defaultCalendar"/>
3694                   </xsl:otherwise>
3695                 </xsl:choose>
3696               </span>
3697               <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
3698             </td>
3699           </tr>
3700         </xsl:if>
3701         <tr>
3702           <td class="fieldname">
3703             Preferred end date/time type:
3704           </td>
3705           <td>
3706             <select name="preferredEndType">
3707               <xsl:choose>
3708                 <xsl:when test="preferredEndType = 'duration'">
3709                   <option value="duration" selected="selected">duration</option>
3710                 </xsl:when>
3711                 <xsl:otherwise>
3712                   <option value="duration">duration</option>
3713                 </xsl:otherwise>
3714               </xsl:choose>
3715               <xsl:choose>
3716                 <xsl:when test="preferredEndType = 'date'">
3717                   <option value="date" selected="selected">date/time</option>
3718                 </xsl:when>
3719                 <xsl:otherwise>
3720                   <option value="date">date/time</option>
3721                 </xsl:otherwise>
3722               </xsl:choose>
3723             </select>
3724           </td>
3725         </tr>
3726         <tr><td colspan="2">&#160;</td></tr>
3727         <tr><td colspan="2" class="fill">Workday settings:</td></tr>
3728         <tr>
3729           <td class="fieldname">
3730             Workdays:
3731           </td>
3732           <td>
3733             <xsl:variable name="workDays" select="workDays"/>
3734             <input type="hidden" name="workDays" value="{$workDays}"/>
3735             <xsl:choose>
3736               <xsl:when test="substring(workDays,1,1) = 'W'">
3737                 <input type="checkbox" name="workDayIndex" value="0" checked="checked"/>Sun
3738               </xsl:when>
3739               <xsl:otherwise>
3740                 <input type="checkbox" name="workDayIndex" value="0"/>Sun
3741               </xsl:otherwise>
3742             </xsl:choose>
3743             <xsl:choose>
3744               <xsl:when test="substring(workDays,2,1) = 'W'">
3745                 <input type="checkbox" name="workDayIndex" value="1" checked="checked"/>Mon
3746               </xsl:when>
3747               <xsl:otherwise>
3748                 <input type="checkbox" name="workDayIndex" value="1"/>Mon
3749               </xsl:otherwise>
3750             </xsl:choose>
3751             <xsl:choose>
3752               <xsl:when test="substring(workDays,3,1) = 'W'">
3753                 <input type="checkbox" name="workDayIndex" value="2" checked="checked"/>Tue
3754               </xsl:when>
3755               <xsl:otherwise>
3756                 <input type="checkbox" name="workDayIndex" value="2"/>Tue
3757               </xsl:otherwise>
3758             </xsl:choose>
3759             <xsl:choose>
3760               <xsl:when test="substring(workDays,4,1) = 'W'">
3761                 <input type="checkbox" name="workDayIndex" value="3" checked="checked"/>Wed
3762               </xsl:when>
3763               <xsl:otherwise>
3764                 <input type="checkbox" name="workDayIndex" value="3"/>Wed
3765               </xsl:otherwise>
3766             </xsl:choose>
3767             <xsl:choose>
3768               <xsl:when test="substring(workDays,5,1) = 'W'">
3769                 <input type="checkbox" name="workDayIndex" value="4" checked="checked"/>Thu
3770               </xsl:when>
3771               <xsl:otherwise>
3772                 <input type="checkbox" name="workDayIndex" value="4"/>Thu
3773               </xsl:otherwise>
3774             </xsl:choose>
3775             <xsl:choose>
3776               <xsl:when test="substring(workDays,6,1) = 'W'">
3777                 <input type="checkbox" name="workDayIndex" value="5" checked="checked"/>Fri
3778               </xsl:when>
3779               <xsl:otherwise>
3780                 <input type="checkbox" name="workDayIndex" value="5"/>Fri
3781               </xsl:otherwise>
3782             </xsl:choose>
3783             <xsl:choose>
3784               <xsl:when test="substring(workDays,7,1) = 'W'">
3785                 <input type="checkbox" name="workDayIndex" value="6" checked="checked"/>Sat
3786               </xsl:when>
3787               <xsl:otherwise>
3788                 <input type="checkbox" name="workDayIndex" value="6"/>Sat
3789               </xsl:otherwise>
3790             </xsl:choose>
3791           </td>
3792         </tr>
3793         <tr>
3794           <td class="fieldname">
3795             Workday start:
3796           </td>
3797           <td>
3798             <select name="workDayStart">
3799               <xsl:call-template name="buildWorkdayOptionsList">
3800                 <xsl:with-param name="selectedVal" select="workDayStart"/>
3801               </xsl:call-template>
3802             </select>
3803           </td>
3804         </tr>
3805         <tr>
3806           <td class="fieldname">
3807             Workday end:
3808           </td>
3809           <td>
3810             <xsl:variable name="workDayEnd" select="workDayEnd"/>
3811             <select name="workDayEnd">
3812               <xsl:call-template name="buildWorkdayOptionsList">
3813                 <xsl:with-param name="selectedVal" select="workDayEnd"/>
3814               </xsl:call-template>
3815             </select>
3816           </td>
3817         </tr>
3818         <tr><td colspan="2">&#160;</td></tr>
3819         <tr><td colspan="2" class="fill">Display options:</td></tr>
3820         <xsl:if test="/bedework/views/view[position()=2]">
3821           <!-- only display if there is more than one to select -->
3822           <tr>
3823             <td class="fieldname">
3824               Preferred view:
3825             </td>
3826             <td>
3827               <xsl:variable name="preferredView" select="preferredView"/>
3828               <select name="preferredView">
3829                 <xsl:for-each select="/bedework/views/view">
3830                   <xsl:variable name="viewName" select="name"/>
3831                   <xsl:choose>
3832                     <xsl:when test="viewName = $preferredView">
3833                       <option value="{$viewName}" selected="selected"><xsl:value-of select="name"/></option>
3834                     </xsl:when>
3835                     <xsl:otherwise>
3836                       <option value="{$viewName}"><xsl:value-of select="name"/></option>
3837                     </xsl:otherwise>
3838                   </xsl:choose>
3839                 </xsl:for-each>
3840               </select>
3841             </td>
3842           </tr>
3843         </xsl:if>
3844         <tr>
3845           <td class="fieldname">
3846             Preferred view period:
3847           </td>
3848           <td>
3849             <select name="viewPeriod">
3850               <!-- picking the selected item could be done with javascript. for
3851                    now, this will do.  -->
3852               <xsl:choose>
3853                 <xsl:when test="preferredViewPeriod = 'dayView'">
3854                   <option value="dayView" selected="selected">day</option>
3855                 </xsl:when>
3856                 <xsl:otherwise>
3857                   <option value="dayView">day</option>
3858                 </xsl:otherwise>
3859               </xsl:choose>
3860               <xsl:choose>
3861                 <xsl:when test="preferredViewPeriod = 'todayView'">
3862                   <option value="todayView" selected="selected">today</option>
3863                 </xsl:when>
3864                 <xsl:otherwise>
3865                   <option value="todayView">today</option>
3866                 </xsl:otherwise>
3867               </xsl:choose>
3868               <xsl:choose>
3869                 <xsl:when test="preferredViewPeriod = 'weekView'">
3870                   <option value="weekView" selected="selected">week</option>
3871                 </xsl:when>
3872                 <xsl:otherwise>
3873                   <option value="weekView">week</option>
3874                 </xsl:otherwise>
3875               </xsl:choose>
3876               <xsl:choose>
3877                 <xsl:when test="preferredViewPeriod = 'monthView'">
3878                   <option value="monthView" selected="selected">month</option>
3879                 </xsl:when>
3880                 <xsl:otherwise>
3881                   <option value="monthView">month</option>
3882                 </xsl:otherwise>
3883               </xsl:choose>
3884               <xsl:choose>
3885                 <xsl:when test="preferredViewPeriod = 'yearView'">
3886                   <option value="yearView" selected="selected">year</option>
3887                 </xsl:when>
3888                 <xsl:otherwise>
3889                   <option value="yearView">year</option>
3890                 </xsl:otherwise>
3891               </xsl:choose>
3892             </select>
3893           </td>
3894         </tr>
3895         <!-- as you add skins, update this list and set the selected flag
3896                  as required; hide if not in use -->
3897         <!--<tr>
3898           <td class="fieldname">
3899             Skin name:
3900           </td>
3901           <td>
3902             <xsl:variable name="skinName" select="skinName"/>
3903             <select name="skin">
3904               <option value="default">default</option>
3905             </select>
3906           </td>
3907         </tr> -->
3908         <!-- if you have skin styles, update this list and set the selected flag
3909                  as required; hide if not in use -->
3910         <!--
3911         <tr>
3912           <td class="fieldname">
3913             Skin style:
3914           </td>
3915           <td>
3916             <xsl:variable name="skinStyle" select="skinStyle"/>
3917             <select name="skinStyle">
3918               <option value="default">default</option>
3919             </select>
3920           </td>
3921         </tr> -->
3922         <!-- hide if not in use: -->
3923         <!--<tr>
3924           <td class="fieldname">
3925             Interface mode:
3926           </td>
3927           <td>
3928             <xsl:variable name="userMode" select="userMode"/>
3929             <select name="userMode">
3930               <xsl:choose>
3931                 <xsl:when test="userMode = 0">
3932                   <option value="0" selected="selected">basic</option>
3933                 </xsl:when>
3934                 <xsl:otherwise>
3935                   <option value="0">basic</option>
3936                 </xsl:otherwise>
3937               </xsl:choose>
3938               <xsl:choose>
3939                 <xsl:when test="userMode = 1">
3940                   <option value="1" selected="selected">simple</option>
3941                 </xsl:when>
3942                 <xsl:otherwise>
3943                   <option value="1">simple</option>
3944                 </xsl:otherwise>
3945               </xsl:choose>
3946               <xsl:choose>
3947                 <xsl:when test="userMode = 3">
3948                   <option value="3" selected="selected">advanced</option>
3949                 </xsl:when>
3950                 <xsl:otherwise>
3951                   <option value="3">advanced</option>
3952                 </xsl:otherwise>
3953               </xsl:choose>
3954             </select>
3955           </td>
3956         </tr>-->
3957       </table>
3958       <br />
3959
3960       <input type="submit" name="modPrefs" value="Update"/>
3961       <input type="reset" value="Reset"/>
3962       <input type="submit" name="cancelled" value="Cancel"/>
3963     </form>
3964   </xsl:template>
3965
3966   <!-- construct the workDay times options listings from minute 0 to less than
3967        minute 1440 (midnight inclusive); initialize the template with the currently
3968        selected value. Change the default value for "increment" here. minTime
3969        and maxTime are constants. -->
3970   <xsl:template name="buildWorkdayOptionsList">
3971     <xsl:param name="selectedVal"/>
3972     <xsl:param name="increment" select="number(30)"/>
3973     <xsl:param name="currentTime" select="number(0)"/>
3974     <xsl:variable name="minTime" select="number(0)"/>
3975     <xsl:variable name="maxTime" select="number(1440)"/>
3976     <xsl:if test="$currentTime &lt; $maxTime">
3977       <xsl:choose>
3978         <xsl:when test="$currentTime = $selectedVal">
3979           <option value="{$currentTime}" selected="selected">
3980             <xsl:if test="floor($currentTime div 60) &lt; 10">0</xsl:if><xsl:value-of select="floor($currentTime div 60)"/>:<xsl:if test="string-length($currentTime mod 60)=1">0</xsl:if><xsl:value-of select="$currentTime mod 60"/>
3981           </option>
3982         </xsl:when>
3983         <xsl:otherwise>
3984           <option value="{$currentTime}">
3985             <xsl:if test="floor($currentTime div 60) &lt; 10">0</xsl:if><xsl:value-of select="floor($currentTime div 60)"/>:<xsl:if test="string-length($currentTime mod 60)=1">0</xsl:if><xsl:value-of select="$currentTime mod 60"/>
3986           </option>
3987         </xsl:otherwise>
3988       </xsl:choose>
3989       <xsl:call-template name="buildWorkdayOptionsList">
3990         <xsl:with-param name="selectedVal" select="$selectedVal"/>
3991         <xsl:with-param name="currentTime" select="$currentTime + $increment"/>
3992       </xsl:call-template>
3993     </xsl:if>
3994   </xsl:template>
3995
3996   <!--==== SIDE CALENDAR MENU ====-->
3997   <xsl:template match="calendar" mode="sideList">
3998     <xsl:variable name="calPath" select="encodedPath"/>
3999     <div class="std-text">
4000       <a href="{$setSelection}&amp;calPath={$calPath}"><xsl:value-of select="title"/></a>
4001     </div>
4002   </xsl:template>
4003
4004   <!--==== STAND-ALONE PAGES ====-->
4005   <!-- not currently in use -->
4006   <xsl:template name="selectPage">
4007     <!-- <xsl:choose>
4008       <xsl:when test="/bedework/appvar[key='page']">
4009         <xsl:choose>
4010           <xsl:otherwise>
4011             <xsl:call-template name="noPage"/>
4012           </xsl:otherwise>
4013         </xsl:choose>
4014       </xsl:when>
4015       <xsl:otherwise> -->
4016         <xsl:call-template name="noPage"/>
4017       <!--</xsl:otherwise>
4018     </xsl:choose>-->
4019   </xsl:template>
4020
4021   <xsl:template name="noPage">
4022     <p>
4023       Error: there is no page with that name.  Please select a navigational
4024       link to continue.
4025     </p>
4026   </xsl:template>
4027
4028   <!--==== UTILITY TEMPLATES ====-->
4029
4030   <!-- search and replace template taken from
4031        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
4032   <xsl:template name="replace">
4033     <xsl:param name="string" select="''"/>
4034     <xsl:param name="pattern" select="''"/>
4035     <xsl:param name="replacement" select="''"/>
4036     <xsl:choose>
4037       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
4038         <xsl:value-of select="substring-before($string, $pattern)"/>
4039         <xsl:copy-of select="$replacement"/>
4040         <xsl:call-template name="replace">
4041           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
4042           <xsl:with-param name="pattern" select="$pattern"/>
4043           <xsl:with-param name="replacement" select="$replacement"/>
4044         </xsl:call-template>
4045       </xsl:when>
4046       <xsl:otherwise>
4047         <xsl:value-of select="$string"/>
4048       </xsl:otherwise>
4049     </xsl:choose>
4050   </xsl:template>
4051
4052   <!--==== FOOTER ====-->
4053   <xsl:template name="footer">
4054     <div id="footer">
4055       Demonstration calendar; place footer information here.
4056     </div>
4057     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
4058       <tr>
4059         <td class="leftCell">
4060           <a href="http://www.bedework.org/">Bedework Calendar</a> |
4061           <a href="?noxslt=yes">show XML</a> |
4062           <a href="?refreshXslt=yes">refresh XSLT</a>
4063         </td>
4064         <td class="rightCell">
4065           <!--<form name="skinSelectForm" method="post" action="{$setup}">
4066             skin selector:
4067             <select name="skinNameSticky" onChange="submit()">
4068               <option>select a skin</option>
4069               <option value="default">Demo Calendar</option>
4070               <option value="rensselaer">Rensselaer</option>
4071               <option value="washington">Washington</option>
4072             </select>
4073           </form>-->
4074         </td>
4075       </tr>
4076     </table>
4077   </xsl:template>
4078 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.