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

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

updates to event editing and adding in user client; beginnings of category support in user client

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