root/branches/REL-3.1rc4/calendar3/deployment/webuser/uportal2/resources/demoskins/default/default/default.xsl

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

adding rc4 branch

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