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

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

basic editing of recurring events

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