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

Revision 1389 (checked in by douglm, 6 years ago)

Allow logins with accounts of the form /principals/resources/room301

For resource principals auto-respond to meeting requests.

Incomplete, we should check for a preference rather than principal type. Also we should accept or refuse based on busy status of time period.

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