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

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

admin client: overhaul of access control; now the same as in user client. Provides much simpler basic interface, and a much more complete advanced interface.

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