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

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

user client: add ability to reset "unauthenticated" access to default

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