root/trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

Revision 1416 (checked in by johnsa, 6 years ago)

admin client: provide some link text for events lacking summaries (titles) in the edit event list

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/strict.dtd"
9       standalone="yes"
10       omit-xml-declaration="yes"/>
11    <xsl:strip-space elements="*"/>
12
13   <!-- ======================================== -->
14   <!--      BEDEWORK ADMIN CLIENT STYLESHEET     -->
15   <!-- ========================================= -->
16
17   <!-- **********************************************************************
18     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
19
20     Redistribution and use of this distribution in source and binary forms,
21     with or without modification, are permitted provided that:
22        The above copyright notice and this permission notice appear in all
23         copies and supporting documentation;
24
25         The name, identifiers, and trademarks of Rensselaer Polytechnic
26         Institute are not used in advertising or publicity without the
27         express prior written permission of Rensselaer Polytechnic Institute;
28
29     DISCLAIMER: The software is distributed" AS IS" without any express or
30     implied warranty, including but not limited to, any implied warranties
31     of merchantability or fitness for a particular purpose or any warrant)'
32     of non-infringement of any current or pending patent rights. The authors
33     of the software make no representations about the suitability of this
34     software for any particular purpose. The entire risk as to the quality
35     and performance of the software is with the user. Should the software
36     prove defective, the user assumes the cost of all necessary servicing,
37     repair or correction. In particular, neither Rensselaer Polytechnic
38     Institute, nor the authors of the software are liable for any indirect,
39     special, consequential, or incidental damages related to the software,
40     to the maximum extent the law permits. -->
41
42   <!-- DEFINE INCLUDES -->
43   <xsl:include href="../../../bedework-common/default/default/errors.xsl"/>
44   <xsl:include href="../../../bedework-common/default/default/messages.xsl"/>
45
46   <!-- DEFINE GLOBAL CONSTANTS -->
47   <!-- URL of html resources (images, css, other html); by default this is
48        set to the application root, but for the admin client
49        this should be changed to point to a
50        web server over https to avoid mixed content errors, e.g.,
51   <xsl:variable name="resourcesRoot" select="'https://mywebserver.edu/myresourcesdir'"/>
52     -->
53   <xsl:variable name="resourcesRoot" select="/bedeworkadmin/approot"/>
54
55   <!-- URL of the XSL template directory -->
56   <!-- The approot is an appropriate place to put
57        included stylesheets and xml fragments. These are generally
58        referenced relatively (like errors.xsl and messages.xsl above);
59        this variable is here for your convenience if you choose to
60        reference it explicitly.  It is not used in this stylesheet, however,
61        and can be safely removed if you so choose. -->
62   <xsl:variable name="appRoot" select="/bedeworkadmin/approot"/>
63
64   <!-- Properly encoded prefixes to the application actions; use these to build
65        urls; allows the application to be used without cookies or within a portal.
66        we will probably change the way we create these before long (e.g. build them
67        dynamically in the xslt). -->
68   <xsl:variable name="setup" select="/bedeworkadmin/urlPrefixes/setup/a/@href"/>
69   <xsl:variable name="logout" select="/bedeworkadmin/urlPrefixes/logout/a/@href"/>
70   <xsl:variable name="search" select="/bedeworkadmin/urlPrefixes/search/search/a/@href"/>
71   <xsl:variable name="search-next" select="/bedeworkadmin/urlPrefixes/search/next/a/@href"/>
72   <!-- events -->
73   <xsl:variable name="event-showEvent" select="/bedeworkadmin/urlPrefixes/event/showEvent/a/@href"/>
74   <xsl:variable name="event-showModForm" select="/bedeworkadmin/urlPrefixes/event/showModForm/a/@href"/>
75   <xsl:variable name="event-showUpdateList" select="/bedeworkadmin/urlPrefixes/event/showUpdateList/a/@href"/>
76   <xsl:variable name="event-showDeleteConfirm" select="/bedeworkadmin/urlPrefixes/event/showDeleteConfirm/a/@href"/>
77   <xsl:variable name="event-initAddEvent" select="/bedeworkadmin/urlPrefixes/event/initAddEvent/a/@href"/>
78   <xsl:variable name="event-initUpdateEvent" select="/bedeworkadmin/urlPrefixes/event/initUpdateEvent/a/@href"/>
79   <xsl:variable name="event-delete" select="/bedeworkadmin/urlPrefixes/event/delete/a/@href"/>
80   <xsl:variable name="event-fetchForDisplay" select="/bedeworkadmin/urlPrefixes/event/fetchForDisplay/a/@href"/>
81   <xsl:variable name="event-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/event/fetchForUpdate/a/@href"/>
82   <xsl:variable name="event-update" select="/bedeworkadmin/urlPrefixes/event/update/a/@href"/>
83   <xsl:variable name="event-selectCalForEvent" select="/bedeworkadmin/urlPrefixes/event/selectCalForEvent/a/@href"/>
84   <xsl:variable name="event-showRdates" select="/bedeworkadmin/urlPrefixes/event/showRdates"/>
85   <xsl:variable name="event-setRdate" select="/bedeworkadmin/urlPrefixes/event/setRdate"/>
86   <xsl:variable name="event-initUpload" select="/bedeworkadmin/urlPrefixes/event/initUpload/a/@href"/>
87   <xsl:variable name="event-upload" select="/bedeworkadmin/urlPrefixes/event/upload/a/@href"/>
88   <!-- contacts -->
89   <xsl:variable name="contact-showContact" select="/bedeworkadmin/urlPrefixes/contact/showContact/a/@href"/>
90   <xsl:variable name="contact-showReferenced" select="/bedeworkadmin/urlPrefixes/contact/showReferenced/a/@href"/>
91   <xsl:variable name="contact-showModForm" select="/bedeworkadmin/urlPrefixes/contact/showModForm/a/@href"/>
92   <xsl:variable name="contact-showUpdateList" select="/bedeworkadmin/urlPrefixes/contact/showUpdateList/a/@href"/>
93   <xsl:variable name="contact-showDeleteConfirm" select="/bedeworkadmin/urlPrefixes/contact/showDeleteConfirm/a/@href"/>
94   <xsl:variable name="contact-initAdd" select="/bedeworkadmin/urlPrefixes/contact/initAdd/a/@href"/>
95   <xsl:variable name="contact-initUpdate" select="/bedeworkadmin/urlPrefixes/contact/initUpdate/a/@href"/>
96   <xsl:variable name="contact-delete" select="/bedeworkadmin/urlPrefixes/contact/delete/a/@href"/>
97   <xsl:variable name="contact-fetchForDisplay" select="/bedeworkadmin/urlPrefixes/contact/fetchForDisplay/a/@href"/>
98   <xsl:variable name="contact-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/contact/fetchForUpdate/a/@href"/>
99   <xsl:variable name="contact-update" select="/bedeworkadmin/urlPrefixes/contact/update/a/@href"/>
100   <!-- locations -->
101   <xsl:variable name="location-showLocation" select="/bedeworkadmin/urlPrefixes/location/showLocation/a/@href"/>
102   <xsl:variable name="location-showReferenced" select="/bedeworkadmin/urlPrefixes/location/showReferenced/a/@href"/>
103   <xsl:variable name="location-showModForm" select="/bedeworkadmin/urlPrefixes/location/showModForm/a/@href"/>
104   <xsl:variable name="location-showUpdateList" select="/bedeworkadmin/urlPrefixes/location/showUpdateList/a/@href"/>
105   <xsl:variable name="location-showDeleteConfirm" select="/bedeworkadmin/urlPrefixes/location/showDeleteConfirm/a/@href"/>
106   <xsl:variable name="location-initAdd" select="/bedeworkadmin/urlPrefixes/location/initAdd/a/@href"/>
107   <xsl:variable name="location-initUpdate" select="/bedeworkadmin/urlPrefixes/location/initUpdate/a/@href"/>
108   <xsl:variable name="location-delete" select="/bedeworkadmin/urlPrefixes/location/delete/a/@href"/>
109   <xsl:variable name="location-fetchForDisplay" select="/bedeworkadmin/urlPrefixes/location/fetchForDisplay/a/@href"/>
110   <xsl:variable name="location-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/location/fetchForUpdate/a/@href"/>
111   <xsl:variable name="location-update" select="/bedeworkadmin/urlPrefixes/location/update/a/@href"/>
112   <!-- categories -->
113   <xsl:variable name="category-showReferenced" select="/bedeworkadmin/urlPrefixes/category/showReferenced/a/@href"/>
114   <xsl:variable name="category-showModForm" select="/bedeworkadmin/urlPrefixes/category/showModForm/a/@href"/>
115   <xsl:variable name="category-showUpdateList" select="/bedeworkadmin/urlPrefixes/category/showUpdateList/a/@href"/>
116   <xsl:variable name="category-showDeleteConfirm" select="/bedeworkadmin/urlPrefixes/category/showDeleteConfirm/a/@href"/>
117   <xsl:variable name="category-initAdd" select="/bedeworkadmin/urlPrefixes/category/initAdd/a/@href"/>
118   <xsl:variable name="category-initUpdate" select="/bedeworkadmin/urlPrefixes/category/initUpdate/a/@href"/>
119   <xsl:variable name="category-delete" select="/bedeworkadmin/urlPrefixes/category/delete/a/@href"/>
120   <xsl:variable name="category-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/category/fetchForUpdate/a/@href"/>
121   <xsl:variable name="category-update" select="/bedeworkadmin/urlPrefixes/category/update/a/@href"/>
122   <!-- calendars -->
123   <xsl:variable name="calendar-fetch" select="/bedeworkadmin/urlPrefixes/calendar/fetch/a/@href"/>
124   <xsl:variable name="calendar-fetchDescriptions" select="/bedeworkadmin/urlPrefixes/calendar/fetchDescriptions/a/@href"/>
125   <xsl:variable name="calendar-initAdd" select="/bedeworkadmin/urlPrefixes/calendar/initAdd/a/@href"/>
126   <xsl:variable name="calendar-delete" select="/bedeworkadmin/urlPrefixes/calendar/delete/a/@href"/>
127   <xsl:variable name="calendar-fetchForDisplay" select="/bedeworkadmin/urlPrefixes/calendar/fetchForDisplay/a/@href"/>
128   <xsl:variable name="calendar-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/calendar/fetchForUpdate/a/@href"/>
129   <xsl:variable name="calendar-update" select="/bedeworkadmin/urlPrefixes/calendar/update/a/@href"/>
130   <xsl:variable name="calendar-setAccess" select="/bedeworkadmin/urlPrefixes/calendar/setAccess/a/@href"/>
131   <!-- subscriptions -->
132   <xsl:variable name="subscriptions-fetch" select="/bedeworkadmin/urlPrefixes/subscriptions/fetch/a/@href"/>
133   <xsl:variable name="subscriptions-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/>
134   <xsl:variable name="subscriptions-initAdd" select="/bedeworkadmin/urlPrefixes/subscriptions/initAdd/a/@href"/>
135   <xsl:variable name="subscriptions-subscribe" select="/bedeworkadmin/urlPrefixes/subscriptions/subscribe/a/@href"/>
136   <!-- views -->
137   <xsl:variable name="view-fetch" select="/bedeworkadmin/urlPrefixes/view/fetch/a/@href"/>
138   <xsl:variable name="view-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/view/fetchForUpdate/a/@href"/>
139   <xsl:variable name="view-addView" select="/bedeworkadmin/urlPrefixes/view/addView/a/@href"/>
140   <xsl:variable name="view-update" select="/bedeworkadmin/urlPrefixes/view/update/a/@href"/>
141   <xsl:variable name="view-remove" select="/bedeworkadmin/urlPrefixes/view/remove/a/@href"/>
142   <!-- system -->
143   <xsl:variable name="system-fetch" select="/bedeworkadmin/urlPrefixes/system/fetch/a/@href"/>
144   <xsl:variable name="system-update" select="/bedeworkadmin/urlPrefixes/system/update/a/@href"/>
145   <!-- calsuites -->
146   <xsl:variable name="calsuite-fetch" select="/bedeworkadmin/urlPrefixes/calsuite/fetch/a/@href"/>
147   <xsl:variable name="calsuite-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/calsuite/fetchForUpdate/a/@href"/>
148   <xsl:variable name="calsuite-add" select="/bedeworkadmin/urlPrefixes/calsuite/add/a/@href"/>
149   <xsl:variable name="calsuite-update" select="/bedeworkadmin/urlPrefixes/calsuite/update/a/@href"/>
150   <xsl:variable name="calsuite-showAddForm" select="/bedeworkadmin/urlPrefixes/calsuite/showAddForm/a/@href"/>
151   <xsl:variable name="calsuite-setAccess" select="/bedeworkadmin/urlPrefixes/calsuite/setAccess/a/@href"/>
152   <xsl:variable name="calsuite-fetchPrefsForUpdate" select="/bedeworkadmin/urlPrefixes/calsuite/fetchPrefsForUpdate/a/@href"/>
153   <xsl:variable name="calsuite-updatePrefs" select="/bedeworkadmin/urlPrefixes/calsuite/updatePrefs/a/@href"/>
154   <!-- timezones and stats -->
155   <xsl:variable name="timezones-initUpload" select="/bedeworkadmin/urlPrefixes/timezones/initUpload/a/@href"/>
156   <xsl:variable name="timezones-upload" select="/bedeworkadmin/urlPrefixes/timezones/upload/a/@href"/>
157   <xsl:variable name="timezones-fix" select="/bedeworkadmin/urlPrefixes/timezones/fix/a/@href"/>
158   <xsl:variable name="stats-update" select="/bedeworkadmin/urlPrefixes/stats/update/a/@href"/>
159   <!-- authuser and prefs -->
160   <xsl:variable name="authuser-showModForm" select="/bedeworkadmin/urlPrefixes/authuser/showModForm/a/@href"/>
161   <xsl:variable name="authuser-showUpdateList" select="/bedeworkadmin/urlPrefixes/authuser/showUpdateList/a/@href"/>
162   <xsl:variable name="authuser-initUpdate" select="/bedeworkadmin/urlPrefixes/authuser/initUpdate/a/@href"/>
163   <xsl:variable name="authuser-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/authuser/fetchForUpdate/a/@href"/>
164   <xsl:variable name="authuser-update" select="/bedeworkadmin/urlPrefixes/authuser/update/a/@href"/>
165   <xsl:variable name="prefs-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/prefs/fetchForUpdate/a/@href"/>
166   <xsl:variable name="prefs-update" select="/bedeworkadmin/urlPrefixes/prefs/update/a/@href"/>
167   <!-- admin groups -->
168   <xsl:variable name="admingroup-showModForm" select="/bedeworkadmin/urlPrefixes/admingroup/showModForm/a/@href"/>
169   <xsl:variable name="admingroup-showModMembersForm" select="/bedeworkadmin/urlPrefixes/admingroup/showModMembersForm/a/@href"/>
170   <xsl:variable name="admingroup-showUpdateList" select="/bedeworkadmin/urlPrefixes/admingroup/showUpdateList/a/@href"/>
171   <xsl:variable name="admingroup-showChooseGroup" select="/bedeworkadmin/urlPrefixes/admingroup/showChooseGroup/a/@href"/>
172   <xsl:variable name="admingroup-showDeleteConfirm" select="/bedeworkadmin/urlPrefixes/admingroup/showDeleteConfirm/a/@href"/>
173   <xsl:variable name="admingroup-initAdd" select="/bedeworkadmin/urlPrefixes/admingroup/initAdd/a/@href"/>
174   <xsl:variable name="admingroup-initUpdate" select="/bedeworkadmin/urlPrefixes/admingroup/initUpdate/a/@href"/>
175   <xsl:variable name="admingroup-delete" select="/bedeworkadmin/urlPrefixes/admingroup/delete/a/@href"/>
176   <xsl:variable name="admingroup-fetchUpdateList" select="/bedeworkadmin/urlPrefixes/admingroup/fetchUpdateList/a/@href"/>
177   <xsl:variable name="admingroup-fetchForUpdate" select="/bedeworkadmin/urlPrefixes/admingroup/fetchForUpdate/a/@href"/>
178   <xsl:variable name="admingroup-fetchForUpdateMembers" select="/bedeworkadmin/urlPrefixes/admingroup/fetchForUpdateMembers/a/@href"/>
179   <xsl:variable name="admingroup-update" select="/bedeworkadmin/urlPrefixes/admingroup/update/a/@href"/>
180   <xsl:variable name="admingroup-updateMembers" select="/bedeworkadmin/urlPrefixes/admingroup/updateMembers/a/@href"/>
181   <xsl:variable name="admingroup-switch" select="/bedeworkadmin/urlPrefixes/admingroup/switch/a/@href"/>
182
183   <!-- URL of the web application - includes web context -->
184   <xsl:variable name="urlPrefix" select="/bedeworkadmin/urlprefix"/>
185
186   <!-- Other generally useful global variables -->
187   <xsl:variable name="publicCal">/cal</xsl:variable>
188
189   <!--==== MAIN TEMPLATE  ====-->
190   <xsl:template match="/">
191     <html lang="en">
192       <head>
193         <title>Calendar Admin: Events Calendar Administration</title>
194         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
195         <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
196         <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/>
197         <xsl:if test="/bedeworkadmin/page='modEvent' or
198                       /bedeworkadmin/page='rdates'">
199           <script type="text/javascript" src="{$resourcesRoot}/resources/bedework.js">&#160;</script>
200           <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js">&#160;</script>
201           <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
202           <script type="text/javascript" src="/bedework-common/javascript/dojo/dojo.js">&#160;</script>
203           <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkEventForm.js">&#160;</script>
204         </xsl:if>
205         <xsl:if test="/bedeworkadmin/page='modCalendar'">
206           <script type="text/javascript" src="{$resourcesRoot}/resources/bedework.js">&#160;</script>
207           <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkAccess.js">&#160;</script>
208         </xsl:if>
209         <xsl:if test="/bedeworkadmin/page='upload' or /bedeworkadmin/page='selectCalForEvent'">
210           <script type="text/javascript" src="{$resourcesRoot}/resources/bedework.js">&#160;</script>
211         </xsl:if>
212         <xsl:if test="/bedeworkadmin/page='calendarDescriptions' or /bedeworkadmin/page='displayCalendar'">
213           <link rel="stylesheet" href="{$resourcesRoot}/resources/calendarDescriptions.css"/>
214         </xsl:if>
215         <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
216         <script language="JavaScript" type="text/javascript">
217           <xsl:comment>
218         <![CDATA[
219         // places the cursor in the first available form element when the page is loaded
220         // (if a form exists on the page)
221         function focusFirstElement() {
222           if (window.document.forms[0]) {
223             window.document.forms[0].elements[0].focus();
224           }
225         }]]>
226         </xsl:comment>
227         </script>
228       </head>
229       <body onload="focusFirstElement()">
230         <xsl:choose>
231           <xsl:when test="/bedeworkadmin/page='selectCalForEvent'">
232             <xsl:call-template name="selectCalForEvent"/>
233           </xsl:when>
234           <xsl:when test="/bedeworkadmin/page='rdates'">
235             <xsl:call-template name="rdates"/>
236           </xsl:when>
237           <xsl:otherwise>
238             <xsl:call-template name="header"/>
239             <div id="content">
240               <xsl:choose>
241                 <xsl:when test="/bedeworkadmin/page='eventList'">
242                   <xsl:call-template name="eventList"/>
243                 </xsl:when>
244                 <xsl:when test="/bedeworkadmin/page='modEvent'">
245                   <xsl:apply-templates select="/bedeworkadmin/formElements" mode="modEvent"/>
246                 </xsl:when>
247                 <xsl:when test="/bedeworkadmin/page='displayEvent' or /bedeworkadmin/page='deleteEventConfirm'">
248                   <xsl:apply-templates select="/bedeworkadmin/event" mode="displayEvent"/>
249                 </xsl:when>
250                 <xsl:when test="/bedeworkadmin/page='contactList'">
251                   <xsl:call-template name="contactList"/>
252                 </xsl:when>
253                 <xsl:when test="/bedeworkadmin/page='modContact'">
254                   <xsl:call-template name="modContact"/>
255                 </xsl:when>
256                 <xsl:when test="/bedeworkadmin/page='deleteContactConfirm' or /bedeworkadmin/page='contactReferenced'">
257                   <xsl:call-template name="deleteContactConfirm"/>
258                 </xsl:when>
259                 <xsl:when test="/bedeworkadmin/page='locationList'">
260                   <xsl:call-template name="locationList"/>
261                 </xsl:when>
262                 <xsl:when test="/bedeworkadmin/page='modLocation'">
263                   <xsl:call-template name="modLocation"/>
264                 </xsl:when>
265                 <xsl:when test="/bedeworkadmin/page='deleteLocationConfirm'">
266                   <xsl:call-template name="deleteLocationConfirm"/>
267                 </xsl:when>
268                 <xsl:when test="/bedeworkadmin/page='categoryList'">
269                   <xsl:call-template name="categoryList"/>
270                 </xsl:when>
271                 <xsl:when test="/bedeworkadmin/page='modCategory'">
272                   <xsl:call-template name="modCategory"/>
273                 </xsl:when>
274                 <xsl:when test="/bedeworkadmin/page='deleteCategoryConfirm'">
275                   <xsl:call-template name="deleteCategoryConfirm"/>
276                 </xsl:when>
277                 <xsl:when test="/bedeworkadmin/page='calendarList' or /bedeworkadmin/page='calendarDescriptions' or /bedeworkadmin/page='displayCalendar' or /bedeworkadmin/page='modCalendar' or /bedeworkadmin/page='deleteCalendarConfirm' or /bedeworkadmin/page='calendarReferenced'">
278                   <xsl:apply-templates select="/bedeworkadmin/calendars"/>
279                 </xsl:when>
280                 <xsl:when test="/bedeworkadmin/page='subscriptions' or /bedeworkadmin/page='modSubscription'">
281                   <xsl:apply-templates select="/bedeworkadmin/subscriptions"/>
282                 </xsl:when>
283                 <xsl:when test="/bedeworkadmin/page='views'">
284                   <xsl:apply-templates select="/bedeworkadmin/views" mode="viewList"/>
285                 </xsl:when>
286                 <xsl:when test="/bedeworkadmin/page='modView'">
287                   <xsl:call-template name="modView"/>
288                 </xsl:when>
289                 <xsl:when test="/bedeworkadmin/page='deleteViewConfirm'">
290                   <xsl:call-template name="deleteViewConfirm"/>
291                 </xsl:when>
292                 <xsl:when test="/bedeworkadmin/page='modSyspars'">
293                   <xsl:call-template name="modSyspars"/>
294                 </xsl:when>
295                 <xsl:when test="/bedeworkadmin/page='calSuiteList'">
296                   <xsl:apply-templates select="/bedeworkadmin/calSuites" mode="calSuiteList"/>
297                 </xsl:when>
298                 <xsl:when test="/bedeworkadmin/page='addCalSuite'">
299                   <xsl:call-template name="addCalSuite"/>
300                 </xsl:when>
301                 <xsl:when test="/bedeworkadmin/page='modCalSuite'">
302                   <xsl:apply-templates select="/bedeworkadmin/calSuite"/>
303                 </xsl:when>
304                 <xsl:when test="/bedeworkadmin/page='calSuitePrefs'">
305                   <xsl:call-template name="calSuitePrefs"/>
306                 </xsl:when>
307                 <xsl:when test="/bedeworkadmin/page='authUserList'">
308                   <xsl:call-template name="authUserList"/>
309                 </xsl:when>
310                 <xsl:when test="/bedeworkadmin/page='modAuthUser'">
311                   <xsl:call-template name="modAuthUser"/>
312                 </xsl:when>
313                 <xsl:when test="/bedeworkadmin/page='modPrefs'">
314                   <xsl:call-template name="modPrefs"/>
315                 </xsl:when>
316                 <xsl:when test="/bedeworkadmin/page='chooseGroup'">
317                   <xsl:apply-templates select="/bedeworkadmin/groups" mode="chooseGroup"/>
318                 </xsl:when>
319                 <xsl:when test="/bedeworkadmin/page='adminGroupList'">
320                   <xsl:call-template name="listAdminGroups"/>
321                 </xsl:when>
322                 <xsl:when test="/bedeworkadmin/page='modAdminGroup'">
323                   <xsl:call-template name="modAdminGroup"/>
324                 </xsl:when>
325                 <xsl:when test="/bedeworkadmin/page='modAdminGroupMembers'">
326                   <xsl:call-template name="modAdminGroupMembers"/>
327                 </xsl:when>
328                 <xsl:when test="/bedeworkadmin/page='deleteAdminGroupConfirm'">
329                   <xsl:call-template name="deleteAdminGroupConfirm"/>
330                 </xsl:when>
331                 <xsl:when test="/bedeworkadmin/page='searchResult'">
332                   <xsl:call-template name="searchResult"/>
333                 </xsl:when>
334                 <xsl:when test="/bedeworkadmin/page='noGroup'">
335                   <h2>No administrative group</h2>
336                   <p>Your userid has not been assigned to an administrative group.
337                     Please inform your administrator.</p>
338                 </xsl:when>
339                 <xsl:when test="/bedeworkadmin/page='upload'">
340                   <xsl:call-template name="upload"/>
341                 </xsl:when>
342                 <xsl:when test="/bedeworkadmin/page='uploadTimezones'">
343                   <xsl:call-template name="uploadTimezones"/>
344                 </xsl:when>
345                 <xsl:when test="/bedeworkadmin/page='showSysStats'">
346                   <xsl:apply-templates select="/bedeworkadmin/sysStats" mode="showSysStats"/>
347                 </xsl:when>
348                 <xsl:when test="/bedeworkadmin/page='noAccess'">
349                   <h2>No Access</h2>
350                   <p>
351                     You have no access to the action you just attempted. If you believe
352                     you should have access and the problem persists, contact your
353                     administrator.
354                   </p>
355                   <p>
356                     <a href="{$setup}">continue</a>
357                   </p>
358                 </xsl:when>
359                 <xsl:when test="/bedeworkadmin/page='error'">
360                   <h2>Application error</h2>
361                   <p>An application error occurred.</p>
362                   <p>
363                     <a href="{$setup}">continue</a>
364                   </p>
365                 </xsl:when>
366                 <xsl:otherwise>
367                   <xsl:call-template name="mainMenu"/>
368                 </xsl:otherwise>
369               </xsl:choose>
370             </div>
371             <!-- footer -->
372             <xsl:call-template name="footer"/>
373           </xsl:otherwise>
374         </xsl:choose>
375       </body>
376     </html>
377   </xsl:template>
378
379
380   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
381
382   <xsl:template name="header">
383     <div id="header">
384       <a href="/bedework/">
385         <img id="logo"
386             alt="logo"
387             src="{$resourcesRoot}/resources/bedeworkAdminLogo.gif"
388             width="217"
389             height="40"
390             border="0"/>
391       </a>
392       <!-- set the page heading: -->
393       <h1>
394         <xsl:choose>
395           <xsl:when test="/bedeworkadmin/page='modEvent' or /bedeworkadmin/page='eventList' or /bedeworkadmin/page='displayEvent'">
396             Manage Events
397           </xsl:when>
398           <xsl:when test="/bedeworkadmin/page='contactList' or /bedeworkadmin/page='modContact' or /bedeworkadmin/page='deleteContactConfirm'">
399             Manage Contacts
400           </xsl:when>
401           <xsl:when test="/bedeworkadmin/page='locationList' or /bedeworkadmin/page='modLocation' or /bedeworkadmin/page='deleteLocationConfirm'">
402             Manage Locations
403           </xsl:when>
404           <xsl:when test="/bedeworkadmin/page='calendarList' or /bedeworkadmin/page='modCalendar' or /bedeworkadmin/page='calendarReferenced' or /bedeworkadmin/page='deleteCalendarConfirm'">
405             Manage Calendars
406           </xsl:when>
407           <xsl:when test="/bedeworkadmin/page='calendarDescriptions' or /bedeworkadmin/page='displayCalendar'">
408             Public Calendars
409           </xsl:when>
410           <xsl:when test="/bedeworkadmin/page='subscriptions' or /bedeworkadmin/page='modSubscription'">
411             Manage Subscriptions
412           </xsl:when>
413           <xsl:when test="/bedeworkadmin/page='views' or /bedeworkadmin/page='modView'">
414             Manage Views
415           </xsl:when>
416           <xsl:when test="/bedeworkadmin/page='modSyspars'">
417             Manage System Preferences
418           </xsl:when>
419           <xsl:when test="/bedeworkadmin/page='authUserList' or /bedeworkadmin/page='modAuthUser'">
420             Manage Public Events Administrators
421           </xsl:when>
422           <xsl:when test="/bedeworkadmin/page='chooseGroup'">
423             Choose Administrative Group
424           </xsl:when>
425           <xsl:when test="/bedeworkadmin/page='adminGroupList' or /bedeworkadmin/page='modAdminGroup' or /bedeworkadmin/page='modAdminGroup' or /bedeworkadmin/page='modAdminGroupMembers'">
426             Manage Administrative Groups
427           </xsl:when>
428           <xsl:when test="/bedeworkadmin/page='noGroup'">
429             No Administrative Group
430           </xsl:when>
431           <xsl:when test="/bedeworkadmin/page='uploadTimezones'">
432             Manage Time Zones
433           </xsl:when>
434           <xsl:when test="/bedeworkadmin/page='noAccess'">
435             Access Denied
436           </xsl:when>
437           <xsl:when test="/bedeworkadmin/page='error'">
438             Error
439           </xsl:when>
440           <xsl:otherwise>
441             Bedework Calendar Administration
442           </xsl:otherwise>
443         </xsl:choose>
444       </h1>
445
446       <xsl:call-template name="messagesAndErrors"/>
447
448     </div>
449     <table id="statusBarTable">
450       <tr>
451         <td class="leftCell">
452           <a href="{$setup}">Main Menu</a> |
453           <a href="{$publicCal}" target="calendar">Launch Calendar</a> |
454           <a href="{$logout}">Log Out</a>
455         </td>
456         <xsl:if test="/bedeworkadmin/userInfo/user">
457           <td class="rightCell">
458             <xsl:if test="/bedeworkadmin/currentCalSuite/name">
459               Calendar Suite:
460               <span class="status">
461                 <xsl:value-of select="/bedeworkadmin/currentCalSuite/name"/>
462               </span>
463               &#160;
464             </xsl:if>
465             Logged in as:
466             <span class="status">
467               <xsl:value-of select="/bedeworkadmin/userInfo/user"/>
468             </span>
469             &#160;
470             <xsl:if test="/bedeworkadmin/userInfo/group">
471               Group:
472               <span class="status">
473                 <xsl:value-of select="/bedeworkadmin/userInfo/group"/>
474               </span>
475             </xsl:if>
476           </td>
477         </xsl:if>
478       </tr>
479     </table>
480     <div id="titleBar">
481       CALENDAR of EVENTS
482     </div>
483   </xsl:template>
484
485   <xsl:template name="messagesAndErrors">
486     <xsl:if test="/bedeworkadmin/message">
487       <ul id="messages">
488         <xsl:for-each select="/bedeworkadmin/message">
489           <li><xsl:apply-templates select="."/></li>
490         </xsl:for-each>
491       </ul>
492     </xsl:if>
493     <xsl:if test="/bedeworkadmin/error">
494       <ul id="errors">
495         <xsl:for-each select="/bedeworkadmin/error">
496           <li><xsl:apply-templates select="."/></li>
497         </xsl:for-each>
498       </ul>
499     </xsl:if>
500   </xsl:template>
501
502   <!--==============================================-->
503   <!--==============================================-->
504   <!--============= PAGE TEMPLATES =================-->
505   <!--==============================================-->
506   <!--==============================================-->
507
508   <!--+++++++++++++++ Main Menu ++++++++++++++++++++-->
509   <xsl:template name="mainMenu">
510     <div id="adminLeftColumn">
511       <h2 class="menuTitle">Main Menu</h2>
512       <table id="mainMenuTable">
513         <tr>
514           <th>Events</th>
515           <td>
516             <a id="addEventLink" href="{$event-initAddEvent}">
517               Add
518             </a>
519           </td>
520           <td>
521             <a href="{$event-initUpdateEvent}">
522               Edit / Delete
523             </a>
524           </td>
525           <!--
526           Disable direct selection by ID; we'll need to find another way
527           of quickly getting to events: search and grid views should be implemented. -->
528           <!--
529           <td>
530             Event ID:
531             <xsl:copy-of select="/bedeworkadmin/formElements/*"/>
532           </td>-->
533         </tr>
534         <tr>
535           <th>Contacts</th>
536           <td>
537             <a id="addContactLink" href="{$contact-initAdd}">
538               Add
539             </a>
540           </td>
541           <td>
542             <a href="{$contact-initUpdate}">
543               Edit / Delete
544             </a>
545           </td>
546         </tr>
547         <tr>
548           <th>Locations</th>
549           <td>
550             <a id="addLocationLink" href="{$location-initAdd}">
551               Add
552             </a>
553           </td>
554           <td>
555             <a href="{$location-initUpdate}">
556               Edit / Delete
557             </a>
558           </td>
559         </tr>
560         <tr>
561           <th>Categories</th>
562           <td>
563             <a id="addCategoryLink" href="{$category-initAdd}">
564               Add
565             </a>
566           </td>
567           <td>
568             <a href="{$category-initUpdate}">
569               Edit / Delete
570             </a>
571           </td>
572         </tr>
573       </table>
574
575       <h4 class="menuTitle">Event search:</h4>
576       <form name="searchForm" method="post" action="{$search}" id="searchForm">
577         <input type="text" name="query" size="30">
578           <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/searchResults/query"/></xsl:attribute>
579         </input>
580         <input type="submit" name="submit" value="go"/>
581         <div id="searchFields">
582           Limit:
583           <input type="radio" name="searchLimits" value="fromToday" checked="checked"/>today forward
584           <input type="radio" name="searchLimits" value="beforeToday"/>past dates
585           <input type="radio" name="searchLimits" value="none"/>all dates
586         </div>
587       </form>
588
589     </div>
590
591     <div id="adminRightColumn">
592       <xsl:if test="/bedeworkadmin/currentCalSuite/currentAccess/current-user-privilege-set/privilege/write or /bedeworkadmin/userInfo/superUser='true'">
593         <h4 class="menuTitle">
594           Manage calendar suite:
595           <em><xsl:value-of select="/bedeworkadmin/currentCalSuite/name"/>
596           </em>
597         </h4>
598         <ul class="adminMenu">
599           <li>
600             <a href="{$calendar-fetch}">
601               Manage calendars
602             </a>
603           </li>
604           <li>
605             <a href="{$subscriptions-fetch}">
606               Manage subscriptions
607             </a>
608           </li>
609           <li>
610             <a href="{$view-fetch}">
611               Manage views
612             </a>
613           </li>
614           <li>
615             <a href="{$calsuite-fetchPrefsForUpdate}">
616               Manage preferences
617             </a>
618           </li>
619           <li>
620             <a href="{$event-initUpload}">
621               Upload iCAL file
622             </a>
623           </li>
624         </ul>
625       </xsl:if>
626
627       <xsl:if test="/bedeworkadmin/userInfo/contentAdminUser='true'">
628         <h4 class="menuTitle">Manage users:</h4>
629         <ul class="adminMenu">
630           <xsl:if test="/bedeworkadmin/userInfo/userMaintOK='true'">
631             <li>
632               <a href="{$authuser-initUpdate}">
633                 Manage public event administrators
634               </a>
635             </li>
636           </xsl:if>
637           <xsl:if test="/bedeworkadmin/userInfo/adminGroupMaintOk='true'">
638             <li>
639               <a href="{$admingroup-initUpdate}">
640                 Manage admin groups
641               </a>
642             </li>
643           </xsl:if>
644           <li>
645             <a href="{$admingroup-switch}">
646               Choose/change group...
647             </a>
648           </li>
649           <xsl:if test="/bedeworkadmin/userInfo/userMaintOK='true'">
650             <li>
651               <form action="{$prefs-fetchForUpdate}" method="post">
652                 Edit user preferences (enter userid):<br/>
653                 <input type="text" name="user" size="15"/>
654                 <input type="submit" name="getPrefs" value="go"/>
655               </form>
656             </li>
657           </xsl:if>
658         </ul>
659       </xsl:if>
660
661       <xsl:if test="/bedeworkadmin/userInfo/superUser='true'">
662         <h4 class="menuTitle">Super user features:</h4>
663         <ul class="adminMenu">
664           <li>
665             <a href="{$calsuite-fetch}">
666               Manage calendar suites
667             </a>
668           </li>
669           <li>
670             <a href="{$system-fetch}">
671               Manage system preferences
672             </a>
673           </li>
674           <li>
675             <a href="{$timezones-initUpload}">
676               Manage system timezones
677             </a>
678           </li>
679           <li>
680             System statistics:
681             <ul>
682               <li>
683                 <a href="{$stats-update}&amp;fetch=yes">
684                   admin web client
685                 </a>
686               </li>
687               <li>
688                 <a href="{$publicCal}/stats.do" target="pubClient">
689                   public web client
690                 </a>
691               </li>
692             </ul>
693           </li>
694         </ul>
695       </xsl:if>
696     </div>
697   </xsl:template>
698
699   <!--++++++++++++++++++ Events ++++++++++++++++++++-->
700   <xsl:template name="eventList">
701     <h2>Edit Events</h2>
702     <p>
703       Select the event that you would like to update:
704       <input type="button" name="return" value="Add new event" onclick="javascript:location.replace('{$event-initAddEvent}')"/>
705     </p>
706
707     <form name="peForm" method="post" action="{$event-initUpdateEvent}">
708       <table>
709         <tr>
710           <td style="padding-right: 1em;">Show:</td>
711           <td>
712             <xsl:copy-of select="/bedeworkadmin/formElements/form/listAllSwitchFalse/*"/>
713             Active
714           </td>
715           <td>
716             <xsl:copy-of select="/bedeworkadmin/formElements/form/listAllSwitchTrue/*"/>
717             All
718           </td>
719         </tr>
720       </table>
721     </form>
722
723     <table id="commonListTable">
724       <tr>
725         <th>Title</th>
726         <th>Start Date</th>
727         <th>End Date</th>
728         <th>Calendar</th>
729         <th>Description</th>
730       </tr>
731
732       <xsl:for-each select="/bedeworkadmin/events/event">
733         <xsl:variable name="subscriptionId" select="subscription/id"/>
734         <xsl:variable name="calPath" select="calendar/encodedPath"/>
735         <xsl:variable name="guid" select="guid"/>
736         <xsl:variable name="recurrenceId" select="recurrenceId"/>
737         <tr>
738           <td>
739             <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
740               <xsl:choose>
741                 <xsl:when test="summary != ''">
742                   <xsl:value-of select="summary"/>
743                 </xsl:when>
744                 <xsl:otherwise>
745                   <em>no title</em>
746                 </xsl:otherwise>
747               </xsl:choose>
748             </a>
749           </td>
750           <td class="date">
751             <xsl:value-of select="start/longdate"/>,
752             <xsl:value-of select="start/time"/>
753           </td>
754           <td class="date">
755             <xsl:value-of select="end/longdate"/>,
756             <xsl:value-of select="end/time"/>
757           </td>
758           <td>
759             <xsl:value-of select="calendar/name"/>
760           </td>
761           <td>
762             <xsl:value-of select="description"/>
763             <xsl:if test="recurring = 'true' or recurrenceId != ''">
764               <div class="recurrenceEditLinks">
765                 Recurring event.
766                 Edit:
767                 <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">
768                   master
769                 </a> |
770                 <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
771                   instance
772                 </a>
773               </div>
774             </xsl:if>
775           </td>
776         </tr>
777       </xsl:for-each>
778     </table>
779   </xsl:template>
780
781   <xsl:template match="formElements" mode="modEvent">
782     <xsl:variable name="subscriptionId" select="subscriptionId"/>
783     <xsl:variable name="calPathEncoded" select="form/calendar/encodedPath"/>
784     <xsl:variable name="calPath" select="form/calendar/path"/>
785     <xsl:variable name="guid" select="guid"/>
786     <xsl:variable name="recurrenceId" select="recurrenceId"/>
787
788     <h2>Event Information</h2>
789
790     <xsl:variable name="modEventAction" select="form/@action"/>
791     <form name="eventForm" method="post" action="{$modEventAction}" onsubmit="setEventFields(this)">
792
793       <table border="0" id="submitTable">
794         <tr>
795           <xsl:choose>
796             <xsl:when test="/bedeworkadmin/creating='true'">
797               <td>
798                 <input type="submit" name="addEvent" value="Add Event"/>
799                 <input type="submit" name="cancelled" value="Cancel"/>
800                 <input type="reset" value="Clear"/>
801               </td>
802             </xsl:when>
803             <xsl:otherwise>
804               <td>
805                 <input type="submit" name="updateEvent" value="Update Event"/>
806                 <input type="submit" name="cancelled" value="Cancel"/>
807                 <input type="submit" name="copy" value="Duplicate Event"/>
808               </td>
809               <td align="right">
810                 <input type="submit" name="delete" value="Delete Event"/>
811               </td>
812             </xsl:otherwise>
813           </xsl:choose>
814         </tr>
815       </table>
816
817       <table class="eventFormTable">
818         <tr>
819           <td class="fieldName">
820             Title:
821           </td>
822           <td>
823             <xsl:copy-of select="form/title/*"/>
824           </td>
825         </tr>
826         <tr>
827           <td class="fieldName">
828             Calendar:**
829           </td>
830           <td>
831             <xsl:if test="form/calendar/preferred/select/option">
832               <select name="prefCalendarId">
833                 <option value="-1">
834                   Select preferred:
835                 </option>
836                 <xsl:for-each select="form/calendar/preferred/select/option">
837                   <xsl:sort select="." order="ascending"/>
838                   <option>
839                     <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
840                     <xsl:if test="@selected"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
841                     <xsl:value-of select="substring-after(node(),'/public/')"/>
842                   </option>
843                 </xsl:for-each>
844               </select><br/>
845               or Calendar (all):
846             </xsl:if>
847             <select name="calendarId">
848               <option value="-1">
849                 Select:
850               </option>
851               <xsl:for-each select="form/calendar/all/select/option">
852                 <xsl:sort select="." order="ascending"/>
853                 <option>
854                   <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
855                     <xsl:if test="@selected"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
856                   <xsl:value-of select="substring-after(node(),'/public/')"/>
857                 </option>
858               </xsl:for-each>
859             </select>
860             <xsl:text> </xsl:text>
861             <span id="calDescriptionsLink">
862               <a href="javascript:launchSimpleWindow('{$calendar-fetchDescriptions}')">calendar descriptions</a>
863             </span>
864           </td>
865         </tr>
866
867         <tr>
868           <td class="fieldName">
869             Date &amp; Time:
870           </td>
871           <td>
872             <!-- Set the timefields class for the first load of the page;
873                  subsequent changes will take place using javascript without a
874                  page reload. -->
875             <xsl:variable name="timeFieldsClass">
876               <xsl:choose>
877                 <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
878                 <xsl:otherwise>timeFields</xsl:otherwise>
879               </xsl:choose>
880             </xsl:variable>
881             <xsl:choose>
882               <xsl:when test="form/allDay/input/@checked='checked'">
883                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
884                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
885                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
886               </xsl:when>
887               <xsl:otherwise>
888                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
889                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
890                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
891               </xsl:otherwise>
892             </xsl:choose>
893             all day (anniversary)
894
895             <!-- floating event: no timezone (and not UTC) -->
896             <xsl:choose>
897               <xsl:when test="form/floating/input/@checked='checked'">
898                 <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="on" checked="checked"/>
899                 <input type="hidden" name="eventStartDate.floating" value="on" id="startFloating"/>
900                 <input type="hidden" name="eventEndDate.floating" value="on" id="endFloating"/>
901               </xsl:when>
902               <xsl:otherwise>
903                 <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="off"/>
904                 <input type="hidden" name="eventStartDate.floating" value="off" id="startFloating"/>
905                 <input type="hidden" name="eventEndDate.floating" value="off" id="endFloating"/>
906               </xsl:otherwise>
907             </xsl:choose>
908             floating
909
910             <!-- store time as coordinated universal time (UTC) -->
911             <xsl:choose>
912               <xsl:when test="form/storeUTC/input/@checked='checked'">
913                 <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="on" checked="checked"/>
914                 <input type="hidden" name="eventStartDate.storeUTC" value="on" id="startStoreUTC"/>
915                 <input type="hidden" name="eventEndDate.storeUTC" value="on" id="endStoreUTC"/>
916               </xsl:when>
917               <xsl:otherwise>
918                 <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="off"/>
919                 <input type="hidden" name="eventStartDate.storeUTC" value="off" id="startStoreUTC"/>
920                 <input type="hidden" name="eventEndDate.storeUTC" value="off" id="endStoreUTC"/>
921               </xsl:otherwise>
922             </xsl:choose>
923             store as UTC
924
925             <br/>
926             <div class="dateStartEndBox">
927               <strong>Start:</strong>
928               <div class="dateFields">
929                 <span class="startDateLabel">Date </span>
930                 <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetStartDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
931                   <xsl:attribute name="value"><xsl:value-of select="form/start/rfc3339DateTime"/></xsl:attribute>
932                   <xsl:text> </xsl:text>
933                 </span>
934                 <input type="hidden" name="eventStartDate.year">
935                   <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute>
936                 </input>
937                 <input type="hidden" name="eventStartDate.month">
938                   <xsl:attribute name="value"><xsl:value-of select="form/start/month/select/option[@selected = 'selected']/@value"/></xsl:attribute>
939                 </input>
940                 <input type="hidden" name="eventStartDate.day">
941                   <xsl:attribute name="value"><xsl:value-of select="form/start/day/select/option[@selected = 'selected']/@value"/></xsl:attribute>
942                 </input>
943                 <!--<xsl:copy-of select="form/start/month/*"/>
944                 <xsl:copy-of select="form/start/day/*"/>
945                 <xsl:choose>
946                   <xsl:when test="/bedeworkadmin/creating = 'true'">
947                     <xsl:copy-of select="form/start/year/*"/>
948                   </xsl:when>
949                   <xsl:otherwise>
950                     <xsl:copy-of select="form/start/yearText/*"/>
951                   </xsl:otherwise>
952                 </xsl:choose>-->
953               </div>
954               <!--
955               <script language="JavaScript" type="text/javascript">
956                 <xsl:comment>
957                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(form/start/yearText/input/@value)"/>, <xsl:value-of select="number(form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/');
958                 </xsl:comment>
959               </script>-->
960               <div class="{$timeFieldsClass}" id="startTimeFields">
961                 <span id="calWidgetStartTimeHider" class="show">
962                   <xsl:copy-of select="form/start/hour/*"/>
963                   <xsl:copy-of select="form/start/minute/*"/>
964                   <xsl:if test="form/start/ampm">
965                     <xsl:copy-of select="form/start/ampm/*"/>
966                   </xsl:if>
967                   <xsl:text> </xsl:text>
968                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
969
970                   <select name="eventStartDate.tzid" id="startTzid" class="timezones">
971                     <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
972                     <option value="-1">select timezone...</option>
973                     <xsl:variable name="startTzId" select="form/start/tzid"/>
974                     <xsl:for-each select="/bedeworkadmin/timezones/timezone">
975                       <option>
976                         <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
977                         <xsl:if test="$startTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
978                         <xsl:value-of select="name"/>
979                       </option>
980                     </xsl:for-each>
981                   </select>
982                 </span>
983               </div>
984             </div>
985             <div class="dateStartEndBox">
986               <strong>End:</strong>
987               <xsl:choose>
988                 <xsl:when test="form/end/type='E'">
989                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
990                 </xsl:when>
991                 <xsl:otherwise>
992                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
993                 </xsl:otherwise>
994               </xsl:choose>
995               Date
996               <xsl:variable name="endDateTimeClass">
997                 <xsl:choose>
998                   <xsl:when test="form/end/type='E'">shown</xsl:when>
999                   <xsl:otherwise>invisible</xsl:otherwise>
1000                 </xsl:choose>
1001               </xsl:variable>
1002               <div class="{$endDateTimeClass}" id="endDateTime">
1003                 <div class="dateFields">
1004                   <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetEndDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
1005                     <xsl:attribute name="value"><xsl:value-of select="form/end/rfc3339DateTime"/></xsl:attribute>
1006                     <xsl:text> </xsl:text>
1007                   </span>
1008                   <input type="hidden" name="eventEndDate.year">
1009                     <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/yearText/input/@value"/></xsl:attribute>
1010                   </input>
1011                   <input type="hidden" name="eventEndDate.month">
1012                     <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/month/select/option[@selected = 'selected']/@value"/></xsl:attribute>
1013                   </input>
1014                   <input type="hidden" name="eventEndDate.day">
1015                     <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/day/select/option[@selected = 'selected']/@value"/></xsl:attribute>
1016                   </input>
1017                   <!--<xsl:copy-of select="form/end/dateTime/month/*"/>
1018                   <xsl:copy-of select="form/end/dateTime/day/*"/>
1019                   <xsl:choose>
1020                     <xsl:when test="/bedeworkadmin/creating = 'true'">
1021                       <xsl:copy-of select="form/end/dateTime/year/*"/>
1022                     </xsl:when>
1023                     <xsl:otherwise>
1024                       <xsl:copy-of select="form/end/dateTime/yearText/*"/>
1025                     </xsl:otherwise>
1026                   </xsl:choose>-->
1027                 </div>
1028                 <!--<script language="JavaScript" type="text/javascript">
1029                   <xsl:comment>
1030                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(form/start/yearText/input/@value)"/>, <xsl:value-of select="number(form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback',true,'<xsl:value-of select="$resourcesRoot"/>/resources/');
1031                 </xsl:comment>
1032                 </script>-->
1033                 <div class="{$timeFieldsClass}" id="endTimeFields">
1034                   <span id="calWidgetEndTimeHider" class="show">
1035                     <xsl:copy-of select="form/end/dateTime/hour/*"/>
1036                     <xsl:copy-of select="form/end/dateTime/minute/*"/>
1037                     <xsl:if test="form/end/dateTime/ampm">
1038                       <xsl:copy-of select="form/end/dateTime/ampm/*"/>
1039                     </xsl:if>
1040                     <xsl:text> </xsl:text>
1041                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1042
1043                     <select name="eventEndDate.tzid" id="endTzid" class="timezones">
1044                       <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">true</xsl:attribute></xsl:if>
1045                       <option value="-1">select timezone...</option>
1046                       <xsl:variable name="endTzId" select="form/end/dateTime/tzid"/>
1047                       <xsl:for-each select="/bedeworkadmin/timezones/timezone">
1048                         <option>
1049                           <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
1050                           <xsl:if test="$endTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
1051                           <xsl:value-of select="name"/>
1052                         </option>
1053                       </xsl:for-each>
1054                     </select>
1055                   </span>
1056                 </div>
1057               </div>
1058               <br/>
1059               <div id="clock" class="invisible">
1060                 <xsl:call-template name="clock"/>
1061               </div>
1062               <div class="dateFields">
1063                 <xsl:choose>
1064                   <xsl:when test="form/end/type='D'">
1065                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1066                   </xsl:when>
1067                   <xsl:otherwise>
1068                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1069                   </xsl:otherwise>
1070                 </xsl:choose>
1071                 Duration
1072                 <xsl:variable name="endDurationClass">
1073                   <xsl:choose>
1074                     <xsl:when test="form/end/type='D'">shown</xsl:when>
1075                     <xsl:otherwise>invisible</xsl:otherwise>
1076                   </xsl:choose>
1077                 </xsl:variable>
1078                 <xsl:variable name="durationHrMinClass">
1079                   <xsl:choose>
1080                     <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1081                     <xsl:otherwise>shown</xsl:otherwise>
1082                   </xsl:choose>
1083                 </xsl:variable>
1084                 <div class="{$endDurationClass}" id="endDuration">
1085                   <xsl:choose>
1086                     <xsl:when test="form/end/duration/weeks/input/@value = '0'">
1087                     <!-- we are using day, hour, minute format -->
1088                     <!-- must send either no week value or week value of 0 (zero) -->
1089                       <div class="durationBox">
1090                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1091                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1092                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1093                         <span id="durationHrMin" class="{$durationHrMinClass}">
1094                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1095                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1096                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1097                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1098                         </span>
1099                       </div>
1100                       <span class="durationSpacerText">or</span>
1101                       <div class="durationBox">
1102                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1103                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1104                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1105                       </div>
1106                     </xsl:when>
1107                     <xsl:otherwise>
1108                       <!-- we are using week format -->
1109                       <div class="durationBox">
1110                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1111                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1112                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1113                         <span id="durationHrMin" class="{$durationHrMinClass}">
1114                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1115                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1116                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1117                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1118                         </span>
1119                       </div>
1120                       <span class="durationSpacerText">or</span>
1121                       <div class="durationBox">
1122                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1123                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1124                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1125                       </div>
1126                     </xsl:otherwise>
1127                   </xsl:choose>
1128                 </div>
1129               </div>
1130               <br/>
1131               <div class="dateFields" id="noDuration">
1132                 <xsl:choose>
1133                   <xsl:when test="form/end/type='N'">
1134                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1135                   </xsl:when>
1136                   <xsl:otherwise>
1137                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1138                   </xsl:otherwise>
1139                 </xsl:choose>
1140                 This event has no duration / end date
1141               </div>
1142             </div>
1143           </td>
1144         </tr>
1145         <!-- Recurrence fields -->
1146         <!-- ================= -->
1147         <tr>
1148           <td class="fieldName">
1149             Recurrence:
1150           </td>
1151           <td>
1152             <xsl:choose>
1153               <xsl:when test="recurrenceId != ''">
1154                 <!-- recurrence instances can not themselves recur,
1155                      so provide access to master event -->
1156                 <em>This event is a recurrence instance.</em><br/>
1157                 <a href="{$event-fetchForUpdate}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}" title="edit master (recurring event)">edit master event</a>
1158               </xsl:when>
1159               <xsl:otherwise>
1160                 <!-- has recurrenceId, so is master -->
1161
1162                 <div id="recurringSwitch">
1163                   <!-- set or remove "recurring" and show or hide all recurrence fields: -->
1164                   <input type="radio" name="recurring" value="true" onclick="swapRecurrence(this)">
1165                     <xsl:if test="form/recurringEntity = 'true'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
1166                   </input> event recurs
1167                   <input type="radio" name="recurring" value="false" onclick="swapRecurrence(this)">
1168                     <xsl:if test="form/recurringEntity = 'false'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
1169                   </input> event does not recur
1170                 </div>
1171
1172                 <!-- wrapper for all recurrence fields (rrules and rdates): -->
1173                 <div id="recurrenceFields" class="invisible">
1174                   <xsl:if test="form/recurringEntity = 'true'"><xsl:attribute name="class">visible</xsl:attribute></xsl:if>
1175
1176                   <!-- show or hide rrules fields: -->
1177                   <input type="checkbox" name="rrulesFlag" onclick="swapRrules(this)" value="on"/>
1178                   <span id="rrulesSwitch">
1179                     <xsl:choose>
1180                       <xsl:when test="form/recurrence">
1181                         change recurrence rules
1182                       </xsl:when>
1183                       <xsl:otherwise>
1184                         create recurrence rules
1185                       </xsl:otherwise>
1186                     </xsl:choose>
1187                   </span>
1188                   <span id="rrulesUiSwitch" class="invisible">
1189                     <input type="checkbox" name="rrulesUiSwitch" value="advanced" onchange="swapVisible(this,'advancedRrules')"/>
1190                     show advanced recurrence rules
1191                   </span>
1192
1193                   <xsl:if test="form/recurrence">
1194                     <!-- Output descriptive recurrence rules information.  Probably not
1195                          complete yet. Replace all strings so can be
1196                          more easily internationalized. -->
1197                     <div id="recurrenceInfo">
1198                       Every
1199                       <xsl:choose>
1200                         <xsl:when test="form/recurrence/interval &gt; 1">
1201                           <xsl:value-of select="form/recurrence/interval"/>
1202                         </xsl:when>
1203                       </xsl:choose>
1204                       <xsl:text> </xsl:text>
1205                       <xsl:choose>
1206                         <xsl:when test="form/recurrence/freq = 'HOURLY'">hour</xsl:when>
1207                         <xsl:when test="form/recurrence/freq = 'DAILY'">day</xsl:when>
1208                         <xsl:when test="form/recurrence/freq = 'WEEKLY'">week</xsl:when>
1209                         <xsl:when test="form/recurrence/freq = 'MONTHLY'">month</xsl:when>
1210                         <xsl:when test="form/recurrence/freq = 'YEARLY'">year</xsl:when>
1211                       </xsl:choose><xsl:if test="form/recurrence/interval &gt; 1">s</xsl:if>
1212                       <xsl:text> </xsl:text>
1213
1214                       <xsl:if test="form/recurrence/byday">
1215                         <xsl:for-each select="form/recurrence/byday/pos">
1216                           <xsl:if test="position() != 1"> and </xsl:if>
1217                           on
1218                           <xsl:choose>
1219                             <xsl:when test="@val='1'">
1220                               the first
1221                             </xsl:when>
1222                             <xsl:when test="@val='2'">
1223                               the second
1224                             </xsl:when>
1225                             <xsl:when test="@val='3'">
1226                               the third
1227                             </xsl:when>
1228                             <xsl:when test="@val='4'">
1229                               the fourth
1230                             </xsl:when>
1231                             <xsl:when test="@val='5'">
1232                               the fifth
1233                             </xsl:when>
1234                             <xsl:when test="@val='-1'">
1235                               the last
1236                             </xsl:when>
1237                             <!-- don't output "every" -->
1238                             <!--<xsl:otherwise>
1239                               every
1240                             </xsl:otherwise>-->
1241                           </xsl:choose>
1242                           <xsl:for-each select="day">
1243                             <xsl:if test="position() != 1 and position() = last()"> and </xsl:if>
1244                             <xsl:variable name="dayVal" select="."/>
1245                             <xsl:variable name="dayPos">
1246                               <xsl:for-each select="/bedeworkadmin/recurdayvals/val">
1247                                 <xsl:if test="node() = $dayVal"><xsl:value-of select="position()"/></xsl:if>
1248                               </xsl:for-each>
1249                             </xsl:variable>
1250                             <xsl:value-of select="/bedeworkadmin/shortdaynames/val[position() = $dayPos]"/>
1251                             <xsl:if test="position() != last()">, </xsl:if>
1252                           </xsl:for-each>
1253                         </xsl:for-each>
1254                       </xsl:if>
1255
1256                       <xsl:if test="form/recurrence/bymonth">
1257                         in
1258                         <xsl:for-each select="form/recurrence/bymonth/val">
1259                           <xsl:if test="position() != 1 and position() = last()"> and </xsl:if>
1260                           <xsl:variable name="monthNum" select="number(.)"/>
1261                           <xsl:value-of select="/bedeworkadmin/monthlabels/val[position() = $monthNum]"/>
1262                           <xsl:if test="position() != last()">, </xsl:if>
1263                         </xsl:for-each>
1264                       </xsl:if>
1265
1266                       <xsl:if test="form/recurrence/bymonthday">
1267                         on the
1268                         <xsl:apply-templates select="form/recurrence/bymonthday/val" mode="weekMonthYearNumbers"/>
1269                         day<xsl:if test="form/recurrence/bymonthday/val[position()=2]">s</xsl:if> of the month
1270                       </xsl:if>
1271
1272                       <xsl:if test="form/recurrence/byyearday">
1273                         on the
1274                         <xsl:apply-templates select="form/recurrence/byyearday/val" mode="weekMonthYearNumbers"/>
1275                         day<xsl:if test="form/recurrence/byyearday/val[position()=2]">s</xsl:if> of the year
1276                       </xsl:if>
1277
1278                       <xsl:if test="form/recurrence/byweekno">
1279                         in the
1280                         <xsl:apply-templates select="form/recurrence/byweekno/val" mode="weekMonthYearNumbers"/>
1281                         week<xsl:if test="form/recurrence/byweekno/val[position()=2]">s</xsl:if> of the year
1282                       </xsl:if>
1283
1284                       repeating
1285                       <xsl:choose>
1286                         <xsl:when test="form/recurrence/count = '-1'">forever</xsl:when>
1287                         <xsl:when test="form/recurrence/until">
1288                           until <xsl:value-of select="substring(form/recurrence/until,1,4)"/>-<xsl:value-of select="substring(form/recurrence/until,5,2)"/>-<xsl:value-of select="substring(form/recurrence/until,7,2)"/>
1289                         </xsl:when>
1290                         <xsl:otherwise>
1291                           <xsl:value-of select="form/recurrence/count"/>
1292                           time<xsl:if test="form/recurrence/count &gt; 1">s</xsl:if>
1293                         </xsl:otherwise>
1294                       </xsl:choose>
1295                     </div>
1296                   </xsl:if>
1297
1298                   <!-- set these dynamically when form is submitted -->
1299                   <input type="hidden" name="interval" value=""/>
1300                   <input type="hidden" name="count" value=""/>
1301                   <input type="hidden" name="until" value=""/>
1302                   <input type="hidden" name="byday" value=""/>
1303                   <input type="hidden" name="bymonthday" value=""/>
1304                   <input type="hidden" name="bymonth" value=""/>
1305                   <input type="hidden" name="byweekno" value=""/>
1306                   <input type="hidden" name="byyearday" value=""/>
1307                   <input type="hidden" name="wkst" value=""/>
1308                   <input type="hidden" name="setpos" value=""/>
1309
1310                   <!-- wrapper for rrules: -->
1311                   <table id="rrulesTable" cellspacing="0" class="invisible">
1312                     <tr>
1313                       <td id="recurrenceFrequency" rowspan="2">
1314                         <strong>Frequency:</strong><br/>
1315                         <input type="radio" name="freq" value="NONE" onclick="showRrules(this.value)" checked="checked"/>none<br/>
1316                         <!--<input type="radio" name="freq" value="HOURLY" onclick="showRrules(this.value)"/>hourly<br/>-->
1317                         <input type="radio" name="freq" value="DAILY" onclick="showRrules(this.value)"/>daily<br/>
1318                         <input type="radio" name="freq" value="WEEKLY" onclick="showRrules(this.value)"/>weekly<br/>
1319                         <input type="radio" name="freq" value="MONTHLY" onclick="showRrules(this.value)"/>monthly<br/>
1320                         <input type="radio" name="freq" value="YEARLY" onclick="showRrules(this.value)"/>yearly
1321                       </td>
1322                       <!-- recurrence count, until, forever -->
1323                       <td id="recurrenceUntil">
1324                         <div id="noneRecurrenceRules">
1325                           no recurrence rules
1326                         </div>
1327                         <div id="recurrenceUntilRules" class="invisible">
1328                           <strong>Repeat:</strong>
1329                           <p>
1330                             <input type="radio" name="recurCountUntil" value="forever">
1331                               <xsl:if test="not(form/recurring) or form/recurring/count = '-1'">
1332                                 <xsl:attribute name="checked">checked</xsl:attribute>
1333                               </xsl:if>
1334                             </input>
1335                             forever
1336                             <input type="radio" name="recurCountUntil" value="count" id="recurCount">
1337                               <xsl:if test="form/recurring/count != '-1'">
1338                                 <xsl:attribute name="checked">checked</xsl:attribute>
1339                               </xsl:if>
1340                             </input>
1341                             <input type="text" value="1" size="2" name="countHolder"  onfocus="selectRecurCountUntil('recurCount')">
1342                               <xsl:if test="form/recurring/count and form/recurring/count != '-1'">
1343                                 <xsl:attribute name="value"><xsl:value-of select="form/recurring/count"/></xsl:attribute>
1344                               </xsl:if>
1345                             </input>
1346                             time(s)
1347                             <input type="radio" name="recurCountUntil" value="until" id="recurUntil">
1348                               <xsl:if test="form/recurring/until">
1349                                 <xsl:attribute name="checked">checked</xsl:attribute>
1350                               </xsl:if>
1351                             </input>
1352                             until
1353                             <span id="untilHolder">
1354                               <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetUntilDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
1355                                 <xsl:attribute name="value"><xsl:value-of select="form/start/rfc3339DateTime"/></xsl:attribute>
1356                                 <xsl:text> </xsl:text>
1357                               </span>
1358                             </span>
1359                           </p>
1360                         </div>
1361                       </td>
1362                     </tr>
1363                     <tr>
1364                       <td id="advancedRrules" class="invisible">
1365                         <!-- hourly -->
1366                         <div id="hourlyRecurrenceRules" class="invisible">
1367                           <p>
1368                             <strong>Interval:</strong>
1369                             every
1370                             <input type="text" name="hourlyInterval" size="2" value="1">
1371                               <xsl:if test="form/recurrence/interval">
1372                                 <xsl:attribute name="value"><xsl:value-of select="form/recurrence/interval"/></xsl:attribute>
1373                               </xsl:if>
1374                             </input>
1375                             hour(s)
1376                           </p>
1377                         </div>
1378                         <!-- daily -->
1379                         <div id="dailyRecurrenceRules" class="invisible">
1380                           <p>
1381                             <strong>Interval:</strong>
1382                             every
1383                             <input type="text" name="dailyInterval" size="2" value="1">
1384                               <xsl:if test="form/recurrence/interval">
1385                                 <xsl:attribute name="value"><xsl:value-of select="form/recurrence/interval"/></xsl:attribute>
1386                               </xsl:if>
1387                             </input>
1388                             day(s)
1389                           </p>
1390                           <p>
1391                             <input type="checkbox" name="swapDayMonthCheckBoxList" value="" onclick="swapVisible(this,'dayMonthCheckBoxList')"/>
1392                             in these months:
1393                             <div id="dayMonthCheckBoxList" class="invisible">
1394                               <xsl:for-each select="/bedeworkadmin/monthlabels/val">
1395                                 <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
1396                                 <span class="chkBoxListItem">
1397                                   <input type="checkbox" name="dayMonths">
1398                                     <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/monthvalues/val[position() = $pos]"/></xsl:attribute>
1399                                   </input>
1400                                   <xsl:value-of select="."/>
1401                                 </span>
1402                                 <xsl:if test="$pos mod 6 = 0"><br/></xsl:if>
1403                               </xsl:for-each>
1404                             </div>
1405                           </p>
1406                           <!--<p>
1407                             <input type="checkbox" name="swapDaySetPos" value="" onclick="swapVisible(this,'daySetPos')"/>
1408                             limit to:
1409                             <div id="daySetPos" class="invisible">
1410                             </div>
1411                           </p>-->
1412                         </div>
1413                         <!-- weekly -->
1414                         <div id="weeklyRecurrenceRules" class="invisible">
1415                           <p>
1416                             <strong>Interval:</strong>
1417                             every
1418                             <input type="text" name="weeklyInterval" size="2" value="1">
1419                               <xsl:if test="form/recurrence/interval">
1420                                 <xsl:attribute name="value"><xsl:value-of select="form/recurrence/interval"/></xsl:attribute>
1421                               </xsl:if>
1422                             </input>
1423                             week(s) on:
1424                           </p>
1425                           <p>
1426                             <div id="weekRecurFields">
1427                               <xsl:call-template name="byDayChkBoxList">
1428                                 <xsl:with-param name="name">byDayWeek</xsl:with-param>
1429                               </xsl:call-template>
1430                             </div>
1431                           </p>
1432                           <p class="weekRecurLinks">
1433                             <a href="javascript:recurSelectWeekdays('weekRecurFields')">select weekdays</a> |
1434                             <a href="javascript:recurSelectWeekends('weekRecurFields')">select weekends</a>
1435                           </p>
1436                           <p>
1437                             Week start:
1438                             <select name="weekWkst">
1439                               <xsl:for-each select="/bedeworkadmin/shortdaynames/val">
1440                                 <xsl:variable name="pos" select="position()"/>
1441                                 <option>
1442                                   <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/recurdayvals/val[position() = $pos]"/></xsl:attribute>
1443                                   <xsl:value-of select="."/>
1444                                 </option>
1445                               </xsl:for-each>
1446                             </select>
1447                           </p>
1448                         </div>
1449                         <!-- monthly -->
1450                         <div id="monthlyRecurrenceRules" class="invisible">
1451                           <p>
1452                             <strong>Interval:</strong>
1453                             every
1454                             <input type="text" name="monthlyInterval" size="2" value="1">
1455                               <xsl:if test="form/recurrence/interval">
1456                                 <xsl:attribute name="value"><xsl:value-of select="form/recurrence/interval"/></xsl:attribute>
1457                               </xsl:if>
1458                             </input>
1459                             month(s)
1460                           </p>
1461                           <div id="monthRecurFields">
1462                             <div id="monthRecurFields1">
1463                               on
1464                               <select name="bymonthposPos1" width="7em" onchange="changeClass('monthRecurFields2','shown')">
1465                                 <xsl:call-template name="recurrenceDayPosOptions"/>
1466                               </select>
1467                               <xsl:call-template name="byDayChkBoxList"/>
1468                             </div>
1469                             <xsl:call-template name="buildRecurFields">
1470                               <xsl:with-param name="current">2</xsl:with-param>
1471                               <xsl:with-param name="total">10</xsl:with-param>
1472                               <xsl:with-param name="name">month</xsl:with-param>
1473                             </xsl:call-template>
1474                           </div>
1475                           <p>
1476                             <input type="checkbox" name="swapMonthDaysCheckBoxList" value="" onclick="swapVisible(this,'monthDaysCheckBoxList')"/>
1477                             on these days:<br/>
1478                             <div id="monthDaysCheckBoxList" class="invisible">
1479                               <xsl:call-template name="buildCheckboxList">
1480                                 <xsl:with-param name="current">1</xsl:with-param>
1481                                 <xsl:with-param name="end">31</xsl:with-param>
1482                                 <xsl:with-param name="name">monthDayBoxes</xsl:with-param>
1483                               </xsl:call-template>
1484                             </div>
1485                           </p>
1486                         </div>
1487                         <!-- yearly -->
1488                         <div id="yearlyRecurrenceRules" class="invisible">
1489                           <p>
1490                             <strong>Interval:</strong>
1491                             every
1492                             <input type="text" name="yearlyInterval" size="2" value="1">
1493                               <xsl:if test="form/recurrence/interval">
1494                                 <xsl:attribute name="value"><xsl:value-of select="form/recurrence/interval"/></xsl:attribute>
1495                               </xsl:if>
1496                             </input>
1497                             years(s)
1498                           </p>
1499                           <div id="yearRecurFields">
1500                             <div id="yearRecurFields1">
1501                               on
1502                               <select name="byyearposPos1" width="7em" onchange="changeClass('yearRecurFields2','shown')">
1503                                 <xsl:call-template name="recurrenceDayPosOptions"/>
1504                               </select>
1505                               <xsl:call-template name="byDayChkBoxList"/>
1506                             </div>
1507                             <xsl:call-template name="buildRecurFields">
1508                               <xsl:with-param name="current">2</xsl:with-param>
1509                               <xsl:with-param name="total">10</xsl:with-param>
1510                               <xsl:with-param name="name">year</xsl:with-param>
1511                             </xsl:call-template>
1512                           </div>
1513                           <p>
1514                             <input type="checkbox" name="swapYearMonthCheckBoxList" value="" onclick="swapVisible(this,'yearMonthCheckBoxList')"/>
1515                             in these months:
1516                             <div id="yearMonthCheckBoxList" class="invisible">
1517                               <xsl:for-each select="/bedeworkadmin/monthlabels/val">
1518                                 <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable>
1519                                 <span class="chkBoxListItem">
1520                                   <input type="checkbox" name="yearMonths">
1521                                     <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/monthvalues/val[position() = $pos]"/></xsl:attribute>
1522                                   </input>
1523                                   <xsl:value-of select="."/>
1524                                 </span>
1525                                 <xsl:if test="$pos mod 6 = 0"><br/></xsl:if>
1526                               </xsl:for-each>
1527                             </div>
1528                           </p>
1529                           <p>
1530                             <input type="checkbox" name="swapYearMonthDaysCheckBoxList" value="" onclick="swapVisible(this,'yearMonthDaysCheckBoxList')"/>
1531                             on these days of the month:<br/>
1532                             <div id="yearMonthDaysCheckBoxList" class="invisible">
1533                               <xsl:call-template name="buildCheckboxList">
1534                                 <xsl:with-param name="current">1</xsl:with-param>
1535                                 <xsl:with-param name="end">31</xsl:with-param>
1536                                 <xsl:with-param name="name">yearMonthDayBoxes</xsl:with-param>
1537                               </xsl:call-template>
1538                             </div>
1539                           </p>
1540                           <p>
1541                             <input type="checkbox" name="swapYearWeeksCheckBoxList" value="" onclick="swapVisible(this,'yearWeeksCheckBoxList')"/>
1542                             in these weeks of the year:<br/>
1543                             <div id="yearWeeksCheckBoxList" class="invisible">
1544                               <xsl:call-template name="buildCheckboxList">
1545                                 <xsl:with-param name="current">1</xsl:with-param>
1546                                 <xsl:with-param name="end">53</xsl:with-param>
1547                                 <xsl:with-param name="name">yearWeekBoxes</xsl:with-param>
1548                               </xsl:call-template>
1549                             </div>
1550                           </p>
1551                           <p>
1552                             <input type="checkbox" name="swapYearDaysCheckBoxList" value="" onclick="swapVisible(this,'yearDaysCheckBoxList')"/>
1553                             on these days of the year:<br/>
1554                             <div id="yearDaysCheckBoxList" class="invisible">
1555                               <xsl:call-template name="buildCheckboxList">
1556                                 <xsl:with-param name="current">1</xsl:with-param>
1557                                 <xsl:with-param name="end">366</xsl:with-param>
1558                                 <xsl:with-param name="name">yearDayBoxes</xsl:with-param>
1559                               </xsl:call-template>
1560                             </div>
1561                           </p>
1562                           <p>
1563                             Week start:
1564                             <select name="yearWkst">
1565                               <xsl:for-each select="/bedeworkadmin/shortdaynames/val">
1566                                 <xsl:variable name="pos" select="position()"/>
1567                                 <option>
1568                                   <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/recurdayvals/val[position() = $pos]"/></xsl:attribute>
1569                                   <xsl:value-of select="."/>
1570                                 </option>
1571                               </xsl:for-each>
1572                             </select>
1573                           </p>
1574                         </div>
1575                       </td>
1576                     </tr>
1577                   </table>
1578                   <!-- recurrence dates (rdates) -->
1579                   <div id="recurrenceDatesButton">
1580                     <input type="button" value="manage recurrence &amp; exception dates" onclick="launchSizedWindow('{$event-showRdates}','700','500')"/>
1581                   </div>
1582                 </div>
1583               </xsl:otherwise>
1584             </xsl:choose>
1585           </td>
1586         </tr>
1587         <!--  Status  -->
1588         <tr>
1589           <td class="fieldName">
1590             Status:
1591           </td>
1592           <td>
1593             <xsl:choose>
1594               <xsl:when test="form/status = 'TENTATIVE'">
1595                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1596               </xsl:when>
1597               <xsl:when test="form/status = 'CANCELLED'">
1598                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED" checked="checked"/>cancelled
1599               </xsl:when>
1600               <xsl:otherwise>
1601                 <input type="radio" name="event.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1602               </xsl:otherwise>
1603             </xsl:choose>
1604           </td>
1605         </tr>
1606         <!--  Description  -->
1607         <tr>
1608           <td class="fieldName">
1609             Description:
1610           </td>
1611           <td>
1612             <xsl:copy-of select="form/desc/*"/>
1613             <div class="fieldInfo">
1614               Enter all pertinent information, including the academic titles of
1615               all speakers and/or participants.
1616               <span class="maxCharNotice">(<xsl:value-of select="form/descLength"/> characters max.)</span>
1617             </div>
1618           </td>
1619         </tr>
1620         <!-- Cost -->
1621         <tr>
1622           <td class="optional">
1623             Price:
1624           </td>
1625           <td>
1626             <xsl:copy-of select="form/cost/*"/>
1627             <xsl:text> </xsl:text>
1628             <span class="fieldInfo">(optional: if any, and place to purchase tickets)</span>
1629           </td>
1630         </tr>
1631         <!-- Url -->
1632         <tr>
1633           <td class="optional">
1634             URL:
1635           </td>
1636           <td>
1637             <xsl:copy-of select="form/link/*"/>
1638             <xsl:text> </xsl:text>
1639             <span class="fieldInfo">(optional: for more information about the event)</span>
1640           </td>
1641         </tr>
1642         <!-- Location -->
1643         <tr>
1644           <td class="fieldName">
1645             Location:**
1646           </td>
1647           <td>
1648             <xsl:if test="form/location/preferred/select/option">
1649               <select name="prefLocationId" id="eventFormPrefLocationList">
1650                 <option value="-1">
1651                   Select preferred:
1652                 </option>
1653                 <xsl:copy-of select="form/location/preferred/select/*"/>
1654               </select>
1655               or Location (all):
1656             </xsl:if>
1657             <select name="allLocationId" id="eventFormLocationList">
1658               <option value="-1">
1659                 Select:
1660               </option>
1661               <xsl:copy-of select="form/location/all/select/*"/>
1662             </select>
1663           </td>
1664         </tr>
1665
1666         <xsl:if test="form/location/address">
1667           <tr>
1668             <td class="fieldName" colspan="2">
1669               <span class="std-text">
1670                 <span class="bold">or</span> add</span>
1671             </td>
1672           </tr>
1673           <tr>
1674             <td class="fieldName">
1675               Address:
1676             </td>
1677             <td>
1678               <xsl:variable name="addressFieldName" select="form/location/address/input/@name"/>
1679               <xsl:variable name="calLocations">
1680                 <xsl:for-each select="form/location/all/select/option">"<xsl:value-of select="."/>"<xsl:if test="position()!=last()">,</xsl:if>
1681                 </xsl:for-each>
1682               </xsl:variable>
1683               <input type="text" size="30" name="{$addressFieldName}" autocomplete="off" onfocus="autoComplete(this,event,new Array({$calLocations}));"/>
1684               <div class="fieldInfo">
1685                 Please include room, building, and campus (if not Seattle).
1686               </div>
1687             </td>
1688           </tr>
1689           <tr>
1690             <td class="optional">
1691               <span class="std-text">Location URL:</span>
1692             </td>
1693             <td>
1694               <xsl:copy-of select="form/location/link/*"/>
1695               <xsl:text> </xsl:text>
1696               <span class="fieldInfo">(optional: for information about the location)</span>
1697             </td>
1698           </tr>
1699         </xsl:if>
1700
1701         <!-- Contact -->
1702         <tr>
1703           <td class="fieldName">
1704             Contact:**
1705           </td>
1706           <td>
1707             <xsl:if test="form/contact/preferred/select/option">
1708               <select name="prefContactId" id="eventFormContactList">
1709                 <option value="-1">
1710                   Select preferred:
1711                 </option>option>
1712                 <xsl:copy-of select="form/contact/preferred/select/*"/>
1713               </select>
1714               or Contact (all):
1715             </xsl:if>
1716             <select name="allContactId" id="eventFormPrefContactList">
1717               <option value="-1">
1718                 Select:
1719               </option>
1720               <xsl:copy-of select="form/contact/all/select/*"/>
1721             </select>
1722           </td>
1723         </tr>
1724
1725
1726         <!--  Category  -->
1727         <tr>
1728           <td class="fieldName">
1729             Categories:**
1730           </td>
1731           <td>
1732             <xsl:if test="form/categories/preferred/category and /bedeworkadmin/creating='true'">
1733               <input type="radio" name="categoryCheckboxes" value="preferred" checked="checked" onclick="changeClass('preferredCategoryCheckboxes','shown');changeClass('allCategoryCheckboxes','invisible');"/>show preferred
1734               <input type="radio" name="categoryCheckboxes" value="all" onclick="changeClass('preferredCategoryCheckboxes','invisible');changeClass('allCategoryCheckboxes','shown')"/>show all<br/>
1735               <table cellpadding="0" id="preferredCategoryCheckboxes">
1736                 <tr>
1737                   <xsl:variable name="catCount" select="count(form/categories/preferred/category)"/>
1738                   <td>
1739                     <xsl:for-each select="form/categories/preferred/category[position() &lt;= ceiling($catCount div 2)]">
1740                       <input type="checkbox" name="categoryKey">
1741                         <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
1742                         <xsl:attribute name="id">pref-<xsl:value-of select="keyword"/></xsl:attribute>
1743                         <xsl:attribute name="onchange">setCatChBx('pref-<xsl:value-of select="keyword"/>','all-<xsl:value-of select="keyword"/>')</xsl:attribute>
1744                         <xsl:if test="keyword = ../../current//category/keyword"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
1745                         <xsl:value-of select="keyword"/>
1746                       </input><br/>
1747                     </xsl:for-each>
1748                   </td>
1749                   <td>
1750                     <xsl:for-each select="form/categories/preferred/category[position() &gt; ceiling($catCount div 2)]">
1751                       <input type="checkbox" name="categoryKey">
1752                         <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
1753                         <xsl:attribute name="id">pref-<xsl:value-of select="keyword"/></xsl:attribute>
1754                         <xsl:attribute name="onchange">setCatChBx('pref-<xsl:value-of select="keyword"/>','all-<xsl:value-of select="keyword"/>')</xsl:attribute>
1755                         <xsl:if test="keyword = ../../current//category/keyword"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
1756                         <xsl:value-of select="keyword"/>
1757                       </input><br/>
1758                     </xsl:for-each>
1759                   </td>
1760                 </tr>
1761               </table>
1762             </xsl:if>
1763             <table cellpadding="0" id="allCategoryCheckboxes">
1764               <xsl:if test="form/categories/preferred/category and /bedeworkadmin/creating='true'">
1765                 <xsl:attribute name="class">invisible</xsl:attribute>
1766               </xsl:if>
1767               <tr>
1768                 <xsl:variable name="catCount" select="count(form/categories/all/category)"/>
1769                 <td>
1770                   <xsl:for-each select="form/categories/all/category[position() &lt;= ceiling($catCount div 2)]">
1771                     <input type="checkbox" name="categoryKey">
1772                       <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
1773                       <xsl:if test="/bedeworkadmin/creating='true'">
1774                         <xsl:attribute name="id">all-<xsl:value-of select="keyword"/></xsl:attribute>
1775                         <xsl:attribute name="onchange">setCatChBx('all-<xsl:value-of select="keyword"/>','pref-<xsl:value-of select="keyword"/>')</xsl:attribute>
1776                       </xsl:if>
1777                       <xsl:if test="keyword = ../../current//category/keyword">
1778                         <xsl:attribute name="checked">checked</xsl:attribute>
1779                       </xsl:if>
1780                       <xsl:value-of select="keyword"/>
1781                     </input><br/>
1782                   </xsl:for-each>
1783                 </td>
1784                 <td>
1785                   <xsl:for-each select="form/categories/all/category[position() &gt; ceiling($catCount div 2)]">
1786                     <input type="checkbox" name="categoryKey">
1787                       <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
1788                       <xsl:if test="/bedeworkadmin/creating='true'">
1789                         <xsl:attribute name="id">all-<xsl:value-of select="keyword"/></xsl:attribute>
1790                         <xsl:attribute name="onchange">setCatChBx('all-<xsl:value-of select="keyword"/>','pref-<xsl:value-of select="keyword"/>')</xsl:attribute>
1791                       </xsl:if>
1792                       <xsl:if test="keyword = ../../current//category/keyword">
1793                         <xsl:attribute name="checked">checked</xsl:attribute>
1794                       </xsl:if>
1795                       <xsl:value-of select="keyword"/>
1796                     </input><br/>
1797                   </xsl:for-each>
1798                 </td>
1799               </tr>
1800             </table>
1801           </td>
1802         </tr>
1803         <!-- note -->
1804         <tr>
1805           <td colspan="2" style="padding-top: 1em;">
1806             <span class="fieldInfo">
1807               **<strong>If "preferred values" are enabled</strong>
1808               by your administrator, the category, location, and contact lists will
1809               contain only those value you've used previously.  If you don't find the value
1810               you need in one of these lists, use the "all" list adjacent to each
1811               of these fields.  The event you select from the "all" list will be added
1812               to your preferred list from that point on.  <strong>Note: if you don't
1813               find a location or contact at all, you can add a new one from the
1814               <a href="{$setup}">main menu</a>.</strong>
1815               Only administrators can create categories, however.
1816               To make sure you've used the
1817               correct category, please see the
1818               <a href="" target="_blank">Calendar Definitions</a>
1819             </span>
1820           </td>
1821         </tr>
1822
1823         <xsl:if test="form/contact/name">
1824           <tr>
1825             <td class="fieldName" colspan="2">
1826               <span class="std-text">
1827                 <span class="bold">or</span> add</span>
1828             </td>
1829           </tr>
1830           <tr>
1831             <td class="fieldName">
1832               Contact (name):
1833             </td>
1834             <td>
1835               <xsl:copy-of select="form/contact/name/*"/>
1836             </td>
1837           </tr>
1838           <tr>
1839             <td class="fieldName">
1840               Contact Phone Number:
1841             </td>
1842             <td>
1843               <xsl:copy-of select="form/contact/phone/*"/>
1844               <xsl:text> </xsl:text>
1845               <span class="fieldInfo">(optional)</span>
1846             </td>
1847           </tr>
1848           <tr>
1849             <td class="optional">
1850               Contact's URL:
1851             </td>
1852             <td>
1853               <xsl:copy-of select="form/contact/link/*"/>
1854               <xsl:text> </xsl:text>
1855               <span class="fieldInfo">(optional)</span>
1856             </td>
1857           </tr>
1858           <tr>
1859             <td class="optional">
1860               Contact Email Address:
1861             </td>
1862             <td>
1863               <xsl:copy-of select="form/contact/email/*"/>
1864               <xsl:text> </xsl:text>
1865               <span class="fieldInfo">(optional)</span> test
1866               <div id="contactEmailAlert">&#160;</div> <!-- space for email warning -->
1867             </td>
1868           </tr>
1869         </xsl:if>
1870       </table>
1871
1872       <table border="0" id="submitTable">
1873         <tr>
1874           <xsl:choose>
1875             <xsl:when test="/bedeworkadmin/creating='true'">
1876               <td>
1877                 <input type="submit" name="addEvent" value="Add Event"/>
1878                 <input type="submit" name="cancelled" value="Cancel"/>
1879                 <input type="reset" value="Clear"/>
1880               </td>
1881             </xsl:when>
1882             <xsl:otherwise>
1883               <td>
1884                 <input type="submit" name="updateEvent" value="Update Event"/>
1885                 <input type="submit" name="cancelled" value="Cancel"/>
1886                 <input type="submit" name="copy" value="Duplicate Event"/>
1887               </td>
1888               <td align="right">
1889                 <input type="submit" name="delete" value="Delete Event"/>
1890               </td>
1891             </xsl:otherwise>
1892           </xsl:choose>
1893         </tr>
1894       </table>
1895     </form>
1896   </xsl:template>
1897
1898   <xsl:template match="val" mode="weekMonthYearNumbers">
1899     <xsl:if test="position() != 1 and position() = last()"> and </xsl:if>
1900     <xsl:value-of select="."/><xsl:choose>
1901       <xsl:when test="substring(., string-length(.)-1, 2) = '11' or
1902                       substring(., string-length(.)-1, 2) = '12' or
1903                       substring(., string-length(.)-1, 2) = '13'">th</xsl:when>
1904       <xsl:when test="substring(., string-length(.), 1) = '1'">st</xsl:when>
1905       <xsl:when test="substring(., string-length(.), 1) = '2'">nd</xsl:when>
1906       <xsl:when test="substring(., string-length(.), 1) = '3'">rd</xsl:when>
1907       <xsl:otherwise>th</xsl:otherwise>
1908     </xsl:choose>
1909     <xsl:if test="position() != last()">, </xsl:if>
1910   </xsl:template>
1911
1912   <xsl:template name="byDayChkBoxList">
1913     <xsl:param name="name"/>
1914     <xsl:for-each select="/bedeworkadmin/shortdaynames/val">
1915       <xsl:variable name="pos" select="position()"/>
1916       <input type="checkbox">
1917         <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/recurdayvals/val[position() = $pos]"/></xsl:attribute>
1918         <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
1919       </input>
1920       <xsl:value-of select="."/>
1921     </xsl:for-each>
1922   </xsl:template>
1923
1924   <xsl:template name="buildCheckboxList">
1925     <xsl:param name="current"/>
1926     <xsl:param name="end"/>
1927     <xsl:param name="name"/>
1928     <xsl:param name="splitter">10</xsl:param>
1929     <span class="chkBoxListItem">
1930       <input type="checkbox">
1931         <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
1932         <xsl:attribute name="value"><xsl:value-of select="$current"/></xsl:attribute>
1933       </input>
1934       <xsl:value-of select="$current"/>
1935     </span>
1936     <xsl:if test="$current mod $splitter = 0"><br/></xsl:if>
1937     <xsl:if test="$current = $end"><br/></xsl:if>
1938     <xsl:if test="$current &lt; $end">
1939       <xsl:call-template name="buildCheckboxList">
1940         <xsl:with-param name="current"><xsl:value-of select="$current + 1"/></xsl:with-param>
1941         <xsl:with-param name="end"><xsl:value-of select="$end"/></xsl:with-param>
1942         <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param>
1943       </xsl:call-template>
1944     </xsl:if>
1945   </xsl:template>
1946
1947   <xsl:template name="recurrenceDayPosOptions">
1948     <option value="0">none</option>
1949     <option value="1">the first</option>
1950     <option value="2">the second</option>
1951     <option value="3">the third</option>
1952     <option value="4">the fourth</option>
1953     <option value="5">the fifth</option>
1954     <option value="-1">the last</option>
1955     <option value="">every</option>
1956   </xsl:template>
1957
1958   <xsl:template name="buildRecurFields">
1959     <xsl:param name="current"/>
1960     <xsl:param name="total"/>
1961     <xsl:param name="name"/>
1962     <div class="invisible">
1963       <xsl:attribute name="id"><xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current"/></xsl:attribute>
1964       and
1965       <select width="12em">
1966         <xsl:attribute name="name">by<xsl:value-of select="$name"/>posPos<xsl:value-of select="$current"/></xsl:attribute>
1967         <xsl:if test="$current != $total">
1968           <xsl:attribute name="onchange">changeClass('<xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current+1"/>','shown')</xsl:attribute>
1969         </xsl:if>
1970         <xsl:call-template name="recurrenceDayPosOptions"/>
1971       </select>
1972       <xsl:call-template name="byDayChkBoxList"/>
1973     </div>
1974     <xsl:if test="$current &lt; $total">
1975       <xsl:call-template name="buildRecurFields">
1976         <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param>
1977         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
1978         <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param>
1979       </xsl:call-template>
1980     </xsl:if>
1981   </xsl:template>
1982
1983   <xsl:template name="buildNumberOptions">
1984     <xsl:param name="current"/>
1985     <xsl:param name="total"/>
1986     <option value="{$current}"><xsl:value-of select="$current"/></option>
1987     <xsl:if test="$current &lt; $total">
1988       <xsl:call-template name="buildNumberOptions">
1989         <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param>
1990         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
1991       </xsl:call-template>
1992     </xsl:if>
1993   </xsl:template>
1994
1995   <xsl:template name="clock">
1996     <div id="bwClock">
1997       <!-- Bedework 24-Hour Clock time selection widget
1998            used with resources/bwClock.js and resources/bwClock.css -->
1999       <xsl:variable name="hour24" select="/bedeworkadmin/hour24"/><!-- true or false -->
2000       <div id="bwClockClock">
2001         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="bwClock" usemap="#bwClockMap" />
2002       </div>
2003       <div id="bwClockCover">
2004         &#160;
2005         <!-- this is a special effect div used simply to cover the pixelated edge
2006              where the clock meets the clock box title -->
2007       </div>
2008       <div id="bwClockBox">
2009         <h2>
2010           Bedework 24-Hour Clock
2011         </h2>
2012         <div id="bwClockDateTypeIndicator">
2013           type
2014         </div>
2015         <div id="bwClockTime">
2016           select time
2017         </div>
2018         <div id="bwClockSwitch">
2019           switch
2020         </div>
2021         <div id="bwClockCloseText">
2022           close
2023         </div>
2024         <div id="bwClockCloseButton">
2025           <a href="javascript:bwClockClose();">X</a>
2026         </div>
2027       </div>
2028       <map name="bwClockMap" id="bwClockMap">
2029         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
2030         <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')" />
2031         <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')" />
2032         <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')" />
2033         <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')" />
2034         <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')" />
2035         <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')" />
2036         <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')" />
2037         <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')" />
2038         <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')" />
2039         <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')" />
2040         <area shape="poly" alt="minute 00:05" title="minute 00:05" coords="196,155, 209,164, 238,126, 206,107" href="javascript:bwClockUpdateDateTimeForm('minute','5')" />
2041         <area shape="poly" alt="minute 00:00" title="minute 00:00" coords="169,155, 196,155, 206,105, 156,105" href="javascript:bwClockUpdateDateTimeForm('minute','0')" />
2042         <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',{$hour24})" />
2043         <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',{$hour24})" />
2044         <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',{$hour24})" />
2045         <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',{$hour24})" />
2046         <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',{$hour24})" />
2047         <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',{$hour24})" />
2048         <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',{$hour24})" />
2049         <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',{$hour24})" />
2050         <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',{$hour24})" />
2051         <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',{$hour24})" />
2052         <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',{$hour24})" />
2053         <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',{$hour24})" />
2054         <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',{$hour24})" />
2055         <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',{$hour24})" />
2056         <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','9',{$hour24})" />
2057         <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','8',{$hour24})" />
2058         <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','7',{$hour24})" />
2059         <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','6',{$hour24})" />
2060         <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','5',{$hour24})" />
2061         <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','4',{$hour24})" />
2062         <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','3',{$hour24})" />
2063         <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','2',{$hour24})" />
2064         <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','1',{$hour24})" />
2065         <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','0',{$hour24})" />
2066       </map>
2067     </div>
2068   </xsl:template>
2069
2070   <xsl:template name="rdates">
2071     <div id="bwDialogBox">
2072       <form name="rdatesForm" id="rdates" action="{$event-setRdate}" method="post" onsubmit="setRdateDatetime(this)">
2073         <h4 id="dialogTitle">
2074           Recurrence and Exception Dates
2075         </h4>
2076         <div id="raContent">
2077           <div class="dateStartEndBox" id="rdatesFormFields">
2078             <div class="dateFields">
2079               <input name="eventRdate.date"
2080                      dojoType="dropdowndatepicker"
2081                      formatLength="medium"
2082                      value="today"
2083                      saveFormat="yyyyMMdd"
2084                      id="bwEventWidgeRdate"
2085                      iconURL="{$resourcesRoot}/resources/calIcon.gif"/>
2086             </div>
2087             <div id="rdateTimeFields" class="timeFields">
2088              <select name="eventRdate.hour">
2089                 <option value="00">00</option>
2090                 <option value="01">01</option>
2091                 <option value="02">02</option>
2092                 <option value="03">03</option>
2093                 <option value="04">04</option>
2094                 <option value="05">05</option>
2095                 <option value="06">06</option>
2096                 <option value="07">07</option>
2097                 <option value="08">08</option>
2098                 <option value="09">09</option>
2099                 <option value="10">10</option>
2100                 <option value="11">11</option>
2101                 <option value="12" selected="selected">12</option>
2102                 <option value="13">13</option>
2103                 <option value="14">14</option>
2104                 <option value="15">15</option>
2105                 <option value="16">16</option>
2106                 <option value="17">17</option>
2107                 <option value="18">18</option>
2108                 <option value="19">19</option>
2109                 <option value="20">20</option>
2110                 <option value="21">21</option>
2111                 <option value="22">22</option>
2112                 <option value="23">23</option>
2113               </select>
2114               <select name="eventRdate.minute">
2115                 <option value="00" selected="selected">00</option>
2116                 <option value="05">05</option>
2117                 <option value="10">10</option>
2118                 <option value="15">15</option>
2119                 <option value="20">20</option>
2120                 <option value="25">25</option>
2121                 <option value="30">30</option>
2122                 <option value="35">35</option>
2123                 <option value="40">40</option>
2124                 <option value="45">45</option>
2125                 <option value="50">50</option>
2126                 <option value="55">55</option>
2127               </select>
2128              <xsl:text> </xsl:text>
2129
2130               <select name="tzid" id="rdateTzid" class="timezones">
2131                 <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
2132                 <option value="-1">select timezone...</option>
2133                 <xsl:variable name="rdateTzId" select="/bedeworkadmin/rdates/tzid"/>
2134                 <xsl:for-each select="/bedeworkadmin/timezones/timezone">
2135                   <option>
2136                     <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
2137                     <xsl:if test="$rdateTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
2138                     <xsl:value-of select="name"/>
2139                   </option>
2140                 </xsl:for-each>
2141               </select>
2142             </div>
2143             <xsl:text> </xsl:text>
2144             <input type="submit" value="add rdate"/>
2145             <br/>
2146             <!-- dateonly (anniversary) event: this is temporary - should be determined by the main event -->
2147             <input type="checkbox" name="dateOnly" id="rdateDateOnly" onclick="swapRdateAllDay(this)" value="on"/>
2148             all day
2149             <!-- floating event: no timezone (and not UTC) -->
2150             <input type="checkbox" name="floating" id="rdateFloating" onclick="swapRdateFloatingTime(this)" value="on"/>
2151             floating
2152             <!-- store time as coordinated universal time (UTC) -->
2153             <input type="checkbox" name="storeUTC" id="rdateStoreUTC" onclick="swapRdateStoreUTC(this)" value="on"/>
2154             store as UTC
2155           </div>
2156
2157           <xsl:call-template name="messagesAndErrors"/>
2158
2159           <table cellspacing="0" class="rdatesTable">
2160             <tr>
2161               <th colspan="2">Recurrence Dates</th>
2162             </tr>
2163             <xsl:choose>
2164               <xsl:when test="/bedeworkadmin/rdates/rdate">
2165                 <xsl:for-each select="/bedeworkadmin/rdates/rdate">
2166                   <tr>
2167                     <td>
2168                       <xsl:value-of select="longdate"/>
2169                       <xsl:if test="allday='false'">
2170                         <xsl:text> </xsl:text>
2171                         <xsl:value-of select="time"/>
2172                         <xsl:if test="floating='false'">
2173                           <xsl:text> </xsl:text>
2174                           <xsl:value-of select="timezone/id"/>
2175                         </xsl:if>
2176                       </xsl:if>
2177                     </td>
2178                     <td class="trash">
2179                       <xsl:variable name="datetime"><xsl:value-of select="unformatted"/></xsl:variable>
2180                       <xsl:variable name="tzid" select="timezone/id"/>
2181                       <xsl:variable name="dateOnly"><xsl:if test="allday = 'true'">&amp;dateOnly=true</xsl:if></xsl:variable>
2182                       <xsl:variable name="floating"><xsl:if test="floating = 'true'">&amp;floating=true</xsl:if></xsl:variable>
2183                       <xsl:variable name="storeUTC"><xsl:if test="utc = 'true'">&amp;storeUTC=true</xsl:if></xsl:variable>
2184                       <a href="{$event-setRdate}&amp;datetime={$datetime}&amp;tzid={$tzid}{$dateOnly}{$floating}{$storeUTC}&amp;delete=true" title="remove">
2185                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
2186                       </a>
2187                     </td>
2188                   </tr>
2189                 </xsl:for-each>
2190               </xsl:when>
2191               <xsl:otherwise>
2192                 <tr>
2193                   <td colspan="2">No recurrence dates</td>
2194                 </tr>
2195               </xsl:otherwise>
2196             </xsl:choose>
2197           </table>
2198
2199           <table cellspacing="0" class="rdatesTable">
2200             <tr>
2201               <th colspan="2">Exception Dates</th>
2202             </tr>
2203             <tr>
2204               <td colspan="2" class="note">
2205                 exception dates are created by deleting an instance of a
2206                 recurring event
2207               </td>
2208             </tr>
2209             <xsl:choose>
2210               <xsl:when test="/bedeworkadmin/exdates/exdate">
2211                 <xsl:for-each select="/bedeworkadmin/exdates/exdate">
2212                   <tr>
2213                     <td>
2214                       <xsl:value-of select="longdate"/>
2215                       <xsl:if test="allday='false'">
2216                         <xsl:value-of select="time"/>
2217                         <xsl:if test="floating='false'">
2218                           <xsl:value-of select="timezone/id"/>
2219                         </xsl:if>
2220                       </xsl:if>
2221                     </td>
2222                     <td class="trash">
2223                       <xsl:variable name="datetime"><xsl:value-of select="unformatted"/></xsl:variable>
2224                       <xsl:variable name="tzid" select="timezone/id"/>
2225                       <xsl:variable name="dateOnly"><xsl:if test="allday = 'true'">&amp;dateOnly=true</xsl:if></xsl:variable>
2226                       <xsl:variable name="floating"><xsl:if test="floating = 'true'">&amp;floating=true</xsl:if></xsl:variable>
2227                       <xsl:variable name="storeUTC"><xsl:if test="utc = 'true'">&amp;storeUTC=true</xsl:if></xsl:variable>
2228                       <a href="{$event-setRdate}&amp;datetime={$datetime}&amp;tzid={$tzid}{$dateOnly}{$floating}{$storeUTC}&amp;exdelete=true" title="remove">
2229                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
2230                       </a>
2231                     </td>
2232                   </tr>
2233                 </xsl:for-each>
2234               </xsl:when>
2235               <xsl:otherwise>
2236                 <tr>
2237                   <td colspan="2">No exception dates</td>
2238                 </tr>
2239               </xsl:otherwise>
2240             </xsl:choose>
2241           </table>
2242
2243           <input type="button" value="done" onclick="window.close()"/>
2244         </div>
2245       </form>
2246     </div>
2247   </xsl:template>
2248
2249   <xsl:template match="event" mode="displayEvent">
2250     <xsl:variable name="calPath" select="calendar/path"/>
2251     <xsl:variable name="guid" select="guid"/>
2252     <xsl:variable name="recurrenceId" select="recurrenceId"/>
2253
2254     <xsl:choose>
2255       <xsl:when test="/bedeworkadmin/page='deleteEventConfirm'">
2256         <h2>Ok to delete this event?</h2>
2257         <p style="width: 400px;">Note: we do not encourage deletion of old but correct events; we prefer to keep
2258            old events for historical reasons.  Please remove only those events
2259            that are truly erroneous.</p>
2260         <p id="confirmButtons">
2261           <form action="{$event-delete}" method="post">
2262             <input type="submit" name="cancelled" value="Cancel"/>
2263             <input type="submit" name="delete" value="Delete"/>
2264             <input type="hidden" name="calPath" value="{$calPath}"/>
2265             <input type="hidden" name="guid" value="{$guid}"/>
2266             <input type="hidden" name="recurrenceId" value="{$recurrenceId}"/>
2267           </form>
2268         </p>
2269       </xsl:when>
2270       <xsl:otherwise>
2271         <h2>Event Information</h2>
2272       </xsl:otherwise>
2273     </xsl:choose>
2274
2275     <table class="eventFormTable">
2276       <tr>
2277         <th>
2278           Title:
2279         </th>
2280         <td>
2281           <strong><xsl:value-of select="summary"/></strong>
2282         </td>
2283       </tr>
2284
2285       <tr>
2286         <th>
2287           When:
2288         </th>
2289         <td>
2290           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
2291           <xsl:if test="start/allday = 'false'">
2292             <span class="time"><xsl:value-of select="start/time"/></span>
2293           </xsl:if>
2294           <xsl:if test="(end/longdate != start/longdate) or
2295                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
2296           <xsl:if test="end/longdate != start/longdate">
2297             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
2298           </xsl:if>
2299           <xsl:choose>
2300             <xsl:when test="start/allday = 'true'">
2301               <span class="time"><em>(all day)</em></span>
2302             </xsl:when>
2303             <xsl:when test="end/longdate != start/longdate">
2304               <span class="time"><xsl:value-of select="end/time"/></span>
2305             </xsl:when>
2306             <xsl:when test="end/time != start/time">
2307               <span class="time"><xsl:value-of select="end/time"/></span>
2308             </xsl:when>
2309           </xsl:choose>
2310         </td>
2311       </tr>
2312
2313       <tr>
2314         <th>
2315           Calendar:
2316         </th>
2317         <td>
2318           <xsl:value-of select="calendar/path"/>
2319         </td>
2320       </tr>
2321
2322       <!--  Description  -->
2323       <tr>
2324         <th>
2325           Description:
2326         </th>
2327         <td>
2328           <xsl:value-of select="description"/>
2329         </td>
2330       </tr>
2331       <!-- Cost -->
2332       <tr>
2333         <th class="optional">
2334           Price:
2335         </th>
2336         <td>
2337           <xsl:value-of select="cost"/>
2338         </td>
2339       </tr>
2340       <!-- Url -->
2341       <tr>
2342         <th class="optional">
2343           URL:
2344         </th>
2345         <td>
2346           <xsl:variable name="eventLink" select="link"/>
2347           <a href="{$eventLink}">
2348             <xsl:value-of select="link"/>
2349           </a>
2350         </td>
2351       </tr>
2352
2353       <!-- Location -->
2354       <tr>
2355         <th>
2356           Location:
2357         </th>
2358         <td>
2359           <xsl:value-of select="location/address"/><br/>
2360           <xsl:value-of select="location/subaddress"/>
2361         </td>
2362       </tr>
2363
2364       <!-- Contact -->
2365       <tr>
2366         <th>
2367           Contact:
2368         </th>
2369         <td>
2370           <xsl:value-of select="contact/name"/><br/>
2371           <xsl:value-of select="contact/phone"/><br/>
2372           <xsl:variable name="mailto" select="email"/>
2373           <a href="mailto:{$mailto}"><xsl:value-of select="email"/></a>
2374           <xsl:variable name="contactLink" select="link"/>
2375           <a href="mailto:{$contactLink}"><xsl:value-of select="contact/link"/></a>
2376         </td>
2377       </tr>
2378
2379       <!-- Owner -->
2380       <tr>
2381         <th>
2382           Owner:
2383         </th>
2384         <td>
2385           <strong><xsl:value-of select="creator"/></strong>
2386         </td>
2387       </tr>
2388
2389       <!--  Categories  -->
2390       <tr>
2391         <th>
2392           Categories:
2393         </th>
2394         <td>
2395           <xsl:for-each select="categories/category">
2396             <xsl:value-of select="word"/><br/>
2397           </xsl:for-each>
2398         </td>
2399       </tr>
2400
2401     </table>
2402
2403     <p>
2404       <xsl:if test="/bedeworkadmin/canEdit = 'true' or /bedeworkadmin/userInfo/superUser = 'true'">
2405         <input type="button" name="return" value="Edit event" onclick="javascript:location.replace('{$event-fetchForUpdate}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}')"/>
2406       </xsl:if>
2407
2408       <input type="button" name="return" value="Back" onclick="javascript:history.back()"/>
2409     </p>
2410   </xsl:template>
2411
2412   <!--+++++++++++++++ Contacts ++++++++++++++++++++-->
2413   <xsl:template name="contactList">
2414     <h2>Edit Contacts</h2>
2415     <p>
2416       Select the contact you would like to update:
2417       <input type="button" name="return" value="Add new contact" onclick="javascript:location.replace('{$contact-initAdd}')"/>
2418     </p>
2419
2420     <table id="commonListTable">
2421       <tr>
2422         <th>Name</th>
2423         <th>Phone</th>
2424         <th>Email</th>
2425         <th>URL</th>
2426       </tr>
2427
2428       <xsl:for-each select="/bedeworkadmin/contacts/contact">
2429         <tr>
2430           <td>
2431             <xsl:copy-of select="name" />
2432           </td>
2433           <td>
2434             <xsl:value-of select="phone" />
2435           </td>
2436           <td>
2437             <xsl:variable name="email" select="email"/>
2438             <a href="mailto:{$email}">
2439               <xsl:value-of select="email"/>
2440             </a>
2441           </td>
2442           <td>
2443             <xsl:variable name="link" select="link" />
2444             <a href="{$link}" target="linktest">
2445               <xsl:value-of select="link" />
2446             </a>
2447           </td>
2448         </tr>
2449       </xsl:for-each>
2450     </table>
2451   </xsl:template>
2452
2453   <xsl:template name="modContact">
2454     <form action="{$contact-update}" method="post">
2455       <h2>Contact Information</h2>
2456
2457       <table id="eventFormTable">
2458         <tr>
2459           <td class="fieldName">
2460             Contact:
2461           </td>
2462           <td>
2463             <xsl:copy-of select="/bedeworkadmin/formElements/form/name/*"/>
2464           </td>
2465         </tr>
2466         <tr>
2467           <td class="fieldName">
2468             Contact Phone Number:
2469           </td>
2470           <td>
2471             <xsl:copy-of select="/bedeworkadmin/formElements/form/phone/*"/>
2472             <span class="fieldInfo"> (optional)</span>
2473           </td>
2474         </tr>
2475         <tr>
2476           <td class="optional">
2477             Contact's URL:
2478           </td>
2479           <td>
2480             <xsl:copy-of select="/bedeworkadmin/formElements/form/link/*"/>
2481             <span class="fieldInfo"> (optional)</span>
2482           </td>
2483         </tr>
2484         <tr>
2485           <td class="optional">
2486             Contact Email Address:
2487           </td>
2488           <td>
2489             <xsl:copy-of select="/bedeworkadmin/formElements/form/email/*"/>
2490             <span class="fieldInfo"> (optional)</span>
2491           </td>
2492         </tr>
2493       </table>
2494
2495       <table border="0" id="submitTable">
2496         <tr>
2497           <xsl:choose>
2498             <xsl:when test="/bedeworkadmin/creating='true'">
2499               <td>
2500                 <input type="submit" name="addContact" value="Add Contact"/>
2501                 <input type="submit" name="cancelled" value="Cancel"/>
2502                 <input type="reset" value="Clear"/>
2503               </td>
2504             </xsl:when>
2505             <xsl:otherwise>
2506               <td>
2507                 <input type="submit" name="updateContact" value="Update Contact"/>
2508                 <input type="submit" name="cancelled" value="Cancel"/>
2509                 <input type="reset" value="Reset"/>
2510               </td>
2511               <td align="right">
2512                 <input type="submit" name="delete" value="Delete Contact"/>
2513               </td>
2514             </xsl:otherwise>
2515           </xsl:choose>
2516         </tr>
2517       </table>
2518
2519     </form>
2520   </xsl:template>
2521
2522   <xsl:template name="deleteContactConfirm">
2523     <h2>Ok to delete this contact?</h2>
2524     <p id="confirmButtons">
2525       <xsl:copy-of select="/bedeworkadmin/formElements/*"/>
2526     </p>
2527
2528     <table class="eventFormTable">
2529       <tr>
2530         <th>Name</th>
2531         <td>
2532           <xsl:value-of select="/bedeworkadmin/contact/name" />
2533         </td>
2534       </tr>
2535       <tr>
2536         <th>Phone</th>
2537         <td>
2538           <xsl:value-of select="/bedeworkadmin/contact/phone" />
2539         </td>
2540       </tr>
2541       <tr>
2542         <th>Email</th>
2543         <td>
2544           <xsl:value-of select="/bedeworkadmin/contact/email" />
2545         </td>
2546       </tr>
2547       <tr>
2548         <th>URL</th>
2549         <td>
2550           <xsl:value-of select="/bedeworkadmin/contact/link" />
2551         </td>
2552       </tr>
2553     </table>
2554   </xsl:template>
2555
2556    <!--+++++++++++++++ Locations ++++++++++++++++++++-->
2557   <xsl:template name="locationList">
2558     <h2>Edit Locations</h2>
2559     <p>
2560       Select the location that you would like to update:
2561       <input type="button" name="return" value="Add new location" onclick="javascript:location.replace('{$location-initAdd}')"/>
2562     </p>
2563
2564     <table id="commonListTable">
2565       <tr>
2566         <th>Address</th>
2567         <th>Subaddress</th>
2568         <th>URL</th>
2569       </tr>
2570
2571       <xsl:for-each select="/bedeworkadmin/locations/location">
2572         <tr>
2573           <td>
2574             <xsl:copy-of select="address/*"/>
2575           </td>
2576           <td>
2577             <xsl:value-of select="subaddress"/>
2578           </td>
2579           <td>
2580             <xsl:variable name="link" select="link" />
2581             <a href="{$link}" target="linktest">
2582               <xsl:value-of select="link" />
2583             </a>
2584           </td>
2585         </tr>
2586       </xsl:for-each>
2587     </table>
2588   </xsl:template>
2589
2590   <xsl:template name="modLocation">
2591     <xsl:choose>
2592       <xsl:when test="/bedeworkadmin/creating='true'">
2593         <h2>Add Location</h2>
2594       </xsl:when>
2595       <xsl:otherwise>
2596         <h2>Update Location</h2>
2597       </xsl:otherwise>
2598     </xsl:choose>
2599
2600     <form action="{$location-update}" method="post">
2601       <table id="eventFormTable">
2602         <tr>
2603           <td class="fieldName">
2604             Address:
2605           </td>
2606           <td>
2607             <xsl:copy-of select="/bedeworkadmin/formElements/form/address/*"/>
2608           </td>
2609         </tr>
2610         <tr>
2611           <td class="optional">
2612             Subaddress:
2613           </td>
2614           <td>
2615             <xsl:copy-of select="/bedeworkadmin/formElements/form/subaddress/*"/>
2616             <span class="fieldInfo"> (optional)</span>
2617           </td>
2618         </tr>
2619         <tr>
2620           <td class="optional">
2621             Location's URL:
2622           </td>
2623           <td>
2624             <xsl:copy-of select="/bedeworkadmin/formElements/form/link/*"/>
2625             <span class="fieldInfo"> (optional)</span>
2626           </td>
2627         </tr>
2628       </table>
2629
2630       <table border="0" id="submitTable">
2631         <tr>
2632           <xsl:choose>
2633             <xsl:when test="/bedeworkadmin/creating='true'">
2634               <td>
2635                 <input type="submit" name="addLocation" value="Add Location"/>
2636                 <input type="submit" name="cancelled" value="Cancel"/>
2637                 <input type="reset" value="Clear"/>
2638               </td>
2639             </xsl:when>
2640             <xsl:otherwise>
2641               <td>
2642                 <input type="submit" name="updateLocation" value="Update Location"/>
2643                 <input type="submit" name="cancelled" value="Cancel"/>
2644                 <input type="reset" value="Reset"/>
2645               </td>
2646               <td align="right">
2647                 <input type="submit" name="delete" value="Delete Location"/>
2648               </td>
2649             </xsl:otherwise>
2650           </xsl:choose>
2651         </tr>
2652       </table>
2653     </form>
2654   </xsl:template>
2655
2656   <xsl:template name="deleteLocationConfirm">
2657     <h2>Ok to delete this location?</h2>
2658     <p id="confirmButtons">
2659       <xsl:copy-of select="/bedeworkadmin/formElements/*"/>
2660     </p>
2661
2662     <table class="eventFormTable">
2663       <tr>
2664         <td class="fieldName">
2665             Address:
2666           </td>
2667         <td>
2668           <xsl:value-of select="/bedeworkadmin/location/address"/>
2669         </td>
2670       </tr>
2671       <tr>
2672         <td class="optional">
2673             Subaddress:
2674           </td>
2675         <td>
2676           <xsl:value-of select="/bedeworkadmin/location/subaddress"/>
2677         </td>
2678       </tr>
2679       <tr>
2680         <td class="optional">
2681             Location's URL:
2682           </td>
2683         <td>
2684           <xsl:variable name="link" select="/bedeworkadmin/location/link"/>
2685           <a href="{$link}">
2686             <xsl:value-of select="/bedeworkadmin/location/link"/>
2687           </a>
2688         </td>
2689       </tr>
2690     </table>
2691   </xsl:template>
2692
2693   <!--+++++++++++++++ Categories ++++++++++++++++++++-->
2694   <xsl:template name="categoryList">
2695     <h2>Edit Categories</h2>
2696     <p>
2697       Select the category you would like to update:
2698       <input type="button" name="return" value="Add new category" onclick="javascript:location.replace('{$category-initAdd}')"/>
2699     </p>
2700
2701     <table id="commonListTable">
2702       <tr>
2703         <th>Keyword</th>
2704         <th>Description</th>
2705       </tr>
2706
2707       <xsl:for-each select="/bedeworkadmin/categories/category">
2708         <xsl:variable name="categoryKey" select="normalize-space(keyword)"/>
2709         <tr>
2710           <td>
2711             <a href="{$category-fetchForUpdate}&amp;categoryKey={$categoryKey}">
2712               <xsl:value-of select="keyword"/>
2713             </a>
2714           </td>
2715           <td>
2716             <xsl:value-of select="desc"/>
2717           </td>
2718         </tr>
2719       </xsl:for-each>
2720     </table>
2721   </xsl:template>
2722
2723   <xsl:template name="modCategory">
2724     <xsl:choose>
2725       <xsl:when test="/bedeworkadmin/creating='true'">
2726         <h2>Add Category</h2>
2727         <form action="{$category-update}" method="post">
2728           <table id="eventFormTable">
2729             <tr>
2730               <td class="fieldName">
2731                 Keyword:
2732               </td>
2733               <td>
2734                 <input type="text" name="categoryWord.value" value="" size="40"/>
2735               </td>
2736             </tr>
2737             <tr>
2738               <td class="optional">
2739                 Description:
2740               </td>
2741               <td>
2742                 <textarea name="categoryDesc.value" rows="3" cols="60">
2743                 </textarea>
2744               </td>
2745             </tr>
2746           </table>
2747           <table border="0" id="submitTable">
2748             <tr>
2749               <td>
2750                 <input type="submit" name="addCategory" value="Add Category"/>
2751                 <input type="submit" name="cancelled" value="Cancel"/>
2752                 <input type="reset" value="Clear"/>
2753               </td>
2754             </tr>
2755           </table>
2756         </form>
2757       </xsl:when>
2758       <xsl:otherwise>
2759         <h2>Update Category</h2>
2760         <form action="{$category-update}" method="post">
2761           <table id="eventFormTable">
2762             <tr>
2763               <td class="fieldName">
2764             Keyword:
2765             </td>
2766               <td>
2767                 <xsl:variable name="keyword" select="normalize-space(/bedeworkadmin/currentCategory/category/keyword)"/>
2768                 <input type="text" name="categoryWord.value" value="{$keyword}" size="40"/>
2769               </td>
2770             </tr>
2771             <tr>
2772               <td class="optional">
2773             Description:
2774             </td>
2775               <td>
2776                 <textarea name="categoryDesc.value" rows="3" cols="60">
2777                   <xsl:value-of select="normalize-space(/bedeworkadmin/currentCategory/category/desc)"/>
2778                 </textarea>
2779               </td>
2780             </tr>
2781           </table>
2782
2783           <table border="0" id="submitTable">
2784             <tr>
2785               <td>
2786                 <input type="submit" name="updateCategory" value="Update Category"/>
2787                 <input type="submit" name="cancelled" value="Cancel"/>
2788                 <input type="reset" value="Reset"/>
2789               </td>
2790               <td align="right">
2791                 <input type="submit" name="delete" value="Delete Category"/>
2792               </td>
2793             </tr>
2794           </table>
2795         </form>
2796       </xsl:otherwise>
2797     </xsl:choose>
2798
2799
2800   </xsl:template>
2801
2802   <xsl:template name="deleteCategoryConfirm">
2803     <h2>Ok to delete this category?</h2>
2804
2805
2806     <table class="eventFormTable">
2807       <tr>
2808         <td class="fieldName">
2809           Keyword:
2810         </td>
2811         <td>
2812           <xsl:value-of select="/bedeworkadmin/currentCategory/category/keyword"/>
2813         </td>
2814       </tr>
2815       <tr>
2816         <td class="optional">
2817           Description:
2818         </td>
2819         <td>
2820           <xsl:value-of select="/bedeworkadmin/currentCategory/category/desc"/>
2821         </td>
2822       </tr>
2823     </table>
2824
2825     <form action="{$category-delete}" method="post">
2826       <input type="submit" name="updateCategory" value="Yes: Delete Category"/>
2827       <input type="submit" name="cancelled" value="No: Cancel"/>
2828     </form>
2829   </xsl:template>
2830
2831 <!--+++++++++++++++ Calendars ++++++++++++++++++++-->
2832   <xsl:template match="calendars">
2833     <table id="calendarTable">
2834       <tr>
2835         <td class="cals">
2836           <h3>Public calendars</h3>
2837           <ul id="calendarTree">
2838             <xsl:choose>
2839               <xsl:when test="/bedeworkadmin/page='calendarDescriptions' or /bedeworkadmin/page='displayCalendar'">
2840                 <xsl:apply-templates select="calendar" mode="listForDisplay"/>
2841               </xsl:when>
2842               <xsl:otherwise>
2843                 <xsl:apply-templates select="calendar" mode="listForUpdate"/>
2844               </xsl:otherwise>
2845             </xsl:choose>
2846           </ul>
2847         </td>
2848         <td class="calendarContent">
2849           <xsl:choose>
2850             <xsl:when test="/bedeworkadmin/page='calendarList' or /bedeworkadmin/page='calendarReferenced'">
2851               <xsl:call-template name="calendarList"/>
2852             </xsl:when>
2853             <xsl:when test="/bedeworkadmin/page='calendarDescriptions'">
2854               <xsl:call-template name="calendarDescriptions"/>
2855             </xsl:when>
2856             <xsl:when test="/bedeworkadmin/page='displayCalendar'">
2857               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="displayCalendar"/>
2858             </xsl:when>
2859             <xsl:when test="/bedeworkadmin/page='deleteCalendarConfirm'">
2860               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="deleteCalendarConfirm"/>
2861             </xsl:when>
2862             <xsl:when test="/bedeworkadmin/creating='true'">
2863               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="addCalendar"/>
2864             </xsl:when>
2865             <xsl:otherwise>
2866               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="modCalendar"/>
2867             </xsl:otherwise>
2868           </xsl:choose>
2869         </td>
2870       </tr>
2871     </table>
2872   </xsl:template>
2873
2874   <xsl:template match="calendar" mode="listForUpdate">
2875     <xsl:variable name="calPath" select="encodedPath"/>
2876     <xsl:variable name="itemClass">
2877       <xsl:choose>
2878         <xsl:when test="calendarCollection='false'">folder</xsl:when>
2879         <xsl:otherwise>calendar</xsl:otherwise>
2880       </xsl:choose>
2881     </xsl:variable>
2882     <li class="{$itemClass}">
2883       <a href="{$calendar-fetchForUpdate}&amp;calPath={$calPath}" title="update">
2884         <xsl:value-of select="name"/>
2885       </a>
2886       <xsl:if test="calendarCollection='false'">
2887         <xsl:text> </xsl:text>
2888         <a href="{$calendar-initAdd}&amp;calPath={$calPath}" title="add a calendar or folder">
2889           <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/>
2890         </a>
2891       </xsl:if>
2892       <xsl:if test="calendar">
2893         <ul>
2894           <xsl:apply-templates select="calendar" mode="listForUpdate">
2895             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates>
2896         </ul>
2897       </xsl:if>
2898     </li>
2899   </xsl:template>
2900
2901   <xsl:template match="calendar" mode="listForDisplay">
2902     <xsl:variable name="calPath" select="encodedPath"/>
2903     <xsl:variable name="itemClass">
2904       <xsl:choose>
2905         <xsl:when test="calendarCollection='false'">folder</xsl:when>
2906         <xsl:otherwise>calendar</xsl:otherwise>
2907       </xsl:choose>
2908     </xsl:variable>
2909     <li class="{$itemClass}">
2910       <a href="{$calendar-fetchForDisplay}&amp;calPath={$calPath}" title="display">
2911         <xsl:value-of select="name"/>
2912       </a>
2913       <xsl:if test="calendar">
2914         <ul>
2915           <xsl:apply-templates select="calendar" mode="listForDisplay">
2916             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates>
2917         </ul>
2918       </xsl:if>
2919     </li>
2920   </xsl:template>
2921
2922   <xsl:template match="currentCalendar" mode="addCalendar">
2923     <h3>Add Calendar / Folder</h3>
2924     <form name="addCalForm" method="post" action="{$calendar-update}">
2925       <table class="eventFormTable">
2926         <tr>
2927           <th>Name:</th>
2928           <td>
2929             <xsl:variable name="curCalName" select="name"/>
2930             <input name="calendar.name" value="{$curCalName}" size="40"/>
2931           </td>
2932         </tr>
2933         <tr>
2934           <th>Summary:</th>
2935           <td>
2936             <xsl:variable name="curCalSummary" select="summary"/>
2937             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2938           </td>
2939         </tr>
2940         <tr>
2941           <th>Description:</th>
2942           <td>
2943             <textarea name="calendar.description" cols="40" rows="4">
2944               <xsl:value-of select="desc"/>
2945             </textarea>
2946           </td>
2947         </tr>
2948         <tr>
2949           <th>Calendar/Folder:</th>
2950           <td>
2951             <xsl:choose>
2952               <xsl:when test="calendarCollection='true'">
2953                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2954                 <input type="radio" value="false" name="calendarCollection"/> Folder
2955               </xsl:when>
2956               <xsl:otherwise>
2957                 <input type="radio" value="true" name="calendarCollection"/> Calendar
2958                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
2959               </xsl:otherwise>
2960             </xsl:choose>
2961           </td>
2962         </tr>
2963       </table>
2964
2965       <table border="0" id="submitTable">
2966         <tr>
2967           <td>
2968             <input type="submit" name="addCalendar" value="Add Calendar/Folder"/>
2969             <input type="submit" name="cancelled" value="Cancel"/>
2970             <input type="reset" value="Clear"/>
2971           </td>
2972         </tr>
2973       </table>
2974     </form>
2975     <div id="sharingBox">
2976       <h3>Sharing</h3>
2977       Sharing may be added to a calendar once created.
2978     </div>
2979   </xsl:template>
2980
2981   <xsl:template match="currentCalendar" mode="modCalendar">
2982     <xsl:choose>
2983       <xsl:when test="calendarCollection='true'">
2984         <h3>Modify Calendar</h3>
2985       </xsl:when>
2986       <xsl:otherwise>
2987         <h3>Modify Folder</h3>
2988       </xsl:otherwise>
2989     </xsl:choose>
2990     <form name="modCalForm" action="{$calendar-update}" method="post">
2991       <table class="eventFormTable">
2992         <tr>
2993           <th>Path:</th>
2994           <td>
2995             <xsl:value-of select="path"/>
2996           </td>
2997         </tr>
2998         <tr>
2999           <th>Name:</th>
3000           <td>
3001             <xsl:value-of select="name"/>
3002           </td>
3003         </tr>
3004         <tr>
3005           <th>Mailing List ID:</th>
3006           <td>
3007             <xsl:value-of select="mailListId"/>
3008           </td>
3009         </tr>
3010         <tr>
3011           <th>Summary:</th>
3012           <td>
3013             <xsl:variable name="curCalSummary" select="summary"/>
3014             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
3015           </td>
3016         </tr>
3017         <tr>
3018           <th>Description:</th>
3019           <td>
3020             <textarea name="calendar.description" cols="40" rows="4">
3021               <xsl:value-of select="desc"/>
3022             </textarea>
3023           </td>
3024         </tr>
3025         <tr>
3026           <th>Calendar/Folder:</th>
3027           <td>
3028             <xsl:choose>
3029               <xsl:when test="calendarCollection='true'">
3030                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
3031                 <input type="radio" value="false" name="calendarCollection"/> Folder
3032               </xsl:when>
3033               <xsl:otherwise>
3034                 <input type="radio" value="true" name="calendarCollection"/> Calendar
3035                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
3036               </xsl:otherwise>
3037             </xsl:choose>
3038           </td>
3039         </tr>
3040       </table>
3041
3042       <table border="0" id="submitTable">
3043         <tr>
3044           <td>
3045             <xsl:choose>
3046               <xsl:when test="calendarCollection='true'">
3047                 <input type="submit" name="updateCalendar" value="Update Calendar"/>
3048               </xsl:when>
3049               <xsl:otherwise>
3050                 <input type="submit" name="updateCalendar" value="Update Folder"/>
3051               </xsl:otherwise>
3052             </xsl:choose>
3053             <input type="submit" name="cancelled" value="Cancel"/>
3054             <input type="reset" value="Reset"/>
3055           </td>
3056           <td align="right">
3057             <xsl:choose>
3058               <xsl:when test="calendarCollection='true'">
3059                 <input type="submit" name="delete" value="Delete Calendar"/>
3060               </xsl:when>
3061               <xsl:otherwise>
3062                 <input type="submit" name="delete" value="Delete Folder"/>
3063               </xsl:otherwise>
3064             </xsl:choose>
3065           </td>
3066         </tr>
3067       </table>
3068     </form>
3069
3070
3071     <div id="sharingBox">
3072       <xsl:apply-templates select="acl" mode="currentAccess">
3073         <xsl:with-param name="action" select="$calendar-setAccess"/>
3074         <xsl:with-param name="calPathEncoded" select="encodedPath"/>
3075       </xsl:apply-templates>
3076       <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm" onsubmit="setAccessHow(this)" method="post">
3077         <input type="hidden" name="calPath">
3078           <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
3079         </input>
3080         <xsl:call-template name="entityAccessForm">
3081           <xsl:with-param name="type">
3082             <xsl:choose>
3083               <xsl:when test="calType = '5'">inbox</xsl:when>
3084               <xsl:when test="calType = '6'">outbox</xsl:when>
3085               <xsl:otherwise>normal</xsl:otherwise>
3086             </xsl:choose>
3087           </xsl:with-param>
3088         </xsl:call-template>
3089       </form>
3090     </div>
3091
3092     <!--<div id="sharingBox">
3093       <xsl:variable name="calPath" select="path"/>
3094       <xsl:variable name="encodedCalPath" select="encodedPath"/>
3095       <xsl:if test="currentAccess/current-user-privilege-set/privilege/read-acl or /bedeworkadmin/userInfo/superUser='true'">
3096         <h3>Sharing</h3>
3097         <table class="common" id="sharing">
3098           <tr>
3099             <th class="commonHeader">Who:</th>
3100             <th class="commonHeader">Current access:</th>
3101             <th class="commonHeader">Source:</th>
3102           </tr>
3103           <xsl:for-each select="acl/ace">
3104             <xsl:variable name="who">
3105               <xsl:choose>
3106                 <xsl:when test="invert">
3107                   <xsl:choose>
3108                     <xsl:when test="invert/principal/href"><xsl:value-of select="normalize-space(invert/principal/href)"/></xsl:when>
3109                     <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3110                     <xsl:otherwise><xsl:value-of select="name(invert/principal/*)"/></xsl:otherwise>
3111                   </xsl:choose>
3112                 </xsl:when>
3113                 <xsl:otherwise>
3114                   <xsl:choose>
3115                     <xsl:when test="principal/href"><xsl:value-of select="normalize-space(principal/href)"/></xsl:when>
3116                     <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3117                     <xsl:otherwise><xsl:value-of select="name(principal/*)"/></xsl:otherwise>
3118                   </xsl:choose>
3119                 </xsl:otherwise>
3120               </xsl:choose>
3121             </xsl:variable>
3122             <tr>
3123             <th class="thin">
3124                 <xsl:if test="invert">
3125                   Not
3126                 </xsl:if>
3127                 <xsl:choose>
3128                   <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">
3129                     <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
3130                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/>
3131                   </xsl:when>
3132                   <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">
3133                     <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
3134                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/>
3135                   </xsl:when>
3136                   <xsl:when test="invert and $who='owner'">
3137                     <xsl:value-of select="$who"/> (other)
3138                   </xsl:when>
3139                   <xsl:otherwise>
3140                     <xsl:value-of select="$who"/>
3141                   </xsl:otherwise>
3142                 </xsl:choose>
3143               </th>
3144               <td>
3145                 <xsl:for-each select="grant/node()">
3146                   <xsl:value-of select="name(.)"/>&#160;&#160;
3147                 </xsl:for-each>
3148                 <xsl:for-each select="deny/node()">
3149                   <xsl:choose>
3150                     <xsl:when test="name(.)='all'">
3151                       none
3152                     </xsl:when>
3153                     <xsl:otherwise>
3154                       deny-<xsl:value-of select="name(.)"/>
3155                     </xsl:otherwise>
3156                   </xsl:choose>
3157                   &#160;&#160;
3158                 </xsl:for-each>
3159               </td>
3160               <td>
3161                 <xsl:choose>
3162                   <xsl:when test="inherited">
3163                     inherited from:
3164                     <a>
3165                       <xsl:attribute name="href"><xsl:value-of select="$calendar-fetchForUpdate"/>&amp;calPath=<xsl:value-of select="inherited/href"/></xsl:attribute>
3166                       <xsl:value-of select="inherited/href"/>
3167                     </a>
3168                   </xsl:when>
3169                   <xsl:otherwise>
3170                     local:
3171                     <xsl:variable name="whoType">
3172                       <xsl:choose>
3173                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">user</xsl:when>
3174                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">group</xsl:when>
3175                         <xsl:when test="$who='authenticated'">auth</xsl:when>
3176                         <xsl:when test="invert/principal/property/owner">other</xsl:when>
3177                         <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3178                         <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3179                         <xsl:otherwise></xsl:otherwise>
3180                       </xsl:choose>
3181                     </xsl:variable>
3182                     <xsl:variable name="shortWho">
3183                       <xsl:choose>
3184                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/></xsl:when>
3185                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/></xsl:when>
3186                         <xsl:otherwise></xsl:otherwise>--> <!-- if not user or group, send no who -->
3187         <!--              </xsl:choose>
3188                     </xsl:variable>
3189                     <xsl:choose>
3190                       <xsl:when test="invert">
3191                         <a href="{$calendar-setAccess}&amp;calPath={$encodedCalPath}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}&amp;notWho=yes">
3192                           reset to default
3193                         </a>
3194                       </xsl:when>
3195                       <xsl:otherwise>
3196                         <a href="{$calendar-setAccess}&amp;calPath={$encodedCalPath}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}">
3197                           reset to default
3198                         </a>
3199                       </xsl:otherwise>
3200                     </xsl:choose>
3201                   </xsl:otherwise>
3202                 </xsl:choose>
3203               </td>
3204             </tr>
3205           </xsl:for-each>
3206         </table>
3207       </xsl:if>
3208
3209       <xsl:if test="currentAccess/current-user-privilege-set/privilege/write-acl or /bedeworkadmin/userInfo/superUser='true'">
3210         <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm" method="post">
3211           <input type="hidden" name="calPath" value="{$calPath}"/>
3212           <table cellspacing="0" id="shareFormTable" class="common">
3213             <tr>
3214               <th colspan="2" class="commonHeader">Set access:</th>
3215             </tr>
3216             <tr class="subhead">
3217               <th>Who:</th>
3218               <th>Rights:</th>
3219             </tr>
3220             <tr>
3221               <td>
3222                 <input type="text" name="who" size="20"/>
3223                 <br/>
3224                 <input type="radio" value="user" name="whoType" checked="checked"/> user
3225                 <input type="radio" value="group" name="whoType"/> group
3226                 <p>OR</p>
3227                 <p>
3228                   <input type="radio" value="auth" name="whoType"/> all authorized users<br/>
3229                   <input type="radio" value="other" name="whoType"/> other users<br/>
3230                   <input type="radio" value="owner" name="whoType"/> owner
3231                 </p>-->
3232                 <!-- we may never use the invert action ...it is probably
3233                      too confusing, and can be achieved in other ways -->
3234                 <!--
3235                 <p class="padTop">
3236                   <input type="checkbox" value="yes" name="notWho"/> invert (deny)
3237                 </p>-->
3238               <!--</td>
3239               <td>
3240                 <ul id="howList">
3241                   <li>
3242                     <input type="radio" value="A" name="how"/>
3243                     <strong>All</strong> (read, write, delete)</li>
3244                   <li class="padTop">
3245                     <input type="radio" value="R" name="how" checked="checked"/>
3246                     <strong>Read</strong> (content, access, freebusy)
3247                   </li>
3248                   <li>
3249                     <input type="radio" value="f" name="how"/> Read freebusy only
3250                   </li>
3251                   <li class="padTop">
3252                     <input type="radio" value="Rc" name="how"/>
3253                     <strong>Read</strong> and <strong>Write content only</strong>
3254                   </li>
3255                   <li class="padTop">
3256                     <input type="radio" value="W" name="how"/>
3257                     <strong>Write and delete</strong> (content, access, properties)
3258                   </li>
3259                   <li>
3260                     <input type="radio" value="c" name="how"/> Write content only
3261                   </li>
3262                   <li>
3263                     <input type="radio" value="u" name="how"/> Delete only
3264                   </li>
3265                   <li class="padTop">
3266                     <input type="radio" value="N" name="how"/>
3267                     <strong>None</strong>
3268                   </li>-->
3269                   <!--
3270                   <li class="padTop">
3271                     <input type="radio" value="default" name="how"/>
3272                     <strong>Restore default access</strong>
3273                   </li>-->
3274                 <!--</ul>
3275               </td>
3276             </tr>
3277           </table>
3278           <input type="submit" name="submit" value="Submit"/>
3279         </form>
3280       </xsl:if>
3281     </div>-->
3282   </xsl:template>
3283
3284
3285   <xsl:template name="calendarList">
3286     <h3>Manage Calendars</h3>
3287     <ul>
3288       <li>Select an item from the calendar list on the left to modify
3289       a calendar or folder.</li>
3290       <li>Select the
3291       <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="true" border="0"/>
3292       icon to add a new calendar or folder to the tree.
3293         <ul>
3294           <li>Folders may only contain calendars and subfolders.</li>
3295           <li>Calendars may only contain events (and other calendar items).</li>
3296           <li>
3297             If a calendar is empty, it may be converted to a folder and vice
3298             versa.  If a calendar or folder are not empty, it may not be
3299             converted.
3300           </li>
3301         </ul>
3302       </li>
3303     </ul>
3304   </xsl:template>
3305
3306   <xsl:template name="calendarDescriptions">
3307     <h2>Calendar Information</h2>
3308     <ul>
3309       <li>Select an item from the calendar tree on the left to view all information
3310       about that calendar or folder.  The tree on the left represents the calendar
3311       heirarchy.</li>
3312     </ul>
3313
3314     <p>
3315       <strong>All Calendar Descriptions:</strong>
3316     </p>
3317     <table id="flatCalendarDescriptions" cellspacing="0">
3318       <tr>
3319         <th>Name</th>
3320         <th>Description</th>
3321       </tr>
3322       <xsl:for-each select="//calendar">
3323         <xsl:variable name="descClass">
3324           <xsl:choose>
3325             <xsl:when test="position() mod 2 = 0">even</xsl:when>
3326             <xsl:otherwise>odd</xsl:otherwise>
3327           </xsl:choose>
3328         </xsl:variable>
3329         <tr class="{$descClass}">
3330           <td>
3331             <xsl:value-of select="name"/>
3332           </td>
3333           <td>
3334             <xsl:value-of select="desc"/>
3335           </td>
3336         </tr>
3337       </xsl:for-each>
3338     </table>
3339   </xsl:template>
3340
3341   <xsl:template match="currentCalendar" mode="displayCalendar">
3342     <h2>Calendar Information</h2>
3343     <table class="eventFormTable">
3344       <tr>
3345         <th>Name:</th>
3346         <td>
3347           <xsl:value-of select="name"/>
3348         </td>
3349       </tr>
3350       <tr>
3351         <th>Path:</th>
3352         <td>
3353           <xsl:value-of select="path"/>
3354         </td>
3355       </tr>
3356       <tr>
3357         <th>Summary:</th>
3358         <td>
3359           <xsl:value-of select="summary"/>
3360         </td>
3361       </tr>
3362       <tr>
3363         <th>Description:</th>
3364         <td>
3365           <xsl:value-of select="desc"/>
3366         </td>
3367       </tr>
3368     </table>
3369   </xsl:template>
3370
3371   <xsl:template match="currentCalendar" mode="deleteCalendarConfirm">
3372     <xsl:choose>
3373       <xsl:when test="calendarCollection='true'">
3374         <h3>Delete Calendar</h3>
3375         <p>
3376           The following calendar will be deleted.  Continue?
3377         </p>
3378       </xsl:when>
3379       <xsl:otherwise>
3380         <h3>Delete Folder</h3>
3381         <p>
3382           The following folder <em>and all its contents</em> will be deleted.
3383           Continue?
3384         </p>
3385       </xsl:otherwise>
3386     </xsl:choose>
3387
3388     <form name="delCalForm" action="{$calendar-delete}" method="post">
3389       <table class="eventFormTable">
3390         <tr>
3391           <th>Path:</th>
3392           <td>
3393             <xsl:value-of select="path"/>
3394           </td>
3395         </tr>
3396         <tr>
3397           <th>Name:</th>
3398           <td>
3399             <xsl:value-of select="name"/>
3400           </td>
3401         </tr>
3402         <tr>
3403           <th>Summary:</th>
3404           <td>
3405             <xsl:value-of select="summary"/>
3406           </td>
3407         </tr>
3408         <tr>
3409           <th>Description:</th>
3410           <td>
3411             <xsl:value-of select="desc"/>
3412           </td>
3413         </tr>
3414       </table>
3415
3416       <table border="0" id="submitTable">
3417         <tr>
3418           <td>
3419             <input type="submit" name="cancelled" value="Cancel"/>
3420           </td>
3421           <td align="right">
3422             <xsl:choose>
3423               <xsl:when test="calendarCollection='true'">
3424                 <input type="submit" name="delete" value="Yes: Delete Calendar!"/>
3425               </xsl:when>
3426               <xsl:otherwise>
3427                 <input type="submit" name="delete" value="Yes: Delete Folder!"/>
3428               </xsl:otherwise>
3429             </xsl:choose>
3430           </td>
3431         </tr>
3432       </table>
3433     </form>
3434   </xsl:template>
3435
3436   <!-- the selectCalForEvent listing creates a calendar tree in a pop-up window -->
3437   <xsl:template name="selectCalForEvent">
3438     <div id="calTreeBlock">
3439       <h2>Select a calendar</h2>
3440       <!--<form name="toggleCals" action="{$event-selectCalForEvent}" method="post">
3441         <xsl:choose>
3442           <xsl:when test="/bedeworkadmin/appvar[key='showAllCalsForEvent']/value = 'true'">
3443             <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" onclick="submit()"/>
3444             show only writable calendars
3445             <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" checked="checked" onclick="submit()"/>
3446             show all calendars
3447           </xsl:when>
3448           <xsl:otherwise>
3449             <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" checked="checked" onclick="submit()"/>
3450             show only writable calendars
3451             <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" onclick="submit()"/>
3452             show all calendars
3453           </xsl:otherwise>
3454         </xsl:choose>
3455       </form>-->
3456       <h4>Calendars</h4>
3457       <ul id="calendarTree">
3458         <xsl:apply-templates select="/bedeworkadmin/calendars/calendar" mode="selectCalForEventCalTree"/>
3459       </ul>
3460     </div>
3461   </xsl:template>
3462
3463   <xsl:template match="calendar" mode="selectCalForEventCalTree">
3464     <xsl:variable name="id" select="id"/>
3465     <li>
3466       <xsl:attribute name="class">
3467         <xsl:choose>
3468           <xsl:when test="calendarCollection='false'">folder</xsl:when>
3469           <xsl:otherwise>calendar</xsl:otherwise>
3470         </xsl:choose>
3471       </xsl:attribute>
3472       <xsl:variable name="calPath" select="path"/><!-- not the encodedPath when put in a form - otherwise it gets double encoded -->
3473       <xsl:variable name="calDisplay" select="path"/>
3474       <xsl:choose>
3475         <xsl:when test="currentAccess/current-user-privilege-set/privilege/write-content and (calendarCollection = 'true')">
3476           <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}')">
3477             <strong>
3478               <xsl:value-of select="name"/>
3479             </strong>
3480           </a>
3481         </xsl:when>
3482         <xsl:otherwise>
3483           <xsl:value-of select="name"/>
3484         </xsl:otherwise>
3485       </xsl:choose>
3486       <xsl:if test="calendar">
3487         <ul>
3488           <xsl:apply-templates select="calendar" mode="selectCalForEventCalTree"/>
3489         </ul>
3490       </xsl:if>
3491     </li>
3492   </xsl:template>
3493
3494   <!--==== ACCESS CONTROL TEMPLATES ====-->
3495
3496   <!--<xsl:template match="eventAccess">
3497     <xsl:variable name="calPathEncoded" select="calendar/encodedPath"/>
3498     <xsl:variable name="calPath" select="calendar/path"/>
3499     <xsl:variable name="guid" select="guid"/>
3500     <xsl:variable name="recurrenceId" select="recurrenceId"/>
3501     <div id="bwEventTab-Access">
3502       <div id="sharingBox">
3503         <xsl:apply-templates select="access/acl" mode="currentAccess">
3504           <xsl:with-param name="action" select="$event-setAccess"/>
3505           <xsl:with-param name="calPathEncoded" select="$calPathEncoded"/>
3506           <xsl:with-param name="guid" select="$guid"/>
3507           <xsl:with-param name="recurrenceId" select="$recurrenceId"/>
3508         </xsl:apply-templates>
3509         <form name="eventShareForm" action="{$event-setAccess}" id="shareForm" onsubmit="setAccessHow(this)" method="post">
3510           <input type="hidden" name="calPath" value="{$calPath}"/>
3511           <input type="hidden" name="guid" value="{$guid}"/>
3512           <input type="hidden" name="recurid" value="{$recurrenceId}"/>
3513           <xsl:call-template name="entityAccessForm"/>
3514         </form>
3515       </div>
3516     </div>
3517   </xsl:template>-->
3518
3519   <xsl:template name="schedulingAccessForm">
3520     <xsl:param name="what"/>
3521     <input type="hidden" name="what">
3522       <xsl:attribute name="value"><xsl:value-of select="$what"/></xsl:attribute>
3523     </input>
3524     <p>
3525       <input type="text" name="who" width="40"/>
3526       <span class="nowrap"><input type="radio" name="whoType" value="user" checked="checked"/>user</span>
3527       <span class="nowrap"><input type="radio" name="whoType" value="group"/>group</span>
3528     </p>
3529     <p>
3530       <strong>or</strong>
3531       <span class="nowrap"><input type="radio" name="whoType" value="owner"/>owner</span>
3532       <span class="nowrap"><input type="radio" name="whoType" value="auth"/>authenticated users</span>
3533       <span class="nowrap"><input type="radio" name="whoType" value="other"/>anyone</span>
3534     </p>
3535
3536     <input type="hidden" name="how" value="S"/>
3537     <dl>
3538       <dt>
3539         <input type="checkbox" name="howSetter" value="S" checked="checked" onchange="toggleScheduleHow(this.form,this)"/>all scheduling
3540       </dt>
3541       <dd>
3542         <input type="checkbox" name="howSetter" value="t" checked="checked" disabled="disabled"/>scheduling requests<br/>
3543         <input type="checkbox" name="howSetter" value="y" checked="checked" disabled="disabled"/>scheduling replies<br/>
3544         <input type="checkbox" name="howSetter" value="s" checked="checked" disabled="disabled"/>free-busy requests
3545       </dd>
3546     </dl>
3547
3548     <input type="submit" name="modPrefs" value="Update"/>
3549     <input type="reset" value="Reset"/>
3550     <input type="submit" name="cancelled" value="cancel"/>
3551   </xsl:template>
3552
3553   <xsl:template name="entityAccessForm">
3554     <xsl:param name="type"/><!-- optional:
3555     currently used for inbox and outbox to conditionally
3556     display scheduling access -->
3557     <table cellpadding="0" id="shareFormTable" class="common">
3558       <tr>
3559         <th colspan="2" class="commonHeader">Add:</th>
3560       </tr>
3561       <tr>
3562         <td>
3563           <h5>Who:</h5>
3564           <div class="whoTypes">
3565             <input type="text" name="who" size="20"/><br/>
3566             <input type="radio" value="user" name="whoType" checked="checked"/> user
3567             <input type="radio" value="group" name="whoType"/> group
3568             <p>OR</p>
3569             <p>
3570               <input type="radio" value="owner" name="whoType"/> owner<br/>
3571               <input type="radio" value="auth" name="whoType"/> authenticated<br/>
3572               <input type="radio" value="unauth" name="whoType"/> unauthenticated<br/>
3573               <input type="radio" value="other" name="whoType"/> other users
3574             </p>
3575           </div>
3576         </td>
3577         <td>
3578           <h5>
3579             <span id="accessRightsToggle">
3580               <xsl:choose>
3581                 <xsl:when test="/bedeworkadmin/appvar[key='accessRightsToggle']/value='basic'">
3582                   <input type="radio" name="setappvar" value="accessRightsToggle(basic)" checked="checked" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/>basic
3583                   <input type="radio" name="setappvar" value="accessRightsToggle(advanced)" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/>advanced
3584                 </xsl:when>
3585                 <xsl:otherwise>
3586                   <input type="radio" name="setappvar" value="accessRightsToggle(basic)" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/>basic
3587                   <input type="radio" name="setappvar" value="accessRightsToggle(advanced)" checked="checked" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/>advanced
3588                 </xsl:otherwise>
3589               </xsl:choose>
3590             </span>
3591             Rights:
3592           </h5>
3593           <input type="hidden" name="how" value=""/>
3594           <!-- Advanced Access Rights: -->
3595           <!-- the "how" field is set by iterating over the howItems below -->
3596           <table id="howTable" class="visible" cellspacing="0">
3597             <xsl:if test="/bedeworkadmin/appvar[key='accessRightsToggle']/value='basic'">
3598               <xsl:attribute name="class">invisible</xsl:attribute>
3599             </xsl:if>
3600             <tr>
3601               <th>access type</th>
3602               <th>allow</th>
3603               <th>deny</th>
3604             </tr>
3605             <tr>
3606               <td class="level1">
3607                 <input type="checkbox" value="A" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/>All
3608               </td>
3609               <td>
3610                 <input type="radio" value="A" name="A" checked="checked" disabled="disabled"/>
3611               </td>
3612               <td>
3613                 <input type="radio" value="-A" name="A" disabled="disabled"/>
3614               </td>
3615             </tr>
3616             <tr>
3617               <td class="level2">
3618                 <input type="checkbox" value="R" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)" checked="checked"/> Read
3619               </td>
3620               <td>
3621                 <input type="radio" value="R" name="R" checked="checked"/>
3622               </td>
3623               <td>
3624                 <input type="radio" value="-R" name="R"/>
3625               </td>
3626             </tr>
3627             <tr>
3628               <td class="level3">
3629                 <input type="checkbox" value="r" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read ACL
3630               </td>
3631               <td>
3632                 <input type="radio" value="r" name="r" checked="checked" disabled="disabled"/>
3633               </td>
3634               <td>
3635                 <input type="radio" value="-r" name="r" disabled="disabled"/>
3636               </td>
3637             </tr>
3638             <tr>
3639               <td class="level3">
3640                 <input type="checkbox" value="P" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read current user privilege set
3641               </td>
3642               <td>
3643                 <input type="radio" value="P" name="P" checked="checked" disabled="disabled"/>
3644               </td>
3645               <td>
3646                 <input type="radio" value="-P" name="P" disabled="disabled"/>
3647               </td>
3648             </tr>
3649             <tr>
3650               <td class="level3">
3651                 <input type="checkbox" value="F" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read freebusy
3652               </td>
3653               <td>
3654                 <input type="radio" value="F" name="F" checked="checked" disabled="disabled"/>
3655               </td>
3656               <td>
3657                 <input type="radio" value="-F" name="F" disabled="disabled"/>
3658               </td>
3659             </tr>
3660             <tr>
3661               <td class="level2">
3662                 <input type="checkbox" value="W" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> Write
3663               </td>
3664               <td>
3665                 <input type="radio" value="W" name="W" checked="checked" disabled="disabled"/>
3666               </td>
3667               <td>
3668                 <input type="radio" value="-W" name="W" disabled="disabled"/>
3669               </td>
3670             </tr>
3671             <tr>
3672               <td class="level3">
3673                 <input type="checkbox" value="a" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write ACL
3674               </td>
3675               <td>
3676                 <input type="radio" value="a" name="a" checked="checked" disabled="disabled"/>
3677               </td>
3678               <td>
3679                 <input type="radio" value="-a" name="a" disabled="disabled"/>
3680               </td>
3681             </tr>
3682             <tr>
3683               <td class="level3">
3684                 <input type="checkbox" value="p" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write properties
3685               </td>
3686               <td>
3687                 <input type="radio" value="p" name="p" checked="checked" disabled="disabled"/>
3688               </td>
3689               <td>
3690                 <input type="radio" value="-p" name="p" disabled="disabled"/>
3691               </td>
3692             </tr>
3693             <tr>
3694               <td class="level3">
3695                 <input type="checkbox" value="c" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write content
3696               </td>
3697               <td>
3698                 <input type="radio" value="c" name="c" checked="checked" disabled="disabled"/>
3699               </td>
3700               <td>
3701                 <input type="radio" value="-c" name="c" disabled="disabled"/>
3702               </td>
3703             </tr>
3704             <tr>
3705               <td class="level3">
3706                 <input type="checkbox" value="b" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> create (bind)
3707               </td>
3708               <td>
3709                 <input type="radio" value="b" name="b" checked="checked" disabled="disabled"/>
3710               </td>
3711               <td>
3712                 <input type="radio" value="-b" name="b" disabled="disabled"/>
3713               </td>
3714             </tr>
3715             <tr>
3716               <td class="level4">
3717                 <input type="checkbox" value="S" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> schedule
3718               </td>
3719               <td>
3720                 <input type="radio" value="S" name="S" checked="checked" disabled="disabled"/>
3721               </td>
3722               <td>
3723                 <input type="radio" value="-S" name="S" disabled="disabled"/>
3724               </td>
3725               </tr>
3726               <tr>
3727                 <td class="level5">
3728                   <input type="checkbox" value="t" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule request
3729                 </td>
3730               <td>
3731                 <input type="radio" value="t" name="t" checked="checked" disabled="disabled"/>
3732               </td>
3733               <td>
3734                 <input type="radio" value="-t" name="t" disabled="disabled"/>
3735               </td>
3736               </tr>
3737               <tr>
3738                 <td class="level5">
3739                   <input type="checkbox" value="y" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule reply
3740                 </td>
3741               <td>
3742                 <input type="radio" value="y" name="y" checked="checked" disabled="disabled"/>
3743               </td>
3744               <td>
3745                 <input type="radio" value="-y" name="y" disabled="disabled"/>
3746               </td>
3747               </tr>
3748               <tr>
3749                 <td class="level5">
3750                   <input type="checkbox" value="s" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule free-busy
3751                 </td>
3752               <td>
3753                 <input type="radio" value="s" name="s" checked="checked" disabled="disabled"/>
3754               </td>
3755               <td>
3756                 <input type="radio" value="-s" name="s" disabled="disabled"/>
3757               </td>
3758             </tr>
3759             <tr>
3760               <td class="level3">
3761                  <input type="checkbox" value="u" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> delete (unbind)
3762               </td>
3763               <td>
3764                 <input type="radio" value="u" name="u" checked="checked" disabled="disabled"/>
3765               </td>
3766               <td>
3767                 <input type="radio" value="-u" name="u" disabled="disabled"/>
3768               </td>
3769             </tr>
3770             <!--<tr>
3771               <td class="level1">
3772                 <input type="checkbox" value="N" name="howItem" onclick="setupAccessForm(this, this.form)"/> None
3773               </td>
3774               <td>
3775               </td>
3776               <td>
3777               </td>
3778             </tr>-->
3779           </table>
3780           <!-- Simple Access Rights: -->
3781           <!-- the "how" field is set by getting the selected basicHowItem -->
3782           <ul id="howList" class="invisible">
3783             <xsl:if test="/bedeworkadmin/appvar[key='accessRightsToggle']/value='basic'">
3784               <xsl:attribute name="class">visible</xsl:attribute>
3785             </xsl:if>
3786             <li>
3787               <input type="radio" value="A" name="basicHowItem"/>All
3788             </li>
3789             <li>
3790               <input type="radio" value="R" name="basicHowItem" checked="checked"/>Read only
3791             </li>
3792           </ul>
3793
3794           <!-- below is a simplified listing using radio buttons only; keep for
3795                those who would like something inbetween the advanced and simple
3796                interfaces -->
3797           <!--
3798           <ul id="howList">
3799             <li><input type="radio" value="A" name="how"/> <strong>All</strong> (read, write, delete)</li>
3800             <li class="padTop">
3801               <input type="radio" value="R" name="how" checked="checked"/> <strong>Read</strong> (content, access, freebusy)
3802             </li>
3803             <li>
3804               <input type="radio" value="F" name="how"/> Read freebusy only
3805             </li>
3806             <li class="padTop">
3807               <input type="radio" value="W" name="how"/> <strong>Write and delete</strong> (content, access, properties)
3808             </li>
3809             <li>
3810               <input type="radio" value="c" name="how"/> Write content only
3811             </li>
3812             <li>
3813              <input type="radio" value="u" name="how"/> Delete only
3814             </li>
3815             <li class="padTop">
3816               <input type="radio" value="Rc" name="how"/> <strong>Read</strong> and <strong>Write content only</strong>
3817             </li>
3818             <li class="padTop">
3819               <input type="radio" value="N" name="how"/> <strong>None</strong>
3820             </li>
3821           </ul> -->
3822         </td>
3823       </tr>
3824     </table>
3825     <input type="submit" name="submit" value="Submit"/>
3826   </xsl:template>
3827
3828   <xsl:template match="acl" mode="currentAccess">
3829     <xsl:param name="action"/> <!-- required -->
3830     <xsl:param name="calPathEncoded"/> <!-- optional (for entities) -->
3831     <xsl:param name="guid"/> <!-- optional (for entities) -->
3832     <xsl:param name="recurrenceId"/> <!-- optional (for entities) -->
3833     <xsl:param name="what"/> <!-- optional (for scheduling only) -->
3834     <h3>Current Access:</h3>
3835       <table class="common scheduling">
3836         <tr>
3837           <th>Entry</th>
3838           <th>Access</th>
3839           <th>Inherited from</th>
3840           <td></td>
3841         </tr>
3842         <xsl:for-each select="ace">
3843         <xsl:variable name="who">
3844           <xsl:choose>
3845             <xsl:when test="invert">
3846               <xsl:choose>
3847                 <xsl:when test="invert/principal/href"><xsl:value-of select="normalize-space(invert/principal/href)"/></xsl:when>
3848                 <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3849                 <xsl:otherwise><xsl:value-of select="name(invert/principal/*)"/></xsl:otherwise>
3850               </xsl:choose>
3851             </xsl:when>
3852             <xsl:otherwise>
3853               <xsl:choose>
3854                 <xsl:when test="principal/href"><xsl:value-of select="normalize-space(principal/href)"/></xsl:when>
3855                 <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3856                 <xsl:otherwise><xsl:value-of select="name(principal/*)"/></xsl:otherwise>
3857               </xsl:choose>
3858             </xsl:otherwise>
3859           </xsl:choose>
3860         </xsl:variable>
3861         <xsl:variable name="whoType">
3862           <xsl:choose>
3863             <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">user</xsl:when>
3864             <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">group</xsl:when>
3865             <xsl:when test="$who='authenticated'">auth</xsl:when>
3866             <xsl:when test="invert/principal/property/owner">other</xsl:when>
3867             <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3868             <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3869             <xsl:otherwise></xsl:otherwise>
3870           </xsl:choose>
3871         </xsl:variable>
3872         <xsl:variable name="shortWho">
3873           <xsl:choose>
3874             <xsl:when test="$whoType='user'"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/></xsl:when>
3875             <xsl:when test="$whoType='group'"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/></xsl:when>
3876             <xsl:otherwise></xsl:otherwise> <!-- if not user or group, send no who -->
3877           </xsl:choose>
3878         </xsl:variable>
3879         <tr>
3880           <td>
3881             <xsl:choose>
3882               <xsl:when test="$whoType = 'user' or ($who = 'owner' and $whoType != 'other')">
3883                 <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
3884               </xsl:when>
3885               <xsl:otherwise>
3886                 <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
3887               </xsl:otherwise>
3888             </xsl:choose>
3889             <xsl:text> </xsl:text>
3890             <xsl:choose>
3891               <xsl:when test="$whoType = 'other'">
3892                 anyone (other)
3893               </xsl:when>
3894               <xsl:when test="$shortWho != ''">
3895                 <xsl:value-of select="$shortWho"/>
3896               </xsl:when>
3897               <xsl:otherwise>
3898                 <xsl:value-of select="$who"/>
3899               </xsl:otherwise>
3900             </xsl:choose>
3901           </td>
3902           <td class="acls">
3903             <xsl:if test="grant">
3904               grant:
3905               <span class="grant">
3906                 <xsl:for-each select="grant/*">
3907                   <xsl:value-of select="name(.)"/>
3908                   <xsl:if test="position() != last()">, </xsl:if>
3909                 </xsl:for-each>
3910               </span><br/>
3911             </xsl:if>
3912             <xsl:if test="deny">
3913               deny:
3914               <span class="deny">
3915                 <xsl:for-each select="deny/*">
3916                   <xsl:value-of select="name(.)"/>
3917                   <xsl:if test="position() != last()">, </xsl:if>
3918                 </xsl:for-each>
3919               </span>
3920             </xsl:if>
3921           </td>
3922           <td>
3923             <xsl:choose>
3924               <xsl:when test="inherited">
3925                 <xsl:value-of select="inherited/href"/>
3926               </xsl:when>
3927               <xsl:otherwise>
3928                 local
3929               </xsl:otherwise>
3930             </xsl:choose>
3931           </td>
3932           <td>
3933             <xsl:if test="not(inherited)">
3934               <a href="{$action}&amp;how=default&amp;what={$what}&amp;who={$shortWho}&amp;whoType={$whoType}&amp;calPath={$calPathEncoded}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="reset to default">
3935                 <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="reset to default"/>
3936               </a>
3937             </xsl:if>
3938           </td>
3939         </tr>
3940       </xsl:for-each>
3941     </table>
3942   </xsl:template>
3943
3944   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
3945   <xsl:template match="subscriptions">
3946     <table id="subsTable">
3947       <tr>
3948         <td class="cals">
3949           <h3>Public calendars</h3>
3950           <p class="smaller">
3951             Select a calendar below to add a <em><strong>new</strong>
3952             </em>
3953             internal subscription. <!-- or
3954             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
3955             subscribe to an external calendar</a>.-->
3956           </p>
3957           <ul id="calendarTree">
3958             <xsl:apply-templates select="/bedeworkadmin/subscriptions/subscribe/calendars/calendar" mode="subscribe"/>
3959           </ul>
3960         </td>
3961         <td class="subs">
3962           <xsl:choose>
3963             <xsl:when test="/bedeworkadmin/page='subscriptions'">
3964               <xsl:call-template name="subscriptionList"/>
3965             </xsl:when>
3966             <xsl:when test="/bedeworkadmin/creating='true'">
3967               <xsl:apply-templates select="subscription" mode="addSubscription"/>
3968             </xsl:when>
3969             <xsl:otherwise>
3970               <xsl:apply-templates select="subscription" mode="modSubscription"/>
3971             </xsl:otherwise>
3972           </xsl:choose>
3973         </td>
3974       </tr>
3975     </table>
3976   </xsl:template>
3977
3978   <xsl:template match="calendar" mode="subscribe">
3979     <xsl:variable name="calPath" select="encodedPath"/>
3980     <xsl:variable name="itemClass">
3981       <xsl:choose>
3982         <xsl:when test="calendarCollection='false'">folder</xsl:when>
3983         <xsl:otherwise>calendar</xsl:otherwise>
3984       </xsl:choose>
3985     </xsl:variable>
3986     <li class="{$itemClass}">
3987       <a href="{$subscriptions-initAdd}&amp;calPath={$calPath}">
3988         <xsl:value-of select="name"/>
3989       </a>
3990       <xsl:if test="calendar">
3991         <ul>
3992           <xsl:apply-templates select="calendar" mode="subscribe">
3993             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates>
3994         </ul>
3995       </xsl:if>
3996     </li>
3997   </xsl:template>
3998
3999   <xsl:template match="subscription" mode="addSubscription">
4000     <h2>Add New Subscription</h2>
4001     <p class="note">*the subsciption name must be unique</p>
4002     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
4003       <table class="eventFormTable">
4004         <tr>
4005           <th>Name*:</th>
4006           <td>
4007             <xsl:variable name="subName" select="name"/>
4008             <input type="text" value="{$subName}" name="subscription.name" size="60"/>
4009           </td>
4010         </tr>
4011         <xsl:if test="internal='false'">
4012           <tr>
4013             <th>Uri:</th>
4014             <td>
4015               <xsl:variable name="subUri" select="uri"/>
4016               <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
4017             </td>
4018           </tr>
4019         </xsl:if>
4020         <tr>
4021           <th>Display:</th>
4022           <td>
4023             <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
4024             <input type="radio" value="false" name="subscription.display"/> no
4025           </td>
4026         </tr>
4027         <xsl:if test="/bedeworkadmin/userInfo/superUser='true'">
4028           <tr>
4029             <th>Unremovable:</th>
4030             <td>
4031               <input type="radio" value="true" name="unremoveable" size="60"/> true
4032               <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
4033             </td>
4034           </tr>
4035         </xsl:if>
4036         <tr>
4037           <th>Style:</th>
4038           <td>
4039             <xsl:variable name="subStyle" select="style"/>
4040             <input type="text" value="{$subStyle}" name="subscription.style" size="50"/>
4041             <div style="width: 400px">
4042               Enter a css class to style events rendered in the list and grid
4043               views.  Leave blank to render with the default colors, or select from
4044               one of the system-wide choices:
4045               <select name="bwColors" onchange="document.subscribeForm['subscription.style'].value = this.value">
4046                 <option value="">default</option>
4047                 <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
4048                   <xsl:variable name="subColor" select="."/>
4049                   <option value="{$subColor}" class="{$subColor}">
4050                     <xsl:value-of select="@name"/>
4051                   </option>
4052                 </xsl:for-each>
4053               </select>
4054               <p class="note">Note: This class is added alongside the default class used
4055               in the list and grid views.  It does not replace it, so create your
4056               style appropriately.</p>
4057             </div>
4058           </td>
4059         </tr>
4060       </table>
4061       <table border="0" id="submitTable">
4062         <tr>
4063           <td>
4064             <input type="submit" name="addSubscription" value="Add Subscription"/>
4065             <input type="submit" name="cancelled" value="Cancel"/>
4066             <input type="reset" value="Clear"/>
4067           </td>
4068         </tr>
4069       </table>
4070     </form>
4071   </xsl:template>
4072
4073   <xsl:template match="subscription" mode="modSubscription">
4074     <h2>Modify Subscription</h2>
4075     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
4076       <table class="eventFormTable">
4077         <tr>
4078           <th>Name*:</th>
4079           <td>
4080             <xsl:value-of select="name"/>
4081             <xsl:variable name="subName" select="name"/>
4082             <input type="hidden" value="{$subName}" name="name"/>
4083           </td>
4084         </tr>
4085         <xsl:choose>
4086           <xsl:when test="internal='false'">
4087             <tr>
4088               <th>Uri:</th>
4089               <td>
4090                 <xsl:variable name="subUri" select="uri"/>
4091                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
4092               </td>
4093             </tr>
4094           </xsl:when>
4095           <xsl:otherwise>
4096             <tr>
4097               <th>Uri:</th>
4098               <td>
4099                 <xsl:value-of select="uri"/>
4100               </td>
4101             </tr>
4102           </xsl:otherwise>
4103         </xsl:choose>
4104         <tr>
4105           <th>Display:</th>
4106           <td>
4107             <xsl:choose>
4108               <xsl:when test="display='true'">
4109                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
4110                 <input type="radio" value="false" name="subscription.display"/> no
4111               </xsl:when>
4112               <xsl:otherwise>
4113                 <input type="radio" value="true" name="subscription.display"/> yes
4114                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
4115               </xsl:otherwise>
4116             </xsl:choose>
4117           </td>
4118         </tr>
4119         <xsl:if test="/bedeworkadmin/userInfo/superUser='true'">
4120           <tr>
4121             <th>Unremovable:</th>
4122             <td>
4123               <xsl:choose>
4124                 <xsl:when test="unremoveable='true'">
4125                   <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
4126                   <input type="radio" value="false" name="unremoveable" size="60"/> false
4127                 </xsl:when>
4128                 <xsl:otherwise>
4129                   <input type="radio" value="true" name="unremoveable" size="60"/> true
4130                   <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
4131                 </xsl:otherwise>
4132               </xsl:choose>
4133             </td>
4134           </tr>
4135         </xsl:if>
4136         <tr>
4137           <th>Style:</th>
4138           <td>
4139             <xsl:variable name="subStyle" select="style"/>
4140             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
4141             <div style="width: 400px">
4142               Enter a css class to style events rendered in the list and grid
4143               views.  Leave blank to render with the default colors, or select from
4144               one of the system-wide choices:
4145               <select name="bwColors" onchange="document.subscribeForm['subscription.style'].value = this.value">
4146                 <option value="">default</option>
4147                 <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
4148                   <xsl:variable name="subColor" select="."/>
4149                   <option value="{$subColor}" class="{$subColor}">
4150                     <xsl:value-of select="@name"/>
4151                   </option>
4152                 </xsl:for-each>
4153               </select>
4154               <p class="note">Note: This class is added alongside the default class used
4155               in the list and grid views.  It does not replace it, so create your
4156               style appropriately.</p>
4157             </div>
4158           </td>
4159         </tr>
4160       </table>
4161       <table border="0" id="submitTable">
4162         <tr>
4163           <td>
4164             <input type="submit" name="updateSubscription" value="Update Subscription"/>
4165             <input type="submit" name="cancelled" value="Cancel"/>
4166             <input type="reset" value="Reset"/>
4167           </td>
4168           <td align="right">
4169             <input type="submit" name="delete" value="Delete Subscription"/>
4170           </td>
4171         </tr>
4172       </table>
4173     </form>
4174   </xsl:template>
4175
4176   <xsl:template name="subscriptionList">
4177     <h3>Current subscriptions</h3>
4178     <table id="commonListTable">
4179       <tr>
4180         <th>Name</th>
4181         <th>URI</th>
4182         <th>Style</th>
4183         <th>Display</th>
4184         <th>Unremovable</th>
4185         <th>External</th>
4186         <th>Deleted?</th>
4187       </tr>
4188       <xsl:for-each select="subscription">
4189         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4190         <tr>
4191           <td>
4192             <xsl:variable name="subname" select="name"/>
4193             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
4194               <xsl:value-of select="name"/>
4195             </a>
4196           </td>
4197           <td>
4198             <xsl:value-of select="uri"/>
4199           </td>
4200           <td>
4201             <xsl:value-of select="style"/>
4202           </td>
4203           <td class="center">
4204             <xsl:if test="display='true'">
4205               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4206             </xsl:if>
4207           </td>
4208           <td class="center">
4209             <xsl:if test="unremoveable='true'">
4210               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4211             </xsl:if>
4212           </td>
4213           <td class="center">
4214             <xsl:if test="internal='false'">
4215               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4216             </xsl:if>
4217           </td>
4218           <td class="center">
4219             <xsl:if test="calendarDeleted='true'">
4220               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4221             </xsl:if>
4222           </td>
4223         </tr>
4224       </xsl:for-each>
4225     </table>
4226     <!--<h4><a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>-->
4227   </xsl:template>
4228
4229   <!--+++++++++++++++ Views ++++++++++++++++++++-->
4230   <xsl:template match="views" mode="viewList">
4231
4232     <h3>Add a new view</h3>
4233     <form name="addView" action="{$view-addView}" method="post">
4234       <input type="text" name="name" size="60"/>
4235       <input type="submit" value="add view" name="addview"/>
4236     </form>
4237
4238     <h3>Views</h3>
4239     <table id="commonListTable">
4240       <tr>
4241         <th>Name</th>
4242         <th>Included subscriptions</th>
4243       </tr>
4244
4245       <xsl:for-each select="view">
4246         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4247         <tr>
4248           <td>
4249             <xsl:variable name="viewName" select="name"/>
4250             <a href="{$view-fetchForUpdate}&amp;name={$viewName}">
4251               <xsl:value-of select="name"/>
4252             </a>
4253           </td>
4254           <td>
4255             <xsl:for-each select="subscriptions/subscription">
4256               <xsl:value-of select="name"/>
4257               <xsl:if test="position()!=last()">, </xsl:if>
4258             </xsl:for-each>
4259           </td>
4260         </tr>
4261       </xsl:for-each>
4262     </table>
4263   </xsl:template>
4264
4265   <xsl:template name="modView">
4266     <h2>Update View</h2>
4267     <xsl:variable name="viewName" select="/bedeworkadmin/views/view/name"/>
4268     <h3 class="viewName">
4269       <xsl:value-of select="$viewName"/>
4270     </h3>
4271     <table id="viewsTable">
4272       <tr>
4273         <td class="subs">
4274           <h3>Available Subscriptions:</h3>
4275
4276           <table class="subscriptionsListSubs">
4277             <xsl:for-each select="/bedeworkadmin/subscriptions/subscription">
4278               <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4279               <xsl:if test="not(/bedeworkadmin/views/view/subscriptions/subscription/name=name)">
4280                 <tr>
4281                   <td>
4282                     <xsl:value-of select="name"/>
4283                   </td>
4284                   <td class="arrows">
4285                     <xsl:variable name="subAddName" select="name"/>
4286                     <a href="{$view-update}&amp;name={$viewName}&amp;add={$subAddName}">
4287                       <img src="{$resourcesRoot}/resources/arrowRight.gif"
4288                           width="13" height="13" border="0"
4289                           alt="add subscription"/>
4290                     </a>
4291                   </td>
4292                 </tr>
4293               </xsl:if>
4294             </xsl:for-each>
4295           </table>
4296         </td>
4297         <td class="view">
4298           <h3>Active Subscriptions:</h3>
4299           <table class="subscriptionsListView">
4300             <xsl:for-each select="/bedeworkadmin/views/view/subscriptions/subscription">
4301               <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4302               <tr>
4303                 <td class="arrows">
4304                   <xsl:variable name="subRemoveName" select="name"/>
4305                   <a href="{$view-update}&amp;name={$viewName}&amp;remove={$subRemoveName}">
4306                     <img src="{$resourcesRoot}/resources/arrowLeft.gif"
4307                         width="13" height="13" border="0"
4308                         alt="add subscription"/>
4309                   </a>
4310                 </td>
4311                 <td>
4312                   <xsl:value-of select="name"/>
4313                 </td>
4314               </tr>
4315             </xsl:for-each>
4316           </table>
4317         </td>
4318       </tr>
4319     </table>
4320     <table border="0" id="submitTable">
4321       <tr>
4322         <td>
4323           <input type="button" name="return" value="Return to Views Listing" onclick="javascript:location.replace('{$view-fetch}')"/>
4324         </td>
4325         <td align="right">
4326           <form name="deleteViewForm" action="{$view-fetchForUpdate}" method="post">
4327             <input type="submit" name="deleteButton" value="Delete View"/>
4328             <input type="hidden" name="name" value="{$viewName}"/>
4329             <input type="hidden" name="delete" value="yes"/>
4330           </form>
4331         </td>
4332       </tr>
4333     </table>
4334   </xsl:template>
4335
4336   <xsl:template name="deleteViewConfirm">
4337     <h2>Remove View?</h2>
4338
4339     <xsl:variable name="viewName" select="/bedeworkadmin/views/view/name"/>
4340     <p>The following view will be removed. <em>Be forewarned: if caching is
4341     enabled, removing views from a
4342     production system can cause the public interface to throw errors until the
4343     cache is flushed (a few minutes).</em>
4344     </p>
4345
4346     <p>Continue?</p>
4347
4348     <h3 class="viewName">
4349       <xsl:value-of select="$viewName"/>
4350     </h3>
4351     <form name="removeView" action="{$view-remove}" method="post">
4352       <input type="hidden" name="name" value="{$viewName}"/>
4353       <input type="submit" name="delete" value="Yes: Remove View"/>
4354       <input type="submit" name="cancelled" value="No: Cancel"/>
4355     </form>
4356
4357   </xsl:template>
4358
4359   <!--==== UPLOAD ====-->
4360   <xsl:template name="upload">
4361   <!-- The name "eventForm" is referenced by several javascript functions. Do not
4362     change it without modifying includes.js -->
4363     <form name="eventForm" method="post" action="{$event-upload}" id="standardForm" enctype="multipart/form-data">
4364       <h2>Upload iCAL File</h2>
4365       <table class="common" cellspacing="0">
4366         <tr>
4367           <td class="fieldname">
4368             Filename:
4369           </td>
4370           <td align="left">
4371             <input type="file" name="uploadFile" size="60" />
4372           </td>
4373         </tr>
4374         <tr>
4375           <td class="fieldname padMeTop">
4376             Into calendar:
4377           </td>
4378           <td align="left" class="padMeTop">
4379             <input type="hidden" name="newCalPath" value=""/>
4380             <span id="bwEventCalDisplay">
4381               <em>none selected</em>
4382             </span>
4383             <xsl:text> </xsl:text>
4384             [<a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">change</a>]
4385           </td>
4386         </tr>
4387         <!--<tr>
4388           <td class="fieldname padMeTop">
4389             Effects free/busy:
4390           </td>
4391           <td align="left" class="padMeTop">
4392             <input type="radio" value="" name="transparency" checked="checked"/> accept event's settings<br/>
4393             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
4394             <input type="radio" value="TRANSPARENT" name="transparency"/> no <span class="note">(transparent: event status does not affect your free/busy)</span><br/>
4395           </td>
4396         </tr>-->
4397         <tr>
4398           <td class="fieldname padMeTop">
4399             Status:
4400           </td>
4401           <td align="left" class="padMeTop">
4402             <input type="radio" value="" name="status" checked="checked"/> accept event's status<br/>
4403             <input type="radio" value="CONFIRMED" name="status"/> confirmed<br/>
4404             <input type="radio" value="TENTATIVE" name="status"/> tentative<br/>
4405             <input type="radio" value="CANCELLED" name="status"/> cancelled<br/>
4406           </td>
4407         </tr>
4408       </table>
4409       <table border="0" id="submitTable">
4410         <tr>
4411           <td>
4412             <input name="submit" type="submit" value="Continue"/>
4413             <input name="cancelled" type="submit" value="Cancel"/>
4414           </td>
4415         </tr>
4416       </table>
4417     </form>
4418   </xsl:template>
4419
4420   <!--+++++++++++++++ System Parameters (preferences) ++++++++++++++++++++-->
4421   <xsl:template name="modSyspars">
4422     <h2>Modify System Preferences/Parameters</h2>
4423     <p>
4424       Do not change unless you know what you're doing.<br/>
4425       Changes to these parameters have wide impact on the system.
4426     </p>
4427     <form name="systemParamsForm" action="{$system-update}" method="post">
4428       <table class="eventFormTable params">
4429         <tr>
4430           <th>System name:</th>
4431           <td>
4432             <xsl:variable name="sysname" select="/bedeworkadmin/system/name"/>
4433             <xsl:value-of select="$sysname"/>
4434             <div class="desc">
4435               Name for this system. Cannot be changed.
4436             </div>
4437           </td>
4438         </tr>
4439         <tr>
4440           <th>Default timezone:</th>
4441           <td>
4442             <xsl:variable name="tzid" select="/bedeworkadmin/system/tzid"/>
4443
4444             <select name="tzid">
4445               <option value="-1">select timezone...</option>
4446               <xsl:for-each select="/bedeworkadmin/timezones/timezone">
4447                 <option>
4448                   <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
4449                   <xsl:if test="/bedeworkadmin/system/tzid = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
4450                   <xsl:value-of select="name"/>
4451                 </option>
4452               </xsl:for-each>
4453             </select>
4454
4455             <div class="desc">
4456               Default timezone id for date/time values. This should normally be your local timezone.
4457             </div>
4458           </td>
4459         </tr>
4460         <!--<tr>
4461           <th>12 or 24 hour clock/time:</th>
4462           <td>
4463             <select name="">
4464               <option value="-1">select preference...</option>
4465               <option value="true">
4466                 <xsl:if test="/bedeworkadmin/system/NEEDPARAM = 'true'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
4467                 Use 24 hour clock/time
4468               </option>
4469               <option value="false">
4470                 <xsl:if test="/bedeworkadmin/system/NEEDPARAM = 'false'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
4471                 Use 12 Hour clock/time + am/pm
4472               </option>
4473             </select>
4474             <div class="desc">
4475               Affects the time fields when adding and editing events
4476             </div>
4477           </td>
4478         </tr>-->
4479         <tr>
4480           <th>System id:</th>
4481           <td>
4482             <xsl:variable name="systemid" select="/bedeworkadmin/system/systemid"/>
4483             <xsl:value-of select="$systemid"/>
4484             <div class="desc">
4485               System id used when building uids and identifying users. Should not be changed.
4486             </div>
4487           </td>
4488         </tr>
4489         <tr>
4490           <th>Public Calendar Root:</th>
4491           <td>
4492             <xsl:variable name="publicCalendarRoot" select="/bedeworkadmin/system/publicCalendarRoot"/>
4493             <xsl:value-of select="$publicCalendarRoot"/>
4494             <div class="desc">
4495               Name for public calendars root directory. Should not be changed.
4496             </div>
4497           </td>
4498         </tr>
4499         <tr>
4500           <th>User Calendar Root:</th>
4501           <td>
4502             <xsl:variable name="userCalendarRoot" select="/bedeworkadmin/system/userCalendarRoot"/>
4503             <xsl:value-of select="$userCalendarRoot"/>
4504             <div class="desc">
4505               Name for user calendars root directory. Should not be changed.
4506             </div>
4507           </td>
4508         </tr>
4509         <tr>
4510           <th>User Calendar Default name:</th>
4511           <td>
4512             <xsl:variable name="userDefaultCalendar" select="/bedeworkadmin/system/userDefaultCalendar"/>
4513             <input value="{$userDefaultCalendar}" name="userDefaultCalendar" />
4514             <div class="desc">
4515               Default name for user calendar. Used when initialising user. Possibly can be changed.
4516             </div>
4517           </td>
4518         </tr>
4519         <tr>
4520           <th>Trash Calendar Default name:</th>
4521           <td>
4522             <xsl:variable name="defaultTrashCalendar" select="/bedeworkadmin/system/defaultTrashCalendar"/>
4523             <input value="{$defaultTrashCalendar}" name="defaultTrashCalendar" />
4524             <div class="desc">
4525               Default name for user trash calendar. Used when initialising user. Possibly can be changed.
4526             </div>
4527           </td>
4528         </tr>
4529         <tr>
4530           <th>User Inbox Default name:</th>
4531           <td>
4532             <xsl:variable name="userInbox" select="/bedeworkadmin/system/userInbox"/>
4533             <input value="{$userInbox}" name="userInbox" />
4534             <div class="desc">
4535               Default name for user inbox. Used when initialising user. Possibly can be changed.
4536             </div>
4537           </td>
4538         </tr>
4539         <tr>
4540           <th>User Outbox Default name:</th>
4541           <td>
4542             <xsl:variable name="userOutbox" select="/bedeworkadmin/system/userOutbox"/>
4543             <input value="{$userOutbox}" name="userOutbox" />
4544             <div class="desc">
4545               Default name for user outbox. Used when initialising user. Possibly can be changed.
4546             </div>
4547           </td>
4548         </tr>
4549         <tr>
4550           <th>User Deleted Calendar Default name:</th>
4551           <td>
4552             <xsl:variable name="deletedCalendar" select="/bedeworkadmin/system/deletedCalendar"/>
4553             <input value="{$deletedCalendar}" name="deletedCalendar" />
4554             <div class="desc">
4555               Default name for user calendar used to hold deleted items. Used when initialising user. Possibly can be changed.
4556             </div>
4557           </td>
4558         </tr>
4559         <tr>
4560           <th>User Busy Calendar Default name:</th>
4561           <td>
4562             <xsl:variable name="busyCalendar" select="/bedeworkadmin/system/busyCalendar"/>
4563             <input value="{$busyCalendar}" name="busyCalendar" />
4564             <div class="desc">
4565               Default name for user busy time calendar. Used when initialising user. Possibly can be changed.
4566             </div>
4567           </td>
4568         </tr>
4569         <tr>
4570           <th>Default user view name:</th>
4571           <td>
4572             <xsl:variable name="defaultViewName" select="/bedeworkadmin/system/defaultUserViewName"/>
4573             <input value="{$defaultViewName}" name="defaultUserViewName" />
4574             <div class="desc">
4575               Name used for default view created when a new user is added
4576             </div>
4577           </td>
4578         </tr>
4579         <tr>
4580           <th>Http connections per user:</th>
4581           <td>
4582             <xsl:variable name="httpPerUser" select="/bedeworkadmin/system/httpConnectionsPerUser"/>
4583             <input value="{$httpPerUser}" name="httpConnectionsPerUser" />
4584             <div class="desc">
4585             </div>
4586           </td>
4587         </tr>
4588         <tr>
4589           <th>Http connections per host:</th>
4590           <td>
4591             <xsl:variable name="httpPerHost" select="/bedeworkadmin/system/httpConnectionsPerHost"/>
4592             <input value="{$httpPerHost}" name="httpConnectionsPerHost" />
4593             <div class="desc">
4594             </div>
4595           </td>
4596         </tr>
4597         <tr>
4598           <th>Total http connections:</th>
4599           <td>
4600             <xsl:variable name="httpTotal" select="/bedeworkadmin/system/httpConnections"/>
4601             <input value="{$httpTotal}" name="httpConnections" />
4602             <div class="desc">
4603             </div>
4604           </td>
4605         </tr>
4606         <tr>
4607           <th>Maximum length of public event description:</th>
4608           <td>
4609             <xsl:variable name="maxPublicDescriptionLength" select="/bedeworkadmin/system/maxPublicDescriptionLength"/>
4610             <input value="{$maxPublicDescriptionLength}" name="maxPublicDescriptionLength" />
4611             <div class="desc">
4612             </div>
4613           </td>
4614         </tr>
4615         <tr>
4616           <th>Maximum length of user event description:</th>
4617           <td>
4618             <xsl:variable name="maxUserDescriptionLength" select="/bedeworkadmin/system/maxUserDescriptionLength"/>
4619             <input value="{$maxUserDescriptionLength}" name="maxUserDescriptionLength" />
4620             <div class="desc">
4621             </div>
4622           </td>
4623         </tr>
4624         <tr>
4625           <th>Maximum size of a user entity:</th>
4626           <td>
4627             <xsl:variable name="maxUserEntitySize" select="/bedeworkadmin/system/maxUserEntitySize"/>
4628             <input value="{$maxUserEntitySize}" name="maxUserEntitySize" />
4629             <div class="desc">
4630             </div>
4631           </td>
4632         </tr>
4633         <tr>
4634           <th>Default user quota:</th>
4635           <td>
4636             <xsl:variable name="defaultUserQuota" select="/bedeworkadmin/system/defaultUserQuota"/>
4637             <input value="{$defaultUserQuota}" name="defaultUserQuota" />
4638             <div class="desc">
4639             </div>
4640           </td>
4641         </tr>
4642         <tr>
4643           <th>Max recurring instances:</th>
4644           <td>
4645             <xsl:variable name="maxInstances" select="/bedeworkadmin/system/maxInstances"/>
4646             <input value="{$maxInstances}" name="maxInstances" />
4647             <div class="desc">
4648               Used to limit recurring events to reasonable numbers of instances.
4649             </div>
4650           </td>
4651         </tr>
4652         <tr>
4653           <th>Max recurring years:</th>
4654           <td>
4655             <xsl:variable name="maxYears" select="/bedeworkadmin/system/maxYears"/>
4656             <input value="{$maxYears}" name="maxYears" />
4657             <div class="desc">
4658               Used to limit recurring events to reasonable period of time.
4659             </div>
4660           </td>
4661         </tr>
4662         <tr>
4663           <th>User authorisation class:</th>
4664           <td>
4665             <xsl:variable name="userauthClass" select="/bedeworkadmin/system/userauthClass"/>
4666             <input value="{$userauthClass}" name="userauthClass" class="wide"/>
4667             <div class="desc">
4668               Class used to determine authorisation (not authentication) for
4669               administrative users. Should probably only be changed on rebuild.
4670             </div>
4671           </td>
4672         </tr>
4673         <tr>
4674           <th>Mailer class:</th>
4675           <td>
4676             <xsl:variable name="mailerClass" select="/bedeworkadmin/system/mailerClass"/>
4677             <input value="{$mailerClass}" name="mailerClass" class="wide"/>
4678             <div class="desc">
4679               Class used to mail events. Should probably only be changed on rebuild.
4680             </div>
4681           </td>
4682         </tr>
4683         <tr>
4684           <th>Admin groups class:</th>
4685           <td>
4686             <xsl:variable name="admingroupsClass" select="/bedeworkadmin/system/admingroupsClass"/>
4687             <input value="{$admingroupsClass}" name="admingroupsClass" class="wide"/>
4688             <div class="desc">
4689               Class used to query and maintain groups for
4690               administrative users. Should probably only be changed on rebuild.
4691             </div>
4692           </td>
4693         </tr>
4694         <tr>
4695           <th>User groups class:</th>
4696           <td>
4697             <xsl:variable name="usergroupsClass" select="/bedeworkadmin/system/usergroupsClass"/>
4698             <input value="{$usergroupsClass}" name="usergroupsClass" class="wide"/>
4699             <div class="desc">
4700               Class used to query and maintain groups for
4701               non-administrative users. Should probably only be changed on rebuild.
4702             </div>
4703           </td>
4704         </tr>
4705         <tr>
4706           <th>Directory browsing disallowed:</th>
4707           <td>
4708             <xsl:variable name="directoryBrowsingDisallowed" select="/bedeworkadmin/system/directoryBrowsingDisallowed"/>
4709             <input value="{$directoryBrowsingDisallowed}" name="directoryBrowsingDisallowed" />
4710             <div class="desc">
4711               True if the server hosting the xsl disallows directory browsing.
4712             </div>
4713           </td>
4714         </tr>
4715         <tr>
4716           <th>Index root:</th>
4717           <td>
4718             <xsl:variable name="indexRoot" select="/bedeworkadmin/system/indexRoot"/>
4719             <input value="{$indexRoot}" name="indexRoot" class="wide"/>
4720             <div class="desc">
4721               Root for the event indexes. Should only be changed if the indexes are moved/copied
4722             </div>
4723           </td>
4724         </tr>
4725       </table>
4726       <table border="0" id="submitTable">
4727         <tr>
4728           <td>
4729             <input type="submit" name="updateSystemParams" value="Update"/>
4730             <input type="submit" name="cancelled" value="Cancel"/>
4731             <input type="reset" value="Reset"/>
4732           </td>
4733         </tr>
4734       </table>
4735     </form>
4736   </xsl:template>
4737
4738   <!--+++++++++++++++ Calendar Suites (calsuite) ++++++++++++++++++++-->
4739   <xsl:template match="calSuites" mode="calSuiteList">
4740     <h2>Manage Calendar Suites</h2>
4741
4742     <h4>Calendar suites:</h4>
4743     <p>
4744       <input type="button" name="return" value="Add calendar suite" onclick="javascript:location.replace('{$calsuite-showAddForm}')"/>
4745     </p>
4746
4747     <ul>
4748       <xsl:for-each select="calSuite">
4749         <li>
4750           <xsl:variable name="name" select="name"/>
4751           <a href="{$calsuite-fetchForUpdate}&amp;name={$name}">
4752             <xsl:value-of select="name"/>
4753           </a>
4754         </li>
4755       </xsl:for-each>
4756     </ul>
4757
4758   </xsl:template>
4759
4760   <xsl:template name="addCalSuite">
4761     <h2>Add Calendar Suite</h2>
4762     <form name="calSuiteForm" action="{$calsuite-add}" method="post">
4763       <table class="eventFormTable">
4764         <tr>
4765           <th>Name:</th>
4766           <td>
4767             <input name="name" size="20"/>
4768           </td>
4769           <td>
4770             Name of your calendar suite
4771           </td>
4772         </tr>
4773         <tr>
4774           <th>Group:</th>
4775           <td>
4776             <input name="groupName" size="20"/>
4777           </td>
4778           <td>
4779             Name of admin group which contains event administrators and event owner to which preferences for the suite are attached
4780           </td>
4781         </tr>
4782         <tr>
4783           <th>Root calendar:</th>
4784           <td>
4785             <input name="calPath" size="20"/>
4786           </td>
4787           <td>
4788             Path of root calendar (not required if suite only consists of subscriptions and views)
4789           </td>
4790         </tr>
4791       </table>
4792       <table border="0" id="submitTable">
4793         <tr>
4794           <td>
4795             <input type="submit" name="updateCalSuite" value="Add"/>
4796             <input type="submit" name="cancelled" value="Cancel"/>
4797             <input type="reset" value="Reset"/>
4798           </td>
4799         </tr>
4800       </table>
4801     </form>
4802   </xsl:template>
4803
4804   <xsl:template match="calSuite" name="modCalSuite">
4805     <h2>Modify Calendar Suite</h2>
4806     <xsl:variable name="calSuiteName" select="name"/>
4807     <form name="calSuiteForm" action="{$calsuite-update}" method="post">
4808       <table class="eventFormTable">
4809         <tr>
4810           <th>Name:</th>
4811           <td>
4812             <input name="name" value="{$calSuiteName}" size="20"/>
4813           </td>
4814           <td>
4815             Name of your calendar suite
4816           </td>
4817         </tr>
4818         <tr>
4819           <th>Group:</th>
4820           <td>
4821             <xsl:variable name="group" select="group"/>
4822             <input name="groupName" value="{$group}" size="20"/>
4823           </td>
4824           <td>
4825             Name of admin group which contains event administrators and event owner to which preferences for the suite are attached
4826           </td>
4827         </tr>
4828         <tr>
4829           <th>Root calendar:</th>
4830           <td>
4831             <xsl:variable name="calPath" select="calPath"/>
4832             <input name="calPath" value="{$calPath}" size="20"/>
4833           </td>
4834           <td>
4835             Path of root calendar (not required if suite only consists of subscriptions and views)
4836           </td>
4837         </tr>
4838       </table>
4839       <table border="0" id="submitTable">
4840         <tr>
4841           <td>
4842             <input type="submit" name="updateCalSuite" value="Update"/>
4843             <input type="submit" name="cancelled" value="Cancel"/>
4844             <input type="reset" value="Reset"/>
4845           </td>
4846         </tr>
4847       </table>
4848     </form>
4849     <!--<div id="sharingBox">
4850       <h3>Manage suite administrators</h3>
4851       <table class="common">
4852         <tr>
4853           <th class="commonHeader" colspan="2">Current access:</th>
4854         </tr>
4855
4856         <xsl:for-each select="acl/ace">
4857           <tr>
4858             <th class="thin">
4859               <xsl:choose>
4860                 <xsl:when test="invert">
4861                   <em>Deny to
4862                   <xsl:choose>
4863                     <xsl:when test="invert/principal/href">
4864                       <xsl:value-of select="invert/principal/href"/>
4865                       </xsl:when>
4866                       <xsl:when test="invert/principal/property">
4867                         <xsl:value-of select="name(invert/principal/property/*)"/>
4868                       </xsl:when>
4869                       <xsl:otherwise>
4870                         <xsl:value-of select="name(invert/principal/*)"/>
4871                       </xsl:otherwise>
4872                     </xsl:choose>
4873                   </em>
4874                 </xsl:when>
4875                 <xsl:otherwise>
4876                   <xsl:choose>
4877                     <xsl:when test="principal/href">
4878                       <xsl:value-of select="principal/href"/>
4879                     </xsl:when>
4880                     <xsl:when test="principal/property">
4881                       <xsl:value-of select="name(principal/property/*)"/>
4882                     </xsl:when>
4883                     <xsl:otherwise>
4884                       <xsl:value-of select="name(principal/*)"/>
4885                     </xsl:otherwise>
4886                   </xsl:choose>
4887                 </xsl:otherwise>
4888               </xsl:choose>
4889             </th>
4890             <td>
4891               <xsl:for-each select="grant/node()">
4892                 <xsl:value-of select="name(.)"/>&#160;&#160;
4893               </xsl:for-each>
4894             </td>
4895           </tr>
4896         </xsl:for-each>
4897       </table>
4898       <form name="calsuiteShareForm" action="{$calsuite-setAccess}" id="shareForm" method="post">
4899         <input type="hidden" name="calSuiteName" value="{$calSuiteName}"/>
4900         <input type="hidden" name="how" value="RW" />
4901         <p>
4902           Add administrator:<br/>
4903           <input type="text" name="who" size="20"/>
4904           <input type="radio" value="user" name="whoType" checked="checked"/> user
4905           <input type="radio" value="group" name="whoType"/> group
4906         </p>
4907         <input type="submit" name="submit" value="Submit"/>
4908       </form>
4909     </div>-->
4910
4911     <div id="sharingBox">
4912       <xsl:variable name="calPath" select="path"/>
4913       <xsl:variable name="encodedCalPath" select="encodedPath"/>
4914       <xsl:if test="currentAccess/current-user-privilege-set/privilege/read-acl or /bedeworkadmin/userInfo/superUser='true'">
4915         <h3>Manage suite administrators</h3>
4916         <table class="common" id="sharing">
4917           <tr>
4918             <th class="commonHeader">Who:</th>
4919             <th class="commonHeader">Current access:</th>
4920             <th class="commonHeader">Source:</th>
4921           </tr>
4922           <xsl:for-each select="acl/ace">
4923             <xsl:variable name="who">
4924               <xsl:choose>
4925                 <xsl:when test="invert">
4926                   <xsl:choose>
4927                     <xsl:when test="invert/principal/href"><xsl:value-of select="normalize-space(invert/principal/href)"/></xsl:when>
4928                     <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
4929                     <xsl:otherwise><xsl:value-of select="name(invert/principal/*)"/></xsl:otherwise>
4930                   </xsl:choose>
4931                 </xsl:when>
4932                 <xsl:otherwise>
4933                   <xsl:choose>
4934                     <xsl:when test="principal/href"><xsl:value-of select="normalize-space(principal/href)"/></xsl:when>
4935                     <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
4936                     <xsl:otherwise><xsl:value-of select="name(principal/*)"/></xsl:otherwise>
4937                   </xsl:choose>
4938                 </xsl:otherwise>
4939               </xsl:choose>
4940             </xsl:variable>
4941             <tr>
4942             <th class="thin">
4943                 <xsl:if test="invert">
4944                   Not
4945                 </xsl:if>
4946                 <xsl:choose>
4947                   <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">
4948                     <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
4949                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/>
4950                   </xsl:when>
4951                   <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">
4952                     <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
4953                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/>
4954                   </xsl:when>
4955                   <xsl:when test="invert and $who='owner'">
4956                     <xsl:value-of select="$who"/> (other)
4957                   </xsl:when>
4958                   <xsl:otherwise>
4959                     <xsl:value-of select="$who"/>
4960                   </xsl:otherwise>
4961                 </xsl:choose>
4962               </th>
4963               <td>
4964                 <xsl:for-each select="grant/node()">
4965                   <xsl:value-of select="name(.)"/>&#160;&#160;
4966                 </xsl:for-each>
4967                 <xsl:for-each select="deny/node()">
4968                   <xsl:choose>
4969                     <xsl:when test="name(.)='all'">
4970                       none
4971                     </xsl:when>
4972                     <xsl:otherwise>
4973                       deny-<xsl:value-of select="name(.)"/>
4974                     </xsl:otherwise>
4975                   </xsl:choose>
4976                   &#160;&#160;
4977                 </xsl:for-each>
4978               </td>
4979               <td>
4980                 <xsl:choose>
4981                   <xsl:when test="inherited">
4982                     inherited from:
4983                     <a>
4984                       <xsl:attribute name="href"><xsl:value-of select="$calendar-fetchForUpdate"/>&amp;calPath=<xsl:value-of select="inherited/href"/></xsl:attribute>
4985                       <xsl:value-of select="inherited/href"/>
4986                     </a>
4987                   </xsl:when>
4988                   <xsl:otherwise>
4989                     local:
4990                     <xsl:variable name="whoType">
4991                       <xsl:choose>
4992                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">user</xsl:when>
4993                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">group</xsl:when>
4994                         <xsl:when test="$who='authenticated'">auth</xsl:when>
4995                         <xsl:when test="invert/principal/property/owner">other</xsl:when>
4996                         <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
4997                         <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
4998                         <xsl:otherwise></xsl:otherwise>
4999                       </xsl:choose>
5000                     </xsl:variable>
5001                     <xsl:variable name="shortWho">
5002                       <xsl:choose>
5003                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/></xsl:when>
5004                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/></xsl:when>
5005                         <xsl:otherwise></xsl:otherwise> <!-- if not user or group, send no who -->
5006                       </xsl:choose>
5007                     </xsl:variable>
5008                     <xsl:choose>
5009                       <xsl:when test="invert">
5010                         <a href="{$calsuite-setAccess}&amp;calSuiteName={$calSuiteName}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}&amp;notWho=yes">
5011                           reset to default
5012                         </a>
5013                       </xsl:when>
5014                       <xsl:otherwise>
5015                         <a href="{$calsuite-setAccess}&amp;calSuiteName={$calSuiteName}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}">
5016                           reset to default
5017                         </a>
5018                       </xsl:otherwise>
5019                     </xsl:choose>
5020                   </xsl:otherwise>
5021                 </xsl:choose>
5022               </td>
5023             </tr>
5024           </xsl:for-each>
5025         </table>
5026       </xsl:if>
5027
5028       <xsl:if test="currentAccess/current-user-privilege-set/privilege/write-acl or /bedeworkadmin/userInfo/superUser='true'">
5029         <form name="calsuiteShareForm" action="{$calsuite-setAccess}" id="shareForm" method="post">
5030           <input type="hidden" name="calSuiteName" value="{$calSuiteName}"/>
5031           <table cellspacing="0" id="shareFormTable" class="common">
5032             <tr>
5033               <th colspan="2" class="commonHeader">Set access:</th>
5034             </tr>
5035             <tr class="subhead">
5036               <th>Who:</th>
5037               <th>Rights:</th>
5038             </tr>
5039             <tr>
5040               <td>
5041                 <input type="text" name="who" size="20"/>
5042                 <br/>
5043                 <input type="radio" value="user" name="whoType" checked="checked"/> user
5044                 <input type="radio" value="group" name="whoType"/> group
5045                 <p>OR</p>
5046                 <p>
5047                   <input type="radio" value="auth" name="whoType"/> all authorized users<br/>
5048                   <input type="radio" value="other" name="whoType"/> other users<br/>
5049                   <input type="radio" value="owner" name="whoType"/> owner
5050                 </p>
5051                 <!-- we may never use the invert action ...it is probably
5052                      too confusing, and can be achieved in other ways -->
5053                 <!--
5054                 <p class="padTop">
5055                   <input type="checkbox" value="yes" name="notWho"/> invert (deny)
5056                 </p>-->
5057               </td>
5058               <td>
5059                 <ul id="howList">
5060                   <li>
5061                     <input type="radio" value="A" name="how"/>
5062                     <strong>All</strong> (read, write, delete)</li>
5063                   <li class="padTop">
5064                     <input type="radio" value="R" name="how"/>
5065                     <strong>Read</strong> (content, access, freebusy)
5066                   </li>
5067                   <li>
5068                     <input type="radio" value="f" name="how"/> Read freebusy only
5069                   </li>
5070                   <li class="padTop">
5071                     <input type="radio" value="Rc" name="how" checked="checked"/>
5072                     <strong>Read</strong> and <strong>Write content only</strong>
5073                   </li>
5074                   <li class="padTop">
5075                     <input type="radio" value="W" name="how"/>
5076                     <strong>Write and delete</strong> (content, access, properties)
5077                   </li>
5078                   <li>
5079                     <input type="radio" value="c" name="how"/> Write content only
5080                   </li>
5081                   <li>
5082                     <input type="radio" value="u" name="how"/> Delete only
5083                   </li>
5084                   <li class="padTop">
5085                     <input type="radio" value="N" name="how"/>
5086                     <strong>None</strong>
5087                   </li>
5088                 </ul>
5089               </td>
5090             </tr>
5091           </table>
5092           <input type="submit" name="submit" value="Submit"/>
5093         </form>
5094       </xsl:if>
5095     </div>
5096   </xsl:template>
5097
5098   <xsl:template name="calSuitePrefs">
5099     <h2>Edit Calendar Suite Preferences</h2>
5100     <form name="userPrefsForm" method="post" action="{$calsuite-updatePrefs}">
5101       <table id="eventFormTable">
5102         <tr>
5103           <td class="fieldName">
5104             Calendar Suite:
5105           </td>
5106           <td>
5107             <xsl:value-of select="/bedeworkadmin/currentCalSuite/name"/>
5108           </td>
5109         </tr>
5110         <tr>
5111           <td class="fieldName">
5112             Preferred view:
5113           </td>
5114           <td>
5115             <xsl:variable name="preferredView" select="/bedeworkadmin/prefs/preferredView"/>
5116             <input type="text" name="preferredView" value="{$preferredView}" size="40"/>
5117           </td>
5118         </tr>
5119         <tr>
5120           <td class="fieldName">
5121             Preferred view period:
5122           </td>
5123           <td>
5124             <xsl:variable name="preferredViewPeriod" select="/bedeworkadmin/prefs/preferredViewPeriod"/>
5125             <select name="viewPeriod">
5126               <!-- picking the selected item could be done with javascript. for
5127                    now, this will do.  -->
5128               <xsl:choose>
5129                 <xsl:when test="$preferredViewPeriod = 'dayView'">
5130                   <option value="dayView" selected="selected">day</option>
5131                 </xsl:when>
5132                 <xsl:otherwise>
5133                   <option value="dayView">day</option>
5134                 </xsl:otherwise>
5135               </xsl:choose>
5136               <xsl:choose>
5137                 <xsl:when test="$preferredViewPeriod = 'todayView'">
5138                   <option value="todayView" selected="selected">today</option>
5139                 </xsl:when>
5140                 <xsl:otherwise>
5141                   <option value="todayView">today</option>
5142                 </xsl:otherwise>
5143               </xsl:choose>
5144               <xsl:choose>
5145                 <xsl:when test="$preferredViewPeriod = 'weekView'">
5146                   <option value="weekView" selected="selected">week</option>
5147                 </xsl:when>
5148                 <xsl:otherwise>
5149                   <option value="weekView">week</option>
5150                 </xsl:otherwise>
5151               </xsl:choose>
5152               <xsl:choose>
5153                 <xsl:when test="$preferredViewPeriod = 'monthView'">
5154                   <option value="monthView" selected="selected">month</option>
5155                 </xsl:when>
5156                 <xsl:otherwise>
5157                   <option value="monthView">month</option>
5158                 </xsl:otherwise>
5159               </xsl:choose>
5160               <xsl:choose>
5161                 <xsl:when test="$preferredViewPeriod = 'yearView'">
5162                   <option value="yearView" selected="selected">year</option>
5163                 </xsl:when>
5164                 <xsl:otherwise>
5165                   <option value="yearView">year</option>
5166                 </xsl:otherwise>
5167               </xsl:choose>
5168             </select>
5169           </td>
5170         </tr>
5171         <tr>
5172           <td class="fieldName">
5173             Skin name:
5174           </td>
5175           <td>
5176             <xsl:variable name="skinName" select="/bedeworkadmin/prefs/skinName"/>
5177             <input type="text" name="skin" value="{$skinName}" size="40"/>
5178           </td>
5179         </tr>
5180         <tr>
5181           <td class="fieldName">
5182             Skin style:
5183           </td>
5184           <td>
5185             <xsl:variable name="skinStyle" select="/bedeworkadmin/prefs/skinStyle"/>
5186             <input type="text" name="skinStyle" value="{$skinStyle}" size="40"/>
5187           </td>
5188         </tr>
5189       </table>
5190       <br />
5191
5192       <input type="submit" name="modPrefs" value="Update"/>
5193       <input type="reset" value="Reset"/>
5194       <input type="submit" name="cancelled" value="Cancel"/>
5195     </form>
5196   </xsl:template>
5197
5198   <!--+++++++++++++++ Timezones ++++++++++++++++++++-->
5199   <xsl:template name="uploadTimezones">
5200     <h2>Manage Timezones</h2>
5201
5202     <form name="peForm" method="post" action="{$timezones-upload}" enctype="multipart/form-data">
5203       <input type="file" name="uploadFile" size="40" value=""/>
5204       <input type="submit" name="doUpload" value="Upload Timezones"/>
5205       <input type="submit" name="cancelled" value="Cancel"/>
5206     </form>
5207
5208     <p>
5209       <a href="{$timezones-fix}">Fix Timezones</a> (recalculate UTC values)<br/>
5210       <span class="note">Run this to make sure no UTC values have changed due
5211       to this upload (e.g. DST changes).</span>
5212     </p>
5213
5214   </xsl:template>
5215
5216   <!--+++++++++++++++ Authuser ++++++++++++++++++++-->
5217   <xsl:template name="authUserList">
5218     <h2>Modify Administrators</h2>
5219
5220     <div id="authUserInputForms">
5221       <form name="getUserRolesForm" action="{$authuser-fetchForUpdate}" method="post">
5222         Edit admin roles by userid: <input type="text" name="editAuthUserId" size="20"/>
5223         <input type="submit" value="go" name="submit"/>
5224       </form>
5225     </div>
5226
5227     <table id="commonListTable">
5228       <tr>
5229         <th>UserId</th>
5230         <th>Roles</th>
5231         <th></th>
5232       </tr>
5233
5234       <xsl:for-each select="bedeworkadmin/authUsers/authUser">
5235         <!--<xsl:sort select="account" order="ascending" case-order="upper-first"/>-->
5236         <tr>
5237           <td>
5238             <xsl:value-of select="account"/>
5239           </td>
5240           <td>
5241             <xsl:if test="publicEventUser='true'">
5242               publicEvent; <xsl:text> </xsl:text>
5243             </xsl:if>
5244             <xsl:if test="superUser='true'">
5245               superUser; <xsl:text> </xsl:text>
5246             </xsl:if>
5247             <xsl:if test="alertUser='true'">
5248               alert; <xsl:text> </xsl:text>
5249             </xsl:if>
5250           </td>
5251           <td>
5252             <xsl:variable name="account" select="account"/>
5253             <a href="{$authuser-fetchForUpdate}&amp;editAuthUserId={$account}">
5254               edit
5255             </a>
5256           </td>
5257         </tr>
5258       </xsl:for-each>
5259     </table>
5260   </xsl:template>
5261
5262   <xsl:template name="modAuthUser">
5263     <h2>Update Administrator</h2>
5264     <xsl:variable name="modAuthUserAction" select="/bedeworkadmin/formElements/form/@action"/>
5265     <form action="{$modAuthUserAction}" method="post">
5266       <table id="eventFormTable">
5267         <tr>
5268           <td class="fieldName">
5269             Account:
5270           </td>
5271           <td>
5272             <xsl:value-of select="/bedeworkadmin/formElements/form/account"/>
5273           </td>
5274         </tr>
5275         <tr>
5276           <td class="fieldName">
5277             Alerts:
5278           </td>
5279           <td>
5280             <xsl:copy-of select="/bedeworkadmin/formElements/form/alerts/*"/>
5281           </td>
5282         </tr>
5283         <tr>
5284           <td class="fieldName">
5285             Public Events:
5286           </td>
5287           <td>
5288             <xsl:copy-of select="/bedeworkadmin/formElements/form/publicEvents/*"/>
5289           </td>
5290         </tr>
5291         <tr>
5292           <td class="fieldName">
5293             Super User:
5294           </td>
5295           <td>
5296             <xsl:copy-of select="/bedeworkadmin/formElements/form/superUser/*"/>
5297           </td>
5298         </tr>
5299         <!--<tr>
5300           <td class="optional">
5301             Email:
5302           </td>
5303           <td>
5304             <xsl:copy-of select="/bedeworkadmin/formElements/form/email/*"/>
5305             <span class="fieldInfo"></span>
5306           </td>
5307         </tr>
5308         <tr>
5309           <td class="optional">
5310             Phone:
5311           </td>
5312           <td>
5313             <xsl:copy-of select="/bedeworkadmin/formElements/form/phone/*"/>
5314             <span class="fieldInfo"></span>
5315           </td>
5316         </tr>
5317         <tr>
5318           <td class="optional">
5319             Department:
5320           </td>
5321           <td>
5322             <xsl:copy-of select="/bedeworkadmin/formElements/form/dept/*"/>
5323             <span class="fieldInfo"></span>
5324           </td>
5325         </tr>
5326         <tr>
5327           <td class="optional">
5328             Last name:
5329           </td>
5330           <td>
5331             <xsl:copy-of select="/bedeworkadmin/formElements/form/lastName/*"/>
5332             <span class="fieldInfo"></span>
5333           </td>
5334         </tr>
5335         <tr>
5336           <td class="optional">
5337             First name:
5338           </td>
5339           <td>
5340             <xsl:copy-of select="/bedeworkadmin/formElements/form/firstName/*"/>
5341             <span class="fieldInfo"></span>
5342           </td>
5343         </tr>-->
5344       </table>
5345       <br />
5346
5347       <input type="submit" name="modAuthUser" value="Update"/>
5348       <input type="reset" value="Reset"/>
5349       <input type="submit" name="cancelled" value="Cancel"/>
5350     </form>
5351   </xsl:template>
5352
5353   <!--+++++++++++++++ User Prefs ++++++++++++++++++++-->
5354   <xsl:template name="modPrefs">
5355     <h2>Edit User Preferences</h2>
5356     <form name="userPrefsForm" method="post" action="{$prefs-update}">
5357       <table id="eventFormTable">
5358         <tr>
5359           <td class="fieldName">
5360             User:
5361           </td>
5362           <td>
5363             <xsl:value-of select="/bedeworkadmin/prefs/user"/>
5364             <xsl:variable name="user" select="/bedeworkadmin/prefs/user"/>
5365             <input type="hidden" name="user" value="{$user}"/>
5366           </td>
5367         </tr>
5368         <tr>
5369           <td class="fieldName">
5370             Preferred view:
5371           </td>
5372           <td>
5373             <xsl:variable name="preferredView" select="/bedeworkadmin/prefs/preferredView"/>
5374             <input type="text" name="preferredView" value="{$preferredView}" size="40"/>
5375           </td>
5376         </tr>
5377         <tr>
5378           <td class="fieldName">
5379             Preferred view period:
5380           </td>
5381           <td>
5382             <xsl:variable name="preferredViewPeriod" select="/bedeworkadmin/prefs/preferredViewPeriod"/>
5383             <select name="viewPeriod">
5384               <!-- picking the selected item could be done with javascript. for
5385                    now, this will do.  -->
5386               <xsl:choose>
5387                 <xsl:when test="$preferredViewPeriod = 'dayView'">
5388                   <option value="dayView" selected="selected">day</option>
5389                 </xsl:when>
5390                 <xsl:otherwise>
5391                   <option value="dayView">day</option>
5392                 </xsl:otherwise>
5393               </xsl:choose>
5394               <xsl:choose>
5395                 <xsl:when test="$preferredViewPeriod = 'todayView'">
5396                   <option value="todayView" selected="selected">today</option>
5397                 </xsl:when>
5398                 <xsl:otherwise>
5399                   <option value="todayView">today</option>
5400                 </xsl:otherwise>
5401               </xsl:choose>
5402               <xsl:choose>
5403                 <xsl:when test="$preferredViewPeriod = 'weekView'">
5404                   <option value="weekView" selected="selected">week</option>
5405                 </xsl:when>
5406                 <xsl:otherwise>
5407                   <option value="weekView">week</option>
5408                 </xsl:otherwise>
5409               </xsl:choose>
5410               <xsl:choose>
5411                 <xsl:when test="$preferredViewPeriod = 'monthView'">
5412                   <option value="monthView" selected="selected">month</option>
5413                 </xsl:when>
5414                 <xsl:otherwise>
5415                   <option value="monthView">month</option>
5416                 </xsl:otherwise>
5417               </xsl:choose>
5418               <xsl:choose>
5419                 <xsl:when test="$preferredViewPeriod = 'yearView'">
5420                   <option value="yearView" selected="selected">year</option>
5421                 </xsl:when>
5422                 <xsl:otherwise>
5423                   <option value="yearView">year</option>
5424                 </xsl:otherwise>
5425               </xsl:choose>
5426             </select>
5427           </td>
5428         </tr>
5429         <tr>
5430           <td class="fieldName">
5431             Skin name:
5432           </td>
5433           <td>
5434             <xsl:variable name="skinName" select="/bedeworkadmin/prefs/skinName"/>
5435             <input type="text" name="skin" value="{$skinName}" size="40"/>
5436           </td>
5437         </tr>
5438         <tr>
5439           <td class="fieldName">
5440             Skin style:
5441           </td>
5442           <td>
5443             <xsl:variable name="skinStyle" select="/bedeworkadmin/prefs/skinStyle"/>
5444             <input type="text" name="skinStyle" value="{$skinStyle}" size="40"/>
5445           </td>
5446         </tr>
5447       </table>
5448       <br />
5449
5450       <input type="submit" name="modPrefs" value="Update"/>
5451       <input type="reset" value="Reset"/>
5452       <input type="submit" name="cancelled" value="Cancel"/>
5453     </form>
5454   </xsl:template>
5455
5456   <!--+++++++++++++++ Admin Groups ++++++++++++++++++++-->
5457   <xsl:template name="listAdminGroups">
5458     <h2>Modify Groups</h2>
5459     <form name="adminGroupMembersForm" method="post" action="{$admingroup-initUpdate}">
5460       <xsl:choose>
5461         <xsl:when test="/bedeworkadmin/groups/showMembers='true'">
5462           <input type="radio" name="showAgMembers" value="false" onclick="document.adminGroupMembersForm.submit();"/>
5463           Hide members
5464           <input type="radio" name="showAgMembers" value="true" checked="checked" onclick="document.adminGroupMembersForm.submit();"/>
5465           Show members
5466         </xsl:when>
5467         <xsl:otherwise>
5468           <input type="radio" name="showAgMembers" value="false" checked="checked" onclick="document.adminGroupMembersForm.submit();"/>
5469           Hide members
5470           <input type="radio" name="showAgMembers" value="true" onclick="document.adminGroupMembersForm.submit();"/>
5471           Show members
5472         </xsl:otherwise>
5473       </xsl:choose>
5474     </form>
5475
5476     <p>Click on the group name to modify the group owner or description.<br/>
5477     Click "add/remove members" to modify group membership.</p>
5478     <p>
5479       <input type="button" name="return" onclick="javascript:location.replace('{$admingroup-initAdd}')" value="Add a new group"/>
5480     </p>
5481     <table id="commonListTable">
5482       <tr>
5483         <th>Name</th>
5484         <th>Description</th>
5485         <xsl:if test="/bedeworkadmin/groups/showMembers='true'">
5486           <th>Members</th>
5487         </xsl:if>
5488         <th></th>
5489       </tr>
5490       <xsl:for-each select="/bedeworkadmin/groups/group">
5491         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
5492         <xsl:variable name="groupName" select="name"/>
5493         <tr>
5494           <td>
5495             <a href="{$admingroup-fetchForUpdate}&amp;adminGroupName={$groupName}">
5496               <xsl:value-of select="name"/>
5497             </a>
5498           </td>
5499           <td>
5500             <xsl:value-of select="desc"/>
5501           </td>
5502           <xsl:if test="/bedeworkadmin/groups/showMembers='true'">
5503             <td>
5504               <xsl:for-each select="members/member/account">
5505                 <xsl:value-of select="."/>&#160;
5506               </xsl:for-each>
5507             </td>
5508           </xsl:if>
5509           <td>
5510             <a href="{$admingroup-fetchForUpdateMembers}&amp;adminGroupName={$groupName}">Add/Remove members</a>
5511           </td>
5512         </tr>
5513       </xsl:for-each>
5514     </table>
5515     <p>
5516       <input type="button" name="return" onclick="javascript:location.replace('{$admingroup-initAdd}')" value="Add a new group"/>
5517     </p>
5518   </xsl:template>
5519
5520   <xsl:template match="groups" mode="chooseGroup">
5521     <h2>Choose Your Administrative Group</h2>
5522
5523     <table id="commonListTable">
5524
5525       <tr>
5526         <th>Name</th>
5527         <th>Description</th>
5528       </tr>
5529
5530       <xsl:for-each select="group">
5531         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
5532         <tr>
5533           <td>
5534             <xsl:variable name="admGroupName" select="name"/>
5535             <a href="{$setup}&amp;adminGroupName={$admGroupName}">
5536               <xsl:copy-of select="name"/>
5537             </a>
5538           </td>
5539           <td>
5540             <xsl:value-of select="desc"/>
5541           </td>
5542         </tr>
5543       </xsl:for-each>
5544     </table>
5545   </xsl:template>
5546
5547   <xsl:template name="modAdminGroup">
5548     <xsl:choose>
5549       <xsl:when test="/bedeworkadmin/creating = 'true'">
5550         <h2>Add Group</h2>
5551       </xsl:when>
5552       <xsl:otherwise>
5553         <h2>Modify Group</h2>
5554       </xsl:otherwise>
5555     </xsl:choose>
5556     <form name="peForm" method="post" action="{$admingroup-update}">
5557       <table id="adminGroupFormTable">
5558         <tr>
5559           <td class="fieldName">
5560             Name:
5561           </td>
5562           <td>
5563             <xsl:choose>
5564               <xsl:when test="/bedeworkadmin/creating = 'true'">
5565                 <xsl:copy-of select="/bedeworkadmin/formElements/form/name/*"/>
5566               </xsl:when>
5567               <xsl:otherwise>
5568                 <xsl:value-of select="/bedeworkadmin/formElements/form/name"/>
5569               </xsl:otherwise>
5570             </xsl:choose>
5571           </td>
5572         </tr>
5573         <tr>
5574           <td class="fieldName">
5575             Description:
5576           </td>
5577           <td>
5578             <xsl:copy-of select="/bedeworkadmin/formElements/form/desc/*"/>
5579           </td>
5580         </tr>
5581         <tr>
5582           <td class="fieldName">
5583             Group owner:
5584           </td>
5585           <td>
5586             <xsl:copy-of select="/bedeworkadmin/formElements/form/groupOwner/*"/>
5587           </td>
5588         </tr>
5589         <tr>
5590           <td class="fieldName">
5591             Events owner:
5592           </td>
5593           <td>
5594            <xsl:choose>
5595               <xsl:when test="/bedeworkadmin/creating = 'true'">
5596                 <xsl:copy-of select="/bedeworkadmin/formElements/form/eventsOwner/*"/>
5597               </xsl:when>
5598               <xsl:otherwise>
5599                 <xsl:value-of select="/bedeworkadmin/formElements/form/eventsOwner/input/@value"/>
5600               </xsl:otherwise>
5601             </xsl:choose>
5602           </td>
5603         </tr>
5604       </table>
5605       <table border="0" id="submitTable">
5606         <tr>
5607           <td>
5608             <xsl:choose>
5609               <xsl:when test="/bedeworkadmin/creating = 'true'">
5610                 <input type="submit" name="updateAdminGroup" value="Add Admin Group"/>
5611                 <input type="submit" name="cancelled" value="Cancel"/>
5612                 <input type="reset" value="Clear"/>
5613               </xsl:when>
5614               <xsl:otherwise>
5615                 <input type="submit" name="updateAdminGroup" value="Update Admin Group"/>
5616                 <input type="submit" name="cancelled" value="Cancel"/>
5617                 <input type="reset" value="Reset"/>
5618               </xsl:otherwise>
5619             </xsl:choose>
5620           </td>
5621           <td align="right">
5622             <xsl:if test="/bedeworkadmin/creating = 'false'">
5623               <input type="submit" name="delete" value="Delete"/>
5624             </xsl:if>
5625           </td>
5626         </tr>
5627       </table>
5628     </form>
5629   </xsl:template>
5630
5631   <xsl:template name="modAdminGroupMembers">
5632     <h2>Update Group Membership</h2>
5633     <p>Enter a userid (for user or group) and click "add" to update group membership.
5634     Click the trash icon to remove a user from the group.</p>
5635
5636     <form name="adminGroupMembersForm" method="post" action="{$admingroup-updateMembers}">
5637       <p>Add member:
5638         <input type="text" name="updGroupMember" size="15"/>
5639         <input type="radio" value="user" name="kind" checked="checked"/>user
5640         <input type="radio" value="group" name="kind"/>group
5641         <input type="submit" name="addGroupMember" value="Add"/>
5642       </p>
5643     </form>
5644     <p>
5645       <input type="button" name="return" onclick="javascript:location.replace('{$admingroup-initUpdate}')" value="Return to Admin Group listing"/>
5646     </p>
5647
5648     <table id="adminGroupFormTable">
5649       <tr>
5650         <td class="fieldName">
5651           Name:
5652         </td>
5653         <td>
5654           <xsl:value-of select="/bedeworkadmin/adminGroup/name"/>
5655         </td>
5656       </tr>
5657       <tr>
5658         <td class="fieldName">
5659           Members:
5660         </td>
5661         <td>
5662           <table id="memberAccountList">
5663             <xsl:for-each select="/bedeworkadmin/adminGroup/members/member">
5664               <xsl:choose>
5665                 <xsl:when test="kind='0'"><!-- kind = user -->
5666                   <tr>
5667                     <td>
5668                       <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
5669                     </td>
5670                     <td>
5671                       <xsl:value-of select="account"/>
5672                     </td>
5673                     <td>
5674                       <xsl:variable name="acct" select="account"/>
5675                       <a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=user" title="remove">
5676                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
5677                       </a>
5678                     </td>
5679                   </tr>
5680                 </xsl:when>
5681                 <xsl:otherwise><!-- kind = group -->
5682                   <tr>
5683                     <td>
5684                       <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
5685                     </td>
5686                     <td>
5687                       <strong>
5688                         <xsl:value-of select="account"/>
5689                       </strong>
5690                     </td>
5691                     <td>
5692                       <xsl:variable name="acct" select="account"/>
5693                       <a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=group" title="remove">
5694                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
5695                       </a>
5696                     </td>
5697                   </tr>
5698                 </xsl:otherwise>
5699               </xsl:choose>
5700             </xsl:for-each>
5701           </table>
5702         </td>
5703       </tr>
5704     </table>
5705     <p>
5706       <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/> user,
5707       <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
5708       <xsl:text> </xsl:text>
5709       <strong>group</strong>
5710     </p>
5711   </xsl:template>
5712
5713   <xsl:template name="deleteAdminGroupConfirm">
5714     <h2>Delete Admin Group?</h2>
5715     <p>The following group will be deleted. Continue?</p>
5716     <p>
5717       <strong>
5718         <xsl:value-of select="/bedeworkadmin/groups/group/name"/>
5719       </strong>:
5720       <xsl:value-of select="/bedeworkadmin/groups/group/desc"/>
5721     </p>
5722     <form name="adminGroupDelete" method="post" action="{$admingroup-delete}">
5723       <input type="submit" name="removeAdminGroupOK" value="Yes: Delete!"/>
5724       <input type="submit" name="cancelled" value="No: Cancel"/>
5725     </form>
5726   </xsl:template>
5727
5728   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
5729
5730   <xsl:template match="sysStats" mode="showSysStats">
5731     <h2>System Statistics</h2>
5732
5733     <p>
5734       Stats collection:
5735     </p>
5736     <ul>
5737       <li>
5738         <a href="{$stats-update}&amp;enable=yes">enable</a> |
5739         <a href="{$stats-update}&amp;disable=yes">disable</a>
5740       </li>
5741       <li>
5742         <a href="{$stats-update}&amp;fetch=yes">fetch statistics</a>
5743       </li>
5744       <li>
5745         <a href="{$stats-update}&amp;dump=yes">dump stats to log</a>
5746       </li>
5747     </ul>
5748     <table id="statsTable" cellpadding="0">
5749       <xsl:for-each select="*">
5750         <xsl:choose>
5751           <xsl:when test="name(.) = 'header'">
5752             <tr>
5753               <th colspan="2">
5754                 <xsl:value-of select="."/>
5755               </th>
5756             </tr>
5757           </xsl:when>
5758           <xsl:otherwise>
5759             <tr>
5760               <td class="label">
5761                 <xsl:value-of select="label"/>
5762               </td>
5763               <td class="value">
5764                 <xsl:value-of select="value"/>
5765               </td>
5766             </tr>
5767           </xsl:otherwise>
5768         </xsl:choose>
5769       </xsl:for-each>
5770     </table>
5771   </xsl:template>
5772
5773   <!--==== SEARCH RESULT ====-->
5774   <xsl:template name="searchResult">
5775     <h2 class="bwStatusConfirmed">
5776       <div id="searchFilter">
5777         <form name="searchForm" method="post" action="{$search}">
5778           Search:
5779           <input type="text" name="query" size="15">
5780             <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/searchResults/query"/></xsl:attribute>
5781           </input>
5782           <input type="submit" name="submit" value="go"/>
5783           Limit:
5784           <xsl:choose>
5785             <xsl:when test="/bedeworkadmin/searchResults/searchLimits = 'beforeToday'">
5786               <input type="radio" name="searchLimits" value="fromToday"/>today forward
5787               <input type="radio" name="searchLimits" value="beforeToday" checked="checked"/>past dates
5788               <input type="radio" name="searchLimits" value="none"/>all dates
5789             </xsl:when>
5790             <xsl:when test="/bedeworkadmin/searchResults/searchLimits = 'none'">
5791               <input type="radio" name="searchLimits" value="fromToday"/>today forward
5792               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
5793               <input type="radio" name="searchLimits" value="none" checked="checked"/>all dates
5794             </xsl:when>
5795             <xsl:otherwise>
5796               <input type="radio" name="searchLimits" value="fromToday" checked="checked"/>today forward
5797               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
5798               <input type="radio" name="searchLimits" value="none"/>all dates
5799             </xsl:otherwise>
5800           </xsl:choose>
5801         </form>
5802       </div>
5803       Search Result
5804     </h2>
5805     <table id="searchTable" cellpadding="0" cellspacing="0">
5806       <tr>
5807         <th colspan="5">
5808           <xsl:if test="/bedeworkadmin/searchResults/numPages &gt; 1">
5809             <xsl:variable name="curPage" select="/bedeworkadmin/searchResults/curPage"/>
5810             <div id="searchPageForm">
5811               page:
5812               <xsl:if test="/bedeworkadmin/searchResults/curPage != 1">
5813                 <xsl:variable name="prevPage" select="number($curPage) - 1"/>
5814                 &lt;<a href="{$search-next}&amp;pageNum={$prevPage}">prev</a>
5815               </xsl:if>
5816               <xsl:text> </xsl:text>
5817
5818               <xsl:call-template name="searchResultPageNav">
5819                 <xsl:with-param name="page">
5820                   <xsl:choose>
5821                     <xsl:when test="number($curPage) - 10 &lt; 1">1</xsl:when>
5822                     <xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise>
5823                   </xsl:choose>
5824                 </xsl:with-param>
5825               </xsl:call-template>
5826
5827               <xsl:text> </xsl:text>
5828               <xsl:choose>
5829                 <xsl:when test="$curPage != /bedeworkadmin/searchResults/numPages">
5830                   <xsl:variable name="nextPage" select="number($curPage) + 1"/>
5831                   <a href="{$search-next}&amp;pageNum={$nextPage}">next</a>&gt;
5832                 </xsl:when>
5833                 <xsl:otherwise>
5834                   <span class="hidden">next&gt;</span><!-- occupy the space to keep the navigation from moving around -->
5835                 </xsl:otherwise>
5836               </xsl:choose>
5837             </div>
5838           </xsl:if>
5839           <xsl:value-of select="/bedeworkadmin/searchResults/resultSize"/>
5840           result<xsl:if test="/bedeworkadmin/searchResults/resultSize != 1">s</xsl:if> returned
5841           for <em><xsl:value-of select="/bedeworkadmin/searchResults/query"/></em>
5842         </th>
5843       </tr>
5844       <xsl:if test="/bedeworkadmin/searchResults/searchResult">
5845         <tr class="fieldNames">
5846           <td>
5847             relevance
5848           </td>
5849           <td>
5850             summary
5851           </td>
5852           <td>
5853             date &amp; time
5854           </td>
5855           <td>
5856             calendar
5857           </td>
5858           <td>
5859             location
5860           </td>
5861         </tr>
5862       </xsl:if>
5863       <xsl:for-each select="/bedeworkadmin/searchResults/searchResult">
5864         <xsl:variable name="subscriptionId" select="event/subscription/id"/>
5865         <xsl:variable name="calPath" select="event/calendar/encodedPath"/>
5866         <xsl:variable name="guid" select="event/guid"/>
5867         <xsl:variable name="recurrenceId" select="event/recurrenceId"/>
5868         <tr>
5869           <td class="relevance">
5870             <xsl:value-of select="ceiling(number(score)*100)"/>%
5871             <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance">
5872               <xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute>
5873             </img>
5874           </td>
5875           <td>
5876             <a href="{$event-fetchForDisplay}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
5877               <xsl:value-of select="event/summary"/>
5878             </a>
5879           </td>
5880           <td>
5881             <xsl:value-of select="event/start/longdate"/>
5882             <xsl:text> </xsl:text>
5883             <xsl:value-of select="event/start/time"/>
5884             <xsl:choose>
5885               <xsl:when test="event/start/longdate != event/end/longdate">
5886                 - <xsl:value-of select="event/start/longdate"/>
5887                 <xsl:text> </xsl:text>
5888                 <xsl:value-of select="event/end/time"/>
5889               </xsl:when>
5890               <xsl:when test="event/start/time != event/end/time">
5891                 - <xsl:value-of select="event/end/time"/>
5892               </xsl:when>
5893             </xsl:choose>
5894           </td>
5895           <td>
5896             <xsl:value-of select="event/calendar/name"/>
5897           </td>
5898           <td>
5899             <xsl:value-of select="event/location/address"/>
5900           </td>
5901         </tr>
5902       </xsl:for-each>
5903     </table>
5904   </xsl:template>
5905
5906   <xsl:template name="searchResultPageNav">
5907     <xsl:param name="page">1</xsl:param>
5908     <xsl:variable name="curPage" select="/bedeworkadmin/searchResults/curPage"/>
5909     <xsl:variable name="numPages" select="/bedeworkadmin/searchResults/numPages"/>
5910     <xsl:variable name="endPage">
5911       <xsl:choose>
5912         <xsl:when test="number($curPage) + 6 &gt; number($numPages)"><xsl:value-of select="$numPages"/></xsl:when>
5913         <xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise>
5914       </xsl:choose>
5915     </xsl:variable>
5916     <xsl:choose>
5917       <xsl:when test="$page = $curPage">
5918         <xsl:value-of select="$page"/>
5919       </xsl:when>
5920       <xsl:otherwise>
5921         <a href="{$search-next}&amp;pageNum={$page}">
5922           <xsl:value-of select="$page"/>
5923         </a>
5924       </xsl:otherwise>
5925     </xsl:choose>
5926     <xsl:text> </xsl:text>
5927     <xsl:if test="$page &lt; $endPage">
5928        <xsl:call-template name="searchResultPageNav">
5929          <xsl:with-param name="page" select="number($page)+1"/>
5930       </xsl:call-template>
5931     </xsl:if>
5932   </xsl:template>
5933
5934   <!--==== FOOTER ====-->
5935   <xsl:template name="footer">
5936     <div id="footer">
5937       <a href="http://www.bedework.org/">Bedework Website</a> |
5938       <!-- Enable the following two items when debugging skins only -->
5939       <a href="?noxslt=yes">show XML</a> |
5940       <a href="?refreshXslt=yes">refresh XSLT</a>
5941     </div>
5942   </xsl:template>
5943 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.