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

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

subscription style update

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