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

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

personal client:

now displays event sharing information in edit event page
fixed up upload validation actions in struts config and stylesheets

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