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

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