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

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

admin client: add "owner" as access control whoType

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