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

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

updated current access (sharing/acl) display in personal and admin clients

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="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="event-attendeesForEvent" select="/bedework/urlPrefixes/event/attendeesForEvent/a/@href"/>
79   <xsl:variable name="event-showAttendeesForEvent" select="/bedework/urlPrefixes/event/showAttendeesForEvent/a/@href"/>
80   <xsl:variable name="editEvent" select="/bedework/urlPrefixes/editEvent"/>
81   <xsl:variable name="delEvent" select="/bedework/urlPrefixes/delEvent"/>
82   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
83   <xsl:variable name="export" select="/bedework/urlPrefixes/export/a/@href"/>
84   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
85   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
86   <xsl:variable name="manageLocations" select="/bedework/urlPrefixes/manageLocations"/>
87   <xsl:variable name="addLocation" select="/bedework/urlPrefixes/addLocation"/>
88   <xsl:variable name="editLocation" select="/bedework/urlPrefixes/editLocation"/>
89   <xsl:variable name="delLocation" select="/bedework/urlPrefixes/delLocation"/>
90   <xsl:variable name="initEventAlarm" select="/bedework/urlPrefixes/initEventAlarm"/>
91   <xsl:variable name="setAlarm" select="/bedework/urlPrefixes/setAlarm"/>
92   <xsl:variable name="initUpload" select="/bedework/urlPrefixes/initUpload"/>
93   <xsl:variable name="upload" select="/bedework/urlPrefixes/upload"/>
94   <xsl:variable name="freeBusy-fetch" select="/bedework/urlPrefixes/freeBusy/fetch/a/@href"/>
95   <xsl:variable name="freeBusy-setAccess" select="/bedework/urlPrefixes/freeBusy/setAccess/a/@href"/>
96   <!-- calendars -->
97   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
98   <xsl:variable name="calendar-fetch" select="/bedework/urlPrefixes/calendar/fetch/a/@href"/><!-- used -->
99   <xsl:variable name="calendar-fetchDescriptions" select="/bedework/urlPrefixes/calendar/fetchDescriptions/a/@href"/><!-- used -->
100   <xsl:variable name="calendar-initAdd" select="/bedework/urlPrefixes/calendar/initAdd/a/@href"/><!-- used -->
101   <xsl:variable name="calendar-delete" select="/bedework/urlPrefixes/calendar/delete/a/@href"/>
102   <xsl:variable name="calendar-fetchForDisplay" select="/bedework/urlPrefixes/calendar/fetchForDisplay/a/@href"/>
103   <xsl:variable name="calendar-fetchForUpdate" select="/bedework/urlPrefixes/calendar/fetchForUpdate/a/@href"/><!-- used -->
104   <xsl:variable name="calendar-update" select="/bedework/urlPrefixes/calendar/update/a/@href"/><!-- used -->
105   <xsl:variable name="calendar-setAccess" select="/bedework/urlPrefixes/calendar/setAccess/a/@href"/>
106   <xsl:variable name="calendar-trash" select="/bedework/urlPrefixes/calendar/trash/a/@href"/>
107   <xsl:variable name="calendar-emptyTrash" select="/bedework/urlPrefixes/calendar/emptyTrash/a/@href"/>
108   <!-- subscriptions -->
109   <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/>
110   <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/>
111   <xsl:variable name="subscriptions-addSubByUri" select="/bedework/urlPrefixes/subscriptions/addSubByUri/a/@href"/>
112   <xsl:variable name="subscriptions-subscribeByUri" select="/bedework/urlPrefixes/subscriptions/subscribeByUri/a/@href"/>
113   <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/>
114   <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/>
115   <!-- preferences -->
116   <xsl:variable name="prefs-fetchForUpdate" select="/bedework/urlPrefixes/prefs/fetchForUpdate/a/@href"/>
117   <xsl:variable name="prefs-update" select="/bedework/urlPrefixes/prefs/update/a/@href"/>
118   <xsl:variable name="prefs-fetchSchedulingForUpdate" select="/bedework/urlPrefixes/prefs/fetchSchedulingForUpdate/a/@href"/>
119   <xsl:variable name="prefs-setAccess" select="/bedework/urlPrefixes/prefs/setAccess/a/@href"/>
120   <!-- scheduling -->
121   <xsl:variable name="showInbox" select="/bedework/urlPrefixes/schedule/showInbox/a/@href"/>
122   <xsl:variable name="showOutbox" select="/bedework/urlPrefixes/schedule/showOutbox/a/@href"/>
123   <xsl:variable name="schedule-initAttendeeRespond" select="/bedework/urlPrefixes/schedule/initAttendeeRespond/a/@href"/>
124   <xsl:variable name="schedule-attendeeRespond" select="/bedework/urlPrefixes/schedule/attendeeRespond/a/@href"/>
125   <xsl:variable name="schedule-initAttendeeReply" select="/bedework/urlPrefixes/schedule/initAttendeeReply/a/@href"/>
126   <xsl:variable name="schedule-processAttendeeReply" select="/bedework/urlPrefixes/schedule/processAttendeeReply/a/@href"/>
127
128   <!-- URL of the web application - includes web context
129   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/> -->
130
131   <!-- Other generally useful global variables -->
132   <xsl:variable name="confId" select="/bedework/confirmationid"/>
133   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
134   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
135   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
136   <xsl:variable name="skin">default</xsl:variable>
137   <xsl:variable name="publicCal">/cal</xsl:variable>
138
139  <!-- BEGIN MAIN TEMPLATE -->
140   <xsl:template match="/">
141     <html lang="en">
142       <head>
143         <xsl:call-template name="headSection"/>
144       </head>
145       <xsl:variable name="inboxNumActive" select="/bedework/inboxState/numActive"/>
146       <xsl:variable name="inboxChanged" select="/bedework/inboxState/changed"/>
147       <body onload="checkStatus({$inboxNumActive},{$inboxChanged},'{$showInbox}')">
148       <xsl:choose>
149         <xsl:when test="/bedework/page='selectCalForEvent'">
150           <xsl:call-template name="selectCalForEvent"/>
151         </xsl:when>
152         <xsl:otherwise>
153             <xsl:call-template name="headBar"/>
154             <xsl:if test="/bedework/message">
155               <div id="messages">
156                 <xsl:apply-templates select="/bedework/message"/>
157               </div>
158             </xsl:if>
159             <xsl:if test="/bedework/error">
160               <div id="errors">
161                 <xsl:apply-templates select="/bedework/error"/>
162               </div>
163             </xsl:if>
164             <table id="bodyBlock" cellspacing="0">
165               <tr>
166                 <xsl:choose>
167                   <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
168                     <td id="sideBarClosed">
169                       <img src="{$resourcesRoot}/resources/spacer.gif" width="1" height="1" border="0" alt="*"/>
170                     </td>
171                   </xsl:when>
172                   <xsl:otherwise>
173                     <td id="sideBar">
174                       <xsl:call-template name="sideBar"/>
175                     </td>
176                   </xsl:otherwise>
177                 </xsl:choose>
178                 <td id="bodyContent">
179                   <xsl:call-template name="tabs"/>
180                   <xsl:call-template name="navigation"/>
181                   <xsl:choose>
182                     <xsl:when test="/bedework/page='event'">
183                       <!-- show an event -->
184                       <xsl:apply-templates select="/bedework/event"/>
185                     </xsl:when>
186                     <xsl:when test="/bedework/page='addEvent'">
187                       <xsl:call-template name="addEvent"/>
188                     </xsl:when>
189                     <xsl:when test="/bedework/page='addEventRef'">
190                       <xsl:apply-templates select="/bedework/event" mode="addEventRef"/>
191                     </xsl:when>
192                     <xsl:when test="/bedework/page='editEvent'">
193                       <!-- edit an event -->
194                       <xsl:apply-templates select="/bedework/formElements" mode="editEvent"/>
195                     </xsl:when>
196                     <xsl:when test="/bedework/page='alarmOptions'">
197                       <xsl:call-template name="alarmOptions" />
198                     </xsl:when>
199                     <xsl:when test="/bedework/page='upload'">
200                       <xsl:call-template name="upload" />
201                     </xsl:when>
202                     <xsl:when test="/bedework/page='manageLocations'">
203                       <xsl:call-template name="manageLocations" />
204                     </xsl:when>
205                     <xsl:when test="/bedework/page='editLocation'">
206                       <xsl:apply-templates select="/bedework/formElements" mode="editLocation"/>
207                     </xsl:when>
208                     <xsl:when test="/bedework/page='subscriptions' or
209                                     /bedework/page='modSubscription' or
210                                     /bedework/page='addSubByUri'">
211                       <xsl:apply-templates select="/bedework/subscriptions"/>
212                     </xsl:when>
213                     <xsl:when test="/bedework/page='calendarList' or
214                                     /bedework/page='calendarDescriptions' or
215                                     /bedework/page='displayCalendar' or
216                                     /bedework/page='modCalendar' or
217                                     /bedework/page='deleteCalendarConfirm' or
218                                     /bedework/page='calendarReferenced'">
219                       <xsl:apply-templates select="/bedework/calendars"/>
220                     </xsl:when>
221                     <xsl:when test="/bedework/page='freeBusy'">
222                       <xsl:call-template name="utilBar"/>
223                       <xsl:apply-templates select="/bedework/freebusy"/>
224                     </xsl:when>
225                     <xsl:when test="/bedework/page='modPrefs'">
226                       <xsl:apply-templates select="/bedework/prefs"/>
227                     </xsl:when>
228                     <xsl:when test="/bedework/page='modSchedulingPrefs'">
229                       <xsl:apply-templates select="/bedework/schPrefs"/>
230                     </xsl:when>
231                     <xsl:when test="/bedework/page='inbox'">
232                       <xsl:apply-templates select="/bedework/inbox"/>
233                     </xsl:when>
234                     <xsl:when test="/bedework/page='outbox'">
235                       <xsl:apply-templates select="/bedework/outbox"/>
236                     </xsl:when>
237                     <xsl:when test="/bedework/page='attendeeRespond'">
238                       <xsl:apply-templates select="/bedework/formElements" mode="attendeeRespond"/>
239                     </xsl:when>
240                     <xsl:when test="/bedework/page='attendeeReply'">
241                       <xsl:apply-templates select="/bedework/event" mode="attendeeReply"/>
242                     </xsl:when>
243                     <xsl:when test="/bedework/page='other'">
244                       <!-- show an arbitrary page -->
245                       <xsl:call-template name="selectPage"/>
246                     </xsl:when>
247                     <xsl:otherwise>
248                       <!-- otherwise, show the eventsCalendar -->
249                       <xsl:call-template name="utilBar"/>
250                       <!-- main eventCalendar content -->
251                       <xsl:choose>
252                         <xsl:when test="/bedework/periodname='Day'">
253                           <xsl:call-template name="listView"/>
254                         </xsl:when>
255                         <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
256                           <xsl:choose>
257                             <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
258                               <xsl:call-template name="listView"/>
259                             </xsl:when>
260                             <xsl:otherwise>
261                               <xsl:call-template name="weekView"/>
262                             </xsl:otherwise>
263                           </xsl:choose>
264                         </xsl:when>
265                         <xsl:when test="/bedework/periodname='Month'">
266                           <xsl:choose>
267                             <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
268                               <xsl:call-template name="listView"/>
269                             </xsl:when>
270                             <xsl:otherwise>
271                               <xsl:call-template name="monthView"/>
272                             </xsl:otherwise>
273                           </xsl:choose>
274                         </xsl:when>
275                         <xsl:otherwise>
276                           <xsl:call-template name="yearView"/>
277                         </xsl:otherwise>
278                       </xsl:choose>
279                     </xsl:otherwise>
280                   </xsl:choose>
281                 </td>
282               </tr>
283             </table>
284             <!-- footer -->
285             <xsl:call-template name="footer"/>
286           </xsl:otherwise>
287         </xsl:choose>
288       </body>
289     </html>
290   </xsl:template>
291
292   <!--==== HEAD SECTION  ====-->
293
294   <xsl:template name="headSection">
295     <title>Bedework: Personal Calendar Client</title>
296     <meta name="robots" content="noindex,nofollow"/>
297     <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
298     <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/>
299     <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
300     <script type="text/javascript" src="{$resourcesRoot}/resources/dojo-0.3.1-ajax/dojo.js"></script>
301     <script type="text/javascript">
302       dojo.require("dojo.event.*");
303       dojo.require("dojo.io.*");
304       dojo.require("dojo.widget.FloatingPane");
305     </script>
306     <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
307     <xsl:if test="/bedework/page='addEvent' or
308                   /bedework/page='addEventRef' or
309                   /bedework/page='editEvent' or
310                   /bedework/page='selectCalForEvent' or
311                   /bedework/page='upload' or
312                   /bedework/page='addSubByUri' or
313                   /bedework/page='modPrefs' or
314                   /bedework/page='attendeeRespond'">
315       <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
316     </xsl:if>
317     <xsl:if test="/bedework/page='addEvent' or
318                   /bedework/page='editEvent'">
319       <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js"></script>
320       <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
321       <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
322       <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
323       <script type="text/javascript" src="{$resourcesRoot}/resources/browserSniffer.js"></script>
324     </xsl:if>
325     <script type="text/javascript">
326       <xsl:comment>
327       <![CDATA[
328       // Check status of inbox and outbox and alert user appropriately.
329       // Just take care of inbox for now.
330       function checkStatus(inboxCount,changed,url) {
331         if (inboxCount && changed) {
332         alert("You have " + inboxCount + " pending meeting requests.");
333         window.location.replace(url);
334         }
335       }
336       ]]>
337       </xsl:comment>
338     </script>
339   </xsl:template>
340
341   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
342
343   <xsl:template name="headBar">
344     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
345       <tr>
346         <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>
347         <td colspan="2" id="schoolLinksCell">
348           <h2>Personal Calendar</h2>
349           <a href="{$publicCal}">Public Calendar</a> |
350           <a href="http://www.yourschoolhere.edu">School Home</a> |
351           <a href="http://www.bedework.org/">Other Link</a> |
352           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
353             Example Calendar Help
354           </a>
355         </td>
356       </tr>
357     </table>
358     <table id="curDateRangeTable"  cellspacing="0">
359       <tr>
360         <td class="sideBarOpenCloseIcon">
361           <xsl:choose>
362             <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
363               <a href="?setappvar=sidebar(opened)">
364                 <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
365               </a>
366             </xsl:when>
367             <xsl:otherwise>
368               <a href="?setappvar=sidebar(closed)">
369                 <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
370               </a>
371             </xsl:otherwise>
372           </xsl:choose>
373         </td>
374         <td class="date">
375           <xsl:value-of select="/bedework/firstday/longdate"/>
376           <xsl:if test="/bedework/periodname!='Day'">
377             -
378             <xsl:value-of select="/bedework/lastday/longdate"/>
379           </xsl:if>
380         </td>
381         <td class="rssPrint">
382           <a href="javascript:window.print()" title="print this view">
383             <img alt="print this view" src="{$resourcesRoot}/resources/std-print-icon.gif" width="20" height="14" border="0"/> print
384           </a>
385           <a class="rss" href="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
386         </td>
387       </tr>
388     </table>
389   </xsl:template>
390
391   <xsl:template name="sideBar">
392     <h3>
393       <!--<img alt="manage views" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/>-->
394       views
395     </h3>
396     <ul id="myViews">
397       <xsl:choose>
398         <xsl:when test="/bedework/views/view">
399           <xsl:for-each select="/bedework/views/view">
400             <xsl:variable name="viewName" select="name"/>
401             <xsl:choose>
402               <xsl:when test="/bedework/selectionState/selectionType = 'view'
403                               and name=/bedework/selectionState/view/name">
404                 <li class="selected"><a href="{$setSelection}&amp;viewName={$viewName}"><xsl:value-of select="name"/></a></li>
405               </xsl:when>
406               <xsl:otherwise>
407                 <li><a href="{$setSelection}&amp;viewName={$viewName}"><xsl:value-of select="name"/></a></li>
408               </xsl:otherwise>
409             </xsl:choose>
410           </xsl:for-each>
411         </xsl:when>
412         <xsl:otherwise>
413           <li class="none">no views</li>
414         </xsl:otherwise>
415       </xsl:choose>
416     </ul>
417
418     <h3>
419       <a href="{$calendar-fetch}">
420         <img alt="manage calendars" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/> calendars
421       </a>
422     </h3>
423     <!-- normal calendars -->
424     <ul class="calendarTree">
425       <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar/calendar[calType &lt; 2]" mode="myCalendars"/>
426     </ul>
427     <!-- special calendars: inbox, outbox, and trash -->
428     <ul class="calendarTree">
429       <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar/calendar[calType &gt; 1]" mode="mySpecialCalendars"/>
430     </ul>
431
432     <h3>
433       <a href="{$subscriptions-fetch}" title="manage subscriptions">
434         <img alt="manage subscriptions" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/>
435         subscriptions
436       </a>
437     </h3>
438     <ul class="calendarTree">
439       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
440       <xsl:choose>
441         <xsl:when test="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]">
442           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]" mode="mySubscriptions"/>
443         </xsl:when>
444         <xsl:otherwise>
445           <li class="none">no subscriptions</li>
446         </xsl:otherwise>
447       </xsl:choose>
448     </ul>
449
450     <h3>options</h3>
451     <ul id="sideBarMenu">
452       <li><a href="{$manageLocations}">Manage Locations</a></li>
453       <li><a href="{$prefs-fetchForUpdate}">Preferences</a></li>
454     </ul>
455   </xsl:template>
456
457   <xsl:template name="tabs">
458     <xsl:choose>
459       <xsl:when test="/bedework/page='eventscalendar' or /bedework/page='freeBusy'">
460         <xsl:variable name="navAction">
461           <xsl:choose>
462             <xsl:when test="/bedework/page='freeBusy'"><xsl:value-of select="$freeBusy-fetch"/></xsl:when>
463             <xsl:otherwise><xsl:value-of select="$setViewPeriod"/></xsl:otherwise>
464           </xsl:choose>
465         </xsl:variable>
466         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
467           <tr>
468             <td>
469               <xsl:choose>
470                 <xsl:when test="/bedework/periodname='Day'">
471                   <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>
472                 </xsl:when>
473                 <xsl:otherwise>
474                   <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>
475                 </xsl:otherwise>
476               </xsl:choose>
477             </td>
478             <td>
479               <xsl:choose>
480                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
481                   <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>
482                  </xsl:when>
483                 <xsl:otherwise>
484                   <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>
485                  </xsl:otherwise>
486               </xsl:choose>
487             </td>
488             <td>
489               <xsl:choose>
490                 <xsl:when test="/bedework/periodname='Month'">
491                   <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>
492                 </xsl:when>
493                 <xsl:otherwise>
494                   <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>
495                 </xsl:otherwise>
496               </xsl:choose>
497             </td>
498             <td>
499               <xsl:choose>
500                 <!-- don't allow switching to year for free busy view, so only use setViewPeriod action -->
501                 <xsl:when test="/bedework/periodname='Year'">
502                   <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>
503                 </xsl:when>
504                 <xsl:otherwise>
505                   <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>
506                 </xsl:otherwise>
507               </xsl:choose>
508             </td>
509             <td class="rightCell">
510               logged in as
511               <xsl:text> </xsl:text>
512               <strong><xsl:value-of select="/bedework/userid"/></strong>
513               <xsl:text> </xsl:text>
514               <span class="logout"><a href="{$setup}&amp;logout=true">logout</a></span>
515             </td>
516           </tr>
517         </table>
518       </xsl:when>
519       <xsl:otherwise>
520         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
521           <tr>
522             <td>
523               <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>
524             </td>
525             <td>
526               <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>
527             </td>
528             <td>
529               <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>
530             </td>
531             <td>
532               <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>
533             </td>
534             <td class="rightCell">
535               logged in as
536               <xsl:text> </xsl:text>
537               <strong><xsl:value-of select="/bedework/userid"/></strong>
538               <xsl:text> </xsl:text>
539               <span class="logout"><a href="{$setup}&amp;logout=true">logout</a></span>
540             </td>
541           </tr>
542         </table>
543       </xsl:otherwise>
544     </xsl:choose>
545   </xsl:template>
546
547   <xsl:template name="navigation">
548     <xsl:variable name="navAction">
549       <xsl:choose>
550         <xsl:when test="/bedework/page='freeBusy'"><xsl:value-of select="$freeBusy-fetch"/></xsl:when>
551         <xsl:otherwise><xsl:value-of select="$setViewPeriod"/></xsl:otherwise>
552       </xsl:choose>
553     </xsl:variable>
554     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
555       <tr>
556         <td class="leftCell">
557           <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>
558           <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>
559           <xsl:choose>
560             <xsl:when test="/bedework/periodname='Year'">
561               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
562             </xsl:when>
563             <xsl:when test="/bedework/periodname='Month'">
564               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
565             </xsl:when>
566             <xsl:when test="/bedework/periodname='Week'">
567               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
568             </xsl:when>
569             <xsl:otherwise>
570               <xsl:value-of select="/bedework/firstday/longdate"/>
571             </xsl:otherwise>
572           </xsl:choose>
573         </td>
574         <td class="todayButton">
575           <a href="{$navAction}&amp;viewType=todayView&amp;date={$curdate}">
576             <img src="{$resourcesRoot}/resources/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
577           </a>
578         </td>
579         <td align="right" class="gotoForm">
580           <form name="calForm" method="post" action="{$navAction}">
581              <table border="0" cellpadding="0" cellspacing="0">
582               <tr>
583                 <xsl:if test="/bedework/periodname!='Year'">
584                   <td>
585                     <select name="viewStartDate.month">
586                       <xsl:for-each select="/bedework/monthvalues/val">
587                         <xsl:variable name="temp" select="."/>
588                         <xsl:variable name="pos" select="position()"/>
589                         <xsl:choose>
590                           <xsl:when test="/bedework/monthvalues[start=$temp]">
591                             <option value="{$temp}" selected="selected">
592                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
593                             </option>
594                           </xsl:when>
595                           <xsl:otherwise>
596                             <option value="{$temp}">
597                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
598                             </option>
599                           </xsl:otherwise>
600                         </xsl:choose>
601                       </xsl:for-each>
602                     </select>
603                   </td>
604                   <xsl:if test="/bedework/periodname!='Month'">
605                     <td>
606                       <select name="viewStartDate.day">
607                         <xsl:for-each select="/bedework/dayvalues/val">
608                           <xsl:variable name="temp" select="."/>
609                           <xsl:variable name="pos" select="position()"/>
610                           <xsl:choose>
611                             <xsl:when test="/bedework/dayvalues[start=$temp]">
612                               <option value="{$temp}" selected="selected">
613                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
614                               </option>
615                             </xsl:when>
616                             <xsl:otherwise>
617                               <option value="{$temp}">
618                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
619                               </option>
620                             </xsl:otherwise>
621                           </xsl:choose>
622                         </xsl:for-each>
623                       </select>
624                     </td>
625                   </xsl:if>
626                 </xsl:if>
627                 <td>
628                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
629                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
630                 </td>
631                 <td>
632                   <input name="submit" type="submit" value="go"/>
633                 </td>
634               </tr>
635             </table>
636           </form>
637         </td>
638       </tr>
639     </table>
640   </xsl:template>
641
642   <xsl:template name="utilBar">
643     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="utilBarTable">
644        <tr>
645          <td class="leftCell">
646            <xsl:choose>
647              <xsl:when test="/bedework/periodname = 'day'">
648                <xsl:variable name="date" select="/bedework/firstday/date"/>
649                <a href="{$initEvent}&amp;startdate={$date}" title="add event">
650                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
651                   add event
652                </a>
653              </xsl:when>
654              <xsl:otherwise>
655                <a href="{$initEvent}" title="add event">
656                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
657                   add event
658                </a>
659              </xsl:otherwise>
660            </xsl:choose>
661            <a href="{$initUpload}" title="upload event">
662               <img src="{$resourcesRoot}/resources/std-icalUpload-icon-small.gif" width="12" height="16" border="0" alt="upload event"/>
663               upload
664            </a>
665          </td>
666          <td class="rightCell">
667
668            <!-- show free / busy -->
669            <xsl:choose>
670              <xsl:when test="/bedework/periodname!='Year'">
671                <xsl:choose>
672                  <xsl:when test="/bedework/page='freeBusy'">
673                    <a href="{$setViewPeriod}&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-button-events.gif" width="70" height="21" border="0" alt="show events"/></a>
674                  </xsl:when>
675                  <xsl:otherwise>
676                    <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>
677                  </xsl:otherwise>
678                </xsl:choose>
679              </xsl:when>
680              <xsl:otherwise>
681                <img src="{$resourcesRoot}/resources/std-button-freebusy-off.gif" width="70" height="21" border="0" alt="show free/busy"/>
682              </xsl:otherwise>
683            </xsl:choose>
684
685            <!-- toggle list / calendar view -->
686            <xsl:choose>
687              <xsl:when test="/bedework/periodname='Day'">
688                <img src="{$resourcesRoot}/resources/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
689              </xsl:when>
690              <xsl:when test="/bedework/periodname='Year'">
691                <img src="{$resourcesRoot}/resources/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
692              </xsl:when>
693              <xsl:when test="/bedework/periodname='Month'">
694                <xsl:choose>
695                  <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
696                    <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="toggle list/calendar view">
697                      <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
698                    </a>
699                  </xsl:when>
700                  <xsl:otherwise>
701                    <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="toggle list/calendar view">
702                      <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
703                    </a>
704                  </xsl:otherwise>
705                </xsl:choose>
706              </xsl:when>
707              <xsl:otherwise>
708                <xsl:choose>
709                  <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
710                    <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="toggle list/calendar view">
711                      <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
712                    </a>
713                  </xsl:when>
714                  <xsl:otherwise>
715                    <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="toggle list/calendar view">
716                      <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
717                    </a>
718                  </xsl:otherwise>
719                </xsl:choose>
720              </xsl:otherwise>
721            </xsl:choose>
722
723            <!-- summary / detailed mode toggle -->
724            <xsl:choose>
725              <xsl:when test="/bedework/periodname='Year' or
726                               (/bedework/periodname='Month' and
727                               (/bedework/appvar[key='monthViewMode']/value='cal' or
728                                not(/bedework/appvar[key='monthViewMode']))) or
729                               (/bedework/periodname='Week' and
730                               (/bedework/appvar[key='weekViewMode']/value='cal' or
731                                not(/bedework/appvar[key='weekViewMode'])))">
732                <xsl:choose>
733                  <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
734                    <img src="{$resourcesRoot}/resources/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
735                  </xsl:when>
736                  <xsl:otherwise>
737                    <img src="{$resourcesRoot}/resources/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
738                  </xsl:otherwise>
739                </xsl:choose>
740              </xsl:when>
741              <xsl:otherwise>
742                <xsl:choose>
743                  <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
744                    <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="toggle summary/detailed view">
745                      <img src="{$resourcesRoot}/resources/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
746                    </a>
747                  </xsl:when>
748                  <xsl:otherwise>
749                    <a href="{$setup}&amp;setappvar=summaryMode(details)" title="toggle summary/detailed view">
750                      <img src="{$resourcesRoot}/resources/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
751                    </a>
752                  </xsl:otherwise>
753                </xsl:choose>
754              </xsl:otherwise>
755            </xsl:choose>
756
757            <!-- refresh button -->
758            <a href="{$setup}"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
759          </td>
760        </tr>
761     </table>
762   </xsl:template>
763
764   <!--==== LIST VIEW  (for day, week, and month) ====-->
765   <xsl:template name="listView">
766     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
767       <xsl:choose>
768         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
769           <tr>
770             <td class="noEventsCell">
771               No events to display.
772             </td>
773           </tr>
774         </xsl:when>
775         <xsl:otherwise>
776           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
777             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
778               <tr>
779                 <td colspan="6" class="dateRow">
780                    <xsl:variable name="date" select="date"/>
781                    <a href="{$initEvent}&amp;startdate={$date}" class="listAdd">
782                      add event
783                    </a>
784                    <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
785                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
786                    </a>
787                  </td>
788               </tr>
789             </xsl:if>
790             <xsl:for-each select="event">
791               <xsl:variable name="id" select="id"/>
792               <xsl:variable name="subscriptionId" select="subscription/id"/>
793               <xsl:variable name="calPath" select="calendar/encodedPath"/>
794               <xsl:variable name="guid" select="guid"/>
795               <xsl:variable name="recurrenceId" select="recurrenceId"/>
796               <tr>
797                 <xsl:variable name="dateRangeStyle">
798                   <xsl:choose>
799                     <xsl:when test="start/shortdate = parent::day/shortdate">
800                       <xsl:choose>
801                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
802                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
803                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
804                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
805                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
806                       </xsl:choose>
807                     </xsl:when>
808                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
809                   </xsl:choose>
810                 </xsl:variable>
811                 <xsl:choose>
812                   <xsl:when test="start/allday = 'true' and
813                                   start/shortdate = end/shortdate">
814                     <td class="{$dateRangeStyle} center" colspan="3">
815                       all day
816                     </td>
817                   </xsl:when>
818                   <xsl:when test="start/shortdate = end/shortdate and
819                                   start/time = end/time">
820                     <td class="{$dateRangeStyle} center" colspan="3">
821                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
822                         <xsl:value-of select="start/time"/>
823                       </a>
824                     </td>
825                   </xsl:when>
826                   <xsl:otherwise>
827                     <td class="{$dateRangeStyle} right">
828                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
829                       <xsl:choose>
830                         <xsl:when test="start/allday = 'true' and
831                                         parent::day/shortdate = start/shortdate">
832                           today
833                         </xsl:when>
834                         <xsl:when test="parent::day/shortdate != start/shortdate">
835                           <span class="littleArrow">&#171;</span>&#160;
836                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
837                         </xsl:when>
838                         <xsl:otherwise>
839                           <xsl:value-of select="start/time"/>
840                         </xsl:otherwise>
841                       </xsl:choose>
842                       </a>
843                     </td>
844                     <td class="{$dateRangeStyle} center">
845                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
846                     </td>
847                     <td class="{$dateRangeStyle} left">
848                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
849                       <xsl:choose>
850                         <xsl:when test="end/allday = 'true' and
851                                         parent::day/shortdate = end/shortdate">
852                           today
853                         </xsl:when>
854                         <xsl:when test="parent::day/shortdate != end/shortdate">
855                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
856                           &#160;<span class="littleArrow">&#187;</span>
857                         </xsl:when>
858                         <xsl:otherwise>
859                           <xsl:value-of select="end/time"/>
860                         </xsl:otherwise>
861                       </xsl:choose>
862                       </a>
863                     </td>
864                   </xsl:otherwise>
865                 </xsl:choose>
866                 <xsl:variable name="descriptionClass">
867                   <xsl:choose>
868                     <xsl:when test="status='CANCELLED'">description bwStatusCancelled</xsl:when>
869                     <xsl:when test="status='TENTATIVE'">description bwStatusTentative</xsl:when>
870                     <xsl:otherwise>description</xsl:otherwise>
871                   </xsl:choose>
872                 </xsl:variable>
873                 <xsl:variable name="subStyle" select="subscription/style"/>
874                 <td class="{$descriptionClass} {$subStyle}">
875                   <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if>
876                   <xsl:choose>
877                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
878                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
879                         <strong>
880                           <xsl:value-of select="summary"/>:
881                         </strong>
882                         <xsl:value-of select="description"/>&#160;
883                         <em>
884                           <xsl:value-of select="location/address"/>
885                           <xsl:if test="location/subaddress != ''">
886                             , <xsl:value-of select="location/subaddress"/>
887                           </xsl:if>.&#160;
888                           <xsl:if test="cost!=''">
889                             <xsl:value-of select="cost"/>.&#160;
890                           </xsl:if>
891                           <xsl:if test="sponsor/name!='none'">
892                             Contact: <xsl:value-of select="sponsor/name"/>
893                           </xsl:if>
894                         </em>
895                       </a>
896                       <xsl:if test="link != ''">
897                         <xsl:variable name="link" select="link"/>
898                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
899                       </xsl:if>
900                     </xsl:when>
901                     <xsl:otherwise>
902                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
903                         <xsl:value-of select="summary"/>
904                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
905                       </a>
906                     </xsl:otherwise>
907                   </xsl:choose>
908                 </td>
909                 <td class="eventLinks">
910                   <xsl:call-template name="eventLinks"/>
911                 </td>
912                 <td class="smallIcon">
913                   <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
914                   <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">
915                     <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"/>
916                   </a>
917                 </td>
918               </tr>
919             </xsl:for-each>
920           </xsl:for-each>
921         </xsl:otherwise>
922       </xsl:choose>
923     </table>
924   </xsl:template>
925
926   <xsl:template name="eventLinks">
927     <xsl:variable name="subscriptionId" select="subscription/id"/>
928     <xsl:variable name="calPath" select="calendar/encodedPath"/>
929     <xsl:variable name="guid" select="guid"/>
930     <xsl:variable name="recurrenceId" select="recurrenceId"/>
931     <xsl:choose>
932       <xsl:when test="isAnnotation">
933         <xsl:choose>
934           <xsl:when test="recurring=true">
935             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;confirmationid={$confId}">Remove All</a>
936           </xsl:when>
937           <xsl:otherwise>
938             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Remove</a>
939           </xsl:otherwise>
940         </xsl:choose>
941       </xsl:when>
942       <xsl:when test="calendar/owner = /bedework/userid">
943         <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">Edit</a> |
944         <xsl:choose>
945           <xsl:when test="recurring=true">
946             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete All</a>
947           </xsl:when>
948           <xsl:otherwise>
949             <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete</a>
950           </xsl:otherwise>
951         </xsl:choose>
952       </xsl:when>
953       <xsl:otherwise>
954         <a href="{$subscriptions-fetch}">Subscription</a>
955       </xsl:otherwise>
956     </xsl:choose>
957   </xsl:template>
958
959   <!--==== WEEK CALENDAR VIEW ====-->
960   <xsl:template name="weekView">
961     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
962       <tr>
963         <xsl:for-each select="/bedework/daynames/val">
964           <th class="dayHeading"><xsl:value-of select="."/></th>
965         </xsl:for-each>
966       </tr>
967       <tr>
968         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
969           <xsl:variable name="dayPos" select="position()"/>
970           <xsl:if test="filler='false'">
971             <td>
972               <xsl:variable name="dayDate" select="date"/>
973               <a href="{$initEvent}&amp;startdate={$dayDate}" class="gridAdd" title="add event">
974                 <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="9" height="10" border="0" alt="add event"/>
975               </a>
976               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
977                 <xsl:value-of select="value"/>
978               </a>
979               <ul>
980                 <xsl:apply-templates select="event" mode="calendarLayout">
981                   <xsl:with-param name="dayPos" select="$dayPos"/>
982                 </xsl:apply-templates>
983               </ul>
984             </td>
985           </xsl:if>
986         </xsl:for-each>
987       </tr>
988     </table>
989   </xsl:template>
990
991   <!--==== MONTH CALENDAR VIEW ====-->
992   <xsl:template name="monthView">
993     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
994       <tr>
995         <xsl:for-each select="/bedework/daynames/val">
996           <th class="dayHeading"><xsl:value-of select="."/></th>
997         </xsl:for-each>
998       </tr>
999       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
1000         <tr>
1001           <xsl:for-each select="day">
1002             <xsl:variable name="dayPos" select="position()"/>
1003             <xsl:choose>
1004               <xsl:when test="filler='true'">
1005                 <td class="filler">&#160;</td>
1006               </xsl:when>
1007               <xsl:otherwise>
1008                 <td>
1009                   <xsl:variable name="dayDate" select="date"/>
1010                   <a href="{$initEvent}&amp;startdate={$dayDate}" class="gridAdd" title="add event">
1011                     <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="10" height="10" border="0" alt="add event"/>
1012                   </a>
1013                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
1014                     <xsl:value-of select="value"/>
1015                   </a>
1016                   <ul>
1017                     <xsl:apply-templates select="event" mode="calendarLayout">
1018                       <xsl:with-param name="dayPos" select="$dayPos"/>
1019                     </xsl:apply-templates>
1020                   </ul>
1021                 </td>
1022               </xsl:otherwise>
1023             </xsl:choose>
1024           </xsl:for-each>
1025         </tr>
1026       </xsl:for-each>
1027     </table>
1028   </xsl:template>
1029
1030   <xsl:template match="event" mode="calendarLayout">
1031     <xsl:param name="dayPos"/>
1032     <xsl:variable name="subscriptionId" select="subscription/id"/>
1033     <xsl:variable name="calPath" select="calendar/encodedPath"/>
1034     <xsl:variable name="guid" select="guid"/>
1035     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1036     <xsl:variable name="eventRootClass">
1037       <xsl:choose>
1038         <!-- Otherwise: Alternating colors for all standard events -->
1039         <xsl:when test="position() = 1">event firstEvent</xsl:when>
1040         <xsl:otherwise>event</xsl:otherwise>
1041       </xsl:choose>
1042     </xsl:variable>
1043     <xsl:variable name="eventClass">
1044       <xsl:choose>
1045         <!-- Special styles for the month grid -->
1046         <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when>
1047         <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when>
1048         <!-- Otherwise: Alternating colors for all standard events -->
1049         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
1050         <xsl:otherwise>eventLinkB</xsl:otherwise>
1051       </xsl:choose>
1052     </xsl:variable>
1053     <!-- User defined subscription styles.
1054          These are set in the add/modify subscription forms which
1055          rely (in this stylesheet) on subColors.css; if present, these
1056          override the background-color set by eventClass. User styles should
1057          not be used for cancelled events (tentative is ok). -->
1058     <xsl:variable name="subColor">
1059       <xsl:choose>
1060          <xsl:when test="status != 'CANCELLED' and
1061                         subscription/style != '' and
1062                         subscription/style != 'default'"><xsl:value-of select="subscription/style"/></xsl:when>
1063         <xsl:otherwise></xsl:otherwise>
1064       </xsl:choose>
1065     </xsl:variable>
1066     <li>
1067       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"
1068         class="{$eventRootClass} {$eventClass} {$subColor}">
1069         <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
1070         <xsl:value-of select="summary"/>
1071         <xsl:variable name="eventTipClass">
1072           <xsl:choose>
1073             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
1074             <xsl:otherwise>eventTip</xsl:otherwise>
1075           </xsl:choose>
1076         </xsl:variable>
1077         <span class="{$eventTipClass}">
1078           <xsl:if test="status='CANCELLED'"><span class="eventTipStatusCancelled">CANCELLED</span></xsl:if>
1079           <xsl:if test="status='TENTATIVE'"><span class="eventTipStatusTentative">TENTATIVE</span></xsl:if>
1080           <strong><xsl:value-of select="summary"/></strong><br/>
1081           Time:
1082           <xsl:choose>
1083             <xsl:when test="start/allday = 'false'">
1084               <xsl:value-of select="start/time"/>
1085               <xsl:if test="start/time != end/time">
1086                 - <xsl:value-of select="end/time"/>
1087               </xsl:if>
1088             </xsl:when>
1089             <xsl:otherwise>
1090               all day
1091             </xsl:otherwise>
1092           </xsl:choose><br/>
1093           <xsl:if test="location/address">
1094             Location: <xsl:value-of select="location/address"/><br/>
1095           </xsl:if>
1096           Calendar:
1097             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1098             <xsl:choose>
1099               <xsl:when test="contains(calendar/path,$userPath)">
1100                 <xsl:value-of select="substring-after(calendar/path,$userPath)"/>
1101               </xsl:when>
1102               <xsl:otherwise>
1103                 <xsl:value-of select="calendar/path"/>
1104               </xsl:otherwise>
1105             </xsl:choose><br/>
1106           Type:
1107           <xsl:choose>
1108             <xsl:when test="isAnnotation">
1109               public event
1110             </xsl:when>
1111             <xsl:when test="calendar/owner = /bedework/userid">
1112               personal event, editable
1113             </xsl:when>
1114             <xsl:otherwise>
1115               subscription
1116             </xsl:otherwise>
1117           </xsl:choose>
1118         </span>
1119       </a>
1120     </li>
1121   </xsl:template>
1122
1123   <!--==== YEAR VIEW ====-->
1124   <xsl:template name="yearView">
1125     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
1126       <tr>
1127         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
1128       </tr>
1129       <tr>
1130         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
1131       </tr>
1132       <tr>
1133         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
1134       </tr>
1135       <tr>
1136         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
1137       </tr>
1138     </table>
1139   </xsl:template>
1140
1141   <!-- year view month tables -->
1142   <xsl:template match="month">
1143     <td>
1144       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
1145         <tr>
1146           <td colspan="8" class="monthName">
1147             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
1148             <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">
1149               <xsl:value-of select="longname"/>
1150             </a>
1151           </td>
1152         </tr>
1153         <tr>
1154           <th>&#160;</th>
1155           <xsl:for-each select="/bedework/shortdaynames/val">
1156             <th><xsl:value-of select="."/></th>
1157           </xsl:for-each>
1158         </tr>
1159         <xsl:for-each select="week">
1160           <tr>
1161             <td class="weekCell">
1162               <xsl:variable name="firstDayOfWeek" select="day/date"/>
1163               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}">
1164                 <xsl:value-of select="value"/>
1165               </a>
1166             </td>
1167             <xsl:for-each select="day">
1168               <xsl:choose>
1169                 <xsl:when test="filler='true'">
1170                   <td class="filler">&#160;</td>
1171                 </xsl:when>
1172                 <xsl:otherwise>
1173                   <td>
1174                     <xsl:variable name="dayDate" select="date"/>
1175                     <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}">
1176                       <xsl:value-of select="value"/>
1177                     </a>
1178                   </td>
1179                 </xsl:otherwise>
1180               </xsl:choose>
1181             </xsl:for-each>
1182           </tr>
1183         </xsl:for-each>
1184       </table>
1185     </td>
1186   </xsl:template>
1187
1188   <!--==== SINGLE EVENT ====-->
1189   <xsl:template match="event">
1190     <xsl:variable name="subscriptionId" select="subscription/id"/>
1191     <xsl:variable name="calPath" select="calendar/encodedPath"/>
1192     <xsl:variable name="guid" select="guid"/>
1193     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1194     <xsl:variable name="statusClass">
1195       <xsl:choose>
1196         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
1197         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
1198         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
1199       </xsl:choose>
1200     </xsl:variable>
1201     <h2 class="{$statusClass}">
1202       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
1203       <xsl:choose>
1204         <xsl:when test="link != ''">
1205           <xsl:variable name="link" select="link"/>
1206           <a href="{$link}">
1207             <xsl:value-of select="summary"/>
1208           </a>
1209         </xsl:when>
1210         <xsl:otherwise>
1211           <xsl:value-of select="summary"/>
1212         </xsl:otherwise>
1213       </xsl:choose>
1214     </h2>
1215     <table class="common" cellspacing="0">
1216       <tr>
1217         <th colspan="2" class="commonHeader">
1218           <div id="eventActions">
1219             <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
1220             <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">
1221               <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"/>
1222               Download
1223             </a> |
1224             <xsl:choose>
1225               <xsl:when test="isAnnotation">
1226                 <xsl:choose>
1227                   <xsl:when test="recurring=true">
1228                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;confirmationid={$confId}">
1229                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1230                       Remove All (recurring)
1231                     </a>
1232                   </xsl:when>
1233                   <xsl:otherwise>
1234                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1235                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1236                       Remove
1237                     </a>
1238                   </xsl:otherwise>
1239                 </xsl:choose>
1240               </xsl:when>
1241               <xsl:when test="currentAccess/current-user-privilege-set/privilege/write-content">
1242                 <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1243                   <img src="{$resourcesRoot}/resources/std-ical_iconEditDkGray.gif" width="12" height="16" border="0" alt="edit"/>
1244                   Edit
1245                 </a>
1246               </xsl:when>
1247               <xsl:otherwise>
1248                 <a href="{$subscriptions-fetch}">
1249                   <img src="{$resourcesRoot}/resources/std-ical_iconSubsDkGray.gif" width="12" height="16" border="0" alt="edit"/>
1250                   Manage Subscriptions
1251                 </a>
1252               </xsl:otherwise>
1253             </xsl:choose>
1254             <xsl:if test="currentAccess/current-user-privilege-set/privilege/unbind and not(isAnnotation)">
1255                |
1256               <xsl:choose>
1257                 <xsl:when test="recurring=true">
1258                   <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;confirmationid={$confId}">
1259                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1260                     Delete All (recurring)
1261                   </a>
1262                 </xsl:when>
1263                 <xsl:otherwise>
1264                   <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1265                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1266                     Delete
1267                   </a>
1268                 </xsl:otherwise>
1269               </xsl:choose>
1270             </xsl:if>
1271           </div>
1272           <xsl:choose>
1273             <xsl:when test="calendar/owner = /bedework/userid">
1274               Personal Event
1275             </xsl:when>
1276             <xsl:when test="starts-with(calendar/path,'/user/')">
1277               User Event (<xsl:value-of select="calendar/owner"/>)
1278             </xsl:when>
1279             <xsl:when test="isAnnotation">
1280               Public Event
1281             </xsl:when>
1282             <xsl:otherwise>
1283               <xsl:choose>
1284                 <xsl:when test="starts-with(calendar/path,'/public/')">
1285                   Public Event from Subscription
1286                 </xsl:when>
1287                 <xsl:otherwise>
1288                   Event from Subscription
1289                 </xsl:otherwise>
1290               </xsl:choose>
1291             </xsl:otherwise>
1292           </xsl:choose>
1293         </th>
1294       </tr>
1295       <tr>
1296         <td class="fieldname">When:</td>
1297         <td class="fieldval">
1298           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
1299           <xsl:if test="start/allday = 'false'">
1300             <span class="time"><xsl:value-of select="start/time"/></span>
1301           </xsl:if>
1302           <xsl:if test="(end/longdate != start/longdate) or
1303                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
1304           <xsl:if test="end/longdate != start/longdate">
1305             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
1306           </xsl:if>
1307           <xsl:choose>
1308             <xsl:when test="start/allday = 'true'">
1309               <span class="time"><em>(all day)</em></span>
1310             </xsl:when>
1311             <xsl:when test="end/longdate != start/longdate">
1312               <span class="time"><xsl:value-of select="end/time"/></span>
1313             </xsl:when>
1314             <xsl:when test="end/time != start/time">
1315               <span class="time"><xsl:value-of select="end/time"/></span>
1316             </xsl:when>
1317           </xsl:choose>
1318         </td>
1319         <!--<th class="icon" rowspan="2">
1320           <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
1321           <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">
1322             <img src="{$resourcesRoot}/resources/std-ical-icon.gif" width="20" height="26" border="0" align="left" alt="Download this event"/>
1323           </a>
1324         </th>-->
1325       </tr>
1326       <tr>
1327         <td class="fieldname">Where:</td>
1328         <td class="fieldval">
1329           <xsl:choose>
1330             <xsl:when test="location/link=''">
1331               <xsl:value-of select="location/address"/>
1332             </xsl:when>
1333             <xsl:otherwise>
1334               <xsl:variable name="locationLink" select="location/link"/>
1335               <a href="{$locationLink}">
1336                 <xsl:value-of select="location/address"/>
1337               </a>
1338             </xsl:otherwise>
1339           </xsl:choose>
1340           <xsl:if test="location/subaddress!=''">
1341             <br/><xsl:value-of select="location/subaddress"/>
1342           </xsl:if>
1343         </td>
1344       </tr>
1345       <tr>
1346         <td class="fieldname">Description:</td>
1347         <td class="fieldval">
1348           <xsl:call-template name="replace">
1349             <xsl:with-param name="string" select="description"/>
1350             <xsl:with-param name="pattern" select="'&#xA;'"/>
1351             <xsl:with-param name="replacement"><br/></xsl:with-param>
1352           </xsl:call-template>
1353         </td>
1354       </tr>
1355       <xsl:if test="status !='' and status != 'CONFIRMED'">
1356         <tr>
1357           <td class="fieldname">Status:</td>
1358           <td class="fieldval">
1359             <xsl:value-of select="status"/>
1360           </td>
1361         </tr>
1362       </xsl:if>
1363       <xsl:if test="organizer">
1364         <tr>
1365           <td class="fieldname">Organizer:</td>
1366           <xsl:variable name="organizerUri" select="organizer/organizerUri"/>
1367           <td class="fieldval">
1368             <strong>
1369               <a href="{$organizerUri}">
1370                 <xsl:choose>
1371                   <xsl:when test="organizer/cn != ''">
1372                     <xsl:value-of select="organizer/cn"/>
1373                   </xsl:when>
1374                   <xsl:otherwise>
1375                     <xsl:value-of select="organizer/organizerUri"/>
1376                   </xsl:otherwise>
1377                 </xsl:choose>
1378               </a>
1379             </strong>
1380           </td>
1381         </tr>
1382       </xsl:if>
1383       <xsl:if test="attendee">
1384         <tr>
1385           <td class="fieldname">Attendees:</td>
1386           <td class="fieldval">
1387             <table id="attendees" cellspacing="0">
1388               <tr>
1389                 <th>role</th>
1390                 <th>status</th>
1391                 <th>attendee</th>
1392               </tr>
1393               <xsl:for-each select="attendee">
1394                 <xsl:sort select="cn" order="ascending" case-order="upper-first"/>
1395                 <xsl:sort select="attendeeUri" order="ascending" case-order="upper-first"/>
1396                 <tr>
1397                   <td class="role">
1398                     <xsl:value-of select="role"/>
1399                   </td>
1400                   <td class="status">
1401                     <xsl:value-of select="partstat"/>
1402                   </td>
1403                   <td>
1404                     <xsl:variable name="attendeeUri" select="attendeeUri"/>
1405                     <a href="{$attendeeUri}">
1406                       <xsl:choose>
1407                         <xsl:when test="cn != ''">
1408                           <xsl:value-of select="cn"/>
1409                         </xsl:when>
1410                         <xsl:otherwise>
1411                           <xsl:value-of select="attendeeUri"/>
1412                         </xsl:otherwise>
1413                       </xsl:choose>
1414                     </a>
1415                   </td>
1416                 </tr>
1417               </xsl:for-each>
1418             </table>
1419           </td>
1420         </tr>
1421       </xsl:if>
1422       <xsl:if test="cost!=''">
1423         <tr>
1424           <td class="fieldname">Cost:</td>
1425           <td class="fieldval"><xsl:value-of select="cost"/></td>
1426         </tr>
1427       </xsl:if>
1428       <xsl:if test="link != ''">
1429         <tr>
1430           <td class="fieldname">See:</td>
1431           <td class="fieldval">
1432             <xsl:variable name="link" select="link"/>
1433             <a href="{$link}"><xsl:value-of select="link"/></a>
1434           </td>
1435         </tr>
1436       </xsl:if>
1437       <xsl:if test="sponsor/name!='none'">
1438         <tr>
1439           <td class="fieldname">Contact:</td>
1440           <td class="fieldval">
1441             <xsl:choose>
1442               <xsl:when test="sponsor/link=''">
1443                 <xsl:value-of select="sponsor/name"/>
1444               </xsl:when>
1445               <xsl:otherwise>
1446                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
1447                 <a href="{$sponsorLink}">
1448                   <xsl:value-of select="sponsor/name"/>
1449                 </a>
1450               </xsl:otherwise>
1451             </xsl:choose>
1452             <xsl:if test="sponsor/phone!=''">
1453               <br /><xsl:value-of select="sponsor/phone"/>
1454             </xsl:if>
1455             <xsl:if test="sponsor/email!=''">
1456               <br />
1457               <xsl:variable name="email" select="sponsor/email"/>
1458               <xsl:variable name="subject" select="summary"/>
1459               <a href="mailto:{$email}&amp;subject={$subject}">
1460                 <xsl:value-of select="sponsor/email"/>
1461               </a>
1462             </xsl:if>
1463           </td>
1464         </tr>
1465       </xsl:if>
1466       <xsl:if test="calendar/path!=''">
1467         <tr>
1468           <td class="fieldname">Calendar:</td>
1469           <td class="fieldval">
1470             <xsl:variable name="calUrl" select="calendar/encodedPath"/>
1471             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1472             <a href="{$setSelection}&amp;calUrl={$calUrl}">
1473               <xsl:choose>
1474                 <xsl:when test="contains(calendar/path,$userPath)">
1475                   <xsl:value-of select="substring-after(calendar/path,$userPath)"/>
1476                 </xsl:when>
1477                 <xsl:otherwise>
1478                   <xsl:value-of select="calendar/path"/>
1479                 </xsl:otherwise>
1480               </xsl:choose>
1481             </a>
1482           </td>
1483         </tr>
1484       </xsl:if>
1485       <tr>
1486         <td class="fieldname filler">&#160;</td>
1487         <td class="fieldval">&#160;</td>
1488       </tr>
1489     </table>
1490   </xsl:template>
1491
1492  <!--==== ADD EVENT ====-->
1493   <xsl:template name="addEvent">
1494   <!-- The name "eventForm" is referenced by several javascript functions. Do not
1495     change it without modifying includes.js -->
1496     <form name="eventForm" method="post" action="{$addEventUsingPage}" id="standardForm">
1497       <input type="hidden" name="confirmationid" value="{$confId}"/>
1498       <input type="hidden" name="endType" value="date"/>
1499       <h2>Add Event</h2>
1500       <table class="common" cellspacing="0">
1501         <tr>
1502           <td class="fieldname">
1503             Title:
1504           </td>
1505           <td class="fieldval">
1506             <xsl:variable name="title" select="/bedework/formElements/form/title/input/@value"/>
1507             <input type="text" name="newEvent.summary" size="80" value="{$title}"/>
1508           </td>
1509         </tr>
1510         <tr>
1511           <td class="fieldname">
1512             Type:
1513           </td>
1514           <td class="fieldval">
1515             <input type="radio" name="schedule" size="80" value="" checked="checked"/>my event
1516             <input type="radio" name="schedule" size="80" value="request"/>meeting request
1517             <input type="radio" name="schedule" size="80" value="publish"/>published event
1518           </td>
1519         </tr>
1520         <tr>
1521           <td class="fieldname">
1522             Calendar:
1523           </td>
1524           <td class="fieldval">
1525             <xsl:variable name="newCalPath" select="/bedework/formElements/form/calendar/path"/>
1526             <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
1527             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1528             <span id="bwEventCalDisplay">
1529               <xsl:choose>
1530                 <xsl:when test="contains(/bedework/formElements/form/calendar/path,$userPath)">
1531                   <xsl:value-of select="substring-after(/bedework/formElements/form/calendar/path,$userPath)"/>
1532                 </xsl:when>
1533                 <xsl:otherwise>
1534                   <xsl:value-of select="/bedework/formElements/form/calendar/path"/>
1535                 </xsl:otherwise>
1536               </xsl:choose>
1537             </span>
1538             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
1539           </td>
1540         </tr>
1541         <tr>
1542           <td class="fieldname">
1543             Date &amp; Time:
1544           </td>
1545           <td class="fieldval">
1546             <!-- Set the timefields class for the first load of the page;
1547                  subsequent changes will take place using javascript without a
1548                  page reload. -->
1549             <xsl:variable name="timeFieldsClass">
1550               <xsl:choose>
1551                 <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1552                 <xsl:otherwise>timeFields</xsl:otherwise>
1553               </xsl:choose>
1554             </xsl:variable>
1555             <xsl:choose>
1556               <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">
1557                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1558                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1559                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1560               </xsl:when>
1561               <xsl:otherwise>
1562                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1563                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1564                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1565               </xsl:otherwise>
1566             </xsl:choose>
1567             all day event<br/>
1568             <div class="dateStartEndBox">
1569               <strong>Start:</strong>
1570               <div class="dateFields">
1571                 <span class="startDateLabel">Date </span>
1572                 <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
1573                 <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
1574                 <xsl:choose>
1575                   <xsl:when test="/bedework/creating = 'true'">
1576                     <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
1577                   </xsl:when>
1578                   <xsl:otherwise>
1579                     <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
1580                   </xsl:otherwise>
1581                 </xsl:choose>
1582               </div>
1583               <script language="JavaScript" type="text/javascript">
1584               <xsl:comment>
1585                 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', '<xsl:value-of select="$resourcesRoot"/>/resources/');
1586               </xsl:comment>
1587               </script>
1588               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1589               <div class="{$timeFieldsClass}" id="startTimeFields">
1590                 <span id="calWidgetStartTimeHider" class="show">
1591                   <xsl:copy-of select="/bedework/formElements/form/start/hour/*"/>
1592                   <xsl:copy-of select="/bedework/formElements/form/start/minute/*"/>
1593                   <xsl:if test="/bedework/formElements/form/start/ampm">
1594                     <xsl:copy-of select="/bedework/formElements/form/start/ampm/*"/>
1595                   </xsl:if>
1596                   <xsl:text> </xsl:text>
1597                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1598                 </span>
1599               </div>
1600             </div>
1601             <div class="dateStartEndBox">
1602               <strong>End:</strong>
1603               <xsl:choose>
1604                 <xsl:when test="/bedework/formElements/form/end/type='E'">
1605                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1606                 </xsl:when>
1607                 <xsl:otherwise>
1608                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1609                 </xsl:otherwise>
1610               </xsl:choose>
1611               Date
1612               <xsl:variable name="endDateTimeClass">
1613                 <xsl:choose>
1614                   <xsl:when test="/bedework/formElements/form/end/type='E'">shown</xsl:when>
1615                   <xsl:otherwise>invisible</xsl:otherwise>
1616                 </xsl:choose>
1617               </xsl:variable>
1618               <div class="{$endDateTimeClass}" id="endDateTime">
1619                 <div class="dateFields">
1620                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
1621                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
1622                   <xsl:choose>
1623                     <xsl:when test="/bedework/creating = 'true'">
1624                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
1625                     </xsl:when>
1626                     <xsl:otherwise>
1627                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
1628                     </xsl:otherwise>
1629                   </xsl:choose>
1630                 </div>
1631                 <script language="JavaScript" type="text/javascript">
1632                 <xsl:comment>
1633                   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', '<xsl:value-of select="$resourcesRoot"/>/resources/');
1634                 </xsl:comment>
1635                 </script>
1636                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1637                 <div class="{$timeFieldsClass}" id="endTimeFields">
1638                   <span id="calWidgetEndTimeHider" class="show">
1639                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/hour/*"/>
1640                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/minute/*"/>
1641                     <xsl:if test="/bedework/formElements/form/end/dateTime/ampm">
1642                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/ampm/*"/>
1643                     </xsl:if>
1644                     <xsl:text> </xsl:text>
1645                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1646                   </span>
1647                 </div>
1648               </div><br/>
1649               <div class="dateFields">
1650                 <xsl:choose>
1651                   <xsl:when test="/bedework/formElements/form/end/type='D'">
1652                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1653                   </xsl:when>
1654                   <xsl:otherwise>
1655                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1656                   </xsl:otherwise>
1657                 </xsl:choose>
1658                 Duration
1659                 <xsl:variable name="endDurationClass">
1660                   <xsl:choose>
1661                     <xsl:when test="/bedework/formElements/form/end/type='D'">shown</xsl:when>
1662                     <xsl:otherwise>invisible</xsl:otherwise>
1663                   </xsl:choose>
1664                 </xsl:variable>
1665                 <xsl:variable name="durationHrMinClass">
1666                   <xsl:choose>
1667                     <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1668                     <xsl:otherwise>shown</xsl:otherwise>
1669                   </xsl:choose>
1670                 </xsl:variable>
1671                 <div class="{$endDurationClass}" id="endDuration">
1672                   <xsl:choose>
1673                     <xsl:when test="/bedework/formElements/form/end/duration/weeks/input/@value = '0'">
1674                     <!-- we are using day, hour, minute format -->
1675                     <!-- must send either no week value or week value of 0 (zero) -->
1676                       <div class="durationBox">
1677                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1678                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1679                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1680                         <span id="durationHrMin" class="{$durationHrMinClass}">
1681                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1682                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1683                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1684                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1685                         </span>
1686                       </div>
1687                       <span class="durationSpacerText">or</span>
1688                       <div class="durationBox">
1689                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1690                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1691                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1692                       </div>
1693                     </xsl:when>
1694                     <xsl:otherwise>
1695                       <!-- we are using week format -->
1696                       <div class="durationBox">
1697                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1698                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1699                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1700                         <span id="durationHrMin" class="{$durationHrMinClass}">
1701                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1702                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1703                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1704                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1705                         </span>
1706                       </div>
1707                       <span class="durationSpacerText">or</span>
1708                       <div class="durationBox">
1709                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1710                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1711                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1712                       </div>
1713                     </xsl:otherwise>
1714                   </xsl:choose>
1715                 </div>
1716               </div><br/>
1717               <div class="dateFields" id="noDuration">
1718                 <xsl:choose>
1719                   <xsl:when test="/bedework/formElements/form/end/type='N'">
1720                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1721                   </xsl:when>
1722                   <xsl:otherwise>
1723                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1724                   </xsl:otherwise>
1725                 </xsl:choose>
1726                 This event has no duration / end date
1727               </div>
1728             </div>
1729           </td>
1730         </tr>
1731         <!--  Status  -->
1732         <tr>
1733           <td class="fieldname">
1734             Status:
1735           </td>
1736           <td class="fieldval">
1737             <xsl:choose>
1738               <xsl:when test="/bedework/formElements/form/status = 'TENTATIVE'">
1739                 <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
1740               </xsl:when>
1741               <xsl:when test="/bedework/formElements/form/status = 'CANCELLED'">
1742                 <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
1743               </xsl:when>
1744               <xsl:otherwise>
1745                 <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
1746               </xsl:otherwise>
1747             </xsl:choose>
1748           </td>
1749         </tr>
1750         <!--  Transparency  -->
1751         <tr>
1752           <td class="fieldname">
1753             Effects free/busy:
1754           </td>
1755           <td class="fieldval">
1756             <input type="radio" name="newEvent.transparency" value="OPAQUE" checked="checked"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
1757             <input type="radio" name="newEvent.transparency" value="TRANSPARENT"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
1758           </td>
1759         </tr>
1760         <!--  Description  -->
1761         <tr>
1762           <td class="fieldname">Description:</td>
1763           <td class="fieldval">
1764             <textarea name="newEvent.description" cols="60" rows="4">
1765               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
1766             </textarea>
1767           </td>
1768         </tr>
1769         <!--  Recipients and Attendees  -->
1770         <tr>
1771           <td class="fieldname">
1772             Recipients &amp;<br/> Attendees:
1773           </td>
1774           <td class="fieldval posrelative">
1775             <input type="button" value="Manage recipients and attendees" onclick="changeClass('recipientsAndAttendees','shown')"/>
1776           </td>
1777         </tr>
1778         <tr>
1779           <td class="fieldname">Location:</td>
1780           <td class="fieldval" align="left">
1781             <span class="std-text">choose: </span>
1782             <span id="eventFormLocationList">
1783               <select name="locationId">
1784                 <option value="-1">select...</option>
1785                 <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
1786               </select>
1787             </span>
1788             <span class="std-text"> or add new: </span>
1789             <input type="text" name="newLocation.address" value="" />
1790           </td>
1791         </tr>
1792         <tr>
1793           <td class="fieldname">Event Link:</td>
1794           <td class="fieldval">
1795             <xsl:variable name="link" select="/bedework/formElements/form/link/input/@value"/>
1796             <input type="text" name="newEvent.link" size="80" value="{$link}"/>
1797           </td>
1798         </tr>
1799         <tr>
1800           <td class="fieldname">&#160;</td>
1801           <td class="fieldval">
1802             <input name="submit" type="submit" value="Submit Event"/>&#160;
1803             <input name="cancelled" type="submit" value="Cancel"/>
1804           </td>
1805         </tr>
1806       </table>
1807     </form>
1808
1809     <!-- pop-up dialog boxes in use with the events page -->
1810     <!-- these should follow other items in the form and in some cases
1811          be in a different form -->
1812
1813     <div id="clock" class="invisible">
1814       <xsl:call-template name="clock"/>
1815     </div>
1816
1817     <form name="raForm" id="recipientsAndAttendees" class="invisible">
1818       <div id="recipientsAndAttendeesBox">
1819         <h4 id="dialogTitle"><!--onmousedown="bwDrag('recipientsAndAttendeesBox')" onmouseup="bwDrop('recipientsAndAttendeesBox')"-->
1820           Recipients and Attendees
1821         </h4>
1822         <div id="raContent">
1823           <table cellspacing="0">
1824             <tr>
1825               <td>
1826                 <input name="raHolder" width="40"/>
1827                 <input type="button" value="add" onclick="postRecipientsAndAttendees('recipientsAndAttendees','{$event-attendeesForEvent}','{$event-showAttendeesForEvent}');"/>
1828                 <br/>
1829                 <input type="checkbox" name="recipient" value="true" checked="checked"/> recipient
1830                 <input type="checkbox" name="attendee" value="true" checked="checked"/> attendee
1831               </td>
1832               <td>
1833                 Role:
1834                 <select name="role">
1835                   <option value="REQ-PARTICIPANT">required participant</option>
1836                   <option value="OPT-PARTICIPANT">optional participant</option>
1837                   <option value="CHAIR">chair</option>
1838                   <option value="NON-PARTICIPANT">non-participant</option>
1839                 </select><br/>
1840                 Status:
1841                 <select name="partstat">
1842                   <option value="NEEDS-ACTION">needs action</option>
1843                   <option value="ACCEPTED">accepted</option>
1844                   <option value="DECLINED">declined</option>
1845                   <option value="TENTATIVE">tentative</option>
1846                   <option value="DELEGATED">delegated</option>
1847                 </select>
1848               </td>
1849             </tr>
1850           </table>
1851           <table cellspacing="0">
1852             <tr>
1853               <th>Recipients</th>
1854               <th>Attendees</th>
1855             </tr>
1856             <tr>
1857               <td>
1858                 <div id="recipientList">
1859                 </div>
1860               </td>
1861               <td>
1862                 <div id="attendeeList">
1863                 </div>
1864               </td>
1865             </tr>
1866           </table>
1867           <input type="button" value="done" onclick="changeClass('recipientsAndAttendees','invisible');"/>
1868         </div>
1869       </div>
1870     </form>
1871   </xsl:template>
1872
1873   <xsl:template name="clock">
1874     <div id="bwClock">
1875       <!-- Bedework 24-Hour Clock time selection widget
1876            used with resources/bwClock.js and resources/bwClock.css -->
1877       <div id="bwClockClock">
1878         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="" usemap="#bwClockMap" />
1879       </div>
1880       <div id="bwClockCover">
1881         <!-- this is a special effect div used simply to cover the pixelated edge
1882              where the clock meets the clock box title -->
1883       </div>
1884       <div id="bwClockBox">
1885         <h2>
1886           Bedework 24-Hour Clock
1887         </h2>
1888         <div id="bwClockDateTypeIndicator">
1889           type
1890         </div>
1891         <div id="bwClockTime">
1892           select time
1893         </div>
1894         <div id="bwClockCloseText">
1895           close
1896         </div>
1897         <div id="bwClockCloseButton">
1898           <a href="javascript:bwClockClose();">X</a>
1899         </div>
1900       </div>
1901       <map name="bwClockMap" id="bwClockMap">
1902         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1903         <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')" />
1904         <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')" />
1905         <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')" />
1906         <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')" />
1907         <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')" />
1908         <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')" />
1909         <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')" />
1910         <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')" />
1911         <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')" />
1912         <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')" />
1913         <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')" />
1914         <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')" />
1915         <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')" />
1916         <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')" />
1917         <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')" />
1918         <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')" />
1919         <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')" />
1920         <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')" />
1921         <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')" />
1922         <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')" />
1923         <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')" />
1924         <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')" />
1925         <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')" />
1926         <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')" />
1927         <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')" />
1928         <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')" />
1929         <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')" />
1930         <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')" />
1931         <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')" />
1932         <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')" />
1933         <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')" />
1934         <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')" />
1935         <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')" />
1936         <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')" />
1937         <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')" />
1938         <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')" />
1939       </map>
1940     </div>
1941   </xsl:template>
1942
1943   <!--==== EDIT EVENT ====-->
1944   <xsl:template match="formElements" mode="editEvent">
1945     <xsl:variable name="subscriptionId" select="subscriptionId"/>
1946     <xsl:variable name="calPathEncoded" select="form/calendar/encodedPath"/>
1947     <xsl:variable name="calPath" select="form/calendar/path"/>
1948     <xsl:variable name="guid" select="guid"/>
1949     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1950     <!-- The name "eventForm" is referenced by several javascript functions. Do not
1951     change it without modifying includes.js -->
1952     <form name="eventForm" method="post" action="{$editEvent}" id="standardForm">
1953       <input type="hidden" name="updateEvent" value="true"/>
1954       <input type="hidden" name="confirmationid" value="{$confId}"/>
1955       <input type="hidden" name="endType" value="date"/>
1956       <h2>Edit Event</h2>
1957       <table class="common" cellspacing="0">
1958         <tr>
1959           <th colspan="2" class="commonHeader">
1960             <div id="eventActions">
1961               <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1962                 <img src="{$resourcesRoot}/resources/glassFill-icon-viewGray.gif" width="13" height="13" border="0" alt="view"/>
1963                 View
1964               </a>
1965               <xsl:if test="currentAccess/current-user-privilege-set/privilege/unbind">
1966                 |
1967                 <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPathEncoded}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1968                   <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
1969                   Delete
1970                 </a>
1971               </xsl:if>
1972             </div>
1973             Personal Event
1974           </th>
1975         </tr>
1976         <tr>
1977           <td class="fieldname">
1978             Title:
1979           </td>
1980           <td class="fieldval">
1981             <xsl:variable name="title" select="form/title/input/@value"/>
1982             <input type="text" name="editEvent.summary" size="80" value="{$title}"/>
1983           </td>
1984         </tr>
1985         <tr>
1986           <td class="fieldname">
1987             Calendar:
1988           </td>
1989           <td class="fieldval">
1990             <xsl:variable name="newCalPath" select="/bedework/formElements/form/calendar/path"/>
1991             <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
1992             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
1993             <span id="bwEventCalDisplay">
1994               <xsl:choose>
1995                 <xsl:when test="contains(/bedework/formElements/form/calendar/path,$userPath)">
1996                   <xsl:value-of select="substring-after(/bedework/formElements/form/calendar/path,$userPath)"/>
1997                 </xsl:when>
1998                 <xsl:otherwise>
1999                   <xsl:value-of select="/bedework/formElements/form/calendar/path"/>
2000                 </xsl:otherwise>
2001               </xsl:choose>
2002             </span>
2003             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
2004           </td>
2005         </tr>
2006         <tr>
2007           <td class="fieldname">
2008             Date &amp; Time:
2009           </td>
2010           <td class="fieldval">
2011             <!-- Set the timefields class for the first load of the page;
2012                  subsequent changes will take place using javascript without a
2013                  page reload. -->
2014             <xsl:variable name="timeFieldsClass">
2015               <xsl:choose>
2016                 <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
2017                 <xsl:otherwise>timeFields</xsl:otherwise>
2018               </xsl:choose>
2019             </xsl:variable>
2020             <xsl:choose>
2021               <xsl:when test="form/allDay/input/@checked='checked'">
2022                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
2023                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
2024                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
2025               </xsl:when>
2026               <xsl:otherwise>
2027                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
2028                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
2029                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
2030               </xsl:otherwise>
2031             </xsl:choose>
2032             all day event<br/>
2033             <div class="dateStartEndBox">
2034               <strong>Start:</strong>
2035               <div class="dateFields">
2036                 <span class="startDateLabel">Date </span>
2037                 <xsl:copy-of select="form/start/month/*"/>
2038                 <xsl:copy-of select="form/start/day/*"/>
2039                 <xsl:choose>
2040                   <xsl:when test="/bedework/creating = 'true'">
2041                     <xsl:copy-of select="form/start/year/*"/>
2042                   </xsl:when>
2043                   <xsl:otherwise>
2044                     <xsl:copy-of select="form/start/yearText/*"/>
2045                   </xsl:otherwise>
2046                 </xsl:choose>
2047               </div>
2048               <script language="JavaScript" type="text/javascript">
2049               <xsl:comment>
2050                 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');
2051               </xsl:comment>
2052               </script>
2053               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
2054               <div class="{$timeFieldsClass}" id="startTimeFields">
2055                 <span id="calWidgetStartTimeHider" class="show">
2056                   <xsl:copy-of select="form/start/hour/*"/>
2057                   <xsl:copy-of select="form/start/minute/*"/>
2058                   <xsl:if test="form/start/ampm">
2059                     <xsl:copy-of select="form/start/ampm/*"/>
2060                   </xsl:if>
2061                   <xsl:text> </xsl:text>
2062                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
2063                 </span>
2064               </div>
2065             </div>
2066             <div class="dateStartEndBox">
2067               <strong>End:</strong>
2068               <xsl:choose>
2069                 <xsl:when test="form/end/type='E'">
2070                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
2071                 </xsl:when>
2072                 <xsl:otherwise>
2073                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
2074                 </xsl:otherwise>
2075               </xsl:choose>
2076               Date
2077               <xsl:variable name="endDateTimeClass">
2078                 <xsl:choose>
2079                   <xsl:when test="form/end/type='E'">shown</xsl:when>
2080                   <xsl:otherwise>invisible</xsl:otherwise>
2081                 </xsl:choose>
2082               </xsl:variable>
2083               <div class="{$endDateTimeClass}" id="endDateTime">
2084                 <div class="dateFields">
2085                   <xsl:copy-of select="form/end/dateTime/month/*"/>
2086                   <xsl:copy-of select="form/end/dateTime/day/*"/>
2087                   <xsl:choose>
2088                     <xsl:when test="/bedework/creating = 'true'">
2089                       <xsl:copy-of select="form/end/dateTime/year/*"/>
2090                     </xsl:when>
2091                     <xsl:otherwise>
2092                       <xsl:copy-of select="form/end/dateTime/yearText/*"/>
2093                     </xsl:otherwise>
2094                   </xsl:choose>
2095                 </div>
2096                 <script language="JavaScript" type="text/javascript">
2097                 <xsl:comment>
2098                   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');
2099                 </xsl:comment>
2100                 </script>
2101                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
2102                 <div class="{$timeFieldsClass}" id="endTimeFields">
2103                   <span id="calWidgetEndTimeHider" class="show">
2104                     <xsl:copy-of select="form/end/dateTime/hour/*"/>
2105                     <xsl:copy-of select="form/end/dateTime/minute/*"/>
2106                     <xsl:if test="form/end/dateTime/ampm">
2107                       <xsl:copy-of select="form/end/dateTime/ampm/*"/>
2108                     </xsl:if>
2109                     <xsl:text> </xsl:text>
2110                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
2111                   </span>
2112                 </div>
2113               </div><br/>
2114               <div id="clock" class="invisible">
2115                 <xsl:call-template name="clock"/>
2116               </div>
2117               <div class="dateFields">
2118                 <xsl:choose>
2119                   <xsl:when test="form/end/type='D'">
2120                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
2121                   </xsl:when>
2122                   <xsl:otherwise>
2123                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
2124                   </xsl:otherwise>
2125                 </xsl:choose>
2126                 Duration
2127                 <xsl:variable name="endDurationClass">
2128                   <xsl:choose>
2129                     <xsl:when test="form/end/type='D'">shown</xsl:when>
2130                     <xsl:otherwise>invisible</xsl:otherwise>
2131                   </xsl:choose>
2132                 </xsl:variable>
2133                 <xsl:variable name="durationHrMinClass">
2134                   <xsl:choose>
2135                     <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
2136                     <xsl:otherwise>shown</xsl:otherwise>
2137                   </xsl:choose>
2138                 </xsl:variable>
2139                 <div class="{$endDurationClass}" id="endDuration">
2140                   <xsl:choose>
2141                     <xsl:when test="form/end/duration/weeks/input/@value = '0'">
2142                     <!-- we are using day, hour, minute format -->
2143                     <!-- must send either no week value or week value of 0 (zero) -->
2144                       <div class="durationBox">
2145                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
2146                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
2147                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
2148                         <span id="durationHrMin" class="{$durationHrMinClass}">
2149                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
2150                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
2151                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
2152                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
2153                         </span>
2154                       </div>
2155                       <span class="durationSpacerText">or</span>
2156                       <div class="durationBox">
2157                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
2158                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
2159                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
2160                       </div>
2161                     </xsl:when>
2162                     <xsl:otherwise>
2163                       <!-- we are using week format -->
2164                       <div class="durationBox">
2165                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
2166                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
2167                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
2168                         <span id="durationHrMin" class="{$durationHrMinClass}">
2169                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
2170                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
2171                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
2172                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
2173                         </span>
2174                       </div>
2175                       <span class="durationSpacerText">or</span>
2176                       <div class="durationBox">
2177                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
2178                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
2179                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
2180                       </div>
2181                     </xsl:otherwise>
2182                   </xsl:choose>
2183                 </div>
2184               </div><br/>
2185               <div class="dateFields" id="noDuration">
2186                 <xsl:choose>
2187                   <xsl:when test="form/end/type='N'">
2188                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
2189                   </xsl:when>
2190                   <xsl:otherwise>
2191                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
2192                   </xsl:otherwise>
2193                 </xsl:choose>
2194                 This event has no duration / end date
2195               </div>
2196             </div>
2197           </td>
2198         </tr>
2199         <!--  Status  -->
2200         <tr>
2201           <td class="fieldname">
2202             Status:
2203           </td>
2204           <td class="fieldval">
2205             <xsl:choose>
2206               <xsl:when test="form/status = 'TENTATIVE'">
2207                 <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
2208               </xsl:when>
2209               <xsl:when test="form/status = 'CANCELLED'">
2210                 <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
2211               </xsl:when>
2212               <xsl:otherwise>
2213                 <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
2214               </xsl:otherwise>
2215             </xsl:choose>
2216           </td>
2217         </tr>
2218         <!--  Transparency  -->
2219         <tr>
2220           <td class="fieldname">
2221             Effects free/busy:
2222           </td>
2223           <td class="fieldval">
2224             <xsl:choose>
2225               <xsl:when test="form/transparency = 'TRANSPARENT'">
2226                 <input type="radio" name="editEvent.transparency" value="OPAQUE"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
2227                 <input type="radio" name="editEvent.transparency" value="TRANSPARENT" checked="checked"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
2228               </xsl:when>
2229               <xsl:otherwise>
2230                 <input type="radio" name="editEvent.transparency" value="OPAQUE" checked="checked"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
2231                 <input type="radio" name="editEvent.transparency" value="TRANSPARENT"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
2232               </xsl:otherwise>
2233             </xsl:choose>
2234           </td>
2235         </tr>
2236         <!--  Description  -->
2237         <tr>
2238           <td class="fieldname">Description:</td>
2239           <td class="fieldval">
2240             <textarea name="editEvent.description" cols="60" rows="4">
2241               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
2242             </textarea>
2243           </td>
2244         </tr>
2245         <tr>
2246           <td class="fieldname">Location:</td>
2247           <td class="fieldval" align="left">
2248             <span class="std-text">choose: </span>
2249             <span id="eventFormLocationList">
2250               <select name="eventLocationId">
2251                 <option value="-1">select...</option>
2252                 <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
2253               </select>
2254             </span>
2255             <span class="std-text"> or add new: </span>
2256             <input type="text" name="laddress" value="" />
2257           </td>
2258         </tr>
2259         <tr>
2260           <td class="fieldname">Event Link:</td>
2261           <td class="fieldval">
2262             <xsl:variable name="link" select="form/link/input/@value"/>
2263             <input type="text" name="editEvent.link" size="80" value="{$link}"/>
2264           </td>
2265         </tr>
2266         <tr>
2267           <td class="fieldname">&#160;</td>
2268           <td class="fieldval">
2269             <input name="submit" type="submit" value="Submit Event"/>&#160;
2270             <input name="cancelled" type="submit" value="Cancel"/>
2271           </td>
2272         </tr>
2273       </table>
2274     </form>
2275
2276     <div id="sharingBox">
2277       <h3>Sharing</h3>
2278       <table class="common">
2279         <tr>
2280           <th class="commonHeader" colspan="2">Current access:</th>
2281         </tr>
2282         <xsl:for-each select="acl/ace">
2283           <tr>
2284             <th class="thin">
2285               <xsl:choose>
2286                 <xsl:when test="invert">
2287                   <em>Deny to
2288                   <xsl:choose>
2289                     <xsl:when test="invert/principal/href">
2290                       <xsl:value-of select="invert/principal/href"/>
2291                     </xsl:when>
2292                     <xsl:when test="invert/principal/property">
2293                       <xsl:value-of select="name(invert/principal/property/*)"/>
2294                     </xsl:when>
2295                     <xsl:otherwise>
2296                       <xsl:value-of select="name(invert/principal/*)"/>
2297                     </xsl:otherwise>
2298                   </xsl:choose>
2299                   </em>
2300                 </xsl:when>
2301                 <xsl:otherwise>
2302                   <xsl:choose>
2303                     <xsl:when test="principal/href">
2304                       <xsl:value-of select="principal/href"/>
2305                     </xsl:when>
2306                     <xsl:when test="principal/property">
2307                       <xsl:value-of select="name(principal/property/*)"/>
2308                     </xsl:when>
2309                     <xsl:otherwise>
2310                       <xsl:value-of select="name(principal/*)"/>
2311                     </xsl:otherwise>
2312                   </xsl:choose>
2313                 </xsl:otherwise>
2314               </xsl:choose>
2315             </th>
2316             <td>
2317               <xsl:value-of select="name(.//grant/*)"/>
2318             </td>
2319           </tr>
2320         </xsl:for-each>
2321       </table>
2322       <form name="eventShareForm" action="{$event-setAccess}" id="shareForm">
2323         <input type="hidden" name="calPath" value="{$calPath}"/>
2324         <input type="hidden" name="guid" value="{$guid}"/>
2325         <input type="hidden" name="recurid" value="{$recurrenceId}"/>
2326         <table cellpadding="0" id="shareFormTable" class="common">
2327           <tr>
2328             <th colspan="2" class="commonHeader">Add:</th>
2329           </tr>
2330           <tr>
2331             <td>
2332               <h5 class="margOk">Who:</h5>
2333               <input type="text" name="who" size="20"/><br/>
2334               <input type="radio" value="user" name="whoType" checked="checked"/> user
2335               <input type="radio" value="group" name="whoType"/> group
2336               <p>OR</p>
2337               <p>
2338                 <input type="radio" value="auth" name="whoType"/> all authorized users<br/>
2339                 <input type="radio" value="other" name="whoType"/> other users
2340               </p>
2341             </td>
2342             <td>
2343               <h5 class="margOk">Rights:</h5>
2344               <ul id="howList">
2345                 <li><input type="radio" value="A" name="how"/> <strong>All</strong> (read, write, delete)</li>
2346                 <li class="padTop">
2347                   <input type="radio" value="R" name="how" checked="checked"/> <strong>Read</strong> (content, access, freebusy)
2348                 </li>
2349                 <li>
2350                   <input type="radio" value="f" name="how"/> Read freebusy only
2351                 </li>
2352                 <li class="padTop">
2353                   <input type="radio" value="W" name="how"/> <strong>Write and delete</strong> (content, access, properties)
2354                 </li>
2355                 <li>
2356                   <input type="radio" value="c" name="how"/> Write content only
2357                 </li>
2358                 <li>
2359                  <input type="radio" value="u" name="how"/> Delete only
2360                 </li>
2361                 <li class="padTop">
2362                   <input type="radio" value="Rc" name="how"/> <strong>Read</strong> and <strong>Write content only</strong>
2363                 </li>
2364                 <li class="padTop">
2365                   <input type="radio" value="N" name="how"/> <strong>None</strong>
2366                 </li>
2367               </ul>
2368             </td>
2369           </tr>
2370         </table>
2371         <!--<p>
2372           Share this event with:<br/>
2373           <input type="text" name="who" size="20"/>
2374           <input type="radio" value="user" name="whoType" checked="checked"/> user
2375           <input type="radio" value="group" name="whoType"/> group
2376         </p>
2377         <p>
2378           Access rights:<br/>
2379           <input type="radio" value="R" name="how" checked="checked"/> read<br/>
2380           <input type="radio" value="Rc" name="how"/> read/write content<br/>
2381           <input type="radio" value="f" name="how"/> read free/busy only<br/>
2382           <input type="radio" value="d" name="how"/> default (reset access)
2383         </p>-->
2384         <input type="submit" name="submit" value="Submit"/>
2385       </form>
2386     </div>
2387   </xsl:template>
2388
2389   <xsl:template match="event" mode="addEventRef">
2390   <!-- The name "eventForm" is referenced by several javascript functions. Do not
2391     change it without modifying includes.js -->
2392     <form name="eventForm" method="post" action="{$event-addEventRefComplete}" id="standardForm"  enctype="multipart/form-data">
2393       <xsl:variable name="subscriptionId" select="subscription/id"/>
2394       <xsl:variable name="calPath" select="calendar/path"/>
2395       <xsl:variable name="guid" select="guid"/>
2396       <xsl:variable name="recurrenceId" select="recurrenceId"/>
2397       <input type="hidden" name="subid" value="{$subscriptionId}"/>
2398       <input type="hidden" name="calPath" value="{$calPath}"/>
2399       <input type="hidden" name="guid" value="{$guid}"/>
2400       <input type="hidden" name="recurrenceId" value="{$recurrenceId}"/>
2401       <!-- newCalPath is the path to the calendar in which the reference
2402            should be placed.  If no value, then default calendar. -->
2403       <input type="hidden" name="newCalPath" value=""/>
2404
2405       <h2>Add Event Reference</h2>
2406       <table class="common" cellspacing="0">
2407         <tr>
2408           <td class="fieldname">
2409             Event:
2410           </td>
2411           <td>
2412             <xsl:value-of select="summary"/>
2413           </td>
2414         </tr>
2415         <tr>
2416           <td class="fieldname">
2417             Into calendar:
2418           </td>
2419           <td align="left">
2420             <span id="bwEventCalDisplay">
2421               <em>default calendar</em>
2422             </span>
2423             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
2424           </td>
2425         </tr>
2426         <tr>
2427           <td class="fieldname">
2428             Affects Free/busy:
2429           </td>
2430           <td align="left">
2431             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
2432             <input type="radio" value="TRANSPARENT" name="transparency" checked="checked"/> no <span class="note">(transparent: event status does not affect your free/busy)</span>
2433           </td>
2434         </tr>
2435       </table>
2436       <table border="0" id="submitTable">
2437         <tr>
2438           <td>
2439             <input name="submit" type="submit" value="Continue"/>
2440             <input name="cancelled" type="submit" value="Cancel"/>
2441           </td>
2442         </tr>
2443       </table>
2444     </form>
2445   </xsl:template>
2446
2447   <!--+++++++++++++++ Free / Busy ++++++++++++++++++++-->
2448   <xsl:template match="freebusy">
2449     <h2>Free / Busy</h2>
2450     <div id="freeBusyWho">for <xsl:value-of select="day/who"/></div>
2451     <table id="freeBusy">
2452       <tr>
2453         <td>&#160;</td>
2454         <xsl:for-each select="day[position()=1]/period">
2455           <th>
2456             <xsl:choose>
2457               <xsl:when test="number(start) mod 200 = 0">
2458                 <xsl:apply-templates select="start" mode="timeDisplay"/>
2459               </xsl:when>
2460               <xsl:otherwise>
2461                 &#160;
2462               </xsl:otherwise>
2463             </xsl:choose>
2464           </th>
2465         </xsl:for-each>
2466       </tr>
2467       <xsl:for-each select="day">
2468         <tr>
2469           <th>
2470             <xsl:value-of select="substring(start,1,4)"/>-<xsl:value-of select="substring(start,5,2)"/>-<xsl:value-of select="substring(start,7,2)"/>
2471           </th>
2472           <xsl:for-each select="period">
2473             <xsl:variable name="startTime"><xsl:apply-templates  select="start" mode="timeDisplay"/></xsl:variable>
2474             <!-- the start date for the add event link is a concat of the day's date plus the period's time (+ seconds)-->
2475             <xsl:variable name="startDate"><xsl:value-of select="substring(../start,1,8)"/>T<xsl:value-of select="start"/>00</xsl:variable>
2476             <xsl:variable name="minutes" select="length"/>
2477             <xsl:variable name="fbClass">
2478               <xsl:choose>
2479                 <xsl:when test="fbtype = '0'">busy</xsl:when>
2480                 <xsl:when test="fbtype = '3'">tentative</xsl:when>
2481                 <xsl:otherwise>free</xsl:otherwise>
2482               </xsl:choose>
2483             </xsl:variable>
2484             <td class="{$fbClass}">
2485               <a href="{$initEvent}&amp;startdate={$startDate}&amp;minutes={$minutes}" title="{$startTime}">*</a>
2486             </td>
2487           </xsl:for-each>
2488         </tr>
2489       </xsl:for-each>
2490     </table>
2491
2492     <table id="freeBusyKey">
2493       <tr>
2494         <td class="free">*</td>
2495         <td>free</td>
2496         <td>&#160;</td>
2497         <td class="busy">*</td>
2498         <td>busy</td>
2499         <td>&#160;</td>
2500         <td class="tentative">*</td>
2501         <td>tentative</td>
2502         <td>&#160;</td>
2503         <td>
2504           <form name="calendarShareForm" action="{$freeBusy-fetch}">
2505             View user's free/busy:<br/>
2506             <input type="text" name="userid" size="20"/>
2507             <input type="submit" name="submit" value="Submit"/>
2508           </form>
2509         </td>
2510       </tr>
2511     </table>
2512
2513     <div id="sharingBox">
2514       <h3>Sharing</h3>
2515       <table class="common">
2516         <tr>
2517           <th class="commonHeader" colspan="2">Current access:</th>
2518         </tr>
2519         <tr>
2520           <th>Users:</th>
2521           <td>
2522             <xsl:choose>
2523               <xsl:when test="/bedework/myCalendars/calendars/calendar/acl/ace/principal/href">
2524                 <xsl:for-each select="/bedework/myCalendars/calendars/calendar/acl/ace[principal/href]">
2525                   <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
2526                 </xsl:for-each>
2527               </xsl:when>
2528               <xsl:otherwise>
2529                 free/busy not shared
2530               </xsl:otherwise>
2531             </xsl:choose>
2532           </td>
2533         </tr>
2534       </table>
2535       <form name="calendarShareForm" action="{$freeBusy-setAccess}" id="shareForm">
2536         <xsl:variable name="calPath" select="/bedework/myCalendars/calendars/calendar/path"/>
2537         <input type="hidden" name="calPath" value="{$calPath}"/>
2538         <p>
2539           Share my free/busy with:<br/>
2540           <input type="text" name="who" size="20"/>
2541           <input type="radio" value="user" name="whoType" checked="checked"/> user
2542           <input type="radio" value="group" name="whoType"/> group
2543         </p>
2544         <p>
2545           Access rights:<br/>
2546           <input type="radio" value="F" name="how" checked="checked"/> view my free/busy<br/>
2547           <input type="radio" value="d" name="how"/> default (reset access)
2548         </p>
2549         <input type="submit" name="submit" value="Submit"/>
2550       </form>
2551     </div>
2552   </xsl:template>
2553
2554   <xsl:template match="start" mode="timeDisplay">
2555     <xsl:choose>
2556       <xsl:when test="node()=0000">12am</xsl:when>
2557       <xsl:when test="node()=0100">1am</xsl:when>
2558       <xsl:when test="node()=0200">2am</xsl:when>
2559       <xsl:when test="node()=0300">3am</xsl:when>
2560       <xsl:when test="node()=0400">4am</xsl:when>
2561       <xsl:when test="node()=0500">5am</xsl:when>
2562       <xsl:when test="node()=0600">6am</xsl:when>
2563       <xsl:when test="node()=0700">7am</xsl:when>
2564       <xsl:when test="node()=0800">8am</xsl:when>
2565       <xsl:when test="node()=0900">9am</xsl:when>
2566       <xsl:when test="node()=1000">10am</xsl:when>
2567       <xsl:when test="node()=1100">11am</xsl:when>
2568       <xsl:when test="node()=1200">NOON</xsl:when>
2569       <xsl:when test="node()=1300">1pm</xsl:when>
2570       <xsl:when test="node()=1400">2pm</xsl:when>
2571       <xsl:when test="node()=1500">3pm</xsl:when>
2572       <xsl:when test="node()=1600">4pm</xsl:when>
2573       <xsl:when test="node()=1700">5pm</xsl:when>
2574       <xsl:when test="node()=1800">6pm</xsl:when>
2575       <xsl:when test="node()=1900">7pm</xsl:when>
2576       <xsl:when test="node()=2000">8pm</xsl:when>
2577       <xsl:when test="node()=2100">9pm</xsl:when>
2578       <xsl:when test="node()=2200">10pm</xsl:when>
2579       <xsl:when test="node()=2300">11pm</xsl:when>
2580       <xsl:when test="node()=2400">12am</xsl:when>
2581       <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2582     </xsl:choose>
2583   </xsl:template>
2584
2585   <!--+++++++++++++++ Calendars ++++++++++++++++++++-->
2586   <xsl:template match="calendars">
2587     <h2>Manage Calendars</h2>
2588     <table id="calendarTable">
2589       <tr>
2590         <td class="cals">
2591           <h3>Calendars</h3>
2592           <ul class="calendarTree">
2593             <xsl:choose>
2594               <xsl:when test="/bedework/page='calendarDescriptions' or
2595                               /bedework/page='displayCalendar'">
2596                 <xsl:apply-templates select="calendar[calType &lt; 2]" mode="listForDisplay"/>
2597               </xsl:when>
2598               <xsl:otherwise>
2599                 <xsl:apply-templates select="calendar[calType &lt; 2]" mode="listForUpdate"/>
2600               </xsl:otherwise>
2601             </xsl:choose>
2602           </ul>
2603         </td>
2604         <td class="calendarContent">
2605           <xsl:choose>
2606             <xsl:when test="/bedework/page='calendarList' or
2607                             /bedework/page='calendarReferenced'">
2608               <xsl:call-template name="calendarList"/>
2609             </xsl:when>
2610             <xsl:when test="/bedework/page='calendarDescriptions'">
2611               <xsl:call-template name="calendarDescriptions"/>
2612             </xsl:when>
2613             <xsl:when test="/bedework/page='displayCalendar'">
2614               <xsl:apply-templates select="/bedework/currentCalendar" mode="displayCalendar"/>
2615             </xsl:when>
2616             <xsl:when test="/bedework/page='deleteCalendarConfirm'">
2617               <xsl:apply-templates select="/bedework/currentCalendar" mode="deleteCalendarConfirm"/>
2618             </xsl:when>
2619             <xsl:when test="/bedework/creating='true'">
2620               <xsl:apply-templates select="/bedework/currentCalendar" mode="addCalendar"/>
2621             </xsl:when>
2622             <xsl:otherwise>
2623               <xsl:apply-templates select="/bedework/currentCalendar" mode="modCalendar"/>
2624             </xsl:otherwise>
2625           </xsl:choose>
2626         </td>
2627       </tr>
2628     </table>
2629   </xsl:template>
2630
2631   <xsl:template match="calendar" mode="myCalendars">
2632     <xsl:variable name="id" select="id"/>
2633     <li>
2634       <xsl:attribute name="class">
2635         <xsl:choose>
2636           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2637                           and path = /bedework/selectionState/subscriptions/subscription/calendar/path">selected</xsl:when>
2638           <xsl:when test="name='Trash'">trash</xsl:when>
2639           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2640           <xsl:otherwise>calendar</xsl:otherwise>
2641         </xsl:choose>
2642       </xsl:attribute>
2643       <xsl:variable name="calPath" select="path"/>
2644       <a href="{$setSelection}&amp;calUrl={$calPath}">
2645         <xsl:value-of select="name"/>
2646       </a>
2647       <xsl:if test="calendar">
2648         <ul>
2649           <xsl:apply-templates select="calendar" mode="myCalendars"/>
2650         </ul>
2651       </xsl:if>
2652       <xsl:if test="calendarCollection='true'">
2653         <!-- set the start date for adding an event to the first day of the
2654              given period, the hour of "now", and give a duration of 60 minutes -->
2655         <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>
2656         <!-- skip setting duration for now; this should be set in the user's prefs-->
2657         <!-- <a href="{$initEvent}&amp;startdate={$startDate}&amp;newCalPath={$calPath}&amp;minutes=60" class="calendarAdd" title="add event"> -->
2658         <a href="{$initEvent}&amp;startdate={$startDate}&amp;newCalPath={$calPath}" class="calendarAdd" title="add event">
2659           <img src="{$resourcesRoot}/resources/addEvent-forCals-icon.gif" width="9" height="12" border="0" alt="add event"/>
2660         </a>
2661       </xsl:if>
2662     </li>
2663   </xsl:template>
2664
2665   <xsl:template match="calendar" mode="mySpecialCalendars">
2666     <!-- Inbox, Outbox, Trash, etc. -->
2667     <xsl:if test="name != 'Deleted'">
2668       <xsl:variable name="id" select="id"/>
2669       <li>
2670         <xsl:attribute name="class">
2671           <xsl:choose>
2672             <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2673                             and path = /bedework/selectionState/subscriptions/subscription/calendar/path">selected</xsl:when>
2674             <xsl:when test="name='Trash'">trash</xsl:when>
2675             <xsl:when test="calendarCollection='false'">folder</xsl:when>
2676             <xsl:otherwise>calendar</xsl:otherwise>
2677           </xsl:choose>
2678         </xsl:attribute>
2679         <xsl:variable name="calPath" select="path"/>
2680           <xsl:choose>
2681             <xsl:when test="name='Inbox' and /bedework/inboxState/numActive != '0'">
2682               <strong>
2683                 <a href="{$showInbox}">
2684                   <xsl:value-of select="name"/>
2685                 </a>
2686                 <xsl:text> </xsl:text>
2687                 (<xsl:value-of select="/bedework/inboxState/numActive"/>)
2688               </strong>
2689             </xsl:when>
2690             <xsl:when test="name='Outbox' and /bedework/outbox/numActive != '0'">
2691               <strong>
2692                 <a href="{$showOutbox}">
2693                   <xsl:value-of select="name"/>
2694                 </a>
2695                 <xsl:text> </xsl:text>
2696                 (<xsl:value-of select="/bedework/outboxState/numActive"/>)
2697               </strong>
2698             </xsl:when>
2699             <xsl:otherwise>
2700               <a href="{$setSelection}&amp;calUrl={$calPath}">
2701                 <xsl:value-of select="name"/>
2702               </a>
2703             </xsl:otherwise>
2704           </xsl:choose>
2705         <xsl:if test="calendar">
2706           <ul>
2707             <xsl:apply-templates select="calendar" mode="myCalendars"/>
2708           </ul>
2709         </xsl:if>
2710       </li>
2711     </xsl:if>
2712   </xsl:template>
2713
2714   <xsl:template match="calendar" mode="listForUpdate">
2715     <xsl:variable name="calPath" select="encodedPath"/>
2716     <li>
2717       <xsl:attribute name="class">
2718         <xsl:choose>
2719           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2720           <xsl:otherwise>calendar</xsl:otherwise>
2721         </xsl:choose>
2722       </xsl:attribute>
2723       <a href="{$calendar-fetchForUpdate}&amp;calPath={$calPath}" title="update">
2724         <xsl:value-of select="name"/>
2725       </a>
2726       <xsl:if test="calendarCollection='false'">
2727         <xsl:text> </xsl:text>
2728         <a href="{$calendar-initAdd}&amp;calPath={$calPath}" title="add a calendar or folder">
2729           <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/>
2730         </a>
2731       </xsl:if>
2732       <xsl:if test="calendar">
2733         <ul>
2734           <xsl:apply-templates select="calendar" mode="listForUpdate">
2735             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2736           </xsl:apply-templates>
2737         </ul>
2738       </xsl:if>
2739     </li>
2740   </xsl:template>
2741
2742   <xsl:template match="calendar" mode="listForDisplay">
2743     <xsl:variable name="calPath" select="encodedPath"/>
2744     <li>
2745       <xsl:attribute name="class">
2746         <xsl:choose>
2747           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2748           <xsl:otherwise>calendar</xsl:otherwise>
2749         </xsl:choose>
2750       </xsl:attribute>
2751       <a href="{$calendar-fetchForDisplay}&amp;calPath={$calPath}" title="display">
2752         <xsl:value-of select="name"/>
2753       </a>
2754       <xsl:if test="calendar">
2755         <ul>
2756           <xsl:apply-templates select="calendar" mode="listForDisplay">
2757             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
2758           </xsl:apply-templates>
2759         </ul>
2760       </xsl:if>
2761     </li>
2762   </xsl:template>
2763
2764   <!-- the selectCalForEvent listing creates a calendar tree in a pop-up window
2765        from myCalendars and mySubscriptions -->
2766   <xsl:template name="selectCalForEvent">
2767     <h2>Select a calendar</h2>
2768     <form name="toggleCals" action="{$event-selectCalForEvent}">
2769       <xsl:choose>
2770         <xsl:when test="/bedework/appvar[key='showAllCalsForEvent']/value = 'true'">
2771           <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" onclick="submit()"/>
2772           show only writable calendars
2773           <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" checked="checked" onclick="submit()"/>
2774           show all calendars
2775         </xsl:when>
2776         <xsl:otherwise>
2777           <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" checked="checked" onclick="submit()"/>
2778           show only writable calendars
2779           <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" onclick="submit()"/>
2780           show all calendars
2781         </xsl:otherwise>
2782       </xsl:choose>
2783     </form>
2784     <h4>My Calendars</h4>
2785     <ul class="calendarTree">
2786       <xsl:choose>
2787         <xsl:when test="/bedework/appvar[key='showAllCalsForEvent']/value = 'true'">
2788           <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar[calType &lt; 2]" mode="selectCalForEventCalTree"/>
2789         </xsl:when>
2790         <xsl:otherwise>
2791           <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar[currentAccess/current-user-privilege-set/privilege/write-content and calType &lt; 2]" mode="selectCalForEventCalTree"/>
2792         </xsl:otherwise>
2793       </xsl:choose>
2794     </ul>
2795     <h4>Subscribed Calendars</h4>
2796     <ul class="calendarTree">
2797       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
2798       <xsl:choose>
2799         <xsl:when test="/bedework/appvar[key='showAllCalsForEvent']/value = 'true'">
2800           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]/calendars/calendar[calType &lt; 2]" mode="selectCalForEventCalTree"/>
2801         </xsl:when>
2802         <xsl:otherwise>
2803           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]/calendars/calendar[currentAccess/current-user-privilege-set/privilege/write-content and calType &lt; 2]" mode="selectCalForEventCalTree"/>
2804         </xsl:otherwise>
2805       </xsl:choose>
2806     </ul>
2807   </xsl:template>
2808
2809   <xsl:template match="calendar" mode="selectCalForEventCalTree">
2810     <xsl:variable name="id" select="id"/>
2811     <li>
2812       <xsl:attribute name="class">
2813         <xsl:choose>
2814           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
2815                           and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when>
2816           <xsl:when test="name='Trash'">trash</xsl:when>
2817           <xsl:when test="calendarCollection='false'">folder</xsl:when>
2818           <xsl:otherwise>calendar</xsl:otherwise>
2819         </xsl:choose>
2820       </xsl:attribute>
2821       <xsl:variable name="calPath" select="path"/>
2822       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
2823       <xsl:variable name="calDisplay">
2824         <xsl:choose>
2825           <xsl:when test="contains(path,$userPath)">
2826             <xsl:value-of select="substring-after(path,$userPath)"/>
2827           </xsl:when>
2828           <xsl:otherwise>
2829             <xsl:value-of select="path"/>
2830           </xsl:otherwise>
2831         </xsl:choose>
2832       </xsl:variable>
2833       <xsl:choose>
2834         <xsl:when test="currentAccess/current-user-privilege-set/privilege/write-content and (calendarCollection = 'true')">
2835           <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}')">
2836             <strong><xsl:value-of select="name"/></strong>
2837           </a>
2838         </xsl:when>
2839         <xsl:otherwise>
2840           <xsl:value-of select="name"/>
2841         </xsl:otherwise>
2842       </xsl:choose>
2843       <xsl:if test="calendar">
2844         <ul>
2845           <xsl:apply-templates select="calendar" mode="selectCalForEventCalTree"/>
2846         </ul>
2847       </xsl:if>
2848     </li>
2849   </xsl:template>
2850
2851   <xsl:template match="currentCalendar" mode="addCalendar">
2852     <h3>Add Calendar / Folder</h3>
2853     <form name="addCalForm" action="{$calendar-update}">
2854       <table class="common">
2855         <tr>
2856           <th>Name:</th>
2857           <td>
2858             <xsl:variable name="curCalName" select="name"/>
2859             <input name="calendar.name" value="{$curCalName}" size="40"/>
2860           </td>
2861         </tr>
2862         <tr>
2863           <th>Summary:</th>
2864           <td>
2865             <xsl:variable name="curCalSummary" select="summary"/>
2866             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2867           </td>
2868         </tr>
2869         <tr>
2870           <th>Description:</th>
2871           <td>
2872             <textarea name="calendar.description" cols="40" rows="4">
2873               <xsl:value-of select="desc"/>
2874             </textarea>
2875           </td>
2876         </tr>
2877         <tr>
2878           <th>Calendar/Folder:</th>
2879           <td>
2880             <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2881             <input type="radio" value="false" name="calendarCollection"/> Folder
2882           </td>
2883         </tr>
2884       </table>
2885
2886       <table border="0" id="submitTable">
2887         <tr>
2888           <td>
2889             <input type="submit" name="addCalendar" value="Add Calendar/Folder"/>
2890             <input type="submit" name="cancelled" value="Cancel"/>
2891             <input type="reset" value="Clear"/>
2892           </td>
2893         </tr>
2894       </table>
2895     </form>
2896
2897     <div id="sharingBox">
2898       <h3>Sharing</h3>
2899       Sharing may be added to a calendar once created.
2900     </div>
2901
2902   </xsl:template>
2903
2904   <xsl:template match="currentCalendar" mode="modCalendar">
2905     <xsl:choose>
2906       <xsl:when test="calendarCollection='true'">
2907         <h3>Modify Calendar</h3>
2908       </xsl:when>
2909       <xsl:otherwise>
2910         <h3>Modify Folder</h3>
2911       </xsl:otherwise>
2912     </xsl:choose>
2913     <xsl:variable name="calPath" select="path"/>
2914     <form name="modCalForm" action="{$calendar-update}">
2915       <table class="common">
2916         <tr>
2917           <th class="commonHeader" colspan="2">
2918             <xsl:value-of select="path"/>
2919           </th>
2920         </tr>
2921         <tr>
2922           <th>Name:</th>
2923           <td>
2924             <xsl:value-of select="name"/>
2925           </td>
2926         </tr>
2927         <tr>
2928           <th>Mailing List ID:</th>
2929           <td>
2930             <xsl:value-of select="mailListId"/>
2931           </td>
2932         </tr>
2933         <tr>
2934           <th>Summary:</th>
2935           <td>
2936             <xsl:variable name="curCalSummary" select="summary"/>
2937             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2938           </td>
2939         </tr>
2940         <tr>
2941           <th>Description:</th>
2942           <td>
2943             <textarea name="calendar.description" cols="40" rows="4">
2944               <xsl:value-of select="desc"/>
2945             </textarea>
2946           </td>
2947         </tr>
2948         <tr>
2949           <th>Calendar/Folder:</th>
2950           <td>
2951             <xsl:choose>
2952               <xsl:when test="calendarCollection='true'">
2953                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2954                 <input type="radio" value="false" name="calendarCollection"/> Folder
2955               </xsl:when>
2956               <xsl:otherwise>
2957                 <input type="radio" value="true" name="calendarCollection"/> Calendar
2958                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
2959               </xsl:otherwise>
2960             </xsl:choose>
2961           </td>
2962         </tr>
2963       </table>
2964
2965       <table border="0" id="submitTable">
2966         <tr>
2967           <td>
2968             <xsl:choose>
2969               <xsl:when test="calendarCollection='true'">
2970                 <input type="submit" name="updateCalendar" value="Update Calendar"/>
2971               </xsl:when>
2972               <xsl:otherwise>
2973                 <input type="submit" name="updateCalendar" value="Update Folder"/>
2974               </xsl:otherwise>
2975             </xsl:choose>
2976             <input type="submit" name="cancelled" value="Cancel"/>
2977             <input type="reset" value="Reset"/>
2978           </td>
2979           <td align="right">
2980             <xsl:choose>
2981               <xsl:when test="calendarCollection='true'">
2982                 <input type="submit" name="delete" value="Delete Calendar"/>
2983               </xsl:when>
2984               <xsl:otherwise>
2985                 <input type="submit" name="delete" value="Delete Folder"/>
2986               </xsl:otherwise>
2987             </xsl:choose>
2988           </td>
2989         </tr>
2990       </table>
2991     </form>
2992     <div id="sharingBox">
2993       <h3>Sharing</h3>
2994       <table class="common">
2995         <tr>
2996           <th class="commonHeader" colspan="2">Current access:</th>
2997         </tr>
2998
2999         <xsl:for-each select="acl/ace">
3000           <tr>
3001             <th class="thin">
3002               <xsl:choose>
3003                 <xsl:when test="invert">
3004                   <em>Deny to
3005                   <xsl:choose>
3006                     <xsl:when test="invert/principal/href">
3007                       <xsl:value-of select="invert/principal/href"/>
3008                     </xsl:when>
3009                     <xsl:when test="invert/principal/property">
3010                       <xsl:value-of select="name(invert/principal/property/*)"/>
3011                     </xsl:when>
3012                     <xsl:otherwise>
3013                       <xsl:value-of select="name(invert/principal/*)"/>
3014                     </xsl:otherwise>
3015                   </xsl:choose>
3016                   </em>
3017                 </xsl:when>
3018                 <xsl:otherwise>
3019                   <xsl:choose>
3020                     <xsl:when test="principal/href">
3021                       <xsl:value-of select="principal/href"/>
3022                     </xsl:when>
3023                     <xsl:when test="principal/property">
3024                       <xsl:value-of select="name(principal/property/*)"/>
3025                     </xsl:when>
3026                     <xsl:otherwise>
3027                       <xsl:value-of select="name(principal/*)"/>
3028                     </xsl:otherwise>
3029                   </xsl:choose>
3030                 </xsl:otherwise>
3031               </xsl:choose>
3032             </th>
3033             <td>
3034               <xsl:value-of select="name(.//grant/*)"/>
3035             </td>
3036           </tr>
3037         </xsl:for-each>
3038       </table>
3039       <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm">
3040         <input type="hidden" name="calPath" value="{$calPath}"/>
3041         <table cellpadding="0" id="shareFormTable" class="common">
3042           <tr>
3043             <th colspan="2" class="commonHeader">Add:</th>
3044           </tr>
3045           <tr>
3046             <td>
3047               <h5>Who:</h5>
3048               <input type="text" name="who" size="20"/><br/>
3049               <input type="radio" value="user" name="whoType" checked="checked"/> user
3050               <input type="radio" value="group" name="whoType"/> group
3051               <p>OR</p>
3052               <p>
3053                 <input type="radio" value="auth" name="whoType"/> all authorized users<br/>
3054                 <input type="radio" value="other" name="whoType"/> other users
3055               </p>
3056             </td>
3057             <td>
3058               <h5>Rights:</h5>
3059               <ul id="howList">
3060                 <li><input type="radio" value="A" name="how"/> <strong>All</strong> (read, write, delete)</li>
3061                 <li class="padTop">
3062                   <input type="radio" value="R" name="how" checked="checked"/> <strong>Read</strong> (content, access, freebusy)
3063                 </li>
3064                 <li>
3065                   <input type="radio" value="f" name="how"/> Read freebusy only
3066                 </li>
3067                 <li class="padTop">
3068                   <input type="radio" value="W" name="how"/> <strong>Write and delete</strong> (content, access, properties)
3069                 </li>
3070                 <li>
3071                   <input type="radio" value="c" name="how"/> Write content only
3072                 </li>
3073                 <li>
3074                  <input type="radio" value="u" name="how"/> Delete only
3075                 </li>
3076                 <li class="padTop">
3077                   <input type="radio" value="Rc" name="how"/> <strong>Read</strong> and <strong>Write content only</strong>
3078                 </li>
3079                 <li class="padTop">
3080                   <input type="radio" value="N" name="how"/> <strong>None</strong>
3081                 </li>
3082               </ul>
3083             </td>
3084           </tr>
3085         </table>
3086         <!--<p>
3087           Share with:<br/>
3088           <input type="text" name="who" size="20"/>
3089           <input type="radio" value="user" name="whoType" checked="checked"/> user
3090           <input type="radio" value="group" name="whoType"/> group
3091         </p>
3092         <p>
3093           Access rights:<br/>
3094           <input type="radio" value="R" name="how" checked="checked"/> read<br/>
3095           <input type="radio" value="Rc" name="how"/> read/write content<br/>
3096           <input type="radio" value="f" name="how"/> read free/busy only<br/>
3097           <input type="radio" value="d" name="how"/> default (reset access)
3098         </p>-->
3099         <input type="submit" name="submit" value="Submit"/>
3100       </form>
3101     </div>
3102   </xsl:template>
3103
3104   <xsl:template name="calendarList">
3105     <h3>Managing Calendars</h3>
3106     <ul>
3107       <li>Select an item from the calendar list on the left to modify
3108       a calendar or folder.</li>
3109       <li>Select the
3110       <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="true" border="0"/>
3111       icon to add a new calendar or folder to the tree.
3112         <ul>
3113           <li>Folders may only contain calendars and subfolders.</li>
3114           <li>Calendars may only contain events (and other calendar items).</li>
3115           <li>
3116             If a calendar is empty, it may be converted to a folder and vice
3117             versa.  If a calendar or folder are not empty, it may not be
3118             converted.
3119           </li>
3120         </ul>
3121       </li>
3122     </ul>
3123   </xsl:template>
3124
3125   <xsl:template name="calendarDescriptions">
3126     <h2>Calendar Information</h2>
3127     <ul>
3128       <li>Select an item from the calendar tree on the left to view all information
3129       about that calendar or folder.  The tree on the left represents the calendar
3130       heirarchy.</li>
3131     </ul>
3132
3133     <p><strong>All Calendar Descriptions:</strong></p>
3134     <table id="flatCalendarDescriptions" cellspacing="0">
3135       <tr>
3136         <th>Name</th>
3137         <th>Description</th>
3138       </tr>
3139       <xsl:for-each select="//calendar[calType &lt; 2]">
3140         <xsl:variable name="descClass">
3141           <xsl:choose>
3142             <xsl:when test="position() mod 2 = 0">even</xsl:when>
3143             <xsl:otherwise>odd</xsl:otherwise>
3144           </xsl:choose>
3145         </xsl:variable>
3146         <tr class="{$descClass}">
3147           <td>
3148             <xsl:value-of select="name"/>
3149           </td>
3150           <td>
3151             <xsl:value-of select="desc"/>
3152           </td>
3153         </tr>
3154       </xsl:for-each>
3155     </table>
3156   </xsl:template>
3157
3158   <xsl:template match="currentCalendar" mode="displayCalendar">
3159     <h2>Calendar Information</h2>
3160     <table class="common">
3161       <tr>
3162         <th>Name:</th>
3163         <td>
3164           <xsl:value-of select="name"/>
3165         </td>
3166       </tr>
3167       <tr>
3168         <th>Path:</th>
3169         <td>
3170           <xsl:value-of select="path"/>
3171         </td>
3172       </tr>
3173       <tr>
3174         <th>Summary:</th>
3175         <td>
3176           <xsl:value-of select="summary"/>
3177         </td>
3178       </tr>
3179       <tr>
3180         <th>Description:</th>
3181         <td>
3182           <xsl:value-of select="desc"/>
3183         </td>
3184       </tr>
3185     </table>
3186   </xsl:template>
3187
3188   <xsl:template match="currentCalendar" mode="deleteCalendarConfirm">
3189     <xsl:choose>
3190       <xsl:when test="calendarCollection='true'">
3191         <h3>Delete Calendar</h3>
3192         <p>
3193           The following calendar will be deleted.  Continue?
3194         </p>
3195       </xsl:when>
3196       <xsl:otherwise>
3197         <h3>Delete Folder</h3>
3198         <p>
3199           The following folder <em>and all its contents</em> will be deleted.
3200           Continue?
3201         </p>
3202       </xsl:otherwise>
3203     </xsl:choose>
3204
3205     <form name="delCalForm" action="{$calendar-delete}">
3206       <table class="common">
3207         <tr>
3208           <th>Path:</th>
3209           <td>
3210             <xsl:value-of select="path"/>
3211           </td>
3212         </tr>
3213         <tr>
3214           <th>Name:</th>
3215           <td>
3216             <xsl:value-of select="name"/>
3217           </td>
3218         </tr>
3219         <tr>
3220           <th>Summary:</th>
3221           <td>
3222             <xsl:value-of select="summary"/>
3223           </td>
3224         </tr>
3225         <tr>
3226           <th>Description:</th>
3227           <td>
3228             <xsl:value-of select="desc"/>
3229           </td>
3230         </tr>
3231       </table>
3232
3233       <table border="0" id="submitTable">
3234         <tr>
3235           <td>
3236             <input type="submit" name="cancelled" value="Cancel"/>
3237           </td>
3238           <td align="right">
3239             <xsl:choose>
3240               <xsl:when test="calendarCollection='true'">
3241                 <input type="submit" name="delete" value="Yes: Delete Calendar!"/>
3242               </xsl:when>
3243               <xsl:otherwise>
3244                 <input type="submit" name="delete" value="Yes: Delete Folder!"/>
3245               </xsl:otherwise>
3246             </xsl:choose>
3247           </td>
3248         </tr>
3249       </table>
3250     </form>
3251
3252   </xsl:template>
3253
3254   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
3255   <xsl:template match="subscriptions">
3256     <h2>Manage Subscriptions</h2>
3257     <table id="subsTable">
3258       <tr>
3259         <td class="cals">
3260           <p class="smaller">
3261             Select a calendar below to add a <em><strong>new</strong></em>
3262             internal subscription. <!-- or
3263             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
3264             subscribe to an external calendar</a>.-->
3265           </p>
3266           <h3>My calendars</h3>
3267           <ul class="calendarTree">
3268             <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar[calType &lt; 2]" mode="subscribe"/>
3269           </ul>
3270           <h3>Public calendars</h3>
3271           <ul class="calendarTree">
3272             <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar[calType &lt; 2]" mode="subscribe"/>
3273           </ul>
3274         </td>
3275         <td class="subs">
3276           <xsl:choose>
3277             <xsl:when test="/bedework/page='subscriptions'">
3278               <xsl:call-template name="subscriptionList"/>
3279             </xsl:when>
3280             <xsl:when test="/bedework/page='addSubByUri'">
3281               <xsl:call-template name="addSubByUri"/>
3282             </xsl:when>
3283             <xsl:when test="/bedework/creating='true'">
3284               <xsl:apply-templates select="subscription" mode="addSystemSubscription"/>
3285             </xsl:when>
3286             <xsl:otherwise>
3287               <xsl:apply-templates select="subscription" mode="modSubscription"/>
3288             </xsl:otherwise>
3289           </xsl:choose>
3290         </td>
3291       </tr>
3292     </table>
3293   </xsl:template>
3294
3295   <xsl:template match="calendar" mode="subscribe">
3296     <xsl:variable name="calPath" select="encodedPath"/>
3297     <xsl:variable name="itemClass">
3298       <xsl:choose>
3299         <xsl:when test="calendarCollection='false'">folder</xsl:when>
3300         <xsl:otherwise>calendar</xsl:otherwise>
3301       </xsl:choose>
3302     </xsl:variable>
3303     <li class="{$itemClass}">
3304       <a href="{$subscriptions-initAdd}&amp;calPath={$calPath}">
3305         <xsl:value-of select="name"/>
3306       </a>
3307       <xsl:if test="calendar">
3308         <ul>
3309           <xsl:apply-templates select="calendar" mode="subscribe">
3310             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
3311           </xsl:apply-templates>
3312         </ul>
3313       </xsl:if>
3314     </li>
3315   </xsl:template>
3316
3317   <!-- add a subscription to a user calendar by user and path; this is actually
3318        a subscription to an arbitrary URI (which we can expose later) -->
3319   <xsl:template name="addSubByUri">
3320     <h3>Add Subscription to User Calendar</h3>
3321     <p class="note">*the subsciption name must be unique</p>
3322     <form name="subscribeForm" action="{$subscriptions-initAdd}" onsubmit="return setSubscriptionUri(this)" method="post">
3323       <table class="common" cellspacing="0">
3324         <tr>
3325           <td class="fieldname">Name:</td>
3326           <td>
3327             <input type="text" value="" name="name" size="60"/>
3328           </td>
3329         </tr>
3330         <!-- the following would be for an arbitrary URI.  We'll add this later.
3331         <tr>
3332           <td class="fieldname">Uri:</td>
3333           <td>
3334             <input type="text" value="" name="calUri" size="60"/>
3335           </td>
3336         </tr>-->
3337         <tr>
3338           <td class="fieldname">User ID:</td>
3339           <td>
3340             <input type="hidden" value="" name="calUri"/>
3341             <input type="text" value="" name="userId" size="20"/>
3342             <span class="note">ex: douglm</span>
3343           </td>
3344         </tr>
3345         <tr>
3346           <td class="fieldname">User path:</td>
3347           <td>
3348             <input type="text" value="" name="userPath" size="20"/>
3349             <span class="note">(optional) ex: someDept/meetings</span>
3350           </td>
3351         </tr>
3352         <!--<tr>
3353           <td class="fieldname">Display:</td>
3354           <td>
3355             <input type="radio" value="true" name="display" checked="checked"/> yes
3356             <input type="radio" value="false" name="display"/> no
3357           </td>
3358         </tr>-->
3359         <tr>
3360           <td class="fieldname">Affects Free/Busy:</td>
3361           <td>
3362             <input type="radio" value="true" name="affectsFreeBusy"/> yes
3363             <input type="radio" value="false" name="affectsFreeBusy" checked="checked"/> no
3364           </td>
3365         </tr>
3366         <tr>
3367           <td class="fieldname">Style:</td>
3368           <td>
3369             <select name="style">
3370               <option value="default">default</option>
3371               <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
3372                 <xsl:variable name="subColor" select="."/>
3373                 <option value="{$subColor}" class="{$subColor}">
3374                   <xsl:value-of select="@name"/>
3375                 </option>
3376               </xsl:for-each>
3377             </select>
3378           </td>
3379         </tr>
3380         <!--<tr>
3381           <td class="fieldname">Unremovable:</td>
3382           <td>
3383             <input type="radio" value="true" name="unremoveable" size="60"/> true
3384             <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
3385           </td>
3386         </tr>-->
3387       </table>
3388       <table border="0" id="submitTable">
3389         <tr>
3390           <td>
3391             <input type="submit" name="addSubscription" value="Add Subscription"/>
3392             <input type="submit" name="cancelled" value="Cancel"/>
3393             <input type="reset" value="Clear"/>
3394           </td>
3395         </tr>
3396       </table>
3397     </form>
3398   </xsl:template>
3399
3400   <!-- add a subscription to a public calendar within the system -->
3401   <xsl:template match="subscription" mode="addSystemSubscription">
3402     <h3>Add New Subscription</h3>
3403     <p class="note">*the subsciption name must be unique</p>
3404     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
3405       <table class="common" cellspacing="0">
3406         <tr>
3407           <td class="fieldname">Name:</td>
3408           <td>
3409             <xsl:variable name="subName" select="name"/>
3410             <input type="text" value="{$subName}" name="name" size="60"/>
3411           </td>
3412         </tr>
3413         <xsl:if test="internal='false'">
3414           <tr>
3415             <td class="fieldname">Uri:</td>
3416             <td>
3417               <xsl:variable name="calPath" select="uri"/>
3418               <input type="text" value="{$calPath}" name="calPath" size="60"/>
3419             </td>
3420           </tr>
3421         </xsl:if>
3422         <!--<tr>
3423           <td class="fieldname">Display:</td>
3424           <td>
3425             <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
3426             <input type="radio" value="false" name="subscription.display"/> no
3427           </td>
3428         </tr>-->
3429         <tr>
3430           <td class="fieldname">Affects Free/Busy:</td>
3431           <td>
3432             <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes
3433             <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no
3434           </td>
3435         </tr>
3436         <tr>
3437           <td class="fieldname">Style:</td>
3438           <td>
3439             <select name="subscription.style">
3440               <option value="default">default</option>
3441               <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
3442                 <xsl:variable name="subColor" select="."/>
3443                 <option value="{$subColor}" class="{$subColor}">
3444                   <xsl:value-of select="@name"/>
3445                 </option>
3446               </xsl:for-each>
3447             </select>
3448           </td>
3449         </tr>
3450         <!--<tr>
3451           <td class="fieldname">Unremovable:</td>
3452           <td>
3453             <input type="radio" value="true" name="subscription.unremoveable" size="60"/> true
3454             <input type="radio" value="false" name="subscription.unremoveable" size="60" checked="checked"/> false
3455           </td>
3456         </tr>-->
3457       </table>
3458       <table border="0" id="submitTable">
3459         <tr>
3460           <td>
3461             <input type="submit" name="addSubscription" value="Add Subscription"/>
3462             <input type="submit" name="cancelled" value="Cancel"/>
3463             <input type="reset" value="Clear"/>
3464           </td>
3465         </tr>
3466       </table>
3467     </form>
3468   </xsl:template>
3469
3470   <xsl:template match="subscription" mode="modSubscription">
3471     <h3>Modify Subscription</h3>
3472     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
3473       <table class="common" cellspacing="0">
3474         <tr>
3475           <td class="fieldname">Name:</td>
3476           <td>
3477             <xsl:value-of select="name"/>
3478             <xsl:variable name="subName" select="name"/>
3479             <input type="hidden" value="{$subName}" name="name"/>
3480           </td>
3481         </tr>
3482         <xsl:choose>
3483           <xsl:when test="internal='false'">
3484             <tr>
3485               <td class="fieldname">Uri:</td>
3486               <td>
3487                 <xsl:variable name="subUri" select="uri"/>
3488                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
3489               </td>
3490             </tr>
3491           </xsl:when>
3492           <xsl:otherwise>
3493             <tr>
3494               <td class="fieldname">Uri:</td>
3495               <td>
3496                 <xsl:value-of select="uri"/>
3497               </td>
3498             </tr>
3499           </xsl:otherwise>
3500         </xsl:choose>
3501         <!-- <tr>
3502           <td class="fieldname">Display:</td>
3503           <td>
3504             <xsl:choose>
3505               <xsl:when test="display='true'">
3506                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
3507                 <input type="radio" value="false" name="subscription.display"/> no
3508               </xsl:when>
3509               <xsl:otherwise>
3510                 <input type="radio" value="true" name="subscription.display"/> yes
3511                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
3512               </xsl:otherwise>
3513             </xsl:choose>
3514           </td>
3515         </tr> -->
3516         <tr>
3517           <td class="fieldname">Affects Free/Busy:</td>
3518           <td>
3519             <xsl:choose>
3520               <xsl:when test="affectsFreeBusy='true'">
3521                 <input type="radio" value="true" name="subscription.affectsFreeBusy" checked="checked"/> yes
3522                 <input type="radio" value="false" name="subscription.affectsFreeBusy"/> no
3523               </xsl:when>
3524               <xsl:otherwise>
3525                 <input type="radio" value="true" name="subscription.affectsFreeBusy"/> yes
3526                 <input type="radio" value="false" name="subscription.affectsFreeBusy" checked="checked"/> no
3527               </xsl:otherwise>
3528             </xsl:choose>
3529           </td>
3530         </tr>
3531         <tr>
3532           <td class="fieldname">Style:</td>
3533           <td>
3534             <xsl:variable name="subStyle" select="style"/>
3535             <select name="subscription.style">
3536               <option value="default">default</option>
3537               <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
3538                 <xsl:variable name="subColor" select="."/>
3539                 <xsl:choose>
3540                   <xsl:when test="$subStyle = $subColor">
3541                     <option value="{$subColor}" class="{$subColor}" selected="selected">
3542                       <xsl:value-of select="@name"/>
3543                     </option>
3544                   </xsl:when>
3545                   <xsl:otherwise>
3546                     <option value="{$subColor}" class="{$subColor}">
3547                       <xsl:value-of select="@name"/>
3548                     </option>
3549                   </xsl:otherwise>
3550                 </xsl:choose>
3551               </xsl:for-each>
3552             </select>
3553           </td>
3554         </tr>
3555         <!--<tr>
3556           <td class="fieldname">Unremovable:</td>
3557           <td>
3558             <xsl:choose>
3559               <xsl:when test="unremoveable='true'">
3560                 <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
3561                 <input type="radio" value="false" name="unremoveable" size="60"/> false
3562               </xsl:when>
3563               <xsl:otherwise>
3564                 <input type="radio" value="true" name="unremoveable" size="60"/> true
3565                 <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
3566               </xsl:otherwise>
3567             </xsl:choose>
3568           </td>
3569         </tr>-->
3570       </table>
3571       <table border="0" id="submitTable">
3572         <tr>
3573           <td>
3574             <input type="submit" name="updateSubscription" value="Update Subscription"/>
3575             <input type="submit" name="cancelled" value="Cancel"/>
3576             <input type="reset" value="Reset"/>
3577           </td>
3578           <td align="right">
3579             <input type="submit" name="delete" value="Delete Subscription"/>
3580           </td>
3581         </tr>
3582       </table>
3583     </form>
3584   </xsl:template>
3585
3586   <xsl:template name="subscriptionList">
3587     <h3>Current subscriptions</h3>
3588     <table class="common" cellspacing="0">
3589       <tr>
3590         <th>Name</th>
3591         <th>URI</th>
3592         <th>Style</th>
3593         <!--<th>Display</th>-->
3594         <th>Free/Busy</th>
3595         <!--<th>Unremovable</th>
3596         <th>External</th>
3597         <th>Deleted?</th>-->
3598       </tr>
3599       <xsl:for-each select="subscription">
3600         <xsl:variable name="style" select="style"/>
3601         <tr>
3602           <td>
3603             <xsl:variable name="subname" select="name"/>
3604             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
3605               <xsl:value-of select="name"/>
3606             </a>
3607           </td>
3608           <td>
3609             <xsl:value-of select="uri"/>
3610           </td>
3611           <td class="{$style}" style="border: none;">
3612             &#160; <!-- just make room and let the style show -->
3613           </td>
3614           <!-- <td class="center">
3615             <xsl:if test="display='true'">
3616               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3617             </xsl:if>
3618           </td> -->
3619           <td class="center">
3620             <xsl:if test="affectsFreeBusy='true'">
3621               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3622             </xsl:if>
3623           </td>
3624           <!--<td class="center">
3625             <xsl:if test="unremoveable='true'">
3626               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3627             </xsl:if>
3628           </td>
3629           <td class="center">
3630             <xsl:if test="internal='false'">
3631               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3632             </xsl:if>
3633           </td>
3634           <td class="center">
3635             <xsl:if test="calendarDeleted='true'">
3636               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
3637             </xsl:if>
3638           </td>-->
3639         </tr>
3640       </xsl:for-each>
3641     </table>
3642     <h4><a href="{$subscriptions-addSubByUri}">Subscribe to another user's calendar</a></h4>
3643   </xsl:template>
3644
3645   <xsl:template match="subscription" mode="mySubscriptions">
3646     <xsl:variable name="itemClass">
3647       <xsl:choose>
3648         <xsl:when test="/bedework/selectionState/selectionType = 'subscription'
3649                         and /bedework/selectionState/subscriptions/subscription/name = name">selected</xsl:when>
3650         <xsl:otherwise>calendar</xsl:otherwise>
3651       </xsl:choose>
3652     </xsl:variable>
3653     <li class="{$itemClass}">
3654       <xsl:variable name="subName" select="name"/>
3655       <xsl:if test="style != '' and style != 'default'">
3656         <!-- the spacer gif approach allows us to avoid some IE misbehavior -->
3657         <xsl:variable name="subStyle" select="style"/>
3658         <img src="{$resourcesRoot}/resources/spacer.gif" width="6" height="6" alt="subscription style" class="subStyle {$subStyle}"/>
3659       </xsl:if>
3660       <a href="{$setSelection}&amp;subname={$subName}">
3661         <xsl:value-of select="name"/>
3662       </a>
3663       <xsl:if test="calendars/calendar/calendarCollection='true' and
3664                     calendars/calendar/currentAccess/current-user-privilege-set/privilege/write-content">
3665         <!-- set the start date for adding an event to the first day of the
3666              given period, the hour of "now", and give a duration of 60 minutes -->
3667         <xsl:variable name="calPath" select="calendars/calendar/encodedPath"/>
3668         <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>
3669         <a href="{$initEvent}&amp;startdate={$startDate}&amp;newCalPath={$calPath}&amp;minutes=60" class="calendarAdd" title="add event">
3670           <img src="{$resourcesRoot}/resources/addEvent-forCals-icon.gif" width="9" height="12" border="0" alt="add event"/>
3671         </a>
3672       </xsl:if>
3673     </li>
3674   </xsl:template>
3675
3676   <!--==== ALARM OPTIONS ====-->
3677   <xsl:template name="alarmOptions">
3678     <form method="post" action="{$setAlarm}" id="standardForm">
3679       <input type="hidden" name="updateAlarmOptions" value="true"/>
3680       <table class="common" cellspacing="0">
3681         <tr>
3682           <th colspan="2" class="commonHeader">Alarm options</th>
3683         </tr>
3684         <tr>
3685           <td class="fieldname">
3686             Alarm Date/Time:
3687             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDate/*"/>
3688           </td>
3689           <td class="fieldval">
3690             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmdate/*"/>
3691             <span class="std-text">at  </span>
3692             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmtime/*"/>
3693           </td>
3694         </tr>
3695         <tr>
3696           <td class="fieldname">
3697             or Before/After event:
3698             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDuration/*"/>
3699           </td>
3700           <td align="left">
3701             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/days/*"/>
3702             days
3703             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/hours/*"/>
3704             hours
3705             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/minutes/*"/>
3706             minutes
3707             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/seconds/*"/>
3708             seconds OR:
3709             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/weeks/*"/>
3710             weeks
3711             &#160;
3712             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationBefore/*"/>
3713             before
3714             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationAfter/*"/>
3715             after
3716             &#160;
3717             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelStart/*"/>
3718             start
3719             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelEnd/*"/>
3720             end
3721           </td>
3722         </tr>
3723         <tr>
3724           <td>
3725             Email Address:
3726           </td>
3727           <td align="left">
3728             <xsl:copy-of select="/bedework/alarmoptionsform/form/email/*"/>
3729           </td>
3730         </tr>
3731         <tr>
3732           <td>
3733             Subject:
3734           </td>
3735           <td align="left">
3736             <xsl:copy-of select="/bedework/alarmoptionsform/form/subject/*"/>
3737           </td>
3738         </tr>
3739         <tr>
3740           <td>&#160;</td>
3741           <td>
3742             <input name="submit" type="submit" value="Continue"/>&#160;
3743             <input name="cancelled" type="submit" value="Cancel"/>
3744           </td>
3745         </tr>
3746       </table>
3747     </form>
3748   </xsl:template>
3749
3750   <!--==== UPLOAD ====-->
3751   <xsl:template name="upload">
3752   <!-- The name "eventForm" is referenced by several javascript functions. Do not
3753     change it without modifying includes.js -->
3754     <form name="eventForm" method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
3755       <h2>Upload iCAL File</h2>
3756       <table class="common" cellspacing="0">
3757         <tr>
3758           <td class="fieldname">
3759             Filename:
3760           </td>
3761           <td align="left">
3762             <input type="file" name="uploadFile" size="60" />
3763           </td>
3764         </tr>
3765         <tr>
3766           <td class="fieldname padMeTop">
3767             Into calendar:
3768           </td>
3769           <td align="left" class="padMeTop">
3770             <input type="hidden" name="newCalPath" value=""/>
3771             <span id="bwEventCalDisplay">
3772               <em>default calendar</em>
3773             </span>
3774             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
3775           </td>
3776         </tr>
3777         <tr>
3778           <td class="fieldname padMeTop">
3779             Effects free/busy:
3780           </td>
3781           <td align="left" class="padMeTop">
3782             <input type="radio" value="" name="transparency" checked="checked"/> accept event's settings<br/>
3783             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
3784             <input type="radio" value="TRANSPARENT" name="transparency"/> no <span class="note">(transparent: event status does not affect your free/busy)</span><br/>
3785           </td>
3786         </tr>
3787         <tr>
3788           <td class="fieldname padMeTop">
3789             Status:
3790           </td>
3791           <td align="left" class="padMeTop">
3792             <input type="radio" value="" name="status" checked="checked"/> accept event's status<br/>
3793             <input type="radio" value="CONFIRMED" name="status"/> confirmed<br/>
3794             <input type="radio" value="TENTATIVE" name="status"/> tentative<br/>
3795             <input type="radio" value="CANCELLED" name="status"/> cancelled<br/>
3796           </td>
3797         </tr>
3798       </table>
3799       <table border="0" id="submitTable">
3800         <tr>
3801           <td>
3802             <input name="submit" type="submit" value="Continue"/>
3803             <input name="cancelled" type="submit" value="Cancel"/>
3804           </td>
3805         </tr>
3806       </table>
3807     </form>
3808   </xsl:template>
3809
3810   <!--==== EMAIL OPTIONS ====-->
3811   <xsl:template name="emailOptions">
3812     <form method="post" action="{$mailEvent}" id="standardForm">
3813       <input type="hidden" name="updateEmailOptions" value="true"/>
3814       <table class="common" cellspacing="0">
3815         <tr>
3816           <th colspan="2" class="commonHeader">Update email options</th>
3817         </tr>
3818         <tr>
3819           <td>
3820
3821             Email Address:
3822           </td>
3823           <td align="left">
3824             <xsl:copy-of select="/bedework/emailoptionsform/form/email/*"/>
3825           </td>
3826         </tr>
3827         <tr>
3828           <td>
3829             Subject:
3830           </td>
3831           <td align="left">
3832             <xsl:copy-of select="/bedework/emailoptionsform/form/subject/*"/>
3833           </td>
3834         </tr>
3835         <tr>
3836           <td>&#160;</td>
3837           <td>
3838             <input name="submit" type="submit" value="Continue"/>&#160;
3839             <input name="cancelled" type="submit" value="Cancel"/>
3840           </td>
3841         </tr>
3842       </table>
3843     </form>
3844   </xsl:template>
3845
3846   <!--==== MANAGE LOCATIONS ====-->
3847   <xsl:template name="manageLocations">
3848     <form name="addLocationForm" method="post" action="{$addLocation}" id="standardForm">
3849       <input type="hidden" name="confirmationid" value="{$confId}"/>
3850       <h2>Manage Locations</h2>
3851       <table class="common" cellspacing="0">
3852         <tr>
3853           <th class="commonHeader" colspan="2">Add Location</th>
3854         </tr>
3855         <tr>
3856           <td class="fieldname">
3857             Main Address:
3858           </td>
3859           <td>
3860             <input size="60" name="newLocation.address" type="text"/>
3861           </td>
3862         </tr>
3863         <tr>
3864           <td class="fieldname">
3865             Subaddress:
3866           </td>
3867           <td>
3868             <input size="60" name="newLocation.subaddress" type="text"/>
3869           </td>
3870         </tr>
3871         <tr>
3872           <td class="fieldname">
3873             Location Link:
3874           </td>
3875           <td>
3876             <input size="60" name="newLocation.link" type="text"/>
3877           </td>
3878         </tr>
3879       </table>
3880       <table border="0" id="submitTable">
3881         <tr>
3882           <td>
3883             <input name="submit" type="submit" value="Submit Location"/>
3884             <input name="cancelled" type="submit" value="Cancel"/>
3885           </td>
3886         </tr>
3887       </table>
3888     </form>
3889     <div style="margin-bottom: 1em;">&#160;</div>
3890     <xsl:call-template name="editLocationList"/>
3891   </xsl:template>
3892
3893   <!--==== EDIT LOCATION ====-->
3894   <xsl:template match="formElements" mode="editLocation">
3895     <form name="editLocationForm" method="post" action="{$editLocation}" id="standardForm">
3896       <input type="hidden" name="updateLocation" value="true"/>
3897       <input type="hidden" name="confirmationid" value="{$confId}"/>
3898       <h2>Manage Locations</h2>
3899       <table class="common" cellspacing="0">
3900         <tr>
3901           <th colspan="2" class="commonHeader">
3902             Edit Location
3903           </th>
3904         </tr>
3905         <tr>
3906           <td class="fieldname">
3907             Main Address:
3908           </td>
3909           <td align="left">
3910             <xsl:variable name="addr" select="form/address/input/@value"/>
3911             <input size="60" name="editLocation.address" value="{$addr}" type="text"/>
3912           </td>
3913         </tr>
3914         <tr>
3915           <td class="fieldname">
3916             Subaddress:
3917           </td>
3918           <td align="left">
3919             <xsl:variable name="subaddr" select="form/subaddress/textarea"/>
3920             <input size="60" name="editLocation.subaddress" value="{$subaddr}" type="text"/>
3921           </td>
3922         </tr>
3923         <tr>
3924           <td class="fieldname">
3925             Location Link:
3926           </td>
3927           <td>
3928             <xsl:variable name="link" select="form/link/input/@value"/>
3929             <input size="60" name="editLocation.link" value="{$link}" type="text"/>
3930           </td>
3931         </tr>
3932       </table>
3933       <table border="0" id="submitTable">
3934         <tr>
3935           <td>
3936             <input name="submit" type="submit" value="Submit Location"/>
3937             <input name="cancelled" type="submit" value="Cancel"/>
3938             <input type="reset" value="Reset"/>
3939           </td>
3940           <td align="right">
3941             <xsl:variable name="locId" select="form/id"/>
3942             <a href="{$delLocation}&amp;locationId={$locId}">
3943               <input type="button" name="delete" value="Delete Location"/>
3944             </a>
3945           </td>
3946         </tr>
3947       </table>
3948     </form>
3949     <div style="margin-bottom: 1em;">&#160;</div>
3950     <xsl:call-template name="editLocationList"/>
3951   </xsl:template>
3952
3953   <xsl:template name="editLocationList">
3954     <table class="common" cellspacing="0">
3955       <tr>
3956         <th class="commonHeader" colspan="2">Edit/Delete Locations</th>
3957       </tr>
3958       <td colspan="2" class="plain">
3959         <ul>
3960           <xsl:for-each select="/bedework/formElements/form/locationmenu/select/option[@value>'3']">
3961             <xsl:sort select="."/>
3962             <li>
3963               <xsl:variable name="locationId" select="@value"/>
3964               <a href="{$editLocation}&amp;locationId={$locationId}"><xsl:value-of select="."/></a>
3965             </li>
3966           </xsl:for-each>
3967         </ul>
3968       </td>
3969     </table>
3970   </xsl:template>
3971
3972   <!--==== INBOX, OUTBOX, and SCHEDULING ====-->
3973   <xsl:template match="inbox">
3974     <h2 class="common">Inbox</h2>
3975     <table id="inbox" class="common" cellspacing="0">
3976       <tr>
3977         <th class="commonHeader">from</th>
3978         <th class="commonHeader">title</th>
3979         <th class="commonHeader">start</th>
3980         <th class="commonHeader">end</th>
3981         <th class="commonHeader">method</th>
3982         <th class="commonHeader">status</th>
3983       </tr>
3984       <xsl:for-each select="events/event">
3985         <xsl:variable name="subscriptionId" select="subscription/id"/>
3986         <xsl:variable name="calPath" select="calendar/encodedPath"/>
3987         <xsl:variable name="eventName" select="name"/>
3988         <xsl:variable name="recurrenceId" select="recurrenceId"/>
3989         <tr>
3990           <xsl:attribute name="class">
3991             <xsl:choose>
3992               <xsl:when test="scheduleMethod=1">publish</xsl:when>
3993               <xsl:when test="scheduleMethod=2">request</xsl:when>
3994               <xsl:when test="scheduleMethod=5">cancel</xsl:when>
3995               <xsl:when test="scheduleMethod=7 or scheduleMethod=8">counter</xsl:when>
3996             </xsl:choose>
3997           </xsl:attribute>
3998           <td>
3999             <xsl:value-of select="from"/>
4000           </td>
4001           <td>
4002             <xsl:variable name="inboxItemAction">
4003               <xsl:choose>
4004                 <xsl:when test="scheduleMethod=2"><xsl:value-of select="$schedule-initAttendeeRespond"/></xsl:when>
4005                 <xsl:when test="scheduleMethod=3"><xsl:value-of select="$schedule-initAttendeeReply"/></xsl:when>
4006                 <xsl:otherwise><xsl:value-of select="$schedule-initAttendeeRespond"/></xsl:otherwise>
4007               </xsl:choose>
4008             </xsl:variable>
4009             <a href="{$inboxItemAction}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;eventName={$eventName}&amp;recurrenceId={$recurrenceId}">
4010               <xsl:value-of select="title"/>
4011             </a>
4012           </td>
4013           <td><xsl:value-of select="start/shortdate"/> <xsl:value-of select="start/time"/></td>
4014           <td><xsl:value-of select="end/shortdate"/> <xsl:value-of select="end/time"/></td>
4015           <td><xsl:apply-templates select="scheduleMethod"/></td>
4016           <td>
4017             <xsl:choose>
4018               <xsl:when test="scheduleState=0"><em>unprocessed</em></xsl:when>
4019               <xsl:otherwise>processed</xsl:otherwise>
4020             </xsl:choose>
4021           </td>
4022         </tr>
4023       </xsl:for-each>
4024     </table>
4025   </xsl:template>
4026
4027   <xsl:template match="Outbox">
4028     <h2>Outbox</h2>
4029   </xsl:template>
4030
4031   <xsl:template match="scheduleMethod">
4032     <xsl:choose>
4033       <xsl:when test="node()=1">publish</xsl:when>
4034       <xsl:when test="node()=2">request</xsl:when>
4035       <xsl:when test="node()=3">reply</xsl:when>
4036       <xsl:when test="node()=4">add</xsl:when>
4037       <xsl:when test="node()=5">cancel</xsl:when>
4038       <xsl:when test="node()=6">refresh</xsl:when>
4039       <xsl:when test="node()=7">counter</xsl:when>
4040       <xsl:when test="node()=8">declined</xsl:when><!-- declinecounter -->
4041       <xsl:otherwise>unknown</xsl:otherwise>
4042     </xsl:choose>
4043   </xsl:template>
4044
4045   <xsl:template match="formElements" mode="attendeeRespond">
4046     <xsl:variable name="subscriptionId" select="subscriptionId"/>
4047     <xsl:variable name="calPathEncoded" select="form/calendar/encodedPath"/>
4048     <xsl:variable name="calPath" select="form/calendar/path"/>
4049     <xsl:variable name="guid" select="guid"/>
4050     <xsl:variable name="recurrenceId" select="recurrenceId"/>
4051     <!-- The name "eventForm" is referenced by several javascript functions. Do not
4052     change it without modifying includes.js -->
4053     <form name="eventForm" method="post" action="{$schedule-attendeeRespond}" id="standardForm">
4054       <input type="hidden" name="updateEvent" value="true"/>
4055       <input type="hidden" name="confirmationid" value="{$confId}"/>
4056       <input type="hidden" name="endType" value="date"/>
4057       <h2>Meeting Request</h2>
4058       <table class="common" cellspacing="0">
4059         <tr>
4060           <th colspan="2" class="commonHeader">
4061             <div id="eventActions">
4062
4063             </div>
4064             Organizer:
4065             <xsl:choose>
4066               <xsl:when test="organizer/cn != ''">
4067                 <xsl:value-of select="organizer/cn"/>
4068               </xsl:when>
4069               <xsl:otherwise>
4070                 <xsl:value-of select="substring-after(organizer/organizerUri,'mailto:')"/>
4071               </xsl:otherwise>
4072             </xsl:choose>
4073           </th>
4074         </tr>
4075         <tr>
4076           <td class="fieldname">Action:</td>
4077           <td class="fieldval scheduleActions">
4078             <input type="radio" name="method" value="REPLY" checked="checked" onclick="swapScheduleDisplay('hide');"/>reply as
4079             <select name="partstat">
4080               <option value="ACCEPTED">accepted</option>
4081               <option value="DECLINED">declined</option>
4082               <option value="TENTATIVE">tentative</option>
4083             </select><br/>
4084             <input type="radio" name="method" value="REFRESH" onclick="swapScheduleDisplay('hide');"/>refresh this event<br/>
4085             <input type="radio" name="method" value="DELEGATE" onclick="swapScheduleDisplay('hide');"/>delegate to
4086             <input type="test" name="delegate" value=""/> (uri or account)<br/>
4087             <input type="radio" name="method" value="COUNTER" onclick="swapScheduleDisplay('show');"/>counter (suggest a different date, time, and/or location)
4088           </td>
4089         </tr>
4090         <tr>
4091           <td class="fieldname">Comment:</td>
4092           <td class="fieldval scheduleActions">
4093             <textarea name="comment" cols="60" rows="2">
4094             </textarea>
4095           </td>
4096         </tr>
4097         <tr>
4098           <td class="fieldname">&#160;</td>
4099           <td class="fieldval scheduleActions">
4100             <input name="submit" type="submit" value="Submit"/>&#160;
4101             <input name="cancelled" type="submit" value="Cancel"/>
4102           </td>
4103         </tr>
4104         <tr>
4105           <td class="fieldname">
4106             Title:
4107           </td>
4108           <td class="fieldval">
4109             <strong><xsl:value-of select="form/title/input/@value"/></strong>
4110           </td>
4111         </tr>
4112         <tr>
4113           <td class="fieldname">Description:</td>
4114           <td class="fieldval">
4115             <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
4116           </td>
4117         </tr>
4118         <tr>
4119           <td class="fieldname">
4120             Date &amp; Time:
4121           </td>
4122           <td class="fieldval">
4123             <div id="scheduleDateDisplay">
4124               <xsl:value-of select="form/start/month/select/option[@selected='selected']"/>
4125               <xsl:text> </xsl:text>
4126               <xsl:value-of select="form/start/day/select/option[@selected='selected']"/>,
4127               <xsl:value-of select="form/start/yearText/input/@value"/>
4128               <xsl:text> </xsl:text>
4129               <xsl:value-of select="form/start/hour/select/option[@selected='selected']"/>:<xsl:value-of select="form/start/minute/select/option[@selected='selected']"/>
4130               -
4131               <xsl:value-of select="form/end/dateTime/month/select/option[@selected='selected']"/>
4132               <xsl:text> </xsl:text>
4133               <xsl:value-of select="form/end/dateTime/day/select/option[@selected='selected']"/>,
4134               <xsl:value-of select="form/end/dateTime/yearText/input/@value"/>
4135               <xsl:text> </xsl:text>
4136               <xsl:value-of select="form/end/dateTime/hour/select/option[@selected='selected']"/>:<xsl:value-of select="form/end/dateTime/minute/select/option[@selected='selected']"/>
4137               <xsl:if test="form/allDay/input/@checked='checked'">
4138                 <xsl:text> </xsl:text>
4139                 (all day)
4140               </xsl:if>
4141             </div>
4142             <div id="scheduleDateEdit" class="invisible">
4143               <!-- Set the timefields class for the first load of the page;
4144                    subsequent changes will take place using javascript without a
4145                    page reload. -->
4146               <xsl:variable name="timeFieldsClass">
4147                 <xsl:choose>
4148                   <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
4149                   <xsl:otherwise>timeFields</xsl:otherwise>
4150                 </xsl:choose>
4151               </xsl:variable>
4152               <xsl:choose>
4153                 <xsl:when test="form/allDay/input/@checked='checked'">
4154                   <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
4155                   <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
4156                   <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
4157                 </xsl:when>
4158                 <xsl:otherwise>
4159                   <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
4160                   <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
4161                   <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
4162                 </xsl:otherwise>
4163               </xsl:choose>
4164               all day event<br/>
4165               <div class="dateStartEndBox">
4166                 <strong>Start:</strong>
4167                 <div class="dateFields">
4168                   <span class="startDateLabel">Date </span>
4169                   <xsl:copy-of select="form/start/month/*"/>
4170                   <xsl:copy-of select="form/start/day/*"/>
4171                   <xsl:choose>
4172                     <xsl:when test="/bedework/creating = 'true'">
4173                       <xsl:copy-of select="form/start/year/*"/>
4174                     </xsl:when>
4175                     <xsl:otherwise>
4176                       <xsl:copy-of select="form/start/yearText/*"/>
4177                     </xsl:otherwise>
4178                   </xsl:choose>
4179                 </div>
4180                 <!--<script language="JavaScript" type="text/javascript">
4181                 <xsl:comment>
4182                   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');
4183                 </xsl:comment>
4184                 </script>-->
4185                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
4186                 <div class="{$timeFieldsClass}" id="startTimeFields">
4187                   <span id="calWidgetStartTimeHider" class="show">
4188                     <xsl:copy-of select="form/start/hour/*"/>
4189                     <xsl:copy-of select="form/start/minute/*"/>
4190                     <xsl:if test="form/start/ampm">
4191                       <xsl:copy-of select="form/start/ampm/*"/>
4192                     </xsl:if>
4193                     <xsl:text> </xsl:text>
4194                     <!--<a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>-->
4195                   </span>
4196                 </div>
4197               </div>
4198               <div class="dateStartEndBox">
4199                 <strong>End:</strong>
4200                 <xsl:choose>
4201                   <xsl:when test="form/end/type='E'">
4202                     <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
4203                   </xsl:when>
4204                   <xsl:otherwise>
4205                     <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
4206                   </xsl:otherwise>
4207                 </xsl:choose>
4208                 Date
4209                 <xsl:variable name="endDateTimeClass">
4210                   <xsl:choose>
4211                     <xsl:when test="form/end/type='E'">shown</xsl:when>
4212                     <xsl:otherwise>invisible</xsl:otherwise>
4213                   </xsl:choose>
4214                 </xsl:variable>
4215                 <div class="{$endDateTimeClass}" id="endDateTime">
4216                   <div class="dateFields">
4217                     <xsl:copy-of select="form/end/dateTime/month/*"/>
4218                     <xsl:copy-of select="form/end/dateTime/day/*"/>
4219                     <xsl:choose>
4220                       <xsl:when test="/bedework/creating = 'true'">
4221                         <xsl:copy-of select="form/end/dateTime/year/*"/>
4222                       </xsl:when>
4223                       <xsl:otherwise>
4224                         <xsl:copy-of select="form/end/dateTime/yearText/*"/>
4225                       </xsl:otherwise>
4226                     </xsl:choose>
4227                   </div>
4228                   <!--<script language="JavaScript" type="text/javascript">
4229                   <xsl:comment>
4230                     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');
4231                   </xsl:comment>
4232                   </script>-->
4233                   <div class="{$timeFieldsClass}" id="endTimeFields">
4234                     <span id="calWidgetEndTimeHider" class="show">
4235                       <xsl:copy-of select="form/end/dateTime/hour/*"/>
4236                       <xsl:copy-of select="form/end/dateTime/minute/*"/>
4237                       <xsl:if test="form/end/dateTime/ampm">
4238                         <xsl:copy-of select="form/end/dateTime/ampm/*"/>
4239                       </xsl:if>
4240                       <xsl:text> </xsl:text>
4241                       <!--<a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>-->
4242                     </span>
4243                   </div>
4244                 </div><br/>
4245                 <div id="clock" class="invisible">
4246                   <xsl:call-template name="clock"/>
4247                 </div>
4248                 <div class="dateFields">
4249                   <xsl:choose>
4250                     <xsl:when test="form/end/type='D'">
4251                       <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
4252                     </xsl:when>
4253                     <xsl:otherwise>
4254                       <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
4255                     </xsl:otherwise>
4256                   </xsl:choose>
4257                   Duration
4258                   <xsl:variable name="endDurationClass">
4259                     <xsl:choose>
4260                       <xsl:when test="form/end/type='D'">shown</xsl:when>
4261                       <xsl:otherwise>invisible</xsl:otherwise>
4262                     </xsl:choose>
4263                   </xsl:variable>
4264                   <xsl:variable name="durationHrMinClass">
4265                     <xsl:choose>
4266                       <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
4267                       <xsl:otherwise>shown</xsl:otherwise>
4268                     </xsl:choose>
4269                   </xsl:variable>
4270                   <div class="{$endDurationClass}" id="endDuration">
4271                     <xsl:choose>
4272                       <xsl:when test="form/end/duration/weeks/input/@value = '0'">
4273                       <!-- we are using day, hour, minute format -->
4274                       <!-- must send either no week value or week value of 0 (zero) -->
4275                         <div class="durationBox">
4276                           <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
4277                           <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
4278                           <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
4279                           <span id="durationHrMin" class="{$durationHrMinClass}">
4280                             <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
4281                             <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
4282                             <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
4283                             <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
4284                           </span>
4285                         </div>
4286                         <span class="durationSpacerText">or</span>
4287                         <div class="durationBox">
4288                           <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
4289                           <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
4290                           <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
4291                         </div>
4292                       </xsl:when>
4293                       <xsl:otherwise>
4294                         <!-- we are using week format -->
4295                         <div class="durationBox">
4296                           <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
4297                           <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
4298                           <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
4299                           <span id="durationHrMin" class="{$durationHrMinClass}">
4300                             <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
4301                             <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
4302                             <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
4303                             <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
4304                           </span>
4305                         </div>
4306                         <span class="durationSpacerText">or</span>
4307                         <div class="durationBox">
4308                           <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
4309                           <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
4310                           <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
4311                         </div>
4312                       </xsl:otherwise>
4313                     </xsl:choose>
4314                   </div>
4315                 </div><br/>
4316                 <div class="dateFields" id="noDuration">
4317                   <xsl:choose>
4318                     <xsl:when test="form/end/type='N'">
4319                       <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
4320                     </xsl:when>
4321                     <xsl:otherwise>
4322                       <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
4323                     </xsl:otherwise>
4324                   </xsl:choose>
4325                   This event has no duration / end date
4326                 </div>
4327               </div>
4328             </div>
4329           </td>
4330         </tr>
4331         <tr>
4332           <td class="fieldname">Location:</td>
4333           <td class="fieldval" align="left">
4334             <div id="scheduleLocationDisplay">
4335               <xsl:if test="location/address = ''">
4336                <em>not specified</em>
4337               </xsl:if>
4338               <xsl:value-of select="location/address"/>
4339             </div>
4340             <div id="scheduleLocationEdit" class="invisible">
4341               <span class="std-text">choose: </span>
4342               <span id="eventFormLocationList">
4343                 <select name="eventLocationId">
4344                   <option value="-1">select...</option>
4345                   <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/select/*"/>
4346                 </select>
4347               </span>
4348               <span class="std-text"> or add new: </span>
4349               <input type="text" name="laddress" value="" />
4350             </div>
4351           </td>
4352         </tr>
4353         <xsl:if test="attendee">
4354           <tr>
4355             <td class="fieldname">Attendees:</td>
4356             <td class="fieldval">
4357               <table id="attendees" cellspacing="0">
4358                 <tr>
4359                   <th>role</th>
4360                   <th>status</th>
4361                   <th>attendee</th>
4362                 </tr>
4363                 <xsl:for-each select="attendee">
4364                   <xsl:sort select="cn" order="ascending" case-order="upper-first"/>
4365                   <xsl:sort select="attendeeUri" order="ascending" case-order="upper-first"/>
4366                   <tr>
4367                     <td class="role">
4368                       <xsl:value-of select="role"/>
4369                     </td>
4370                     <td class="status">
4371                       <xsl:value-of select="partstat"/>
4372                     </td>
4373                     <td>
4374                       <xsl:variable name="attendeeUri" select="attendeeUri"/>
4375                       <a href="{$attendeeUri}">
4376                         <xsl:choose>
4377                           <xsl:when test="cn != ''">
4378                             <xsl:value-of select="cn"/>
4379                           </xsl:when>
4380                           <xsl:otherwise>
4381                             <xsl:value-of select="substring-after(attendeeUri,'mailto:')"/>
4382                           </xsl:otherwise>
4383                         </xsl:choose>
4384                       </a>
4385                     </td>
4386                   </tr>
4387                 </xsl:for-each>
4388               </table>
4389             </td>
4390           </tr>
4391         </xsl:if>
4392         <tr>
4393           <td class="fieldname">
4394             Calendar:
4395           </td>
4396           <td class="fieldval">
4397             <xsl:variable name="newCalPath" select="/bedework/formElements/form/calendar/path"/>
4398             <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
4399             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
4400             <!--<span id="bwEventCalDisplay">
4401               <xsl:choose>
4402                 <xsl:when test="contains(/bedework/formElements/form/calendar/path,$userPath)">
4403                   <xsl:value-of select="substring-after(/bedework/formElements/form/calendar/path,$userPath)"/>
4404                 </xsl:when>
4405                 <xsl:otherwise>
4406                   <xsl:value-of select="/bedework/formElements/form/calendar/path"/>
4407                 </xsl:otherwise>
4408               </xsl:choose>
4409             </span>-->
4410             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">copy this event to a calendar</a>
4411           </td>
4412         </tr>
4413         <!--  Transparency  -->
4414         <!--
4415         <tr>
4416           <td class="fieldname">
4417             Effects free/busy:
4418           </td>
4419           <td class="fieldval">
4420             <xsl:choose>
4421               <xsl:when test="form/transparency = 'TRANSPARENT'">
4422                 <input type="radio" name="editEvent.transparency" value="OPAQUE"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
4423                 <input type="radio" name="editEvent.transparency" value="TRANSPARENT" checked="checked"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
4424               </xsl:when>
4425               <xsl:otherwise>
4426                 <input type="radio" name="editEvent.transparency" value="OPAQUE" checked="checked"/>yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
4427                 <input type="radio" name="editEvent.transparency" value="TRANSPARENT"/>no <span class="note">(transparent: event status does not affect your free/busy)</span>
4428               </xsl:otherwise>
4429             </xsl:choose>
4430           </td>
4431         </tr>-->
4432         <xsl:if test="form/link/input/@value != ''">
4433           <tr>
4434             <td class="fieldname">See:</td>
4435             <td class="fieldval">
4436               <a>
4437                 <xsl:attribute name="href"><xsl:value-of select="form/link/input/@value"/></xsl:attribute>
4438                 <xsl:value-of select="form/link/input/@value"/>
4439               </a>
4440             </td>
4441           </tr>
4442         </xsl:if>
4443         <!--  Status  -->
4444         <tr>
4445           <td class="fieldname">
4446             Status:
4447           </td>
4448           <td class="fieldval">
4449             <xsl:value-of select="form/status"/>
4450           </td>
4451         </tr>
4452       </table>
4453     </form>
4454   </xsl:template>
4455
4456   <xsl:template match="event" mode="attendeeReply">
4457     <xsl:variable name="subscriptionId" select="subscription/id"/>
4458     <xsl:variable name="calPath" select="calendar/encodedPath"/>
4459     <xsl:variable name="guid" select="guid"/>
4460     <xsl:variable name="recurrenceId" select="recurrenceId"/>
4461     <xsl:variable name="statusClass">
4462       <xsl:choose>
4463         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
4464         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
4465         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
4466       </xsl:choose>
4467     </xsl:variable>
4468     <h2>
4469       Meeting Reply
4470     </h2>
4471     <table class="common" cellspacing="0">
4472       <tr>
4473         <th colspan="2" class="commonHeader">
4474           <div id="eventActions">
4475           </div>
4476           Organizer:
4477           <xsl:choose>
4478             <xsl:when test="organizer/cn != ''">
4479               <xsl:value-of select="organizer/cn"/>
4480             </xsl:when>
4481             <xsl:otherwise>
4482               <xsl:value-of select="substring-after(organizer/organizerUri,'mailto:')"/>
4483             </xsl:otherwise>
4484           </xsl:choose>
4485         </th>
4486       </tr>
4487       <tr>
4488         <td class="fieldname">
4489           From:
4490         </td>
4491         <td class="fieldval scheduleActions">
4492           <strong>
4493             <a>
4494               <xsl:attribute name="href"><xsl:value-of select="attendee/attendeeUri"/></xsl:attribute>
4495               <xsl:choose>
4496                 <xsl:when test="cn != ''">
4497                   <xsl:value-of select="cn"/>
4498                 </xsl:when>
4499                 <xsl:otherwise>
4500                   <xsl:value-of select="substring-after(attendee/attendeeUri,'mailto:')"/>
4501                 </xsl:otherwise>
4502               </xsl:choose>
4503             </a>
4504           </strong>
4505         </td>
4506       </tr>
4507       <tr>
4508         <td class="fieldname">
4509           Status:
4510         </td>
4511         <td class="fieldval scheduleActions">
4512           <xsl:value-of select="attendee/partstat"/>
4513           <xsl:if test="comments/comment">
4514             <p><strong>Comments:</strong></p>
4515             <xsl:for-each select="comment">
4516               <p><xsl:value-of select="."/></p>
4517             </xsl:for-each>
4518           </xsl:if>
4519         </td>
4520       </tr>
4521       <tr>
4522         <td class="fieldname">
4523           Action:
4524         </td>
4525         <td class="fieldval scheduleActions">
4526           <form name="processReply" action="{$schedule-processAttendeeReply}">
4527             <input type="submit" value="Accept" name="update"/>
4528             <input type="submit" value="Cancel" name="cancelled"/>
4529           </form>
4530         </td>
4531       </tr>
4532       <tr>
4533         <td class="fieldname">Title:</td>
4534         <td class="fieldval">
4535           <strong>
4536             <xsl:choose>
4537               <xsl:when test="link != ''">
4538                 <xsl:variable name="link" select="link"/>
4539                 <a href="{$link}">
4540                   <xsl:value-of select="summary"/>
4541                 </a>
4542               </xsl:when>
4543               <xsl:otherwise>
4544                 <xsl:value-of select="summary"/>
4545               </xsl:otherwise>
4546             </xsl:choose>
4547           </strong>
4548         </td>
4549       </tr>
4550       <tr>
4551         <td class="fieldname">When:</td>
4552         <td class="fieldval">
4553           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
4554           <xsl:if test="start/allday = 'false'">
4555             <span class="time"><xsl:value-of select="start/time"/></span>
4556           </xsl:if>
4557           <xsl:if test="(end/longdate != start/longdate) or
4558                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
4559           <xsl:if test="end/longdate != start/longdate">
4560             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
4561           </xsl:if>
4562           <xsl:choose>
4563             <xsl:when test="start/allday = 'true'">
4564               <span class="time"><em>(all day)</em></span>
4565             </xsl:when>
4566             <xsl:when test="end/longdate != start/longdate">
4567               <span class="time"><xsl:value-of select="end/time"/></span>
4568             </xsl:when>
4569             <xsl:when test="end/time != start/time">
4570               <span class="time"><xsl:value-of select="end/time"/></span>
4571             </xsl:when>
4572           </xsl:choose>
4573         </td>
4574         <!--<th class="icon" rowspan="2">
4575           <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
4576           <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">
4577             <img src="{$resourcesRoot}/resources/std-ical-icon.gif" width="20" height="26" border="0" align="left" alt="Download this event"/>
4578           </a>
4579         </th>-->
4580       </tr>
4581       <tr>
4582         <td class="fieldname">Where:</td>
4583         <td class="fieldval">
4584           <xsl:choose>
4585             <xsl:when test="location/link=''">
4586               <xsl:value-of select="location/address"/>
4587             </xsl:when>
4588             <xsl:otherwise>
4589               <xsl:variable name="locationLink" select="location/link"/>
4590               <a href="{$locationLink}">
4591                 <xsl:value-of select="location/address"/>
4592               </a>
4593             </xsl:otherwise>
4594           </xsl:choose>
4595           <xsl:if test="location/subaddress!=''">
4596             <br/><xsl:value-of select="location/subaddress"/>
4597           </xsl:if>
4598         </td>
4599       </tr>
4600       <tr>
4601         <td class="fieldname">Description:</td>
4602         <td class="fieldval">
4603           <xsl:call-template name="replace">
4604             <xsl:with-param name="string" select="description"/>
4605             <xsl:with-param name="pattern" select="'&#xA;'"/>
4606             <xsl:with-param name="replacement"><br/></xsl:with-param>
4607           </xsl:call-template>
4608         </td>
4609       </tr>
4610       <xsl:if test="status !='' and status != 'CONFIRMED'">
4611         <tr>
4612           <td class="fieldname">Status:</td>
4613           <td class="fieldval">
4614             <xsl:value-of select="status"/>
4615           </td>
4616         </tr>
4617       </xsl:if>
4618       <tr>
4619         <td class="fieldname filler">&#160;</td>
4620         <td class="fieldval">&#160;</td>
4621       </tr>
4622     </table>
4623   </xsl:template>
4624
4625   <xsl:template match="event" mode="addEventRef">
4626   <!-- The name "eventForm" is referenced by several javascript functions. Do not
4627     change it without modifying includes.js -->
4628     <form name="eventForm" method="post" action="{$event-addEventRefComplete}" id="standardForm"  enctype="multipart/form-data">
4629       <xsl:variable name="subscriptionId" select="subscription/id"/>
4630       <xsl:variable name="calPath" select="calendar/path"/>
4631       <xsl:variable name="guid" select="guid"/>
4632       <xsl:variable name="recurrenceId" select="recurrenceId"/>
4633       <input type="hidden" name="subid" value="{$subscriptionId}"/>
4634       <input type="hidden" name="calPath" value="{$calPath}"/>
4635       <input type="hidden" name="guid" value="{$guid}"/>
4636       <input type="hidden" name="recurrenceId" value="{$recurrenceId}"/>
4637       <!-- newCalPath is the path to the calendar in which the reference
4638            should be placed.  If no value, then default calendar. -->
4639       <input type="hidden" name="newCalPath" value=""/>
4640
4641       <h2>Add Event Reference</h2>
4642       <table class="common" cellspacing="0">
4643         <tr>
4644           <td class="fieldname">
4645             Event:
4646           </td>
4647           <td>
4648             <xsl:value-of select="summary"/>
4649           </td>
4650         </tr>
4651         <tr>
4652           <td class="fieldname">
4653             Into calendar:
4654           </td>
4655           <td align="left">
4656             <span id="bwEventCalDisplay">
4657               <em>default calendar</em>
4658             </span>
4659             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
4660           </td>
4661         </tr>
4662         <tr>
4663           <td class="fieldname">
4664             Affects Free/busy:
4665           </td>
4666           <td align="left">
4667             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
4668             <input type="radio" value="TRANSPARENT" name="transparency" checked="checked"/> no <span class="note">(transparent: event status does not affect your free/busy)</span>
4669           </td>
4670         </tr>
4671       </table>
4672       <table border="0" id="submitTable">
4673         <tr>
4674           <td>
4675             <input name="submit" type="submit" value="Continue"/>
4676             <input name="cancelled" type="submit" value="Cancel"/>
4677           </td>
4678         </tr>
4679       </table>
4680     </form>
4681   </xsl:template>
4682
4683   <!--==== PREFERENCES ====-->
4684   <xsl:template match="prefs">
4685     <h2>Manage Preferences</h2>
4686     <ul class="submenu">
4687       <li class="selected">General</li>
4688       <li><a href="{$prefs-fetchSchedulingForUpdate}">Scheduling/Meetings</a></li>
4689     </ul>
4690     <!-- The name "eventForm" is referenced by several javascript functions. Do not
4691     change it without modifying includes.js -->
4692     <form name="eventForm" method="post" action="{$prefs-update}" onSubmit="setWorkDays(this)">
4693       <table class="common">
4694         <tr><td colspan="2" class="fill">User settings:</td></tr>
4695         <tr>
4696           <td class="fieldname">
4697             User:
4698           </td>
4699           <td>
4700             <xsl:value-of select="user"/>
4701             <xsl:variable name="user" select="user"/>
4702             <input type="hidden" name="user" value="{$user}"/>
4703           </td>
4704         </tr>
4705         <tr>
4706           <td class="fieldname">
4707             Email address:
4708           </td>
4709           <td>
4710             <xsl:variable name="email" select="email"/>
4711             <input type="text" name="email" value="{$email}" size="40"/>
4712           </td>
4713         </tr>
4714         <tr><td colspan="2">&#160;</td></tr>
4715         <tr><td colspan="2" class="fill">Adding events:</td></tr>
4716         <!-- hide if only one calendar to select -->
4717         <xsl:if test="count(/bedework/myCalendars/calendars//calendar[currentAccess/current-user-privilege-set/privilege/write-content and calType = '1']) &gt; 1">
4718           <tr>
4719             <td class="fieldname">
4720               Default calendar:
4721             </td>
4722             <td>
4723               <xsl:variable name="newCalPath" select="defaultCalendar/path"/>
4724               <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
4725               <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable>
4726               <span id="bwEventCalDisplay">
4727                 <xsl:choose>
4728                   <xsl:when test="contains(defaultCalendar,$userPath)">
4729                     <xsl:value-of select="substring-after(defaultCalendar,$userPath)"/>
4730                   </xsl:when>
4731                   <xsl:otherwise>
4732                     <xsl:value-of select="defaultCalendar"/>
4733                   </xsl:otherwise>
4734                 </xsl:choose>
4735               </span>
4736               <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a>
4737             </td>
4738           </tr>
4739         </xsl:if>
4740         <tr>
4741           <td class="fieldname">
4742             Preferred end date/time type:
4743           </td>
4744           <td>
4745             <select name="preferredEndType">
4746               <xsl:choose>
4747                 <xsl:when test="preferredEndType = 'duration'">
4748                   <option value="duration" selected="selected">duration</option>
4749                 </xsl:when>
4750                 <xsl:otherwise>
4751                   <option value="duration">duration</option>
4752                 </xsl:otherwise>
4753               </xsl:choose>
4754               <xsl:choose>
4755                 <xsl:when test="preferredEndType = 'date'">
4756                   <option value="date" selected="selected">date/time</option>
4757                 </xsl:when>
4758                 <xsl:otherwise>
4759                   <option value="date">date/time</option>
4760                 </xsl:otherwise>
4761               </xsl:choose>
4762             </select>
4763           </td>
4764         </tr>
4765         <tr><td colspan="2">&#160;</td></tr>
4766         <tr><td colspan="2" class="fill">Workday settings:</td></tr>
4767         <tr>
4768           <td class="fieldname">
4769             Workdays:
4770           </td>
4771           <td>
4772             <xsl:variable name="workDays" select="workDays"/>
4773             <input type="hidden" name="workDays" value="{$workDays}"/>
4774             <xsl:choose>
4775               <xsl:when test="substring(workDays,1,1) = 'W'">
4776                 <input type="checkbox" name="workDayIndex" value="0" checked="checked"/>Sun
4777               </xsl:when>
4778               <xsl:otherwise>
4779                 <input type="checkbox" name="workDayIndex" value="0"/>Sun
4780               </xsl:otherwise>
4781             </xsl:choose>
4782             <xsl:choose>
4783               <xsl:when test="substring(workDays,2,1) = 'W'">
4784                 <input type="checkbox" name="workDayIndex" value="1" checked="checked"/>Mon
4785               </xsl:when>
4786               <xsl:otherwise>
4787                 <input type="checkbox" name="workDayIndex" value="1"/>Mon
4788               </xsl:otherwise>
4789             </xsl:choose>
4790             <xsl:choose>
4791               <xsl:when test="substring(workDays,3,1) = 'W'">
4792                 <input type="checkbox" name="workDayIndex" value="2" checked="checked"/>Tue
4793               </xsl:when>
4794               <xsl:otherwise>
4795                 <input type="checkbox" name="workDayIndex" value="2"/>Tue
4796               </xsl:otherwise>
4797             </xsl:choose>
4798             <xsl:choose>
4799               <xsl:when test="substring(workDays,4,1) = 'W'">
4800                 <input type="checkbox" name="workDayIndex" value="3" checked="checked"/>Wed
4801               </xsl:when>
4802               <xsl:otherwise>
4803                 <input type="checkbox" name="workDayIndex" value="3"/>Wed
4804               </xsl:otherwise>
4805             </xsl:choose>
4806             <xsl:choose>
4807               <xsl:when test="substring(workDays,5,1) = 'W'">
4808                 <input type="checkbox" name="workDayIndex" value="4" checked="checked"/>Thu
4809               </xsl:when>
4810               <xsl:otherwise>
4811                 <input type="checkbox" name="workDayIndex" value="4"/>Thu
4812               </xsl:otherwise>
4813             </xsl:choose>
4814             <xsl:choose>
4815               <xsl:when test="substring(workDays,6,1) = 'W'">
4816                 <input type="checkbox" name="workDayIndex" value="5" checked="checked"/>Fri
4817               </xsl:when>
4818               <xsl:otherwise>
4819                 <input type="checkbox" name="workDayIndex" value="5"/>Fri
4820               </xsl:otherwise>
4821             </xsl:choose>
4822             <xsl:choose>
4823               <xsl:when test="substring(workDays,7,1) = 'W'">
4824                 <input type="checkbox" name="workDayIndex" value="6" checked="checked"/>Sat
4825               </xsl:when>
4826               <xsl:otherwise>
4827                 <input type="checkbox" name="workDayIndex" value="6"/>Sat
4828               </xsl:otherwise>
4829             </xsl:choose>
4830           </td>
4831         </tr>
4832         <tr>
4833           <td class="fieldname">
4834             Workday start:
4835           </td>
4836           <td>
4837             <select name="workDayStart">
4838               <xsl:call-template name="buildWorkdayOptionsList">
4839                 <xsl:with-param name="selectedVal" select="workDayStart"/>
4840               </xsl:call-template>
4841             </select>
4842           </td>
4843         </tr>
4844         <tr>
4845           <td class="fieldname">
4846             Workday end:
4847           </td>
4848           <td>
4849             <xsl:variable name="workDayEnd" select="workDayEnd"/>
4850             <select name="workDayEnd">
4851               <xsl:call-template name="buildWorkdayOptionsList">
4852                 <xsl:with-param name="selectedVal" select="workDayEnd"/>
4853               </xsl:call-template>
4854             </select>
4855           </td>
4856         </tr>
4857         <tr><td colspan="2">&#160;</td></tr>
4858         <tr><td colspan="2" class="fill">Display options:</td></tr>
4859         <xsl:if test="/bedework/views/view[position()=2]">
4860           <!-- only display if there is more than one to select -->
4861           <tr>
4862             <td class="fieldname">
4863               Preferred view:
4864             </td>
4865             <td>
4866               <xsl:variable name="preferredView" select="preferredView"/>
4867               <select name="preferredView">
4868                 <xsl:for-each select="/bedework/views/view">
4869                   <xsl:variable name="viewName" select="name"/>
4870                   <xsl:choose>
4871                     <xsl:when test="viewName = $preferredView">
4872                       <option value="{$viewName}" selected="selected"><xsl:value-of select="name"/></option>
4873                     </xsl:when>
4874                     <xsl:otherwise>
4875                       <option value="{$viewName}"><xsl:value-of select="name"/></option>
4876                     </xsl:otherwise>
4877                   </xsl:choose>
4878                 </xsl:for-each>
4879               </select>
4880             </td>
4881           </tr>
4882         </xsl:if>
4883         <tr>
4884           <td class="fieldname">
4885             Preferred view period:
4886           </td>
4887           <td>
4888             <select name="viewPeriod">
4889               <!-- picking the selected item could be done with javascript. for
4890                    now, this will do.  -->
4891               <xsl:choose>
4892                 <xsl:when test="preferredViewPeriod = 'dayView'">
4893                   <option value="dayView" selected="selected">day</option>
4894                 </xsl:when>
4895                 <xsl:otherwise>
4896                   <option value="dayView">day</option>
4897                 </xsl:otherwise>
4898               </xsl:choose>
4899               <xsl:choose>
4900                 <xsl:when test="preferredViewPeriod = 'todayView'">
4901                   <option value="todayView" selected="selected">today</option>
4902                 </xsl:when>
4903                 <xsl:otherwise>
4904                   <option value="todayView">today</option>
4905                 </xsl:otherwise>
4906               </xsl:choose>
4907               <xsl:choose>
4908                 <xsl:when test="preferredViewPeriod = 'weekView'">
4909                   <option value="weekView" selected="selected">week</option>
4910                 </xsl:when>
4911                 <xsl:otherwise>
4912                   <option value="weekView">week</option>
4913                 </xsl:otherwise>
4914               </xsl:choose>
4915               <xsl:choose>
4916                 <xsl:when test="preferredViewPeriod = 'monthView'">
4917                   <option value="monthView" selected="selected">month</option>
4918                 </xsl:when>
4919                 <xsl:otherwise>
4920                   <option value="monthView">month</option>
4921                 </xsl:otherwise>
4922               </xsl:choose>
4923               <xsl:choose>
4924                 <xsl:when test="preferredViewPeriod = 'yearView'">
4925                   <option value="yearView" selected="selected">year</option>
4926                 </xsl:when>
4927                 <xsl:otherwise>
4928                   <option value="yearView">year</option>
4929                 </xsl:otherwise>
4930               </xsl:choose>
4931             </select>
4932           </td>
4933         </tr><!-- as you add skins, update this list and set the selected flag
4934                  as required; hide if not in use -->
4935         <!--<tr>
4936           <td class="fieldname">
4937             Skin name:
4938           </td>
4939           <td>
4940             <xsl:variable name="skinName" select="skinName"/>
4941             <select name="skin">
4942               <option value="default">default</option>
4943             </select>
4944           </td>
4945         </tr> -->
4946         <!-- if you have skin styles, update this list and set the selected flag
4947                  as required; hide if not in use -->
4948         <!--
4949         <tr>
4950           <td class="fieldname">
4951             Skin style:
4952           </td>
4953           <td>
4954             <xsl:variable name="skinStyle" select="skinStyle"/>
4955             <select name="skinStyle">
4956               <option value="default">default</option>
4957             </select>
4958           </td>
4959         </tr> -->
4960         <!-- hide if not in use: -->
4961         <!--<tr>
4962           <td class="fieldname">
4963             Interface mode:
4964           </td>
4965           <td>
4966             <xsl:variable name="userMode" select="userMode"/>
4967             <select name="userMode">
4968               <xsl:choose>
4969                 <xsl:when test="userMode = 0">
4970                   <option value="0" selected="selected">basic</option>
4971                 </xsl:when>
4972                 <xsl:otherwise>
4973                   <option value="0">basic</option>
4974                 </xsl:otherwise>
4975               </xsl:choose>
4976               <xsl:choose>
4977                 <xsl:when test="userMode = 1">
4978                   <option value="1" selected="selected">simple</option>
4979                 </xsl:when>
4980                 <xsl:otherwise>
4981                   <option value="1">simple</option>
4982                 </xsl:otherwise>
4983               </xsl:choose>
4984               <xsl:choose>
4985                 <xsl:when test="userMode = 3">
4986                   <option value="3" selected="selected">advanced</option>
4987                 </xsl:when>
4988                 <xsl:otherwise>
4989                   <option value="3">advanced</option>
4990                 </xsl:otherwise>
4991               </xsl:choose>
4992             </select>
4993           </td>
4994         </tr>-->
4995       </table>
4996       <br />
4997
4998       <input type="submit" name="modPrefs" value="Update"/>
4999       <input type="reset" value="Reset"/>
5000       <input type="submit" name="cancelled" value="Cancel"/>
5001     </form>
5002   </xsl:template>
5003
5004   <xsl:template match="schPrefs">
5005     <h2>Manage Preferences</h2>
5006     <ul class="submenu">
5007       <li><a href="{$prefs-fetchForUpdate}">General</a></li>
5008       <li class="selected"><a href="">Scheduling/Meetings</a></li>
5009     </ul>
5010
5011       <table class="common" cellspacing="0">
5012         <tr>
5013           <th>Can send me scheduling requests:</th>
5014           <th class="leftBorder">Can schedule on my behalf:</th>
5015         </tr>
5016         <tr>
5017           <td class="padMe">
5018             <form name="eventForm" method="post" action="{$prefs-setAccess}">
5019               <input type="hidden" name="what" value="in"/>
5020               <p>
5021                 <input type="text" name="who" width="40"/>
5022                 <input type="radio" name="whoType" value="user" checked="checked"/>user
5023                 <input type="radio" name="whoType" value="group"/>group
5024               </p>
5025               <p>
5026                 <strong>or</strong>
5027                 <input type="radio" name="whoType" value="owner"/>owner
5028                 <input type="radio" name="whoType" value="auth"/>authenticated users
5029                 <input type="radio" name="whoType" value="other"/>anyone
5030               </p>
5031
5032               <p><strong>may send the following to me:</strong></p>
5033
5034               <input type="hidden" name="how" value="S"/>
5035               <dl>
5036                 <dt>
5037                   <input type="checkbox" name="howSetter" value="S" checked="checked" onchange="setScheduleHow(this)"/>all scheduling
5038                 </dt>
5039                 <dd>
5040                   <input type="checkbox" name="howSetter" value="t" checked="checked" disabled="disabled"/>scheduling requests<br/>
5041                   <input type="checkbox" name="howSetter" value="y" checked="checked" disabled="disabled"/>scheduling replies<br/>
5042                   <input type="checkbox" name="howSetter" value="s" checked="checked" disabled="disabled"/>free-busy requests
5043                 </dd>
5044               </dl>
5045
5046               <input type="submit" name="modPrefs" value="Update"/>
5047               <input type="reset" value="Reset"/>
5048               <input type="submit" name="cancelled" value="Cancel"/>
5049             </form>
5050             <h3>Current Access:</h3>
5051             <xsl:for-each select="inbox/acl/ace[principal/href]">
5052               <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
5053             </xsl:for-each>
5054           </td>
5055           <td class="leftBorder padMe">
5056             <form name="eventForm" method="post" action="{$prefs-setAccess}">
5057               <input type="hidden" name="what" value="out"/>
5058               <p>
5059                 <input type="text" name="who" width="40"/>
5060                 <input type="radio" name="whoType" value="user" checked="checked"/>user
5061                 <input type="radio" name="whoType" value="group"/>group
5062               </p>
5063               <p>
5064                 <strong>or</strong>
5065                 <input type="radio" name="whoType" value="owner"/>owner
5066                 <input type="radio" name="whoType" value="auth"/>authenticated users
5067                 <input type="radio" name="whoType" value="other"/>anyone
5068               </p>
5069
5070               <p><strong>may send the following on my behalf:</strong></p>
5071
5072               <input type="hidden" name="how" value="S"/>
5073               <dl>
5074                 <dt>
5075                   <input type="checkbox" name="howSetter" value="S" checked="checked" onchange="setScheduleHow(this)"/>all scheduling
5076                 </dt>
5077                 <dd>
5078                   <input type="checkbox" name="howSetter" value="t" checked="checked" disabled="disabled"/>scheduling requests<br/>
5079                   <input type="checkbox" name="howSetter" value="y" checked="checked" disabled="disabled"/>scheduling replies<br/>
5080                   <input type="checkbox" name="howSetter" value="s" checked="checked" disabled="disabled"/>free-busy requests
5081                 </dd>
5082               </dl>
5083
5084               <input type="submit" name="modPrefs" value="Update"/>
5085               <input type="reset" value="Reset"/>
5086               <input type="submit" name="cancelled" value="Cancel"/>
5087             </form>
5088             <h3>Current Access:</h3>
5089             <xsl:for-each select="outbox/acl/ace[principal/href]">
5090               <xsl:value-of select="principal/href"/> (<xsl:value-of select="name(grant/*)"/>)<br/>
5091             </xsl:for-each>
5092           </td>
5093         </tr>
5094       </table>
5095   </xsl:template>
5096
5097   <!-- construct the workDay times options listings from minute 0 to less than
5098        minute 1440 (midnight inclusive); initialize the template with the currently
5099        selected value. Change the default value for "increment" here. minTime
5100        and maxTime are constants. -->
5101   <xsl:template name="buildWorkdayOptionsList">
5102     <xsl:param name="selectedVal"/>
5103     <xsl:param name="increment" select="number(30)"/>
5104     <xsl:param name="currentTime" select="number(0)"/>
5105     <xsl:variable name="minTime" select="number(0)"/>
5106     <xsl:variable name="maxTime" select="number(1440)"/>
5107     <xsl:if test="$currentTime &lt; $maxTime">
5108       <xsl:choose>
5109         <xsl:when test="$currentTime = $selectedVal">
5110           <option value="{$currentTime}" selected="selected">
5111             <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"/>
5112           </option>
5113         </xsl:when>
5114         <xsl:otherwise>
5115           <option value="{$currentTime}">
5116             <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"/>
5117           </option>
5118         </xsl:otherwise>
5119       </xsl:choose>
5120       <xsl:call-template name="buildWorkdayOptionsList">
5121         <xsl:with-param name="selectedVal" select="$selectedVal"/>
5122         <xsl:with-param name="currentTime" select="$currentTime + $increment"/>
5123       </xsl:call-template>
5124     </xsl:if>
5125   </xsl:template>
5126
5127   <!--==== SIDE CALENDAR MENU ====-->
5128   <xsl:template match="calendar" mode="sideList">
5129     <xsl:variable name="calPath" select="encodedPath"/>
5130     <div class="std-text">
5131       <a href="{$setSelection}&amp;calPath={$calPath}"><xsl:value-of select="title"/></a>
5132     </div>
5133   </xsl:template>
5134
5135   <!--==== STAND-ALONE PAGES ====-->
5136   <!-- not currently in use -->
5137   <xsl:template name="selectPage">
5138     <!-- <xsl:choose>
5139       <xsl:when test="/bedework/appvar[key='page']">
5140         <xsl:choose>
5141           <xsl:otherwise>
5142             <xsl:call-template name="noPage"/>
5143           </xsl:otherwise>
5144         </xsl:choose>
5145       </xsl:when>
5146       <xsl:otherwise> -->
5147         <xsl:call-template name="noPage"/>
5148       <!--</xsl:otherwise>
5149     </xsl:choose>-->
5150   </xsl:template>
5151
5152   <xsl:template name="noPage">
5153     <p>
5154       Error: there is no page with that name.  Please select a navigational
5155       link to continue.
5156     </p>
5157   </xsl:template>
5158
5159   <!--==== UTILITY TEMPLATES ====-->
5160
5161   <!-- search and replace template taken from
5162        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
5163   <xsl:template name="replace">
5164     <xsl:param name="string" select="''"/>
5165     <xsl:param name="pattern" select="''"/>
5166     <xsl:param name="replacement" select="''"/>
5167     <xsl:choose>
5168       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
5169         <xsl:value-of select="substring-before($string, $pattern)"/>
5170         <xsl:copy-of select="$replacement"/>
5171         <xsl:call-template name="replace">
5172           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
5173           <xsl:with-param name="pattern" select="$pattern"/>
5174           <xsl:with-param name="replacement" select="$replacement"/>
5175         </xsl:call-template>
5176       </xsl:when>
5177       <xsl:otherwise>
5178         <xsl:value-of select="$string"/>
5179       </xsl:otherwise>
5180     </xsl:choose>
5181   </xsl:template>
5182
5183   <!--==== FOOTER ====-->
5184   <xsl:template name="footer">
5185     <div id="footer">
5186       Demonstration calendar; place footer information here.
5187     </div>
5188     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
5189       <tr>
5190         <td class="leftCell">
5191           <a href="http://www.bedework.org/">Bedework Calendar</a> |
5192           <a href="?noxslt=yes">show XML</a> |
5193           <a href="?refreshXslt=yes">refresh XSLT</a>
5194         </td>
5195         <td class="rightCell">
5196           <!--<form name="skinSelectForm" method="post" action="{$setup}">
5197             skin selector:
5198             <select name="skinNameSticky" onChange="submit()">
5199               <option>select a skin</option>
5200               <option value="default">Demo Calendar</option>
5201               <option value="rensselaer">Rensselaer</option>
5202               <option value="washington">Washington</option>
5203             </select>
5204           </form>-->
5205         </td>
5206       </tr>
5207     </table>
5208   </xsl:template>
5209 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.