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

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

admin client: fix stylesheet bug

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         <h2>Ok to delete this event?</h2>
2236         <p style="width: 400px;">Note: we do not encourage deletion of old but correct events; we prefer to keep
2237            old events for historical reasons.  Please remove only those events
2238            that are truly erroneous.</p>
2239         <p id="confirmButtons">
2240           <form action="{$event-delete}" method="post">
2241             <input type="submit" name="cancelled" value="Cancel"/>
2242             <input type="submit" name="delete" value="Delete"/>
2243             <input type="hidden" name="calPath" value="{$calPath}"/>
2244             <input type="hidden" name="guid" value="{$guid}"/>
2245             <input type="hidden" name="recurrenceId" value="{$recurrenceId}"/>
2246           </form>
2247         </p>
2248       </xsl:when>
2249       <xsl:otherwise>
2250         <h2>Event Information</h2>
2251       </xsl:otherwise>
2252     </xsl:choose>
2253
2254     <table class="eventFormTable">
2255       <tr>
2256         <th>
2257           Title:
2258         </th>
2259         <td>
2260           <strong><xsl:value-of select="summary"/></strong>
2261         </td>
2262       </tr>
2263
2264       <tr>
2265         <th>
2266           When:
2267         </th>
2268         <td>
2269           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
2270           <xsl:if test="start/allday = 'false'">
2271             <span class="time"><xsl:value-of select="start/time"/></span>
2272           </xsl:if>
2273           <xsl:if test="(end/longdate != start/longdate) or
2274                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
2275           <xsl:if test="end/longdate != start/longdate">
2276             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
2277           </xsl:if>
2278           <xsl:choose>
2279             <xsl:when test="start/allday = 'true'">
2280               <span class="time"><em>(all day)</em></span>
2281             </xsl:when>
2282             <xsl:when test="end/longdate != start/longdate">
2283               <span class="time"><xsl:value-of select="end/time"/></span>
2284             </xsl:when>
2285             <xsl:when test="end/time != start/time">
2286               <span class="time"><xsl:value-of select="end/time"/></span>
2287             </xsl:when>
2288           </xsl:choose>
2289         </td>
2290       </tr>
2291
2292       <tr>
2293         <th>
2294           Calendar:
2295         </th>
2296         <td>
2297           <xsl:value-of select="calendar/path"/>
2298         </td>
2299       </tr>
2300
2301       <!--  Description  -->
2302       <tr>
2303         <th>
2304           Description:
2305         </th>
2306         <td>
2307           <xsl:value-of select="description"/>
2308         </td>
2309       </tr>
2310       <!-- Cost -->
2311       <tr>
2312         <th class="optional">
2313           Price:
2314         </th>
2315         <td>
2316           <xsl:value-of select="cost"/>
2317         </td>
2318       </tr>
2319       <!-- Url -->
2320       <tr>
2321         <th class="optional">
2322           URL:
2323         </th>
2324         <td>
2325           <xsl:variable name="eventLink" select="link"/>
2326           <a href="{$eventLink}">
2327             <xsl:value-of select="link"/>
2328           </a>
2329         </td>
2330       </tr>
2331
2332       <!-- Location -->
2333       <tr>
2334         <th>
2335           Location:
2336         </th>
2337         <td>
2338           <xsl:value-of select="location/address"/><br/>
2339           <xsl:value-of select="location/subaddress"/>
2340         </td>
2341       </tr>
2342
2343       <!-- Contact -->
2344       <tr>
2345         <th>
2346           Contact:
2347         </th>
2348         <td>
2349           <xsl:value-of select="contact/name"/><br/>
2350           <xsl:value-of select="contact/phone"/><br/>
2351           <xsl:variable name="mailto" select="email"/>
2352           <a href="mailto:{$mailto}"><xsl:value-of select="email"/></a>
2353           <xsl:variable name="contactLink" select="link"/>
2354           <a href="mailto:{$contactLink}"><xsl:value-of select="contact/link"/></a>
2355         </td>
2356       </tr>
2357
2358       <!-- Owner -->
2359       <tr>
2360         <th>
2361           Owner:
2362         </th>
2363         <td>
2364           <strong><xsl:value-of select="creator"/></strong>
2365         </td>
2366       </tr>
2367
2368       <!--  Categories  -->
2369       <tr>
2370         <th>
2371           Categories:
2372         </th>
2373         <td>
2374           <xsl:for-each select="categories/category">
2375             <xsl:value-of select="word"/><br/>
2376           </xsl:for-each>
2377         </td>
2378       </tr>
2379
2380     </table>
2381
2382     <p>
2383       <xsl:if test="/bedeworkadmin/canEdit = 'true' or /bedeworkadmin/userInfo/superUser = 'true'">
2384         <input type="button" name="return" value="Edit event" onclick="javascript:location.replace('{$event-fetchForUpdate}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}')"/>
2385       </xsl:if>
2386
2387       <input type="button" name="return" value="Back" onclick="javascript:history.back()"/>
2388     </p>
2389   </xsl:template>
2390
2391   <!--+++++++++++++++ Contacts ++++++++++++++++++++-->
2392   <xsl:template name="contactList">
2393     <h2>Edit Contacts</h2>
2394     <p>
2395       Select the contact you would like to update:
2396       <input type="button" name="return" value="Add new contact" onclick="javascript:location.replace('{$contact-initAdd}')"/>
2397     </p>
2398
2399     <table id="commonListTable">
2400       <tr>
2401         <th>Name</th>
2402         <th>Phone</th>
2403         <th>Email</th>
2404         <th>URL</th>
2405       </tr>
2406
2407       <xsl:for-each select="/bedeworkadmin/contacts/contact">
2408         <tr>
2409           <td>
2410             <xsl:copy-of select="name" />
2411           </td>
2412           <td>
2413             <xsl:value-of select="phone" />
2414           </td>
2415           <td>
2416             <xsl:variable name="email" select="email"/>
2417             <a href="mailto:{$email}">
2418               <xsl:value-of select="email"/>
2419             </a>
2420           </td>
2421           <td>
2422             <xsl:variable name="link" select="link" />
2423             <a href="{$link}" target="linktest">
2424               <xsl:value-of select="link" />
2425             </a>
2426           </td>
2427         </tr>
2428       </xsl:for-each>
2429     </table>
2430   </xsl:template>
2431
2432   <xsl:template name="modContact">
2433     <form action="{$contact-update}" method="post">
2434       <h2>Contact Information</h2>
2435
2436       <table id="eventFormTable">
2437         <tr>
2438           <td class="fieldName">
2439             Contact:
2440           </td>
2441           <td>
2442             <xsl:copy-of select="/bedeworkadmin/formElements/form/name/*"/>
2443           </td>
2444         </tr>
2445         <tr>
2446           <td class="fieldName">
2447             Contact Phone Number:
2448           </td>
2449           <td>
2450             <xsl:copy-of select="/bedeworkadmin/formElements/form/phone/*"/>
2451             <span class="fieldInfo"> (optional)</span>
2452           </td>
2453         </tr>
2454         <tr>
2455           <td class="optional">
2456             Contact's URL:
2457           </td>
2458           <td>
2459             <xsl:copy-of select="/bedeworkadmin/formElements/form/link/*"/>
2460             <span class="fieldInfo"> (optional)</span>
2461           </td>
2462         </tr>
2463         <tr>
2464           <td class="optional">
2465             Contact Email Address:
2466           </td>
2467           <td>
2468             <xsl:copy-of select="/bedeworkadmin/formElements/form/email/*"/>
2469             <span class="fieldInfo"> (optional)</span>
2470           </td>
2471         </tr>
2472       </table>
2473
2474       <table border="0" id="submitTable">
2475         <tr>
2476           <xsl:choose>
2477             <xsl:when test="/bedeworkadmin/creating='true'">
2478               <td>
2479                 <input type="submit" name="addContact" value="Add Contact"/>
2480                 <input type="submit" name="cancelled" value="Cancel"/>
2481                 <input type="reset" value="Clear"/>
2482               </td>
2483             </xsl:when>
2484             <xsl:otherwise>
2485               <td>
2486                 <input type="submit" name="updateContact" value="Update Contact"/>
2487                 <input type="submit" name="cancelled" value="Cancel"/>
2488                 <input type="reset" value="Reset"/>
2489               </td>
2490               <td align="right">
2491                 <input type="submit" name="delete" value="Delete Contact"/>
2492               </td>
2493             </xsl:otherwise>
2494           </xsl:choose>
2495         </tr>
2496       </table>
2497
2498     </form>
2499   </xsl:template>
2500
2501   <xsl:template name="deleteContactConfirm">
2502     <h2>Ok to delete this contact?</h2>
2503     <p id="confirmButtons">
2504       <xsl:copy-of select="/bedeworkadmin/formElements/*"/>
2505     </p>
2506
2507     <table class="eventFormTable">
2508       <tr>
2509         <th>Name</th>
2510         <td>
2511           <xsl:value-of select="/bedeworkadmin/contact/name" />
2512         </td>
2513       </tr>
2514       <tr>
2515         <th>Phone</th>
2516         <td>
2517           <xsl:value-of select="/bedeworkadmin/contact/phone" />
2518         </td>
2519       </tr>
2520       <tr>
2521         <th>Email</th>
2522         <td>
2523           <xsl:value-of select="/bedeworkadmin/contact/email" />
2524         </td>
2525       </tr>
2526       <tr>
2527         <th>URL</th>
2528         <td>
2529           <xsl:value-of select="/bedeworkadmin/contact/link" />
2530         </td>
2531       </tr>
2532     </table>
2533   </xsl:template>
2534
2535    <!--+++++++++++++++ Locations ++++++++++++++++++++-->
2536   <xsl:template name="locationList">
2537     <h2>Edit Locations</h2>
2538     <p>
2539       Select the location that you would like to update:
2540       <input type="button" name="return" value="Add new location" onclick="javascript:location.replace('{$location-initAdd}')"/>
2541     </p>
2542
2543     <table id="commonListTable">
2544       <tr>
2545         <th>Address</th>
2546         <th>Subaddress</th>
2547         <th>URL</th>
2548       </tr>
2549
2550       <xsl:for-each select="/bedeworkadmin/locations/location">
2551         <tr>
2552           <td>
2553             <xsl:copy-of select="address/*"/>
2554           </td>
2555           <td>
2556             <xsl:value-of select="subaddress"/>
2557           </td>
2558           <td>
2559             <xsl:variable name="link" select="link" />
2560             <a href="{$link}" target="linktest">
2561               <xsl:value-of select="link" />
2562             </a>
2563           </td>
2564         </tr>
2565       </xsl:for-each>
2566     </table>
2567   </xsl:template>
2568
2569   <xsl:template name="modLocation">
2570     <xsl:choose>
2571       <xsl:when test="/bedeworkadmin/creating='true'">
2572         <h2>Add Location</h2>
2573       </xsl:when>
2574       <xsl:otherwise>
2575         <h2>Update Location</h2>
2576       </xsl:otherwise>
2577     </xsl:choose>
2578
2579     <form action="{$location-update}" method="post">
2580       <table id="eventFormTable">
2581         <tr>
2582           <td class="fieldName">
2583             Address:
2584           </td>
2585           <td>
2586             <xsl:copy-of select="/bedeworkadmin/formElements/form/address/*"/>
2587           </td>
2588         </tr>
2589         <tr>
2590           <td class="optional">
2591             Subaddress:
2592           </td>
2593           <td>
2594             <xsl:copy-of select="/bedeworkadmin/formElements/form/subaddress/*"/>
2595             <span class="fieldInfo"> (optional)</span>
2596           </td>
2597         </tr>
2598         <tr>
2599           <td class="optional">
2600             Location's URL:
2601           </td>
2602           <td>
2603             <xsl:copy-of select="/bedeworkadmin/formElements/form/link/*"/>
2604             <span class="fieldInfo"> (optional)</span>
2605           </td>
2606         </tr>
2607       </table>
2608
2609       <table border="0" id="submitTable">
2610         <tr>
2611           <xsl:choose>
2612             <xsl:when test="/bedeworkadmin/creating='true'">
2613               <td>
2614                 <input type="submit" name="addLocation" value="Add Location"/>
2615                 <input type="submit" name="cancelled" value="Cancel"/>
2616                 <input type="reset" value="Clear"/>
2617               </td>
2618             </xsl:when>
2619             <xsl:otherwise>
2620               <td>
2621                 <input type="submit" name="updateLocation" value="Update Location"/>
2622                 <input type="submit" name="cancelled" value="Cancel"/>
2623                 <input type="reset" value="Reset"/>
2624               </td>
2625               <td align="right">
2626                 <input type="submit" name="delete" value="Delete Location"/>
2627               </td>
2628             </xsl:otherwise>
2629           </xsl:choose>
2630         </tr>
2631       </table>
2632     </form>
2633   </xsl:template>
2634
2635   <xsl:template name="deleteLocationConfirm">
2636     <h2>Ok to delete this location?</h2>
2637     <p id="confirmButtons">
2638       <xsl:copy-of select="/bedeworkadmin/formElements/*"/>
2639     </p>
2640
2641     <table class="eventFormTable">
2642       <tr>
2643         <td class="fieldName">
2644             Address:
2645           </td>
2646         <td>
2647           <xsl:value-of select="/bedeworkadmin/location/address"/>
2648         </td>
2649       </tr>
2650       <tr>
2651         <td class="optional">
2652             Subaddress:
2653           </td>
2654         <td>
2655           <xsl:value-of select="/bedeworkadmin/location/subaddress"/>
2656         </td>
2657       </tr>
2658       <tr>
2659         <td class="optional">
2660             Location's URL:
2661           </td>
2662         <td>
2663           <xsl:variable name="link" select="/bedeworkadmin/location/link"/>
2664           <a href="{$link}">
2665             <xsl:value-of select="/bedeworkadmin/location/link"/>
2666           </a>
2667         </td>
2668       </tr>
2669     </table>
2670   </xsl:template>
2671
2672   <!--+++++++++++++++ Categories ++++++++++++++++++++-->
2673   <xsl:template name="categoryList">
2674     <h2>Edit Categories</h2>
2675     <p>
2676       Select the category you would like to update:
2677       <input type="button" name="return" value="Add new category" onclick="javascript:location.replace('{$category-initAdd}')"/>
2678     </p>
2679
2680     <table id="commonListTable">
2681       <tr>
2682         <th>Keyword</th>
2683         <th>Description</th>
2684       </tr>
2685
2686       <xsl:for-each select="/bedeworkadmin/categories/category">
2687         <xsl:variable name="categoryKey" select="normalize-space(keyword)"/>
2688         <tr>
2689           <td>
2690             <a href="{$category-fetchForUpdate}&amp;categoryKey={$categoryKey}">
2691               <xsl:value-of select="keyword"/>
2692             </a>
2693           </td>
2694           <td>
2695             <xsl:value-of select="desc"/>
2696           </td>
2697         </tr>
2698       </xsl:for-each>
2699     </table>
2700   </xsl:template>
2701
2702   <xsl:template name="modCategory">
2703     <xsl:choose>
2704       <xsl:when test="/bedeworkadmin/creating='true'">
2705         <h2>Add Category</h2>
2706         <form action="{$category-update}" method="post">
2707           <table id="eventFormTable">
2708             <tr>
2709               <td class="fieldName">
2710                 Keyword:
2711               </td>
2712               <td>
2713                 <input type="text" name="categoryWord.value" value="" size="40"/>
2714               </td>
2715             </tr>
2716             <tr>
2717               <td class="optional">
2718                 Description:
2719               </td>
2720               <td>
2721                 <textarea name="categoryDesc.value" rows="3" cols="60">
2722                 </textarea>
2723               </td>
2724             </tr>
2725           </table>
2726           <table border="0" id="submitTable">
2727             <tr>
2728               <td>
2729                 <input type="submit" name="addCategory" value="Add Category"/>
2730                 <input type="submit" name="cancelled" value="Cancel"/>
2731                 <input type="reset" value="Clear"/>
2732               </td>
2733             </tr>
2734           </table>
2735         </form>
2736       </xsl:when>
2737       <xsl:otherwise>
2738         <h2>Update Category</h2>
2739         <form action="{$category-update}" method="post">
2740           <table id="eventFormTable">
2741             <tr>
2742               <td class="fieldName">
2743             Keyword:
2744             </td>
2745               <td>
2746                 <xsl:variable name="keyword" select="normalize-space(/bedeworkadmin/currentCategory/category/keyword)"/>
2747                 <input type="text" name="categoryWord.value" value="{$keyword}" size="40"/>
2748               </td>
2749             </tr>
2750             <tr>
2751               <td class="optional">
2752             Description:
2753             </td>
2754               <td>
2755                 <textarea name="categoryDesc.value" rows="3" cols="60">
2756                   <xsl:value-of select="normalize-space(/bedeworkadmin/currentCategory/category/desc)"/>
2757                 </textarea>
2758               </td>
2759             </tr>
2760           </table>
2761
2762           <table border="0" id="submitTable">
2763             <tr>
2764               <td>
2765                 <input type="submit" name="updateCategory" value="Update Category"/>
2766                 <input type="submit" name="cancelled" value="Cancel"/>
2767                 <input type="reset" value="Reset"/>
2768               </td>
2769               <td align="right">
2770                 <input type="submit" name="delete" value="Delete Category"/>
2771               </td>
2772             </tr>
2773           </table>
2774         </form>
2775       </xsl:otherwise>
2776     </xsl:choose>
2777
2778
2779   </xsl:template>
2780
2781   <xsl:template name="deleteCategoryConfirm">
2782     <h2>Ok to delete this category?</h2>
2783
2784
2785     <table class="eventFormTable">
2786       <tr>
2787         <td class="fieldName">
2788           Keyword:
2789         </td>
2790         <td>
2791           <xsl:value-of select="/bedeworkadmin/currentCategory/category/keyword"/>
2792         </td>
2793       </tr>
2794       <tr>
2795         <td class="optional">
2796           Description:
2797         </td>
2798         <td>
2799           <xsl:value-of select="/bedeworkadmin/currentCategory/category/desc"/>
2800         </td>
2801       </tr>
2802     </table>
2803
2804     <form action="{$category-delete}" method="post">
2805       <input type="submit" name="updateCategory" value="Yes: Delete Category"/>
2806       <input type="submit" name="cancelled" value="No: Cancel"/>
2807     </form>
2808   </xsl:template>
2809
2810 <!--+++++++++++++++ Calendars ++++++++++++++++++++-->
2811   <xsl:template match="calendars">
2812     <table id="calendarTable">
2813       <tr>
2814         <td class="cals">
2815           <h3>Public calendars</h3>
2816           <ul id="calendarTree">
2817             <xsl:choose>
2818               <xsl:when test="/bedeworkadmin/page='calendarDescriptions' or /bedeworkadmin/page='displayCalendar'">
2819                 <xsl:apply-templates select="calendar" mode="listForDisplay"/>
2820               </xsl:when>
2821               <xsl:otherwise>
2822                 <xsl:apply-templates select="calendar" mode="listForUpdate"/>
2823               </xsl:otherwise>
2824             </xsl:choose>
2825           </ul>
2826         </td>
2827         <td class="calendarContent">
2828           <xsl:choose>
2829             <xsl:when test="/bedeworkadmin/page='calendarList' or /bedeworkadmin/page='calendarReferenced'">
2830               <xsl:call-template name="calendarList"/>
2831             </xsl:when>
2832             <xsl:when test="/bedeworkadmin/page='calendarDescriptions'">
2833               <xsl:call-template name="calendarDescriptions"/>
2834             </xsl:when>
2835             <xsl:when test="/bedeworkadmin/page='displayCalendar'">
2836               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="displayCalendar"/>
2837             </xsl:when>
2838             <xsl:when test="/bedeworkadmin/page='deleteCalendarConfirm'">
2839               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="deleteCalendarConfirm"/>
2840             </xsl:when>
2841             <xsl:when test="/bedeworkadmin/creating='true'">
2842               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="addCalendar"/>
2843             </xsl:when>
2844             <xsl:otherwise>
2845               <xsl:apply-templates select="/bedeworkadmin/currentCalendar" mode="modCalendar"/>
2846             </xsl:otherwise>
2847           </xsl:choose>
2848         </td>
2849       </tr>
2850     </table>
2851   </xsl:template>
2852
2853   <xsl:template match="calendar" mode="listForUpdate">
2854     <xsl:variable name="calPath" select="encodedPath"/>
2855     <xsl:variable name="itemClass">
2856       <xsl:choose>
2857         <xsl:when test="calendarCollection='false'">folder</xsl:when>
2858         <xsl:otherwise>calendar</xsl:otherwise>
2859       </xsl:choose>
2860     </xsl:variable>
2861     <li class="{$itemClass}">
2862       <a href="{$calendar-fetchForUpdate}&amp;calPath={$calPath}" title="update">
2863         <xsl:value-of select="name"/>
2864       </a>
2865       <xsl:if test="calendarCollection='false'">
2866         <xsl:text> </xsl:text>
2867         <a href="{$calendar-initAdd}&amp;calPath={$calPath}" title="add a calendar or folder">
2868           <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="add a calendar or folder" border="0"/>
2869         </a>
2870       </xsl:if>
2871       <xsl:if test="calendar">
2872         <ul>
2873           <xsl:apply-templates select="calendar" mode="listForUpdate">
2874             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates>
2875         </ul>
2876       </xsl:if>
2877     </li>
2878   </xsl:template>
2879
2880   <xsl:template match="calendar" mode="listForDisplay">
2881     <xsl:variable name="calPath" select="encodedPath"/>
2882     <xsl:variable name="itemClass">
2883       <xsl:choose>
2884         <xsl:when test="calendarCollection='false'">folder</xsl:when>
2885         <xsl:otherwise>calendar</xsl:otherwise>
2886       </xsl:choose>
2887     </xsl:variable>
2888     <li class="{$itemClass}">
2889       <a href="{$calendar-fetchForDisplay}&amp;calPath={$calPath}" title="display">
2890         <xsl:value-of select="name"/>
2891       </a>
2892       <xsl:if test="calendar">
2893         <ul>
2894           <xsl:apply-templates select="calendar" mode="listForDisplay">
2895             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates>
2896         </ul>
2897       </xsl:if>
2898     </li>
2899   </xsl:template>
2900
2901   <xsl:template match="currentCalendar" mode="addCalendar">
2902     <h3>Add Calendar / Folder</h3>
2903     <form name="addCalForm" action="{$calendar-update}">
2904       <table class="eventFormTable">
2905         <tr>
2906           <th>Name:</th>
2907           <td>
2908             <xsl:variable name="curCalName" select="name"/>
2909             <input name="calendar.name" value="{$curCalName}" size="40"/>
2910           </td>
2911         </tr>
2912         <tr>
2913           <th>Summary:</th>
2914           <td>
2915             <xsl:variable name="curCalSummary" select="summary"/>
2916             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2917           </td>
2918         </tr>
2919         <tr>
2920           <th>Description:</th>
2921           <td>
2922             <textarea name="calendar.description" cols="40" rows="4">
2923               <xsl:value-of select="desc"/>
2924             </textarea>
2925           </td>
2926         </tr>
2927         <tr>
2928           <th>Calendar/Folder:</th>
2929           <td>
2930             <xsl:choose>
2931               <xsl:when test="calendarCollection='true'">
2932                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
2933                 <input type="radio" value="false" name="calendarCollection"/> Folder
2934               </xsl:when>
2935               <xsl:otherwise>
2936                 <input type="radio" value="true" name="calendarCollection"/> Calendar
2937                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
2938               </xsl:otherwise>
2939             </xsl:choose>
2940           </td>
2941         </tr>
2942       </table>
2943
2944       <table border="0" id="submitTable">
2945         <tr>
2946           <td>
2947             <input type="submit" name="addCalendar" value="Add Calendar/Folder"/>
2948             <input type="submit" name="cancelled" value="Cancel"/>
2949             <input type="reset" value="Clear"/>
2950           </td>
2951         </tr>
2952       </table>
2953     </form>
2954     <div id="sharingBox">
2955       <h3>Sharing</h3>
2956       Sharing may be added to a calendar once created.
2957     </div>
2958   </xsl:template>
2959
2960   <xsl:template match="currentCalendar" mode="modCalendar">
2961     <xsl:choose>
2962       <xsl:when test="calendarCollection='true'">
2963         <h3>Modify Calendar</h3>
2964       </xsl:when>
2965       <xsl:otherwise>
2966         <h3>Modify Folder</h3>
2967       </xsl:otherwise>
2968     </xsl:choose>
2969     <form name="modCalForm" action="{$calendar-update}">
2970       <table class="eventFormTable">
2971         <tr>
2972           <th>Path:</th>
2973           <td>
2974             <xsl:value-of select="path"/>
2975           </td>
2976         </tr>
2977         <tr>
2978           <th>Name:</th>
2979           <td>
2980             <xsl:value-of select="name"/>
2981           </td>
2982         </tr>
2983         <tr>
2984           <th>Mailing List ID:</th>
2985           <td>
2986             <xsl:value-of select="mailListId"/>
2987           </td>
2988         </tr>
2989         <tr>
2990           <th>Summary:</th>
2991           <td>
2992             <xsl:variable name="curCalSummary" select="summary"/>
2993             <input type="text" name="calendar.summary" value="{$curCalSummary}" size="40"/>
2994           </td>
2995         </tr>
2996         <tr>
2997           <th>Description:</th>
2998           <td>
2999             <textarea name="calendar.description" cols="40" rows="4">
3000               <xsl:value-of select="desc"/>
3001             </textarea>
3002           </td>
3003         </tr>
3004         <tr>
3005           <th>Calendar/Folder:</th>
3006           <td>
3007             <xsl:choose>
3008               <xsl:when test="calendarCollection='true'">
3009                 <input type="radio" value="true" name="calendarCollection" checked="checked"/> Calendar
3010                 <input type="radio" value="false" name="calendarCollection"/> Folder
3011               </xsl:when>
3012               <xsl:otherwise>
3013                 <input type="radio" value="true" name="calendarCollection"/> Calendar
3014                 <input type="radio" value="false" name="calendarCollection" checked="checked"/> Folder
3015               </xsl:otherwise>
3016             </xsl:choose>
3017           </td>
3018         </tr>
3019       </table>
3020
3021       <table border="0" id="submitTable">
3022         <tr>
3023           <td>
3024             <xsl:choose>
3025               <xsl:when test="calendarCollection='true'">
3026                 <input type="submit" name="updateCalendar" value="Update Calendar"/>
3027               </xsl:when>
3028               <xsl:otherwise>
3029                 <input type="submit" name="updateCalendar" value="Update Folder"/>
3030               </xsl:otherwise>
3031             </xsl:choose>
3032             <input type="submit" name="cancelled" value="Cancel"/>
3033             <input type="reset" value="Reset"/>
3034           </td>
3035           <td align="right">
3036             <xsl:choose>
3037               <xsl:when test="calendarCollection='true'">
3038                 <input type="submit" name="delete" value="Delete Calendar"/>
3039               </xsl:when>
3040               <xsl:otherwise>
3041                 <input type="submit" name="delete" value="Delete Folder"/>
3042               </xsl:otherwise>
3043             </xsl:choose>
3044           </td>
3045         </tr>
3046       </table>
3047     </form>
3048
3049    
3050     <div id="sharingBox">
3051       <xsl:apply-templates select="acl" mode="currentAccess">
3052         <xsl:with-param name="action" select="$calendar-setAccess"/>
3053         <xsl:with-param name="calPathEncoded" select="encodedPath"/>
3054       </xsl:apply-templates>
3055       <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm" onsubmit="setAccessHow(this)">
3056         <input type="hidden" name="calPath">
3057           <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
3058         </input>
3059         <xsl:call-template name="entityAccessForm">
3060           <xsl:with-param name="type">
3061             <xsl:choose>
3062               <xsl:when test="calType = '5'">inbox</xsl:when>
3063               <xsl:when test="calType = '6'">outbox</xsl:when>
3064               <xsl:otherwise>normal</xsl:otherwise>
3065             </xsl:choose>
3066           </xsl:with-param>
3067         </xsl:call-template>
3068       </form>
3069     </div>
3070
3071     <!--<div id="sharingBox">
3072       <xsl:variable name="calPath" select="path"/>
3073       <xsl:variable name="encodedCalPath" select="encodedPath"/>
3074       <xsl:if test="currentAccess/current-user-privilege-set/privilege/read-acl or /bedeworkadmin/userInfo/superUser='true'">
3075         <h3>Sharing</h3>
3076         <table class="common" id="sharing">
3077           <tr>
3078             <th class="commonHeader">Who:</th>
3079             <th class="commonHeader">Current access:</th>
3080             <th class="commonHeader">Source:</th>
3081           </tr>
3082           <xsl:for-each select="acl/ace">
3083             <xsl:variable name="who">
3084               <xsl:choose>
3085                 <xsl:when test="invert">
3086                   <xsl:choose>
3087                     <xsl:when test="invert/principal/href"><xsl:value-of select="normalize-space(invert/principal/href)"/></xsl:when>
3088                     <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3089                     <xsl:otherwise><xsl:value-of select="name(invert/principal/*)"/></xsl:otherwise>
3090                   </xsl:choose>
3091                 </xsl:when>
3092                 <xsl:otherwise>
3093                   <xsl:choose>
3094                     <xsl:when test="principal/href"><xsl:value-of select="normalize-space(principal/href)"/></xsl:when>
3095                     <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3096                     <xsl:otherwise><xsl:value-of select="name(principal/*)"/></xsl:otherwise>
3097                   </xsl:choose>
3098                 </xsl:otherwise>
3099               </xsl:choose>
3100             </xsl:variable>
3101             <tr>
3102             <th class="thin">
3103                 <xsl:if test="invert">
3104                   Not
3105                 </xsl:if>
3106                 <xsl:choose>
3107                   <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">
3108                     <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
3109                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/>
3110                   </xsl:when>
3111                   <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">
3112                     <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
3113                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/>
3114                   </xsl:when>
3115                   <xsl:when test="invert and $who='owner'">
3116                     <xsl:value-of select="$who"/> (other)
3117                   </xsl:when>
3118                   <xsl:otherwise>
3119                     <xsl:value-of select="$who"/>
3120                   </xsl:otherwise>
3121                 </xsl:choose>
3122               </th>
3123               <td>
3124                 <xsl:for-each select="grant/node()">
3125                   <xsl:value-of select="name(.)"/>&#160;&#160;
3126                 </xsl:for-each>
3127                 <xsl:for-each select="deny/node()">
3128                   <xsl:choose>
3129                     <xsl:when test="name(.)='all'">
3130                       none
3131                     </xsl:when>
3132                     <xsl:otherwise>
3133                       deny-<xsl:value-of select="name(.)"/>
3134                     </xsl:otherwise>
3135                   </xsl:choose>
3136                   &#160;&#160;
3137                 </xsl:for-each>
3138               </td>
3139               <td>
3140                 <xsl:choose>
3141                   <xsl:when test="inherited">
3142                     inherited from:
3143                     <a>
3144                       <xsl:attribute name="href"><xsl:value-of select="$calendar-fetchForUpdate"/>&amp;calPath=<xsl:value-of select="inherited/href"/></xsl:attribute>
3145                       <xsl:value-of select="inherited/href"/>
3146                     </a>
3147                   </xsl:when>
3148                   <xsl:otherwise>
3149                     local:
3150                     <xsl:variable name="whoType">
3151                       <xsl:choose>
3152                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">user</xsl:when>
3153                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">group</xsl:when>
3154                         <xsl:when test="$who='authenticated'">auth</xsl:when>
3155                         <xsl:when test="invert/principal/property/owner">other</xsl:when>
3156                         <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3157                         <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3158                         <xsl:otherwise></xsl:otherwise>
3159                       </xsl:choose>
3160                     </xsl:variable>
3161                     <xsl:variable name="shortWho">
3162                       <xsl:choose>
3163                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/></xsl:when>
3164                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/></xsl:when>
3165                         <xsl:otherwise></xsl:otherwise>--> <!-- if not user or group, send no who -->
3166         <!--              </xsl:choose>
3167                     </xsl:variable>
3168                     <xsl:choose>
3169                       <xsl:when test="invert">
3170                         <a href="{$calendar-setAccess}&amp;calPath={$encodedCalPath}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}&amp;notWho=yes">
3171                           reset to default
3172                         </a>
3173                       </xsl:when>
3174                       <xsl:otherwise>
3175                         <a href="{$calendar-setAccess}&amp;calPath={$encodedCalPath}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}">
3176                           reset to default
3177                         </a>
3178                       </xsl:otherwise>
3179                     </xsl:choose>
3180                   </xsl:otherwise>
3181                 </xsl:choose>
3182               </td>
3183             </tr>
3184           </xsl:for-each>
3185         </table>
3186       </xsl:if>
3187
3188       <xsl:if test="currentAccess/current-user-privilege-set/privilege/write-acl or /bedeworkadmin/userInfo/superUser='true'">
3189         <form name="calendarShareForm" action="{$calendar-setAccess}" id="shareForm" method="post">
3190           <input type="hidden" name="calPath" value="{$calPath}"/>
3191           <table cellspacing="0" id="shareFormTable" class="common">
3192             <tr>
3193               <th colspan="2" class="commonHeader">Set access:</th>
3194             </tr>
3195             <tr class="subhead">
3196               <th>Who:</th>
3197               <th>Rights:</th>
3198             </tr>
3199             <tr>
3200               <td>
3201                 <input type="text" name="who" size="20"/>
3202                 <br/>
3203                 <input type="radio" value="user" name="whoType" checked="checked"/> user
3204                 <input type="radio" value="group" name="whoType"/> group
3205                 <p>OR</p>
3206                 <p>
3207                   <input type="radio" value="auth" name="whoType"/> all authorized users<br/>
3208                   <input type="radio" value="other" name="whoType"/> other users<br/>
3209                   <input type="radio" value="owner" name="whoType"/> owner
3210                 </p>-->
3211                 <!-- we may never use the invert action ...it is probably
3212                      too confusing, and can be achieved in other ways -->
3213                 <!--
3214                 <p class="padTop">
3215                   <input type="checkbox" value="yes" name="notWho"/> invert (deny)
3216                 </p>-->
3217               <!--</td>
3218               <td>
3219                 <ul id="howList">
3220                   <li>
3221                     <input type="radio" value="A" name="how"/>
3222                     <strong>All</strong> (read, write, delete)</li>
3223                   <li class="padTop">
3224                     <input type="radio" value="R" name="how" checked="checked"/>
3225                     <strong>Read</strong> (content, access, freebusy)
3226                   </li>
3227                   <li>
3228                     <input type="radio" value="f" name="how"/> Read freebusy only
3229                   </li>
3230                   <li class="padTop">
3231                     <input type="radio" value="Rc" name="how"/>
3232                     <strong>Read</strong> and <strong>Write content only</strong>
3233                   </li>
3234                   <li class="padTop">
3235                     <input type="radio" value="W" name="how"/>
3236                     <strong>Write and delete</strong> (content, access, properties)
3237                   </li>
3238                   <li>
3239                     <input type="radio" value="c" name="how"/> Write content only
3240                   </li>
3241                   <li>
3242                     <input type="radio" value="u" name="how"/> Delete only
3243                   </li>
3244                   <li class="padTop">
3245                     <input type="radio" value="N" name="how"/>
3246                     <strong>None</strong>
3247                   </li>-->
3248                   <!--
3249                   <li class="padTop">
3250                     <input type="radio" value="default" name="how"/>
3251                     <strong>Restore default access</strong>
3252                   </li>-->
3253                 <!--</ul>
3254               </td>
3255             </tr>
3256           </table>
3257           <input type="submit" name="submit" value="Submit"/>
3258         </form>
3259       </xsl:if>
3260     </div>-->
3261   </xsl:template>
3262  
3263  
3264   <xsl:template name="calendarList">
3265     <h3>Manage Calendars</h3>
3266     <ul>
3267       <li>Select an item from the calendar list on the left to modify
3268       a calendar or folder.</li>
3269       <li>Select the
3270       <img src="{$resourcesRoot}/resources/calAddIcon.gif" width="13" height="13" alt="true" border="0"/>
3271       icon to add a new calendar or folder to the tree.
3272         <ul>
3273           <li>Folders may only contain calendars and subfolders.</li>
3274           <li>Calendars may only contain events (and other calendar items).</li>
3275           <li>
3276             If a calendar is empty, it may be converted to a folder and vice
3277             versa.  If a calendar or folder are not empty, it may not be
3278             converted.
3279           </li>
3280         </ul>
3281       </li>
3282     </ul>
3283   </xsl:template>
3284
3285   <xsl:template name="calendarDescriptions">
3286     <h2>Calendar Information</h2>
3287     <ul>
3288       <li>Select an item from the calendar tree on the left to view all information
3289       about that calendar or folder.  The tree on the left represents the calendar
3290       heirarchy.</li>
3291     </ul>
3292
3293     <p>
3294       <strong>All Calendar Descriptions:</strong>
3295     </p>
3296     <table id="flatCalendarDescriptions" cellspacing="0">
3297       <tr>
3298         <th>Name</th>
3299         <th>Description</th>
3300       </tr>
3301       <xsl:for-each select="//calendar">
3302         <xsl:variable name="descClass">
3303           <xsl:choose>
3304             <xsl:when test="position() mod 2 = 0">even</xsl:when>
3305             <xsl:otherwise>odd</xsl:otherwise>
3306           </xsl:choose>
3307         </xsl:variable>
3308         <tr class="{$descClass}">
3309           <td>
3310             <xsl:value-of select="name"/>
3311           </td>
3312           <td>
3313             <xsl:value-of select="desc"/>
3314           </td>
3315         </tr>
3316       </xsl:for-each>
3317     </table>
3318   </xsl:template>
3319
3320   <xsl:template match="currentCalendar" mode="displayCalendar">
3321     <h2>Calendar Information</h2>
3322     <table class="eventFormTable">
3323       <tr>
3324         <th>Name:</th>
3325         <td>
3326           <xsl:value-of select="name"/>
3327         </td>
3328       </tr>
3329       <tr>
3330         <th>Path:</th>
3331         <td>
3332           <xsl:value-of select="path"/>
3333         </td>
3334       </tr>
3335       <tr>
3336         <th>Summary:</th>
3337         <td>
3338           <xsl:value-of select="summary"/>
3339         </td>
3340       </tr>
3341       <tr>
3342         <th>Description:</th>
3343         <td>
3344           <xsl:value-of select="desc"/>
3345         </td>
3346       </tr>
3347     </table>
3348   </xsl:template>
3349
3350   <xsl:template match="currentCalendar" mode="deleteCalendarConfirm">
3351     <xsl:choose>
3352       <xsl:when test="calendarCollection='true'">
3353         <h3>Delete Calendar</h3>
3354         <p>
3355           The following calendar will be deleted.  Continue?
3356         </p>
3357       </xsl:when>
3358       <xsl:otherwise>
3359         <h3>Delete Folder</h3>
3360         <p>
3361           The following folder <em>and all its contents</em> will be deleted.
3362           Continue?
3363         </p>
3364       </xsl:otherwise>
3365     </xsl:choose>
3366
3367     <form name="delCalForm" action="{$calendar-delete}">
3368       <table class="eventFormTable">
3369         <tr>
3370           <th>Path:</th>
3371           <td>
3372             <xsl:value-of select="path"/>
3373           </td>
3374         </tr>
3375         <tr>
3376           <th>Name:</th>
3377           <td>
3378             <xsl:value-of select="name"/>
3379           </td>
3380         </tr>
3381         <tr>
3382           <th>Summary:</th>
3383           <td>
3384             <xsl:value-of select="summary"/>
3385           </td>
3386         </tr>
3387         <tr>
3388           <th>Description:</th>
3389           <td>
3390             <xsl:value-of select="desc"/>
3391           </td>
3392         </tr>
3393       </table>
3394
3395       <table border="0" id="submitTable">
3396         <tr>
3397           <td>
3398             <input type="submit" name="cancelled" value="Cancel"/>
3399           </td>
3400           <td align="right">
3401             <xsl:choose>
3402               <xsl:when test="calendarCollection='true'">
3403                 <input type="submit" name="delete" value="Yes: Delete Calendar!"/>
3404               </xsl:when>
3405               <xsl:otherwise>
3406                 <input type="submit" name="delete" value="Yes: Delete Folder!"/>
3407               </xsl:otherwise>
3408             </xsl:choose>
3409           </td>
3410         </tr>
3411       </table>
3412     </form>
3413   </xsl:template>
3414
3415   <!-- the selectCalForEvent listing creates a calendar tree in a pop-up window -->
3416   <xsl:template name="selectCalForEvent">
3417     <div id="calTreeBlock">
3418       <h2>Select a calendar</h2>
3419       <!--<form name="toggleCals" action="{$event-selectCalForEvent}">
3420         <xsl:choose>
3421           <xsl:when test="/bedeworkadmin/appvar[key='showAllCalsForEvent']/value = 'true'">
3422             <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" onclick="submit()"/>
3423             show only writable calendars
3424             <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" checked="checked" onclick="submit()"/>
3425             show all calendars
3426           </xsl:when>
3427           <xsl:otherwise>
3428             <input type="radio" name="setappvar" value="showAllCalsForEvent(false)" checked="checked" onclick="submit()"/>
3429             show only writable calendars
3430             <input type="radio" name="setappvar" value="showAllCalsForEvent(true)" onclick="submit()"/>
3431             show all calendars
3432           </xsl:otherwise>
3433         </xsl:choose>
3434       </form>-->
3435       <h4>Calendars</h4>
3436       <ul id="calendarTree">
3437         <xsl:apply-templates select="/bedeworkadmin/calendars/calendar" mode="selectCalForEventCalTree"/>
3438       </ul>
3439     </div>
3440   </xsl:template>
3441
3442   <xsl:template match="calendar" mode="selectCalForEventCalTree">
3443     <xsl:variable name="id" select="id"/>
3444     <li>
3445       <xsl:attribute name="class">
3446         <xsl:choose>
3447           <xsl:when test="calendarCollection='false'">folder</xsl:when>
3448           <xsl:otherwise>calendar</xsl:otherwise>
3449         </xsl:choose>
3450       </xsl:attribute>
3451       <xsl:variable name="calPath" select="path"/><!-- not the encodedPath when put in a form - otherwise it gets double encoded -->
3452       <xsl:variable name="calDisplay" select="path"/>
3453       <xsl:choose>
3454         <xsl:when test="currentAccess/current-user-privilege-set/privilege/write-content and (calendarCollection = 'true')">
3455           <a href="javascript:updateEventFormCalendar('{$calPath}','{$calDisplay}')">
3456             <strong>
3457               <xsl:value-of select="name"/>
3458             </strong>
3459           </a>
3460         </xsl:when>
3461         <xsl:otherwise>
3462           <xsl:value-of select="name"/>
3463         </xsl:otherwise>
3464       </xsl:choose>
3465       <xsl:if test="calendar">
3466         <ul>
3467           <xsl:apply-templates select="calendar" mode="selectCalForEventCalTree"/>
3468         </ul>
3469       </xsl:if>
3470     </li>
3471   </xsl:template>
3472
3473   <!--==== ACCESS CONTROL TEMPLATES ====-->
3474
3475   <!--<xsl:template match="eventAccess">
3476     <xsl:variable name="calPathEncoded" select="calendar/encodedPath"/>
3477     <xsl:variable name="calPath" select="calendar/path"/>
3478     <xsl:variable name="guid" select="guid"/>
3479     <xsl:variable name="recurrenceId" select="recurrenceId"/>
3480     <div id="bwEventTab-Access">
3481       <div id="sharingBox">
3482         <xsl:apply-templates select="access/acl" mode="currentAccess">
3483           <xsl:with-param name="action" select="$event-setAccess"/>
3484           <xsl:with-param name="calPathEncoded" select="$calPathEncoded"/>
3485           <xsl:with-param name="guid" select="$guid"/>
3486           <xsl:with-param name="recurrenceId" select="$recurrenceId"/>
3487         </xsl:apply-templates>
3488         <form name="eventShareForm" action="{$event-setAccess}" id="shareForm" onsubmit="setAccessHow(this)">
3489           <input type="hidden" name="calPath" value="{$calPath}"/>
3490           <input type="hidden" name="guid" value="{$guid}"/>
3491           <input type="hidden" name="recurid" value="{$recurrenceId}"/>
3492           <xsl:call-template name="entityAccessForm"/>
3493         </form>
3494       </div>
3495     </div>
3496   </xsl:template>-->
3497
3498   <xsl:template name="schedulingAccessForm">
3499     <xsl:param name="what"/>
3500     <input type="hidden" name="what">
3501       <xsl:attribute name="value"><xsl:value-of select="$what"/></xsl:attribute>
3502     </input>
3503     <p>
3504       <input type="text" name="who" width="40"/>
3505       <span class="nowrap"><input type="radio" name="whoType" value="user" checked="checked"/>user</span>
3506       <span class="nowrap"><input type="radio" name="whoType" value="group"/>group</span>
3507     </p>
3508     <p>
3509       <strong>or</strong>
3510       <span class="nowrap"><input type="radio" name="whoType" value="owner"/>owner</span>
3511       <span class="nowrap"><input type="radio" name="whoType" value="auth"/>authenticated users</span>
3512       <span class="nowrap"><input type="radio" name="whoType" value="other"/>anyone</span>
3513     </p>
3514
3515     <input type="hidden" name="how" value="S"/>
3516     <dl>
3517       <dt>
3518         <input type="checkbox" name="howSetter" value="S" checked="checked" onchange="toggleScheduleHow(this.form,this)"/>all scheduling
3519       </dt>
3520       <dd>
3521         <input type="checkbox" name="howSetter" value="t" checked="checked" disabled="disabled"/>scheduling requests<br/>
3522         <input type="checkbox" name="howSetter" value="y" checked="checked" disabled="disabled"/>scheduling replies<br/>
3523         <input type="checkbox" name="howSetter" value="s" checked="checked" disabled="disabled"/>free-busy requests
3524       </dd>
3525     </dl>
3526
3527     <input type="submit" name="modPrefs" value="Update"/>
3528     <input type="reset" value="Reset"/>
3529     <input type="submit" name="cancelled" value="cancel"/>
3530   </xsl:template>
3531
3532   <xsl:template name="entityAccessForm">
3533     <xsl:param name="type"/><!-- optional:
3534     currently used for inbox and outbox to conditionally
3535     display scheduling access -->
3536     <table cellpadding="0" id="shareFormTable" class="common">
3537       <tr>
3538         <th colspan="2" class="commonHeader">Add:</th>
3539       </tr>
3540       <tr>
3541         <td>
3542           <h5>Who:</h5>
3543           <div class="whoTypes">
3544             <input type="text" name="who" size="20"/><br/>
3545             <input type="radio" value="user" name="whoType" checked="checked"/> user
3546             <input type="radio" value="group" name="whoType"/> group
3547             <p>OR</p>
3548             <p>
3549               <input type="radio" value="auth" name="whoType"/> authenticated<br/>
3550               <input type="radio" value="other" name="whoType"/> other users
3551             </p>
3552           </div>
3553         </td>
3554         <td>
3555           <h5>
3556             <span id="accessRightsToggle">
3557               <xsl:choose>
3558                 <xsl:when test="/bedeworkadmin/appvar[key='accessRightsToggle']/value='advanced'">
3559                   <input type="radio" name="setappvar" value="accessRightsToggle(basic)" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/>basic
3560                   <input type="radio" name="setappvar" value="accessRightsToggle(advanced)" checked="checked" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/>advanced
3561                 </xsl:when>
3562                 <xsl:otherwise>
3563                   <input type="radio" name="setappvar" value="accessRightsToggle(basic)" checked="checked" onclick="changeClass('howList','visible');changeClass('howTable','invisible');"/>basic
3564                   <input type="radio" name="setappvar" value="accessRightsToggle(advanced)" onclick="changeClass('howList','invisible');changeClass('howTable','visible');"/>advanced
3565                 </xsl:otherwise>
3566               </xsl:choose>
3567             </span>
3568             Rights:
3569           </h5>
3570           <input type="hidden" name="how" value=""/>
3571           <!-- Advanced Access Rights: -->
3572           <!-- the "how" field is set by iterating over the howItems below -->
3573           <table id="howTable" class="invisible" cellspacing="0">
3574             <xsl:if test="/bedeworkadmin/appvar[key='accessRightsToggle']/value='advanced'">
3575               <xsl:attribute name="class">visible</xsl:attribute>
3576             </xsl:if>
3577             <tr>
3578               <th>access type</th>
3579               <th>allow</th>
3580               <th>deny</th>
3581             </tr>
3582             <tr>
3583               <td class="level1">
3584                 <input type="checkbox" value="A" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/>All
3585               </td>
3586               <td>
3587                 <input type="radio" value="A" name="A" checked="checked" disabled="disabled"/>
3588               </td>
3589               <td>
3590                 <input type="radio" value="-A" name="A" disabled="disabled"/>
3591               </td>
3592             </tr>
3593             <tr>
3594               <td class="level2">
3595                 <input type="checkbox" value="R" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)" checked="checked"/> Read
3596               </td>
3597               <td>
3598                 <input type="radio" value="R" name="R" checked="checked"/>
3599               </td>
3600               <td>
3601                 <input type="radio" value="-R" name="R"/>
3602               </td>
3603             </tr>
3604             <tr>
3605               <td class="level3">
3606                 <input type="checkbox" value="r" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read ACL
3607               </td>
3608               <td>
3609                 <input type="radio" value="r" name="r" checked="checked" disabled="disabled"/>
3610               </td>
3611               <td>
3612                 <input type="radio" value="-r" name="r" disabled="disabled"/>
3613               </td>
3614             </tr>
3615             <tr>
3616               <td class="level3">
3617                 <input type="checkbox" value="P" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read current user privilege set
3618               </td>
3619               <td>
3620                 <input type="radio" value="P" name="P" checked="checked" disabled="disabled"/>
3621               </td>
3622               <td>
3623                 <input type="radio" value="-P" name="P" disabled="disabled"/>
3624               </td>
3625             </tr>
3626             <tr>
3627               <td class="level3">
3628                 <input type="checkbox" value="F" name="howItem" disabled="disabled" onclick="toggleAllowDenyFlag(this, this.form)"/> read freebusy
3629               </td>
3630               <td>
3631                 <input type="radio" value="F" name="F" checked="checked" disabled="disabled"/>
3632               </td>
3633               <td>
3634                 <input type="radio" value="-F" name="F" disabled="disabled"/>
3635               </td>
3636             </tr>
3637             <tr>
3638               <td class="level2">
3639                 <input type="checkbox" value="W" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> Write
3640               </td>
3641               <td>
3642                 <input type="radio" value="W" name="W" checked="checked" disabled="disabled"/>
3643               </td>
3644               <td>
3645                 <input type="radio" value="-W" name="W" disabled="disabled"/>
3646               </td>
3647             </tr>
3648             <tr>
3649               <td class="level3">
3650                 <input type="checkbox" value="a" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write ACL
3651               </td>
3652               <td>
3653                 <input type="radio" value="a" name="a" checked="checked" disabled="disabled"/>
3654               </td>
3655               <td>
3656                 <input type="radio" value="-a" name="a" disabled="disabled"/>
3657               </td>
3658             </tr>
3659             <tr>
3660               <td class="level3">
3661                 <input type="checkbox" value="p" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write properties
3662               </td>
3663               <td>
3664                 <input type="radio" value="p" name="p" checked="checked" disabled="disabled"/>
3665               </td>
3666               <td>
3667                 <input type="radio" value="-p" name="p" disabled="disabled"/>
3668               </td>
3669             </tr>
3670             <tr>
3671               <td class="level3">
3672                 <input type="checkbox" value="c" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> write content
3673               </td>
3674               <td>
3675                 <input type="radio" value="c" name="c" checked="checked" disabled="disabled"/>
3676               </td>
3677               <td>
3678                 <input type="radio" value="-c" name="c" disabled="disabled"/>
3679               </td>
3680             </tr>
3681             <tr>
3682               <td class="level3">
3683                 <input type="checkbox" value="b" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> create (bind)
3684               </td>
3685               <td>
3686                 <input type="radio" value="b" name="b" checked="checked" disabled="disabled"/>
3687               </td>
3688               <td>
3689                 <input type="radio" value="-b" name="b" disabled="disabled"/>
3690               </td>
3691             </tr>
3692             <xsl:if test="$type = 'inbox' or $type = 'outbox'">
3693               <tr>
3694                 <td class="level4">
3695                   <input type="checkbox" value="S" name="howItem" onclick="setupAccessForm(this, this.form); toggleAllowDenyFlag(this, this.form)"/> schedule
3696                 </td>
3697               <td>
3698                 <input type="radio" value="S" name="S" checked="checked" disabled="disabled"/>
3699               </td>
3700               <td>
3701                 <input type="radio" value="-S" name="S" disabled="disabled"/>
3702               </td>
3703               </tr>
3704               <tr>
3705                 <td class="level5">
3706                   <input type="checkbox" value="t" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule request
3707                 </td>
3708               <td>
3709                 <input type="radio" value="t" name="t" checked="checked" disabled="disabled"/>
3710               </td>
3711               <td>
3712                 <input type="radio" value="-t" name="t" disabled="disabled"/>
3713               </td>
3714               </tr>
3715               <tr>
3716                 <td class="level5">
3717                   <input type="checkbox" value="y" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule reply
3718                 </td>
3719               <td>
3720                 <input type="radio" value="y" name="y" checked="checked" disabled="disabled"/>
3721               </td>
3722               <td>
3723                 <input type="radio" value="-y" name="y" disabled="disabled"/>
3724               </td>
3725               </tr>
3726               <tr>
3727                 <td class="level5">
3728                   <input type="checkbox" value="s" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> schedule free-busy
3729                 </td>
3730               <td>
3731                 <input type="radio" value="s" name="s" checked="checked" disabled="disabled"/>
3732               </td>
3733               <td>
3734                 <input type="radio" value="-s" name="s" disabled="disabled"/>
3735               </td>
3736               </tr>
3737             </xsl:if>
3738             <tr>
3739               <td class="level3">
3740                  <input type="checkbox" value="u" name="howItem" onclick="toggleAllowDenyFlag(this, this.form)"/> delete (unbind)
3741               </td>
3742               <td>
3743                 <input type="radio" value="u" name="u" checked="checked" disabled="disabled"/>
3744               </td>
3745               <td>
3746                 <input type="radio" value="-u" name="u" disabled="disabled"/>
3747               </td>
3748             </tr>
3749             <!--<tr>
3750               <td class="level1">
3751                 <input type="checkbox" value="N" name="howItem" onclick="setupAccessForm(this, this.form)"/> None
3752               </td>
3753               <td>
3754               </td>
3755               <td>
3756               </td>
3757             </tr>-->
3758           </table>
3759           <!-- Simple Access Rights: -->
3760           <!-- the "how" field is set by getting the selected basicHowItem -->
3761           <ul id="howList">
3762             <xsl:if test="/bedeworkadmin/appvar[key='accessRightsToggle']/value='advanced'">
3763               <xsl:attribute name="class">invisible</xsl:attribute>
3764             </xsl:if>
3765             <li>
3766               <input type="radio" value="A" name="basicHowItem"/>All
3767             </li>
3768             <li>
3769               <input type="radio" value="R" name="basicHowItem" checked="checked"/>Read only
3770             </li>
3771           </ul>
3772
3773           <!-- below is a simplified listing using radio buttons only; keep for
3774                those who would like something inbetween the advanced and simple
3775                interfaces -->
3776           <!--
3777           <ul id="howList">
3778             <li><input type="radio" value="A" name="how"/> <strong>All</strong> (read, write, delete)</li>
3779             <li class="padTop">
3780               <input type="radio" value="R" name="how" checked="checked"/> <strong>Read</strong> (content, access, freebusy)
3781             </li>
3782             <li>
3783               <input type="radio" value="F" name="how"/> Read freebusy only
3784             </li>
3785             <li class="padTop">
3786               <input type="radio" value="W" name="how"/> <strong>Write and delete</strong> (content, access, properties)
3787             </li>
3788             <li>
3789               <input type="radio" value="c" name="how"/> Write content only
3790             </li>
3791             <li>
3792              <input type="radio" value="u" name="how"/> Delete only
3793             </li>
3794             <li class="padTop">
3795               <input type="radio" value="Rc" name="how"/> <strong>Read</strong> and <strong>Write content only</strong>
3796             </li>
3797             <li class="padTop">
3798               <input type="radio" value="N" name="how"/> <strong>None</strong>
3799             </li>
3800           </ul> -->
3801         </td>
3802       </tr>
3803     </table>
3804     <input type="submit" name="submit" value="Submit"/>
3805   </xsl:template>
3806
3807   <xsl:template match="acl" mode="currentAccess">
3808     <xsl:param name="action"/> <!-- required -->
3809     <xsl:param name="calPathEncoded"/> <!-- optional (for entities) -->
3810     <xsl:param name="guid"/> <!-- optional (for entities) -->
3811     <xsl:param name="recurrenceId"/> <!-- optional (for entities) -->
3812     <xsl:param name="what"/> <!-- optional (for scheduling only) -->
3813     <h3>Current Access:</h3>
3814       <table class="common scheduling">
3815         <tr>
3816           <th>Entry</th>
3817           <th>Access</th>
3818           <th>Inherited from</th>
3819           <td></td>
3820         </tr>
3821         <xsl:for-each select="ace">
3822         <xsl:variable name="who">
3823           <xsl:choose>
3824             <xsl:when test="invert">
3825               <xsl:choose>
3826                 <xsl:when test="invert/principal/href"><xsl:value-of select="normalize-space(invert/principal/href)"/></xsl:when>
3827                 <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3828                 <xsl:otherwise><xsl:value-of select="name(invert/principal/*)"/></xsl:otherwise>
3829               </xsl:choose>
3830             </xsl:when>
3831             <xsl:otherwise>
3832               <xsl:choose>
3833                 <xsl:when test="principal/href"><xsl:value-of select="normalize-space(principal/href)"/></xsl:when>
3834                 <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3835                 <xsl:otherwise><xsl:value-of select="name(principal/*)"/></xsl:otherwise>
3836               </xsl:choose>
3837             </xsl:otherwise>
3838           </xsl:choose>
3839         </xsl:variable>
3840         <xsl:variable name="whoType">
3841           <xsl:choose>
3842             <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">user</xsl:when>
3843             <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">group</xsl:when>
3844             <xsl:when test="$who='authenticated'">auth</xsl:when>
3845             <xsl:when test="invert/principal/property/owner">other</xsl:when>
3846             <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
3847             <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
3848             <xsl:otherwise></xsl:otherwise>
3849           </xsl:choose>
3850         </xsl:variable>
3851         <xsl:variable name="shortWho">
3852           <xsl:choose>
3853             <xsl:when test="$whoType='user'"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/></xsl:when>
3854             <xsl:when test="$whoType='group'"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/></xsl:when>
3855             <xsl:otherwise></xsl:otherwise> <!-- if not user or group, send no who -->
3856           </xsl:choose>
3857         </xsl:variable>
3858         <tr>
3859           <td>
3860             <xsl:choose>
3861               <xsl:when test="$whoType = 'user' or ($who = 'owner' and $whoType != 'other')">
3862                 <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
3863               </xsl:when>
3864               <xsl:otherwise>
3865                 <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
3866               </xsl:otherwise>
3867             </xsl:choose>
3868             <xsl:text> </xsl:text>
3869             <xsl:choose>
3870               <xsl:when test="$whoType = 'other'">
3871                 anyone (other)
3872               </xsl:when>
3873               <xsl:when test="$shortWho != ''">
3874                 <xsl:value-of select="$shortWho"/>
3875               </xsl:when>
3876               <xsl:otherwise>
3877                 <xsl:value-of select="$who"/>
3878               </xsl:otherwise>
3879             </xsl:choose>
3880           </td>
3881           <td class="acls">
3882             <xsl:if test="grant">
3883               grant:
3884               <span class="grant">
3885                 <xsl:for-each select="grant/*">
3886                   <xsl:value-of select="name(.)"/>
3887                   <xsl:if test="position() != last()">, </xsl:if>
3888                 </xsl:for-each>
3889               </span><br/>
3890             </xsl:if>
3891             <xsl:if test="deny">
3892               deny:
3893               <span class="deny">
3894                 <xsl:for-each select="deny/*">
3895                   <xsl:value-of select="name(.)"/>
3896                   <xsl:if test="position() != last()">, </xsl:if>
3897                 </xsl:for-each>
3898               </span>
3899             </xsl:if>
3900           </td>
3901           <td>
3902             <xsl:choose>
3903               <xsl:when test="inherited">
3904                 <xsl:value-of select="inherited/href"/>
3905               </xsl:when>
3906               <xsl:otherwise>
3907                 local
3908               </xsl:otherwise>
3909             </xsl:choose>
3910           </td>
3911           <td>
3912             <xsl:if test="not(inherited)">
3913               <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">
3914                 <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="reset to default"/>
3915               </a>
3916             </xsl:if>
3917           </td>
3918         </tr>
3919       </xsl:for-each>
3920     </table>
3921   </xsl:template>
3922  
3923   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
3924   <xsl:template match="subscriptions">
3925     <table id="subsTable">
3926       <tr>
3927         <td class="cals">
3928           <h3>Public calendars</h3>
3929           <p class="smaller">
3930             Select a calendar below to add a <em><strong>new</strong>
3931             </em>
3932             internal subscription. <!-- or
3933             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
3934             subscribe to an external calendar</a>.-->
3935           </p>
3936           <ul id="calendarTree">
3937             <xsl:apply-templates select="/bedeworkadmin/subscriptions/subscribe/calendars/calendar" mode="subscribe"/>
3938           </ul>
3939         </td>
3940         <td class="subs">
3941           <xsl:choose>
3942             <xsl:when test="/bedeworkadmin/page='subscriptions'">
3943               <xsl:call-template name="subscriptionList"/>
3944             </xsl:when>
3945             <xsl:when test="/bedeworkadmin/creating='true'">
3946               <xsl:apply-templates select="subscription" mode="addSubscription"/>
3947             </xsl:when>
3948             <xsl:otherwise>
3949               <xsl:apply-templates select="subscription" mode="modSubscription"/>
3950             </xsl:otherwise>
3951           </xsl:choose>
3952         </td>
3953       </tr>
3954     </table>
3955   </xsl:template>
3956
3957   <xsl:template match="calendar" mode="subscribe">
3958     <xsl:variable name="calPath" select="encodedPath"/>
3959     <xsl:variable name="itemClass">
3960       <xsl:choose>
3961         <xsl:when test="calendarCollection='false'">folder</xsl:when>
3962         <xsl:otherwise>calendar</xsl:otherwise>
3963       </xsl:choose>
3964     </xsl:variable>
3965     <li class="{$itemClass}">
3966       <a href="{$subscriptions-initAdd}&amp;calPath={$calPath}">
3967         <xsl:value-of select="name"/>
3968       </a>
3969       <xsl:if test="calendar">
3970         <ul>
3971           <xsl:apply-templates select="calendar" mode="subscribe">
3972             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>--></xsl:apply-templates>
3973         </ul>
3974       </xsl:if>
3975     </li>
3976   </xsl:template>
3977
3978   <xsl:template match="subscription" mode="addSubscription">
3979     <h2>Add New Subscription</h2>
3980     <p class="note">*the subsciption name must be unique</p>
3981     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
3982       <table class="eventFormTable">
3983         <tr>
3984           <th>Name*:</th>
3985           <td>
3986             <xsl:variable name="subName" select="name"/>
3987             <input type="text" value="{$subName}" name="subscription.name" size="60"/>
3988           </td>
3989         </tr>
3990         <xsl:if test="internal='false'">
3991           <tr>
3992             <th>Uri:</th>
3993             <td>
3994               <xsl:variable name="subUri" select="uri"/>
3995               <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
3996             </td>
3997           </tr>
3998         </xsl:if>
3999         <tr>
4000           <th>Display:</th>
4001           <td>
4002             <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
4003             <input type="radio" value="false" name="subscription.display"/> no
4004           </td>
4005         </tr>
4006         <xsl:if test="/bedeworkadmin/userInfo/superUser='true'">
4007           <tr>
4008             <th>Unremovable:</th>
4009             <td>
4010               <input type="radio" value="true" name="unremoveable" size="60"/> true
4011               <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
4012             </td>
4013           </tr>
4014         </xsl:if>
4015         <tr>
4016           <th>Style:</th>
4017           <td>
4018             <xsl:variable name="subStyle" select="style"/>
4019             <input type="text" value="{$subStyle}" name="subscription.style" size="50"/>
4020             <div style="width: 400px">
4021               Enter a css class to style events rendered in the list and grid
4022               views.  Leave blank to render with the default colors, or select from
4023               one of the system-wide choices:
4024               <select name="bwColors" onchange="document.subscribeForm['subscription.style'].value = this.value">
4025                 <option value="">default</option>
4026                 <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
4027                   <xsl:variable name="subColor" select="."/>
4028                   <option value="{$subColor}" class="{$subColor}">
4029                     <xsl:value-of select="@name"/>
4030                   </option>
4031                 </xsl:for-each>
4032               </select>
4033               <p class="note">Note: This class is added alongside the default class used
4034               in the list and grid views.  It does not replace it, so create your
4035               style appropriately.</p>
4036             </div>
4037           </td>
4038         </tr>
4039       </table>
4040       <table border="0" id="submitTable">
4041         <tr>
4042           <td>
4043             <input type="submit" name="addSubscription" value="Add Subscription"/>
4044             <input type="submit" name="cancelled" value="Cancel"/>
4045             <input type="reset" value="Clear"/>
4046           </td>
4047         </tr>
4048       </table>
4049     </form>
4050   </xsl:template>
4051
4052   <xsl:template match="subscription" mode="modSubscription">
4053     <h2>Modify Subscription</h2>
4054     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
4055       <table class="eventFormTable">
4056         <tr>
4057           <th>Name*:</th>
4058           <td>
4059             <xsl:value-of select="name"/>
4060             <xsl:variable name="subName" select="name"/>
4061             <input type="hidden" value="{$subName}" name="name"/>
4062           </td>
4063         </tr>
4064         <xsl:choose>
4065           <xsl:when test="internal='false'">
4066             <tr>
4067               <th>Uri:</th>
4068               <td>
4069                 <xsl:variable name="subUri" select="uri"/>
4070                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
4071               </td>
4072             </tr>
4073           </xsl:when>
4074           <xsl:otherwise>
4075             <tr>
4076               <th>Uri:</th>
4077               <td>
4078                 <xsl:value-of select="uri"/>
4079               </td>
4080             </tr>
4081           </xsl:otherwise>
4082         </xsl:choose>
4083         <tr>
4084           <th>Display:</th>
4085           <td>
4086             <xsl:choose>
4087               <xsl:when test="display='true'">
4088                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
4089                 <input type="radio" value="false" name="subscription.display"/> no
4090               </xsl:when>
4091               <xsl:otherwise>
4092                 <input type="radio" value="true" name="subscription.display"/> yes
4093                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
4094               </xsl:otherwise>
4095             </xsl:choose>
4096           </td>
4097         </tr>
4098         <xsl:if test="/bedeworkadmin/userInfo/superUser='true'">
4099           <tr>
4100             <th>Unremovable:</th>
4101             <td>
4102               <xsl:choose>
4103                 <xsl:when test="unremoveable='true'">
4104                   <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
4105                   <input type="radio" value="false" name="unremoveable" size="60"/> false
4106                 </xsl:when>
4107                 <xsl:otherwise>
4108                   <input type="radio" value="true" name="unremoveable" size="60"/> true
4109                   <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
4110                 </xsl:otherwise>
4111               </xsl:choose>
4112             </td>
4113           </tr>
4114         </xsl:if>
4115         <tr>
4116           <th>Style:</th>
4117           <td>
4118             <xsl:variable name="subStyle" select="style"/>
4119             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
4120             <div style="width: 400px">
4121               Enter a css class to style events rendered in the list and grid
4122               views.  Leave blank to render with the default colors, or select from
4123               one of the system-wide choices:
4124               <select name="bwColors" onchange="document.subscribeForm['subscription.style'].value = this.value">
4125                 <option value="">default</option>
4126                 <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
4127                   <xsl:variable name="subColor" select="."/>
4128                   <option value="{$subColor}" class="{$subColor}">
4129                     <xsl:value-of select="@name"/>
4130                   </option>
4131                 </xsl:for-each>
4132               </select>
4133               <p class="note">Note: This class is added alongside the default class used
4134               in the list and grid views.  It does not replace it, so create your
4135               style appropriately.</p>
4136             </div>
4137           </td>
4138         </tr>
4139       </table>
4140       <table border="0" id="submitTable">
4141         <tr>
4142           <td>
4143             <input type="submit" name="updateSubscription" value="Update Subscription"/>
4144             <input type="submit" name="cancelled" value="Cancel"/>
4145             <input type="reset" value="Reset"/>
4146           </td>
4147           <td align="right">
4148             <input type="submit" name="delete" value="Delete Subscription"/>
4149           </td>
4150         </tr>
4151       </table>
4152     </form>
4153   </xsl:template>
4154
4155   <xsl:template name="subscriptionList">
4156     <h3>Current subscriptions</h3>
4157     <table id="commonListTable">
4158       <tr>
4159         <th>Name</th>
4160         <th>URI</th>
4161         <th>Style</th>
4162         <th>Display</th>
4163         <th>Unremovable</th>
4164         <th>External</th>
4165         <th>Deleted?</th>
4166       </tr>
4167       <xsl:for-each select="subscription">
4168         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4169         <tr>
4170           <td>
4171             <xsl:variable name="subname" select="name"/>
4172             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
4173               <xsl:value-of select="name"/>
4174             </a>
4175           </td>
4176           <td>
4177             <xsl:value-of select="uri"/>
4178           </td>
4179           <td>
4180             <xsl:value-of select="style"/>
4181           </td>
4182           <td class="center">
4183             <xsl:if test="display='true'">
4184               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4185             </xsl:if>
4186           </td>
4187           <td class="center">
4188             <xsl:if test="unremoveable='true'">
4189               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4190             </xsl:if>
4191           </td>
4192           <td class="center">
4193             <xsl:if test="internal='false'">
4194               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4195             </xsl:if>
4196           </td>
4197           <td class="center">
4198             <xsl:if test="calendarDeleted='true'">
4199               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
4200             </xsl:if>
4201           </td>
4202         </tr>
4203       </xsl:for-each>
4204     </table>
4205     <!--<h4><a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>-->
4206   </xsl:template>
4207
4208   <!--+++++++++++++++ Views ++++++++++++++++++++-->
4209   <xsl:template match="views" mode="viewList">
4210
4211     <h3>Add a new view</h3>
4212     <form name="addView" action="{$view-addView}" method="post">
4213       <input type="text" name="name" size="60"/>
4214       <input type="submit" value="add view" name="addview"/>
4215     </form>
4216
4217     <h3>Views</h3>
4218     <table id="commonListTable">
4219       <tr>
4220         <th>Name</th>
4221         <th>Included subscriptions</th>
4222       </tr>
4223
4224       <xsl:for-each select="view">
4225         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4226         <tr>
4227           <td>
4228             <xsl:variable name="viewName" select="name"/>
4229             <a href="{$view-fetchForUpdate}&amp;name={$viewName}">
4230               <xsl:value-of select="name"/>
4231             </a>
4232           </td>
4233           <td>
4234             <xsl:for-each select="subscriptions/subscription">
4235               <xsl:value-of select="name"/>
4236               <xsl:if test="position()!=last()">, </xsl:if>
4237             </xsl:for-each>
4238           </td>
4239         </tr>
4240       </xsl:for-each>
4241     </table>
4242   </xsl:template>
4243
4244   <xsl:template name="modView">
4245     <h2>Update View</h2>
4246     <xsl:variable name="viewName" select="/bedeworkadmin/views/view/name"/>
4247     <h3 class="viewName">
4248       <xsl:value-of select="$viewName"/>
4249     </h3>
4250     <table id="viewsTable">
4251       <tr>
4252         <td class="subs">
4253           <h3>Available Subscriptions:</h3>
4254
4255           <table class="subscriptionsListSubs">
4256             <xsl:for-each select="/bedeworkadmin/subscriptions/subscription">
4257               <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4258               <xsl:if test="not(/bedeworkadmin/views/view/subscriptions/subscription/name=name)">
4259                 <tr>
4260                   <td>
4261                     <xsl:value-of select="name"/>
4262                   </td>
4263                   <td class="arrows">
4264                     <xsl:variable name="subAddName" select="name"/>
4265                     <a href="{$view-update}&amp;name={$viewName}&amp;add={$subAddName}">
4266                       <img src="{$resourcesRoot}/resources/arrowRight.gif"
4267                           width="13" height="13" border="0"
4268                           alt="add subscription"/>
4269                     </a>
4270                   </td>
4271                 </tr>
4272               </xsl:if>
4273             </xsl:for-each>
4274           </table>
4275         </td>
4276         <td class="view">
4277           <h3>Active Subscriptions:</h3>
4278           <table class="subscriptionsListView">
4279             <xsl:for-each select="/bedeworkadmin/views/view/subscriptions/subscription">
4280               <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
4281               <tr>
4282                 <td class="arrows">
4283                   <xsl:variable name="subRemoveName" select="name"/>
4284                   <a href="{$view-update}&amp;name={$viewName}&amp;remove={$subRemoveName}">
4285                     <img src="{$resourcesRoot}/resources/arrowLeft.gif"
4286                         width="13" height="13" border="0"
4287                         alt="add subscription"/>
4288                   </a>
4289                 </td>
4290                 <td>
4291                   <xsl:value-of select="name"/>
4292                 </td>
4293               </tr>
4294             </xsl:for-each>
4295           </table>
4296         </td>
4297       </tr>
4298     </table>
4299     <table border="0" id="submitTable">
4300       <tr>
4301         <td>
4302           <input type="button" name="return" value="Return to Views Listing" onclick="javascript:location.replace('{$view-fetch}')"/>
4303         </td>
4304         <td align="right">
4305           <form name="deleteViewForm" action="{$view-fetchForUpdate}" method="post">
4306             <input type="submit" name="deleteButton" value="Delete View"/>
4307             <input type="hidden" name="name" value="{$viewName}"/>
4308             <input type="hidden" name="delete" value="yes"/>
4309           </form>
4310         </td>
4311       </tr>
4312     </table>
4313   </xsl:template>
4314
4315   <xsl:template name="deleteViewConfirm">
4316     <h2>Remove View?</h2>
4317
4318     <xsl:variable name="viewName" select="/bedeworkadmin/views/view/name"/>
4319     <p>The following view will be removed. Continue?</p>
4320
4321     <h3 class="viewName">
4322       <xsl:value-of select="$viewName"/>
4323     </h3>
4324     <form name="removeView" action="{$view-remove}">
4325       <input type="hidden" name="name" value="{$viewName}"/>
4326       <input type="submit" name="delete" value="Yes: Remove View"/>
4327       <input type="submit" name="cancelled" value="No: Cancel"/>
4328     </form>
4329
4330   </xsl:template>
4331
4332   <!--==== UPLOAD ====-->
4333   <xsl:template name="upload">
4334   <!-- The name "eventForm" is referenced by several javascript functions. Do not
4335     change it without modifying includes.js -->
4336     <form name="eventForm" method="post" action="{$event-upload}" id="standardForm" enctype="multipart/form-data">
4337       <h2>Upload iCAL File</h2>
4338       <table class="common" cellspacing="0">
4339         <tr>
4340           <td class="fieldname">
4341             Filename:
4342           </td>
4343           <td align="left">
4344             <input type="file" name="uploadFile" size="60" />
4345           </td>
4346         </tr>
4347         <tr>
4348           <td class="fieldname padMeTop">
4349             Into calendar:
4350           </td>
4351           <td align="left" class="padMeTop">
4352             <input type="hidden" name="newCalPath" value=""/>
4353             <span id="bwEventCalDisplay">
4354               <em>none selected</em>
4355             </span>
4356             <xsl:text> </xsl:text>
4357             [<a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">change</a>]
4358           </td>
4359         </tr>
4360         <!--<tr>
4361           <td class="fieldname padMeTop">
4362             Effects free/busy:
4363           </td>
4364           <td align="left" class="padMeTop">
4365             <input type="radio" value="" name="transparency" checked="checked"/> accept event's settings<br/>
4366             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
4367             <input type="radio" value="TRANSPARENT" name="transparency"/> no <span class="note">(transparent: event status does not affect your free/busy)</span><br/>
4368           </td>
4369         </tr>-->
4370         <tr>
4371           <td class="fieldname padMeTop">
4372             Status:
4373           </td>
4374           <td align="left" class="padMeTop">
4375             <input type="radio" value="" name="status" checked="checked"/> accept event's status<br/>
4376             <input type="radio" value="CONFIRMED" name="status"/> confirmed<br/>
4377             <input type="radio" value="TENTATIVE" name="status"/> tentative<br/>
4378             <input type="radio" value="CANCELLED" name="status"/> cancelled<br/>
4379           </td>
4380         </tr>
4381       </table>
4382       <table border="0" id="submitTable">
4383         <tr>
4384           <td>
4385             <input name="submit" type="submit" value="Continue"/>
4386             <input name="cancelled" type="submit" value="Cancel"/>
4387           </td>
4388         </tr>
4389       </table>
4390     </form>
4391   </xsl:template>
4392
4393   <!--+++++++++++++++ System Parameters (preferences) ++++++++++++++++++++-->
4394   <xsl:template name="modSyspars">
4395     <h2>Modify System Preferences/Parameters</h2>
4396     <p>
4397       Do not change unless you know what you're doing.<br/>
4398       Changes to these parameters have wide impact on the system.
4399     </p>
4400     <form name="systemParamsForm" action="{$system-update}" method="post">
4401       <table class="eventFormTable params">
4402         <tr>
4403           <th>System name:</th>
4404           <td>
4405             <xsl:variable name="sysname" select="/bedeworkadmin/system/name"/>
4406             <xsl:value-of select="$sysname"/>
4407             <div class="desc">
4408               Name for this system. Cannot be changed.
4409             </div>
4410           </td>
4411         </tr>
4412         <tr>
4413           <th>Default timezone:</th>
4414           <td>
4415             <xsl:variable name="tzid" select="/bedeworkadmin/system/tzid"/>
4416
4417             <select name="tzid">
4418               <option value="-1">select timezone...</option>
4419               <xsl:for-each select="/bedeworkadmin/timezones/timezone">
4420                 <option>
4421                   <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
4422                   <xsl:if test="/bedeworkadmin/system/tzid = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
4423                   <xsl:value-of select="name"/>
4424                 </option>
4425               </xsl:for-each>
4426             </select>
4427
4428             <div class="desc">
4429               Default timezone id for date/time values. This should normally be your local timezone.
4430             </div>
4431           </td>
4432         </tr>
4433         <!--<tr>
4434           <th>12 or 24 hour clock/time:</th>
4435           <td>
4436             <select name="">
4437               <option value="-1">select preference...</option>
4438               <option value="true">
4439                 <xsl:if test="/bedeworkadmin/system/NEEDPARAM = 'true'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
4440                 Use 24 hour clock/time
4441               </option>
4442               <option value="false">
4443                 <xsl:if test="/bedeworkadmin/system/NEEDPARAM = 'false'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
4444                 Use 12 Hour clock/time + am/pm
4445               </option>
4446             </select>
4447             <div class="desc">
4448               Affects the time fields when adding and editing events
4449             </div>
4450           </td>
4451         </tr>-->
4452         <tr>
4453           <th>System id:</th>
4454           <td>
4455             <xsl:variable name="systemid" select="/bedeworkadmin/system/systemid"/>
4456             <xsl:value-of select="$systemid"/>
4457             <div class="desc">
4458               System id used when building uids and identifying users. Should not be changed.
4459             </div>
4460           </td>
4461         </tr>
4462         <tr>
4463           <th>Principal Root:</th>
4464           <td>
4465             <xsl:variable name="proot" select="/bedeworkadmin/system/principalRoot"/>
4466             <input value="{$proot}" name="principalRoot" size="0"/>
4467             <div class="desc">
4468               Used in WebDAV and CalDAV access to define root of user and group principal trees.
4469             </div>
4470           </td>
4471         </tr>
4472         <tr>
4473           <th>User Principal Root:</th>
4474           <td>
4475             <xsl:variable name="uproot" select="/bedeworkadmin/system/userPrincipalRoot"/>
4476             <input value="{$uproot}" name="userPrincipalRoot" size="0"/>
4477             <div class="desc">
4478               Used in WebDAV and CalDAV access to define root of user principal subtree.
4479             </div>
4480           </td>
4481         </tr>
4482         <tr>
4483           <th>Group Principal Root:</th>
4484           <td>
4485             <xsl:variable name="gproot" select="/bedeworkadmin/system/groupPrincipalRoot"/>
4486             <input value="{$gproot}" name="groupPrincipalRoot" size="0"/>
4487             <div class="desc">
4488               Used in WebDAV and CalDAV access to define root of group principal subtree.
4489             </div>
4490           </td>
4491         </tr>
4492         <tr>
4493           <th>Public Calendar Root:</th>
4494           <td>
4495             <xsl:variable name="publicCalendarRoot" select="/bedeworkadmin/system/publicCalendarRoot"/>
4496             <xsl:value-of select="$publicCalendarRoot"/>
4497             <div class="desc">
4498               Name for public calendars root directory. Should not be changed.
4499             </div>
4500           </td>
4501         </tr>
4502         <tr>
4503           <th>User Calendar Root:</th>
4504           <td>
4505             <xsl:variable name="userCalendarRoot" select="/bedeworkadmin/system/userCalendarRoot"/>
4506             <xsl:value-of select="$userCalendarRoot"/>
4507             <div class="desc">
4508               Name for user calendars root directory. Should not be changed.
4509             </div>
4510           </td>
4511         </tr>
4512         <tr>
4513           <th>User Calendar Default name:</th>
4514           <td>
4515             <xsl:variable name="userDefaultCalendar" select="/bedeworkadmin/system/userDefaultCalendar"/>
4516             <input value="{$userDefaultCalendar}" name="userDefaultCalendar" />
4517             <div class="desc">
4518               Default name for user calendar. Used when initialising user. Possibly can be changed.
4519             </div>
4520           </td>
4521         </tr>
4522         <tr>
4523           <th>Trash Calendar Default name:</th>
4524           <td>
4525             <xsl:variable name="defaultTrashCalendar" select="/bedeworkadmin/system/defaultTrashCalendar"/>
4526             <input value="{$defaultTrashCalendar}" name="defaultTrashCalendar" />
4527             <div class="desc">
4528               Default name for user trash calendar. Used when initialising user. Possibly can be changed.
4529             </div>
4530           </td>
4531         </tr>
4532         <tr>
4533           <th>User Inbox Default name:</th>
4534           <td>
4535             <xsl:variable name="userInbox" select="/bedeworkadmin/system/userInbox"/>
4536             <input value="{$userInbox}" name="userInbox" />
4537             <div class="desc">
4538               Default name for user inbox. Used when initialising user. Possibly can be changed.
4539             </div>
4540           </td>
4541         </tr>
4542         <tr>
4543           <th>User Outbox Default name:</th>
4544           <td>
4545             <xsl:variable name="userOutbox" select="/bedeworkadmin/system/userOutbox"/>
4546             <input value="{$userOutbox}" name="userOutbox" />
4547             <div class="desc">
4548               Default name for user outbox. Used when initialising user. Possibly can be changed.
4549             </div>
4550           </td>
4551         </tr>
4552         <tr>
4553           <th>User Deleted Calendar Default name:</th>
4554           <td>
4555             <xsl:variable name="deletedCalendar" select="/bedeworkadmin/system/deletedCalendar"/>
4556             <input value="{$deletedCalendar}" name="deletedCalendar" />
4557             <div class="desc">
4558               Default name for user calendar used to hold deleted items. Used when initialising user. Possibly can be changed.
4559             </div>
4560           </td>
4561         </tr>
4562         <tr>
4563           <th>User Busy Calendar Default name:</th>
4564           <td>
4565             <xsl:variable name="busyCalendar" select="/bedeworkadmin/system/busyCalendar"/>
4566             <input value="{$busyCalendar}" name="busyCalendar" />
4567             <div class="desc">
4568               Default name for user busy time calendar. Used when initialising user. Possibly can be changed.
4569             </div>
4570           </td>
4571         </tr>
4572         <tr>
4573           <th>Default user view name:</th>
4574           <td>
4575             <xsl:variable name="defaultViewName" select="/bedeworkadmin/system/defaultUserViewName"/>
4576             <input value="{$defaultViewName}" name="defaultUserViewName" />
4577             <div class="desc">
4578               Name used for default view created when a new user is added
4579             </div>
4580           </td>
4581         </tr>
4582         <tr>
4583           <th>Http connections per user:</th>
4584           <td>
4585             <xsl:variable name="httpPerUser" select="/bedeworkadmin/system/httpConnectionsPerUser"/>
4586             <input value="{$httpPerUser}" name="httpConnectionsPerUser" />
4587             <div class="desc">
4588             </div>
4589           </td>
4590         </tr>
4591         <tr>
4592           <th>Http connections per host:</th>
4593           <td>
4594             <xsl:variable name="httpPerHost" select="/bedeworkadmin/system/httpConnectionsPerHost"/>
4595             <input value="{$httpPerHost}" name="httpConnectionsPerHost" />
4596             <div class="desc">
4597             </div>
4598           </td>
4599         </tr>
4600         <tr>
4601           <th>Total http connections:</th>
4602           <td>
4603             <xsl:variable name="httpTotal" select="/bedeworkadmin/system/httpConnections"/>
4604             <input value="{$httpTotal}" name="httpConnections" />
4605             <div class="desc">
4606             </div>
4607           </td>
4608         </tr>
4609         <tr>
4610           <th>Maximum length of public event description:</th>
4611           <td>
4612             <xsl:variable name="maxPublicDescriptionLength" select="/bedeworkadmin/system/maxPublicDescriptionLength"/>
4613             <input value="{$maxPublicDescriptionLength}" name="maxPublicDescriptionLength" />
4614             <div class="desc">
4615             </div>
4616           </td>
4617         </tr>
4618         <tr>
4619           <th>Maximum length of user event description:</th>
4620           <td>
4621             <xsl:variable name="maxUserDescriptionLength" select="/bedeworkadmin/system/maxUserDescriptionLength"/>
4622             <input value="{$maxUserDescriptionLength}" name="maxUserDescriptionLength" />
4623             <div class="desc">
4624             </div>
4625           </td>
4626         </tr>
4627         <tr>
4628           <th>Maximum size of a user entity:</th>
4629           <td>
4630             <xsl:variable name="maxUserEntitySize" select="/bedeworkadmin/system/maxUserEntitySize"/>
4631             <input value="{$maxUserEntitySize}" name="maxUserEntitySize" />
4632             <div class="desc">
4633             </div>
4634           </td>
4635         </tr>
4636         <tr>
4637           <th>Default user quota:</th>
4638           <td>
4639             <xsl:variable name="defaultUserQuota" select="/bedeworkadmin/system/defaultUserQuota"/>
4640             <input value="{$defaultUserQuota}" name="defaultUserQuota" />
4641             <div class="desc">
4642             </div>
4643           </td>
4644         </tr>
4645         <tr>
4646           <th>Max recurring instances:</th>
4647           <td>
4648             <xsl:variable name="maxInstances" select="/bedeworkadmin/system/maxInstances"/>
4649             <input value="{$maxInstances}" name="maxInstances" />
4650             <div class="desc">
4651               Used to limit recurring events to reasonable numbers of instances.
4652             </div>
4653           </td>
4654         </tr>
4655         <tr>
4656           <th>Max recurring years:</th>
4657           <td>
4658             <xsl:variable name="maxYears" select="/bedeworkadmin/system/maxYears"/>
4659             <input value="{$maxYears}" name="maxYears" />
4660             <div class="desc">
4661               Used to limit recurring events to reasonable period of time.
4662             </div>
4663           </td>
4664         </tr>
4665         <tr>
4666           <th>User authorisation class:</th>
4667           <td>
4668             <xsl:variable name="userauthClass" select="/bedeworkadmin/system/userauthClass"/>
4669             <input value="{$userauthClass}" name="userauthClass" class="wide"/>
4670             <div class="desc">
4671               Class used to determine authorisation (not authentication) for
4672               administrative users. Should probably only be changed on rebuild.
4673             </div>
4674           </td>
4675         </tr>
4676         <tr>
4677           <th>Mailer class:</th>
4678           <td>
4679             <xsl:variable name="mailerClass" select="/bedeworkadmin/system/mailerClass"/>
4680             <input value="{$mailerClass}" name="mailerClass" class="wide"/>
4681             <div class="desc">
4682               Class used to mail events. Should probably only be changed on rebuild.
4683             </div>
4684           </td>
4685         </tr>
4686         <tr>
4687           <th>Admin groups class:</th>
4688           <td>
4689             <xsl:variable name="admingroupsClass" select="/bedeworkadmin/system/admingroupsClass"/>
4690             <input value="{$admingroupsClass}" name="admingroupsClass" class="wide"/>
4691             <div class="desc">
4692               Class used to query and maintain groups for
4693               administrative users. Should probably only be changed on rebuild.
4694             </div>
4695           </td>
4696         </tr>
4697         <tr>
4698           <th>User groups class:</th>
4699           <td>
4700             <xsl:variable name="usergroupsClass" select="/bedeworkadmin/system/usergroupsClass"/>
4701             <input value="{$usergroupsClass}" name="usergroupsClass" class="wide"/>
4702             <div class="desc">
4703               Class used to query and maintain groups for
4704               non-administrative users. Should probably only be changed on rebuild.
4705             </div>
4706           </td>
4707         </tr>
4708         <tr>
4709           <th>Directory browsing disallowed:</th>
4710           <td>
4711             <xsl:variable name="directoryBrowsingDisallowed" select="/bedeworkadmin/system/directoryBrowsingDisallowed"/>
4712             <input value="{$directoryBrowsingDisallowed}" name="directoryBrowsingDisallowed" />
4713             <div class="desc">
4714               True if the server hosting the xsl disallows directory browsing.
4715             </div>
4716           </td>
4717         </tr>
4718         <tr>
4719           <th>Index root:</th>
4720           <td>
4721             <xsl:variable name="indexRoot" select="/bedeworkadmin/system/indexRoot"/>
4722             <input value="{$indexRoot}" name="indexRoot" class="wide"/>
4723             <div class="desc">
4724               Root for the event indexes. Should only be changed if the indexes are moved/copied
4725             </div>
4726           </td>
4727         </tr>
4728       </table>
4729       <table border="0" id="submitTable">
4730         <tr>
4731           <td>
4732             <input type="submit" name="updateSystemParams" value="Update"/>
4733             <input type="submit" name="cancelled" value="Cancel"/>
4734             <input type="reset" value="Reset"/>
4735           </td>
4736         </tr>
4737       </table>
4738     </form>
4739   </xsl:template>
4740
4741   <!--+++++++++++++++ Calendar Suites (calsuite) ++++++++++++++++++++-->
4742   <xsl:template match="calSuites" mode="calSuiteList">
4743     <h2>Manage Calendar Suites</h2>
4744
4745     <h4>Calendar suites:</h4>
4746     <p>
4747       <input type="button" name="return" value="Add calendar suite" onclick="javascript:location.replace('{$calsuite-showAddForm}')"/>
4748     </p>
4749
4750     <ul>
4751       <xsl:for-each select="calSuite">
4752         <li>
4753           <xsl:variable name="name" select="name"/>
4754           <a href="{$calsuite-fetchForUpdate}&amp;name={$name}">
4755             <xsl:value-of select="name"/>
4756           </a>
4757         </li>
4758       </xsl:for-each>
4759     </ul>
4760
4761   </xsl:template>
4762
4763   <xsl:template name="addCalSuite">
4764     <h2>Add Calendar Suite</h2>
4765     <form name="calSuiteForm" action="{$calsuite-add}" method="post">
4766       <table class="eventFormTable">
4767         <tr>
4768           <th>Name:</th>
4769           <td>
4770             <input name="name" size="20"/>
4771           </td>
4772           <td>
4773             Name of your calendar suite
4774           </td>
4775         </tr>
4776         <tr>
4777           <th>Group:</th>
4778           <td>
4779             <input name="groupName" size="20"/>
4780           </td>
4781           <td>
4782             Name of admin group which contains event administrators and event owner to which preferences for the suite are attached
4783           </td>
4784         </tr>
4785         <tr>
4786           <th>Root calendar:</th>
4787           <td>
4788             <input name="calPath" size="20"/>
4789           </td>
4790           <td>
4791             Path of root calendar (not required if suite only consists of subscriptions and views)
4792           </td>
4793         </tr>
4794       </table>
4795       <table border="0" id="submitTable">
4796         <tr>
4797           <td>
4798             <input type="submit" name="updateCalSuite" value="Add"/>
4799             <input type="submit" name="cancelled" value="Cancel"/>
4800             <input type="reset" value="Reset"/>
4801           </td>
4802         </tr>
4803       </table>
4804     </form>
4805   </xsl:template>
4806
4807   <xsl:template match="calSuite" name="modCalSuite">
4808     <h2>Modify Calendar Suite</h2>
4809     <xsl:variable name="calSuiteName" select="name"/>
4810     <form name="calSuiteForm" action="{$calsuite-update}" method="post">
4811       <table class="eventFormTable">
4812         <tr>
4813           <th>Name:</th>
4814           <td>
4815             <input name="name" value="{$calSuiteName}" size="20"/>
4816           </td>
4817           <td>
4818             Name of your calendar suite
4819           </td>
4820         </tr>
4821         <tr>
4822           <th>Group:</th>
4823           <td>
4824             <xsl:variable name="group" select="group"/>
4825             <input name="groupName" value="{$group}" size="20"/>
4826           </td>
4827           <td>
4828             Name of admin group which contains event administrators and event owner to which preferences for the suite are attached
4829           </td>
4830         </tr>
4831         <tr>
4832           <th>Root calendar:</th>
4833           <td>
4834             <xsl:variable name="calPath" select="calPath"/>
4835             <input name="calPath" value="{$calPath}" size="20"/>
4836           </td>
4837           <td>
4838             Path of root calendar (not required if suite only consists of subscriptions and views)
4839           </td>
4840         </tr>
4841       </table>
4842       <table border="0" id="submitTable">
4843         <tr>
4844           <td>
4845             <input type="submit" name="updateCalSuite" value="Update"/>
4846             <input type="submit" name="cancelled" value="Cancel"/>
4847             <input type="reset" value="Reset"/>
4848           </td>
4849         </tr>
4850       </table>
4851     </form>
4852     <!--<div id="sharingBox">
4853       <h3>Manage suite administrators</h3>
4854       <table class="common">
4855         <tr>
4856           <th class="commonHeader" colspan="2">Current access:</th>
4857         </tr>
4858
4859         <xsl:for-each select="acl/ace">
4860           <tr>
4861             <th class="thin">
4862               <xsl:choose>
4863                 <xsl:when test="invert">
4864                   <em>Deny to
4865                   <xsl:choose>
4866                     <xsl:when test="invert/principal/href">
4867                       <xsl:value-of select="invert/principal/href"/>
4868                       </xsl:when>
4869                       <xsl:when test="invert/principal/property">
4870                         <xsl:value-of select="name(invert/principal/property/*)"/>
4871                       </xsl:when>
4872                       <xsl:otherwise>
4873                         <xsl:value-of select="name(invert/principal/*)"/>
4874                       </xsl:otherwise>
4875                     </xsl:choose>
4876                   </em>
4877                 </xsl:when>
4878                 <xsl:otherwise>
4879                   <xsl:choose>
4880                     <xsl:when test="principal/href">
4881                       <xsl:value-of select="principal/href"/>
4882                     </xsl:when>
4883                     <xsl:when test="principal/property">
4884                       <xsl:value-of select="name(principal/property/*)"/>
4885                     </xsl:when>
4886                     <xsl:otherwise>
4887                       <xsl:value-of select="name(principal/*)"/>
4888                     </xsl:otherwise>
4889                   </xsl:choose>
4890                 </xsl:otherwise>
4891               </xsl:choose>
4892             </th>
4893             <td>
4894               <xsl:for-each select="grant/node()">
4895                 <xsl:value-of select="name(.)"/>&#160;&#160;
4896               </xsl:for-each>
4897             </td>
4898           </tr>
4899         </xsl:for-each>
4900       </table>
4901       <form name="calsuiteShareForm" action="{$calsuite-setAccess}" id="shareForm" method="post">
4902         <input type="hidden" name="calSuiteName" value="{$calSuiteName}"/>
4903         <input type="hidden" name="how" value="RW" />
4904         <p>
4905           Add administrator:<br/>
4906           <input type="text" name="who" size="20"/>
4907           <input type="radio" value="user" name="whoType" checked="checked"/> user
4908           <input type="radio" value="group" name="whoType"/> group
4909         </p>
4910         <input type="submit" name="submit" value="Submit"/>
4911       </form>
4912     </div>-->
4913
4914     <div id="sharingBox">
4915       <xsl:variable name="calPath" select="path"/>
4916       <xsl:variable name="encodedCalPath" select="encodedPath"/>
4917       <xsl:if test="currentAccess/current-user-privilege-set/privilege/read-acl or /bedeworkadmin/userInfo/superUser='true'">
4918         <h3>Manage suite administrators</h3>
4919         <table class="common" id="sharing">
4920           <tr>
4921             <th class="commonHeader">Who:</th>
4922             <th class="commonHeader">Current access:</th>
4923             <th class="commonHeader">Source:</th>
4924           </tr>
4925           <xsl:for-each select="acl/ace">
4926             <xsl:variable name="who">
4927               <xsl:choose>
4928                 <xsl:when test="invert">
4929                   <xsl:choose>
4930                     <xsl:when test="invert/principal/href"><xsl:value-of select="normalize-space(invert/principal/href)"/></xsl:when>
4931                     <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
4932                     <xsl:otherwise><xsl:value-of select="name(invert/principal/*)"/></xsl:otherwise>
4933                   </xsl:choose>
4934                 </xsl:when>
4935                 <xsl:otherwise>
4936                   <xsl:choose>
4937                     <xsl:when test="principal/href"><xsl:value-of select="normalize-space(principal/href)"/></xsl:when>
4938                     <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
4939                     <xsl:otherwise><xsl:value-of select="name(principal/*)"/></xsl:otherwise>
4940                   </xsl:choose>
4941                 </xsl:otherwise>
4942               </xsl:choose>
4943             </xsl:variable>
4944             <tr>
4945             <th class="thin">
4946                 <xsl:if test="invert">
4947                   Not
4948                 </xsl:if>
4949                 <xsl:choose>
4950                   <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">
4951                     <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
4952                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/>
4953                   </xsl:when>
4954                   <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">
4955                     <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
4956                     <xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/>
4957                   </xsl:when>
4958                   <xsl:when test="invert and $who='owner'">
4959                     <xsl:value-of select="$who"/> (other)
4960                   </xsl:when>
4961                   <xsl:otherwise>
4962                     <xsl:value-of select="$who"/>
4963                   </xsl:otherwise>
4964                 </xsl:choose>
4965               </th>
4966               <td>
4967                 <xsl:for-each select="grant/node()">
4968                   <xsl:value-of select="name(.)"/>&#160;&#160;
4969                 </xsl:for-each>
4970                 <xsl:for-each select="deny/node()">
4971                   <xsl:choose>
4972                     <xsl:when test="name(.)='all'">
4973                       none
4974                     </xsl:when>
4975                     <xsl:otherwise>
4976                       deny-<xsl:value-of select="name(.)"/>
4977                     </xsl:otherwise>
4978                   </xsl:choose>
4979                   &#160;&#160;
4980                 </xsl:for-each>
4981               </td>
4982               <td>
4983                 <xsl:choose>
4984                   <xsl:when test="inherited">
4985                     inherited from:
4986                     <a>
4987                       <xsl:attribute name="href"><xsl:value-of select="$calendar-fetchForUpdate"/>&amp;calPath=<xsl:value-of select="inherited/href"/></xsl:attribute>
4988                       <xsl:value-of select="inherited/href"/>
4989                     </a>
4990                   </xsl:when>
4991                   <xsl:otherwise>
4992                     local:
4993                     <xsl:variable name="whoType">
4994                       <xsl:choose>
4995                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)">user</xsl:when>
4996                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)">group</xsl:when>
4997                         <xsl:when test="$who='authenticated'">auth</xsl:when>
4998                         <xsl:when test="invert/principal/property/owner">other</xsl:when>
4999                         <xsl:when test="principal/property"><xsl:value-of select="name(principal/property/*)"/></xsl:when>
5000                         <xsl:when test="invert/principal/property"><xsl:value-of select="name(invert/principal/property/*)"/></xsl:when>
5001                         <xsl:otherwise></xsl:otherwise>
5002                       </xsl:choose>
5003                     </xsl:variable>
5004                     <xsl:variable name="shortWho">
5005                       <xsl:choose>
5006                         <xsl:when test="contains($who,/bedeworkadmin/syspars/userPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/userPrincipalRoot)),'/')"/></xsl:when>
5007                         <xsl:when test="contains($who,/bedeworkadmin/syspars/groupPrincipalRoot)"><xsl:value-of select="substring-after(substring-after($who,normalize-space(/bedeworkadmin/syspars/groupPrincipalRoot)),'/')"/></xsl:when>
5008                         <xsl:otherwise></xsl:otherwise> <!-- if not user or group, send no who -->
5009                       </xsl:choose>
5010                     </xsl:variable>
5011                     <xsl:choose>
5012                       <xsl:when test="invert">
5013                         <a href="{$calsuite-setAccess}&amp;calSuiteName={$calSuiteName}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}&amp;notWho=yes">
5014                           reset to default
5015                         </a>
5016                       </xsl:when>
5017                       <xsl:otherwise>
5018                         <a href="{$calsuite-setAccess}&amp;calSuiteName={$calSuiteName}&amp;how=default&amp;who={$shortWho}&amp;whoType={$whoType}">
5019                           reset to default
5020                         </a>
5021                       </xsl:otherwise>
5022                     </xsl:choose>
5023                   </xsl:otherwise>
5024                 </xsl:choose>
5025               </td>
5026             </tr>
5027           </xsl:for-each>
5028         </table>
5029       </xsl:if>
5030
5031       <xsl:if test="currentAccess/current-user-privilege-set/privilege/write-acl or /bedeworkadmin/userInfo/superUser='true'">
5032         <form name="calsuiteShareForm" action="{$calsuite-setAccess}" id="shareForm" method="post">
5033           <input type="hidden" name="calSuiteName" value="{$calSuiteName}"/>
5034           <table cellspacing="0" id="shareFormTable" class="common">
5035             <tr>
5036               <th colspan="2" class="commonHeader">Set access:</th>
5037             </tr>
5038             <tr class="subhead">
5039               <th>Who:</th>
5040               <th>Rights:</th>
5041             </tr>
5042             <tr>
5043               <td>
5044                 <input type="text" name="who" size="20"/>
5045                 <br/>
5046                 <input type="radio" value="user" name="whoType" checked="checked"/> user
5047                 <input type="radio" value="group" name="whoType"/> group
5048                 <p>OR</p>
5049                 <p>
5050                   <input type="radio" value="auth" name="whoType"/> all authorized users<br/>
5051                   <input type="radio" value="other" name="whoType"/> other users<br/>
5052                   <input type="radio" value="owner" name="whoType"/> owner
5053                 </p>
5054                 <!-- we may never use the invert action ...it is probably
5055                      too confusing, and can be achieved in other ways -->
5056                 <!--
5057                 <p class="padTop">
5058                   <input type="checkbox" value="yes" name="notWho"/> invert (deny)
5059                 </p>-->
5060               </td>
5061               <td>
5062                 <ul id="howList">
5063                   <li>
5064                     <input type="radio" value="A" name="how"/>
5065                     <strong>All</strong> (read, write, delete)</li>
5066                   <li class="padTop">
5067                     <input type="radio" value="R" name="how"/>
5068                     <strong>Read</strong> (content, access, freebusy)
5069                   </li>
5070                   <li>
5071                     <input type="radio" value="f" name="how"/> Read freebusy only
5072                   </li>
5073                   <li class="padTop">
5074                     <input type="radio" value="Rc" name="how" checked="checked"/>
5075                     <strong>Read</strong> and <strong>Write content only</strong>
5076                   </li>
5077                   <li class="padTop">
5078                     <input type="radio" value="W" name="how"/>
5079                     <strong>Write and delete</strong> (content, access, properties)
5080                   </li>
5081                   <li>
5082                     <input type="radio" value="c" name="how"/> Write content only
5083                   </li>
5084                   <li>
5085                     <input type="radio" value="u" name="how"/> Delete only
5086                   </li>
5087                   <li class="padTop">
5088                     <input type="radio" value="N" name="how"/>
5089                     <strong>None</strong>
5090                   </li>
5091                 </ul>
5092               </td>
5093             </tr>
5094           </table>
5095           <input type="submit" name="submit" value="Submit"/>
5096         </form>
5097       </xsl:if>
5098     </div>
5099   </xsl:template>
5100
5101   <xsl:template name="calSuitePrefs">
5102     <h2>Edit Calendar Suite Preferences</h2>
5103     <form name="userPrefsForm" method="post" action="{$calsuite-updatePrefs}">
5104       <table id="eventFormTable">
5105         <tr>
5106           <td class="fieldName">
5107             Calendar Suite:
5108           </td>
5109           <td>
5110             <xsl:value-of select="/bedeworkadmin/currentCalSuite/name"/>
5111           </td>
5112         </tr>
5113         <tr>
5114           <td class="fieldName">
5115             Preferred view:
5116           </td>
5117           <td>
5118             <xsl:variable name="preferredView" select="/bedeworkadmin/prefs/preferredView"/>
5119             <input type="text" name="preferredView" value="{$preferredView}" size="40"/>
5120           </td>
5121         </tr>
5122         <tr>
5123           <td class="fieldName">
5124             Preferred view period:
5125           </td>
5126           <td>
5127             <xsl:variable name="preferredViewPeriod" select="/bedeworkadmin/prefs/preferredViewPeriod"/>
5128             <select name="viewPeriod">
5129               <!-- picking the selected item could be done with javascript. for
5130                    now, this will do.  -->
5131               <xsl:choose>
5132                 <xsl:when test="$preferredViewPeriod = 'dayView'">
5133                   <option value="dayView" selected="selected">day</option>
5134                 </xsl:when>
5135                 <xsl:otherwise>
5136                   <option value="dayView">day</option>
5137                 </xsl:otherwise>
5138               </xsl:choose>
5139               <xsl:choose>
5140                 <xsl:when test="$preferredViewPeriod = 'todayView'">
5141                   <option value="todayView" selected="selected">today</option>
5142                 </xsl:when>
5143                 <xsl:otherwise>
5144                   <option value="todayView">today</option>
5145                 </xsl:otherwise>
5146               </xsl:choose>
5147               <xsl:choose>
5148                 <xsl:when test="$preferredViewPeriod = 'weekView'">
5149                   <option value="weekView" selected="selected">week</option>
5150                 </xsl:when>
5151                 <xsl:otherwise>
5152                   <option value="weekView">week</option>
5153                 </xsl:otherwise>
5154               </xsl:choose>
5155               <xsl:choose>
5156                 <xsl:when test="$preferredViewPeriod = 'monthView'">
5157                   <option value="monthView" selected="selected">month</option>
5158                 </xsl:when>
5159                 <xsl:otherwise>
5160                   <option value="monthView">month</option>
5161                 </xsl:otherwise>
5162               </xsl:choose>
5163               <xsl:choose>
5164                 <xsl:when test="$preferredViewPeriod = 'yearView'">
5165                   <option value="yearView" selected="selected">year</option>
5166                 </xsl:when>
5167                 <xsl:otherwise>
5168                   <option value="yearView">year</option>
5169                 </xsl:otherwise>
5170               </xsl:choose>
5171             </select>
5172           </td>
5173         </tr>
5174         <tr>
5175           <td class="fieldName">
5176             Skin name:
5177           </td>
5178           <td>
5179             <xsl:variable name="skinName" select="/bedeworkadmin/prefs/skinName"/>
5180             <input type="text" name="skin" value="{$skinName}" size="40"/>
5181           </td>
5182         </tr>
5183         <tr>
5184           <td class="fieldName">
5185             Skin style:
5186           </td>
5187           <td>
5188             <xsl:variable name="skinStyle" select="/bedeworkadmin/prefs/skinStyle"/>
5189             <input type="text" name="skinStyle" value="{$skinStyle}" size="40"/>
5190           </td>
5191         </tr>
5192       </table>
5193       <br />
5194
5195       <input type="submit" name="modPrefs" value="Update"/>
5196       <input type="reset" value="Reset"/>
5197       <input type="submit" name="cancelled" value="Cancel"/>
5198     </form>
5199   </xsl:template>
5200
5201   <!--+++++++++++++++ Timezones ++++++++++++++++++++-->
5202   <xsl:template name="uploadTimezones">
5203     <h2>Manage Timezones</h2>
5204
5205     <form name="peForm" method="post" action="{$timezones-upload}" enctype="multipart/form-data">
5206       <input type="file" name="uploadFile" size="40" value=""/>
5207       <input type="submit" name="doUpload" value="Upload Timezones"/>
5208       <input type="submit" name="cancelled" value="Cancel"/>
5209     </form>
5210
5211     <p>
5212       <a href="{$timezones-fix}">Fix Timezones</a> (recalculate UTC values)<br/>
5213       <span class="note">Run this to make sure no UTC values have changed due
5214       to this upload (e.g. DST changes).</span>
5215     </p>
5216
5217   </xsl:template>
5218
5219   <!--+++++++++++++++ Authuser ++++++++++++++++++++-->
5220   <xsl:template name="authUserList">
5221     <h2>Modify Administrators</h2>
5222
5223     <div id="authUserInputForms">
5224       <form name="getUserRolesForm" action="{$authuser-fetchForUpdate}" method="post">
5225         Edit admin roles by userid: <input type="text" name="editAuthUserId" size="20"/>
5226         <input type="submit" value="go" name="submit"/>
5227       </form>
5228     </div>
5229
5230     <table id="commonListTable">
5231       <tr>
5232         <th>UserId</th>
5233         <th>Roles</th>
5234         <th></th>
5235       </tr>
5236
5237       <xsl:for-each select="bedeworkadmin/authUsers/authUser">
5238         <!--<xsl:sort select="account" order="ascending" case-order="upper-first"/>-->
5239         <tr>
5240           <td>
5241             <xsl:value-of select="account"/>
5242           </td>
5243           <td>
5244             <xsl:if test="publicEventUser='true'">
5245               publicEvent; <xsl:text> </xsl:text>
5246             </xsl:if>
5247             <xsl:if test="superUser='true'">
5248               superUser; <xsl:text> </xsl:text>
5249             </xsl:if>
5250             <xsl:if test="alertUser='true'">
5251               alert; <xsl:text> </xsl:text>
5252             </xsl:if>
5253           </td>
5254           <td>
5255             <xsl:variable name="account" select="account"/>
5256             <a href="{$authuser-fetchForUpdate}&amp;editAuthUserId={$account}">
5257               edit
5258             </a>
5259           </td>
5260         </tr>
5261       </xsl:for-each>
5262     </table>
5263   </xsl:template>
5264
5265   <xsl:template name="modAuthUser">
5266     <h2>Update Administrator</h2>
5267     <xsl:variable name="modAuthUserAction" select="/bedeworkadmin/formElements/form/@action"/>
5268     <form action="{$modAuthUserAction}" method="post">
5269       <table id="eventFormTable">
5270         <tr>
5271           <td class="fieldName">
5272             Account:
5273           </td>
5274           <td>
5275             <xsl:value-of select="/bedeworkadmin/formElements/form/account"/>
5276           </td>
5277         </tr>
5278         <tr>
5279           <td class="fieldName">
5280             Alerts:
5281           </td>
5282           <td>
5283             <xsl:copy-of select="/bedeworkadmin/formElements/form/alerts/*"/>
5284           </td>
5285         </tr>
5286         <tr>
5287           <td class="fieldName">
5288             Public Events:
5289           </td>
5290           <td>
5291             <xsl:copy-of select="/bedeworkadmin/formElements/form/publicEvents/*"/>
5292           </td>
5293         </tr>
5294         <tr>
5295           <td class="fieldName">
5296             Super User:
5297           </td>
5298           <td>
5299             <xsl:copy-of select="/bedeworkadmin/formElements/form/superUser/*"/>
5300           </td>
5301         </tr>
5302         <!--<tr>
5303           <td class="optional">
5304             Email:
5305           </td>
5306           <td>
5307             <xsl:copy-of select="/bedeworkadmin/formElements/form/email/*"/>
5308             <span class="fieldInfo"></span>
5309           </td>
5310         </tr>
5311         <tr>
5312           <td class="optional">
5313             Phone:
5314           </td>
5315           <td>
5316             <xsl:copy-of select="/bedeworkadmin/formElements/form/phone/*"/>
5317             <span class="fieldInfo"></span>
5318           </td>
5319         </tr>
5320         <tr>
5321           <td class="optional">
5322             Department:
5323           </td>
5324           <td>
5325             <xsl:copy-of select="/bedeworkadmin/formElements/form/dept/*"/>
5326             <span class="fieldInfo"></span>
5327           </td>
5328         </tr>
5329         <tr>
5330           <td class="optional">
5331             Last name:
5332           </td>
5333           <td>
5334             <xsl:copy-of select="/bedeworkadmin/formElements/form/lastName/*"/>
5335             <span class="fieldInfo"></span>
5336           </td>
5337         </tr>
5338         <tr>
5339           <td class="optional">
5340             First name:
5341           </td>
5342           <td>
5343             <xsl:copy-of select="/bedeworkadmin/formElements/form/firstName/*"/>
5344             <span class="fieldInfo"></span>
5345           </td>
5346         </tr>-->
5347       </table>
5348       <br />
5349
5350       <input type="submit" name="modAuthUser" value="Update"/>
5351       <input type="reset" value="Reset"/>
5352       <input type="submit" name="cancelled" value="Cancel"/>
5353     </form>
5354   </xsl:template>
5355
5356   <!--+++++++++++++++ User Prefs ++++++++++++++++++++-->
5357   <xsl:template name="modPrefs">
5358     <h2>Edit User Preferences</h2>
5359     <form name="userPrefsForm" method="post" action="{$prefs-update}">
5360       <table id="eventFormTable">
5361         <tr>
5362           <td class="fieldName">
5363             User:
5364           </td>
5365           <td>
5366             <xsl:value-of select="/bedeworkadmin/prefs/user"/>
5367             <xsl:variable name="user" select="/bedeworkadmin/prefs/user"/>
5368             <input type="hidden" name="user" value="{$user}"/>
5369           </td>
5370         </tr>
5371         <tr>
5372           <td class="fieldName">
5373             Preferred view:
5374           </td>
5375           <td>
5376             <xsl:variable name="preferredView" select="/bedeworkadmin/prefs/preferredView"/>
5377             <input type="text" name="preferredView" value="{$preferredView}" size="40"/>
5378           </td>
5379         </tr>
5380         <tr>
5381           <td class="fieldName">
5382             Preferred view period:
5383           </td>
5384           <td>
5385             <xsl:variable name="preferredViewPeriod" select="/bedeworkadmin/prefs/preferredViewPeriod"/>
5386             <select name="viewPeriod">
5387               <!-- picking the selected item could be done with javascript. for
5388                    now, this will do.  -->
5389               <xsl:choose>
5390                 <xsl:when test="$preferredViewPeriod = 'dayView'">
5391                   <option value="dayView" selected="selected">day</option>
5392                 </xsl:when>
5393                 <xsl:otherwise>
5394                   <option value="dayView">day</option>
5395                 </xsl:otherwise>
5396               </xsl:choose>
5397               <xsl:choose>
5398                 <xsl:when test="$preferredViewPeriod = 'todayView'">
5399                   <option value="todayView" selected="selected">today</option>
5400                 </xsl:when>
5401                 <xsl:otherwise>
5402                   <option value="todayView">today</option>
5403                 </xsl:otherwise>
5404               </xsl:choose>
5405               <xsl:choose>
5406                 <xsl:when test="$preferredViewPeriod = 'weekView'">
5407                   <option value="weekView" selected="selected">week</option>
5408                 </xsl:when>
5409                 <xsl:otherwise>
5410                   <option value="weekView">week</option>
5411                 </xsl:otherwise>
5412               </xsl:choose>
5413               <xsl:choose>
5414                 <xsl:when test="$preferredViewPeriod = 'monthView'">
5415                   <option value="monthView" selected="selected">month</option>
5416                 </xsl:when>
5417                 <xsl:otherwise>
5418                   <option value="monthView">month</option>
5419                 </xsl:otherwise>
5420               </xsl:choose>
5421               <xsl:choose>
5422                 <xsl:when test="$preferredViewPeriod = 'yearView'">
5423                   <option value="yearView" selected="selected">year</option>
5424                 </xsl:when>
5425                 <xsl:otherwise>
5426                   <option value="yearView">year</option>
5427                 </xsl:otherwise>
5428               </xsl:choose>
5429             </select>
5430           </td>
5431         </tr>
5432         <tr>
5433           <td class="fieldName">
5434             Skin name:
5435           </td>
5436           <td>
5437             <xsl:variable name="skinName" select="/bedeworkadmin/prefs/skinName"/>
5438             <input type="text" name="skin" value="{$skinName}" size="40"/>
5439           </td>
5440         </tr>
5441         <tr>
5442           <td class="fieldName">
5443             Skin style:
5444           </td>
5445           <td>
5446             <xsl:variable name="skinStyle" select="/bedeworkadmin/prefs/skinStyle"/>
5447             <input type="text" name="skinStyle" value="{$skinStyle}" size="40"/>
5448           </td>
5449         </tr>
5450       </table>
5451       <br />
5452
5453       <input type="submit" name="modPrefs" value="Update"/>
5454       <input type="reset" value="Reset"/>
5455       <input type="submit" name="cancelled" value="Cancel"/>
5456     </form>
5457   </xsl:template>
5458
5459   <!--+++++++++++++++ Admin Groups ++++++++++++++++++++-->
5460   <xsl:template name="listAdminGroups">
5461     <h2>Modify Groups</h2>
5462     <form name="adminGroupMembersForm" method="post" action="{$admingroup-initUpdate}">
5463       <xsl:choose>
5464         <xsl:when test="/bedeworkadmin/groups/showMembers='true'">
5465           <input type="radio" name="showAgMembers" value="false" onclick="document.adminGroupMembersForm.submit();"/>
5466           Hide members
5467           <input type="radio" name="showAgMembers" value="true" checked="checked" onclick="document.adminGroupMembersForm.submit();"/>
5468           Show members
5469         </xsl:when>
5470         <xsl:otherwise>
5471           <input type="radio" name="showAgMembers" value="false" checked="checked" onclick="document.adminGroupMembersForm.submit();"/>
5472           Hide members
5473           <input type="radio" name="showAgMembers" value="true" onclick="document.adminGroupMembersForm.submit();"/>
5474           Show members
5475         </xsl:otherwise>
5476       </xsl:choose>
5477     </form>
5478
5479     <p>Click on the group name to modify the group owner or description.<br/>
5480     Click "add/remove members" to modify group membership.</p>
5481     <p>
5482       <input type="button" name="return" onclick="javascript:location.replace('{$admingroup-initAdd}')" value="Add a new group"/>
5483     </p>
5484     <table id="commonListTable">
5485       <tr>
5486         <th>Name</th>
5487         <th>Description</th>
5488         <xsl:if test="/bedeworkadmin/groups/showMembers='true'">
5489           <th>Members</th>
5490         </xsl:if>
5491         <th></th>
5492       </tr>
5493       <xsl:for-each select="/bedeworkadmin/groups/group">
5494         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
5495         <xsl:variable name="groupName" select="name"/>
5496         <tr>
5497           <td>
5498             <a href="{$admingroup-fetchForUpdate}&amp;adminGroupName={$groupName}">
5499               <xsl:value-of select="name"/>
5500             </a>
5501           </td>
5502           <td>
5503             <xsl:value-of select="desc"/>
5504           </td>
5505           <xsl:if test="/bedeworkadmin/groups/showMembers='true'">
5506             <td>
5507               <xsl:for-each select="members/member/account">
5508                 <xsl:value-of select="."/>&#160;
5509               </xsl:for-each>
5510             </td>
5511           </xsl:if>
5512           <td>
5513             <a href="{$admingroup-fetchForUpdateMembers}&amp;adminGroupName={$groupName}">Add/Remove members</a>
5514           </td>
5515         </tr>
5516       </xsl:for-each>
5517     </table>
5518     <p>
5519       <input type="button" name="return" onclick="javascript:location.replace('{$admingroup-initAdd}')" value="Add a new group"/>
5520     </p>
5521   </xsl:template>
5522
5523   <xsl:template match="groups" mode="chooseGroup">
5524     <h2>Choose Your Administrative Group</h2>
5525
5526     <table id="commonListTable">
5527
5528       <tr>
5529         <th>Name</th>
5530         <th>Description</th>
5531       </tr>
5532
5533       <xsl:for-each select="group">
5534         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
5535         <tr>
5536           <td>
5537             <xsl:variable name="admGroupName" select="name"/>
5538             <a href="{$setup}&amp;adminGroupName={$admGroupName}">
5539               <xsl:copy-of select="name"/>
5540             </a>
5541           </td>
5542           <td>
5543             <xsl:value-of select="desc"/>
5544           </td>
5545         </tr>
5546       </xsl:for-each>
5547     </table>
5548   </xsl:template>
5549
5550   <xsl:template name="modAdminGroup">
5551     <xsl:choose>
5552       <xsl:when test="/bedeworkadmin/creating = 'true'">
5553         <h2>Add Group</h2>
5554       </xsl:when>
5555       <xsl:otherwise>
5556         <h2>Modify Group</h2>
5557       </xsl:otherwise>
5558     </xsl:choose>
5559     <form name="peForm" method="post" action="{$admingroup-update}">
5560       <table id="adminGroupFormTable">
5561         <tr>
5562           <td class="fieldName">
5563             Name:
5564           </td>
5565           <td>
5566             <xsl:choose>
5567               <xsl:when test="/bedeworkadmin/creating = 'true'">
5568                 <xsl:copy-of select="/bedeworkadmin/formElements/form/name/*"/>
5569               </xsl:when>
5570               <xsl:otherwise>
5571                 <xsl:value-of select="/bedeworkadmin/formElements/form/name"/>
5572               </xsl:otherwise>
5573             </xsl:choose>
5574           </td>
5575         </tr>
5576         <tr>
5577           <td class="fieldName">
5578             Description:
5579           </td>
5580           <td>
5581             <xsl:copy-of select="/bedeworkadmin/formElements/form/desc/*"/>
5582           </td>
5583         </tr>
5584         <tr>
5585           <td class="fieldName">
5586             Group owner:
5587           </td>
5588           <td>
5589             <xsl:copy-of select="/bedeworkadmin/formElements/form/groupOwner/*"/>
5590           </td>
5591         </tr>
5592         <tr>
5593           <td class="fieldName">
5594             Events owner:
5595           </td>
5596           <td>
5597             <xsl:copy-of select="/bedeworkadmin/formElements/form/eventsOwner/*"/>
5598           </td>
5599         </tr>
5600       </table>
5601       <table border="0" id="submitTable">
5602         <tr>
5603           <td>
5604             <xsl:choose>
5605               <xsl:when test="/bedeworkadmin/creating = 'true'">
5606                 <input type="submit" name="updateAdminGroup" value="Add Admin Group"/>
5607                 <input type="submit" name="cancelled" value="Cancel"/>
5608                 <input type="reset" value="Clear"/>
5609               </xsl:when>
5610               <xsl:otherwise>
5611                 <input type="submit" name="updateAdminGroup" value="Update Admin Group"/>
5612                 <input type="submit" name="cancelled" value="Cancel"/>
5613                 <input type="reset" value="Reset"/>
5614               </xsl:otherwise>
5615             </xsl:choose>
5616           </td>
5617           <td align="right">
5618             <input type="submit" name="delete" value="Delete"/>
5619           </td>
5620         </tr>
5621       </table>
5622     </form>
5623   </xsl:template>
5624
5625   <xsl:template name="modAdminGroupMembers">
5626     <h2>Update Group Membership</h2>
5627     <p>Enter a userid (for user or group) and click "add" to update group membership.
5628     Click the trash icon to remove a user from the group.</p>
5629
5630     <form name="adminGroupMembersForm" method="post" action="{$admingroup-updateMembers}">
5631       <p>Add member:
5632         <input type="text" name="updGroupMember" size="15"/>
5633         <input type="radio" value="user" name="kind" checked="checked"/>user
5634         <input type="radio" value="group" name="kind"/>group
5635         <input type="submit" name="addGroupMember" value="Add"/>
5636       </p>
5637     </form>
5638     <p>
5639       <input type="button" name="return" onclick="javascript:location.replace('{$admingroup-initUpdate}')" value="Return to Admin Group listing"/>
5640     </p>
5641
5642     <table id="adminGroupFormTable">
5643       <tr>
5644         <td class="fieldName">
5645           Name:
5646         </td>
5647         <td>
5648           <xsl:value-of select="/bedeworkadmin/adminGroup/name"/>
5649         </td>
5650       </tr>
5651       <tr>
5652         <td class="fieldName">
5653           Members:
5654         </td>
5655         <td>
5656           <table id="memberAccountList">
5657             <xsl:for-each select="/bedeworkadmin/adminGroup/members/member">
5658               <xsl:choose>
5659                 <xsl:when test="kind='0'"><!-- kind = user -->
5660                   <tr>
5661                     <td>
5662                       <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/>
5663                     </td>
5664                     <td>
5665                       <xsl:value-of select="account"/>
5666                     </td>
5667                     <td>
5668                       <xsl:variable name="acct" select="account"/>
5669                       <a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=user" title="remove">
5670                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
5671                       </a>
5672                     </td>
5673                   </tr>
5674                 </xsl:when>
5675                 <xsl:otherwise><!-- kind = group -->
5676                   <tr>
5677                     <td>
5678                       <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
5679                     </td>
5680                     <td>
5681                       <strong>
5682                         <xsl:value-of select="account"/>
5683                       </strong>
5684                     </td>
5685                     <td>
5686                       <xsl:variable name="acct" select="account"/>
5687                       <a href="{$admingroup-updateMembers}&amp;removeGroupMember={$acct}&amp;kind=group" title="remove">
5688                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
5689                       </a>
5690                     </td>
5691                   </tr>
5692                 </xsl:otherwise>
5693               </xsl:choose>
5694             </xsl:for-each>
5695           </table>
5696         </td>
5697       </tr>
5698     </table>
5699     <p>
5700       <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="user"/> user,
5701       <img src="{$resourcesRoot}/resources/groupIcon.gif" width="13" height="13" border="0" alt="group"/>
5702       <xsl:text> </xsl:text>
5703       <strong>group</strong>
5704     </p>
5705   </xsl:template>
5706
5707   <xsl:template name="deleteAdminGroupConfirm">
5708     <h2>Delete Admin Group?</h2>
5709     <p>The following group will be deleted. Continue?</p>
5710     <p>
5711       <strong>
5712         <xsl:value-of select="/bedeworkadmin/groups/group/name"/>
5713       </strong>:
5714       <xsl:value-of select="/bedeworkadmin/groups/group/desc"/>
5715     </p>
5716     <form name="adminGroupDelete" method="post" action="{$admingroup-delete}">
5717       <input type="submit" name="removeAdminGroupOK" value="Yes: Delete!"/>
5718       <input type="submit" name="cancelled" value="No: Cancel"/>
5719     </form>
5720   </xsl:template>
5721
5722   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
5723
5724   <xsl:template match="sysStats" mode="showSysStats">
5725     <h2>System Statistics</h2>
5726
5727     <p>
5728       Stats collection:
5729     </p>
5730     <ul>
5731       <li>
5732         <a href="{$stats-update}&amp;enable=yes">enable</a> |
5733         <a href="{$stats-update}&amp;disable=yes">disable</a>
5734       </li>
5735       <li>
5736         <a href="{$stats-update}&amp;fetch=yes">fetch statistics</a>
5737       </li>
5738       <li>
5739         <a href="{$stats-update}&amp;dump=yes">dump stats to log</a>
5740       </li>
5741     </ul>
5742     <table id="statsTable" cellpadding="0">
5743       <xsl:for-each select="*">
5744         <xsl:choose>
5745           <xsl:when test="name(.) = 'header'">
5746             <tr>
5747               <th colspan="2">
5748                 <xsl:value-of select="."/>
5749               </th>
5750             </tr>
5751           </xsl:when>
5752           <xsl:otherwise>
5753             <tr>
5754               <td class="label">
5755                 <xsl:value-of select="label"/>
5756               </td>
5757               <td class="value">
5758                 <xsl:value-of select="value"/>
5759               </td>
5760             </tr>
5761           </xsl:otherwise>
5762         </xsl:choose>
5763       </xsl:for-each>
5764     </table>
5765   </xsl:template>
5766
5767   <!--==== SEARCH RESULT ====-->
5768   <xsl:template name="searchResult">
5769     <h2 class="bwStatusConfirmed">
5770       <div id="searchFilter">
5771         <form name="searchForm" method="post" action="{$search}">
5772           Search:
5773           <input type="text" name="query" size="15">
5774             <xsl:attribute name="value"><xsl:value-of select="/bedeworkadmin/searchResults/query"/></xsl:attribute>
5775           </input>
5776           <input type="submit" name="submit" value="go"/>
5777           Limit:
5778           <xsl:choose>
5779             <xsl:when test="/bedeworkadmin/searchResults/searchLimits = 'beforeToday'">
5780               <input type="radio" name="searchLimits" value="fromToday"/>today forward
5781               <input type="radio" name="searchLimits" value="beforeToday" checked="checked"/>past dates
5782               <input type="radio" name="searchLimits" value="none"/>all dates
5783             </xsl:when>
5784             <xsl:when test="/bedeworkadmin/searchResults/searchLimits = 'none'">
5785               <input type="radio" name="searchLimits" value="fromToday"/>today forward
5786               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
5787               <input type="radio" name="searchLimits" value="none" checked="checked"/>all dates
5788             </xsl:when>
5789             <xsl:otherwise>
5790               <input type="radio" name="searchLimits" value="fromToday" checked="checked"/>today forward
5791               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
5792               <input type="radio" name="searchLimits" value="none"/>all dates
5793             </xsl:otherwise>
5794           </xsl:choose>
5795         </form>
5796       </div>
5797       Search Result
5798     </h2>
5799     <table id="searchTable" cellpadding="0" cellspacing="0">
5800       <tr>
5801         <th colspan="5">
5802           <xsl:if test="/bedeworkadmin/searchResults/numPages &gt; 1">
5803             <xsl:variable name="curPage" select="/bedeworkadmin/searchResults/curPage"/>
5804             <div id="searchPageForm">
5805               page:
5806               <xsl:if test="/bedeworkadmin/searchResults/curPage != 1">
5807                 <xsl:variable name="prevPage" select="number($curPage) - 1"/>
5808                 &lt;<a href="{$search-next}&amp;pageNum={$prevPage}">prev</a>
5809               </xsl:if>
5810               <xsl:text> </xsl:text>
5811
5812               <xsl:call-template name="searchResultPageNav">
5813                 <xsl:with-param name="page">
5814                   <xsl:choose>
5815                     <xsl:when test="number($curPage) - 10 &lt; 1">1</xsl:when>
5816                     <xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise>
5817                   </xsl:choose>
5818                 </xsl:with-param>
5819               </xsl:call-template>
5820
5821               <xsl:text> </xsl:text>
5822               <xsl:choose>
5823                 <xsl:when test="$curPage != /bedeworkadmin/searchResults/numPages">
5824                   <xsl:variable name="nextPage" select="number($curPage) + 1"/>
5825                   <a href="{$search-next}&amp;pageNum={$nextPage}">next</a>&gt;
5826                 </xsl:when>
5827                 <xsl:otherwise>
5828                   <span class="hidden">next&gt;</span><!-- occupy the space to keep the navigation from moving around -->
5829                 </xsl:otherwise>
5830               </xsl:choose>
5831             </div>
5832           </xsl:if>
5833           <xsl:value-of select="/bedeworkadmin/searchResults/resultSize"/>
5834           result<xsl:if test="/bedeworkadmin/searchResults/resultSize != 1">s</xsl:if> returned
5835           for <em><xsl:value-of select="/bedeworkadmin/searchResults/query"/></em>
5836         </th>
5837       </tr>
5838       <xsl:if test="/bedeworkadmin/searchResults/searchResult">
5839         <tr class="fieldNames">
5840           <td>
5841             relevance
5842           </td>
5843           <td>
5844             summary
5845           </td>
5846           <td>
5847             date &amp; time
5848           </td>
5849           <td>
5850             calendar
5851           </td>
5852           <td>
5853             location
5854           </td>
5855         </tr>
5856       </xsl:if>
5857       <xsl:for-each select="/bedeworkadmin/searchResults/searchResult">
5858         <xsl:variable name="subscriptionId" select="event/subscription/id"/>
5859         <xsl:variable name="calPath" select="event/calendar/encodedPath"/>
5860         <xsl:variable name="guid" select="event/guid"/>
5861         <xsl:variable name="recurrenceId" select="event/recurrenceId"/>
5862         <tr>
5863           <td class="relevance">
5864             <xsl:value-of select="ceiling(number(score)*100)"/>%
5865             <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance">
5866               <xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute>
5867             </img>
5868           </td>
5869           <td>
5870             <a href="{$event-fetchForDisplay}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
5871               <xsl:value-of select="event/summary"/>
5872             </a>
5873           </td>
5874           <td>
5875             <xsl:value-of select="event/start/longdate"/>
5876             <xsl:text> </xsl:text>
5877             <xsl:value-of select="event/start/time"/>
5878             <xsl:choose>
5879               <xsl:when test="event/start/longdate != event/end/longdate">
5880                 - <xsl:value-of select="event/start/longdate"/>
5881                 <xsl:text> </xsl:text>
5882                 <xsl:value-of select="event/end/time"/>
5883               </xsl:when>
5884               <xsl:when test="event/start/time != event/end/time">
5885                 - <xsl:value-of select="event/end/time"/>
5886               </xsl:when>
5887             </xsl:choose>
5888           </td>
5889           <td>
5890             <xsl:value-of select="event/calendar/name"/>
5891           </td>
5892           <td>
5893             <xsl:value-of select="event/location/address"/>
5894           </td>
5895         </tr>
5896       </xsl:for-each>
5897     </table>
5898   </xsl:template>
5899
5900   <xsl:template name="searchResultPageNav">
5901     <xsl:param name="page">1</xsl:param>
5902     <xsl:variable name="curPage" select="/bedeworkadmin/searchResults/curPage"/>
5903     <xsl:variable name="numPages" select="/bedeworkadmin/searchResults/numPages"/>
5904     <xsl:variable name="endPage">
5905       <xsl:choose>
5906         <xsl:when test="number($curPage) + 6 &gt; number($numPages)"><xsl:value-of select="$numPages"/></xsl:when>
5907         <xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise>
5908       </xsl:choose>
5909     </xsl:variable>
5910     <xsl:choose>
5911       <xsl:when test="$page = $curPage">
5912         <xsl:value-of select="$page"/>
5913       </xsl:when>
5914       <xsl:otherwise>
5915         <a href="{$search-next}&amp;pageNum={$page}">
5916           <xsl:value-of select="$page"/>
5917         </a>
5918       </xsl:otherwise>
5919     </xsl:choose>
5920     <xsl:text> </xsl:text>
5921     <xsl:if test="$page &lt; $endPage">
5922        <xsl:call-template name="searchResultPageNav">
5923          <xsl:with-param name="page" select="number($page)+1"/>
5924       </xsl:call-template>
5925     </xsl:if>
5926   </xsl:template>
5927
5928   <!--==== FOOTER ====-->
5929   <xsl:template name="footer">
5930     <div id="footer">
5931       <a href="http://www.bedework.org/">Bedework Website</a> |
5932       <!-- Enable the following two items when debugging skins only -->
5933       <a href="?noxslt=yes">show XML</a> |
5934       <a href="?refreshXslt=yes">refresh XSLT</a>
5935     </div>
5936   </xsl:template>
5937 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.