root/trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl

Revision 1852 (checked in by johnsa, 5 years ago)

web clients: more x-property client support; break xprops into logical units; fix up admin client submissions comment display

  • Property svn:eol-style set to LF
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="xhtml"
5   indent="no"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
9   standalone="yes"
10   omit-xml-declaration="yes"/>
11
12   <!-- ========================================================= -->
13   <!--         PUBLIC EVENTS SUBMISSION CALENDAR STYLESHEET      -->
14   <!-- ========================================================= -->
15
16   <!-- **********************************************************************
17     Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved.
18
19     Redistribution and use of this distribution in source and binary forms,
20     with or without modification, are permitted provided that:
21        The above copyright notice and this permission notice appear in all
22         copies and supporting documentation;
23
24         The name, identifiers, and trademarks of Rensselaer Polytechnic
25         Institute are not used in advertising or publicity without the
26         express prior written permission of Rensselaer Polytechnic Institute;
27
28     DISCLAIMER: The software is distributed" AS IS" without any express or
29     implied warranty, including but not limited to, any implied warranties
30     of merchantability or fitness for a particular purpose or any warrant)'
31     of non-infringement of any current or pending patent rights. The authors
32     of the software make no representations about the suitability of this
33     software for any particular purpose. The entire risk as to the quality
34     and performance of the software is with the user. Should the software
35     prove defective, the user assumes the cost of all necessary servicing,
36     repair or correction. In particular, neither Rensselaer Polytechnic
37     Institute, nor the authors of the software are liable for any indirect,
38     special, consequential, or incidental damages related to the software,
39     to the maximum extent the law permits. -->
40
41   <!-- DEFINE INCLUDES -->
42   <xsl:include href="../../../bedework-common/default/default/errors.xsl"/>
43   <xsl:include href="../../../bedework-common/default/default/messages.xsl"/>
44
45   <!-- DEFINE GLOBAL CONSTANTS -->
46   <!-- URL of html resources (images, css, other html); by default this is
47        set to the application root, but for the personal calendar
48        this should be changed to point to a
49        web server over https to avoid mixed content errors, e.g.,
50   <xsl:variable name="resourcesRoot">https://mywebserver.edu/myresourcesdir</xsl:variable>
51     -->
52   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
53
54   <!-- URL of the XSL template directory -->
55   <!-- The approot is an appropriate place to put
56        included stylesheets and xml fragments. These are generally
57        referenced relatively (like errors.xsl and messages.xsl above);
58        this variable is here for your convenience if you choose to
59        reference it explicitly.  It is not used in this stylesheet, however,
60        and can be safely removed if you so choose. -->
61   <xsl:variable name="appRoot" select="/bedework/approot"/>
62
63   <!-- Properly encoded prefixes to the application actions; use these to build
64        urls; allows the application to be used without cookies or within a portal.
65        These urls are rewritten in header.jsp and simply passed through for use
66        here. Every url includes a query string (either ?b=de or a real query
67        string) so that all links constructed in this stylesheet may begin the
68        query string with an ampersand. -->
69
70   <xsl:variable name="submissionsRootEncoded" select="/bedework/submissionsRoot/encoded"/>
71   <xsl:variable name="submissionsRootUnencoded" select="/bedework/submissionsRoot/unencoded"/>
72
73   <!-- main -->
74   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
75   <xsl:variable name="initEvent" select="/bedework/urlPrefixes/event/initEvent"/>
76   <xsl:variable name="initPendingEvents" select="/bedework/urlPrefixes/event/initPendingEvents"/>
77   <xsl:variable name="addEvent" select="/bedework/urlPrefixes/event/addEvent"/>
78   <xsl:variable name="editEvent" select="/bedework/urlPrefixes/event/editEvent"/>
79   <xsl:variable name="gotoEditEvent" select="/bedework/urlPrefixes/event/gotoEditEvent"/>
80   <xsl:variable name="updateEvent" select="/bedework/urlPrefixes/event/updateEvent"/>
81   <xsl:variable name="delEvent" select="/bedework/urlPrefixes/event/delEvent"/>
82   <xsl:variable name="initUpload" select="/bedework/urlPrefixes/misc/initUpload/a/@href"/>
83   <xsl:variable name="upload" select="/bedework/urlPrefixes/misc/upload/a/@href"/>
84
85   <!-- URL of the web application - includes web context -->
86   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/>
87
88   <!-- Other generally useful global variables -->
89   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
90   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
91   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
92   <xsl:variable name="skin">default</xsl:variable>
93   <xsl:variable name="publicCal">/cal</xsl:variable>
94
95   <!-- the following variable can be set to "true" or "false";
96        to use dojo widgets and fancier UI features, set to false - these are
97        not guaranteed to work in portals -->
98   <xsl:variable name="portalFriendly">false</xsl:variable>
99
100  <!-- BEGIN MAIN TEMPLATE -->
101   <xsl:template match="/">
102     <html lang="en">
103       <head>
104         <xsl:call-template name="headSection"/>
105       </head>
106       <body>
107         <xsl:if test="/bedework/page = 'editEvent'">
108           <xsl:attribute name="onload">initRXDates();initXProperties();</xsl:attribute>
109         </xsl:if>
110         <div id="bedework"><!-- main wrapper div -->
111           <xsl:call-template name="header"/>
112           <xsl:call-template name="messagesAndErrors"/>
113           <xsl:call-template name="menuTabs"/>
114           <div id="bodyContent">
115             <xsl:choose>
116               <xsl:when test="/bedework/page='addEvent'">
117                 <xsl:apply-templates select="/bedework/formElements" mode="addEvent"/>
118               </xsl:when>
119               <xsl:when test="/bedework/page='eventList'">
120                 <xsl:call-template name="eventList"/>
121               </xsl:when>
122               <xsl:when test="/bedework/page='editEvent'">
123                 <xsl:apply-templates select="/bedework/formElements" mode="editEvent"/>
124               </xsl:when>
125               <xsl:when test="/bedework/page='upload'">
126                 <xsl:call-template name="upload" />
127               </xsl:when>
128               <xsl:otherwise>
129                 <!-- home / entrance screen -->
130                 <xsl:call-template name="home"/>
131               </xsl:otherwise>
132             </xsl:choose>
133           </div>
134           <!-- footer -->
135           <xsl:call-template name="footer"/>
136         </div>
137       </body>
138     </html>
139   </xsl:template>
140
141   <!--==== HEAD SECTION  ====-->
142   <xsl:template name="headSection">
143     <title>Bedework: Submit a Public Event</title>
144     <meta name="robots" content="noindex,nofollow"/>
145     <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
146     <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
147     <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
148     <!-- note: the non-breaking spaces in the script bodies below are to avoid
149          losing the script closing tags (which avoids browser problems) -->
150     <script type="text/javascript" src="{$resourcesRoot}/resources/bedework.js">&#160;</script>
151     <xsl:if test="/bedework/page='addEvent' or /bedework/page='editEvent'">
152       <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js">&#160;</script>
153       <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
154       <script type="text/javascript" src="/bedework-common/javascript/dojo/dojo.js">&#160;</script>
155       <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkEventForm.js">&#160;</script>
156       <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkXProperties.js">&#160;</script>
157     </xsl:if>
158     <!-- <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkAccess.js">&#160;</script> -->
159     <xsl:if test="$portalFriendly = 'true'">
160       <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js">&#160;</script>
161       <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
162     </xsl:if>
163     <script type="text/javascript">
164       <xsl:comment>
165       function focusElement(id) {
166       // focuses element by id
167         document.getElementById(id).focus();
168       }
169       function initRXDates() {
170         // return string values to be loaded into javascript for rdates
171         <xsl:for-each select="/bedework/formElements/form/rdates/rdate">
172           bwRdates.update('<xsl:value-of select="date"/>','<xsl:value-of select="time"/>',false,false,false,'<xsl:value-of select="tzid"/>');
173         </xsl:for-each>
174         // return string values to be loaded into javascript for exdates
175         <xsl:for-each select="/bedework/formElements/form/exdates/rdate">
176           bwExdates.update('<xsl:value-of select="date"/>','<xsl:value-of select="time"/>',false,false,false,'<xsl:value-of select="tzid"/>');
177         </xsl:for-each>
178       }
179       function initXProperties() {
180         <xsl:for-each select="form/xproperties/node()">
181           bwXprops.init('<xsl:value-of select="name()"/>',[<xsl:for-each select="parameters/node()">['<xsl:value-of select="name()"/>','<xsl:value-of select="node()"/>']</xsl:for-each>],"<xsl:value-of select="values/text"/>");
182         </xsl:for-each>
183       }
184       </xsl:comment>
185     </script>
186   </xsl:template>
187
188   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
189
190   <xsl:template name="header">
191     <div id="header">
192       <a href="/bedework/">
193         <img id="logo"
194             alt="logo"
195             src="{$resourcesRoot}/resources/bedeworkAdminLogo.gif"
196             width="217"
197             height="40"
198             border="0"/>
199       </a>
200       <!-- set the page heading: -->
201       <h1>
202         Bedework Public Event Submission
203       </h1>
204     </div>
205     <div id="statusBar">
206       logged in as
207           <xsl:text> </xsl:text>
208           <strong><xsl:value-of select="/bedework/userid"/></strong>
209           <xsl:text> </xsl:text>
210           <span class="logout"><a href="{$setup}&amp;logout=true">logout</a></span>
211     </div>
212   </xsl:template>
213
214   <xsl:template name="messagesAndErrors">
215     <xsl:if test="/bedework/message">
216       <ul id="messages">
217         <xsl:for-each select="/bedework/message">
218           <li><xsl:apply-templates select="."/></li>
219         </xsl:for-each>
220       </ul>
221     </xsl:if>
222     <xsl:if test="/bedework/error">
223       <ul id="errors">
224         <xsl:for-each select="/bedework/error">
225           <li><xsl:apply-templates select="."/></li>
226         </xsl:for-each>
227       </ul>
228     </xsl:if>
229   </xsl:template>
230
231   <!--==== MENUTABS ====-->
232   <xsl:template name="menuTabs">
233     <ul id="menuTabs">
234       <xsl:choose>
235         <xsl:when test="/bedework/page='home'">
236           <li class="selected">Overview</li>
237           <li><a href="{$initEvent}">Add Event</a></li>
238           <li><a href="{$initPendingEvents}&amp;calPath={$submissionsRootEncoded}&amp;listAllEvents=true">My Pending Events</a></li>
239         </xsl:when>
240         <xsl:when test="/bedework/page='eventList'">
241           <li><a href="{$setup}">Overview</a></li>
242           <li><a href="{$initEvent}">Add Event</a></li>
243           <li class="selected">My Pending Events</li>
244         </xsl:when>
245         <xsl:otherwise>
246           <li><a href="{$setup}">Overview</a></li>
247           <li class="selected">Add Event</li>
248           <li><a href="{$initPendingEvents}&amp;calPath={$submissionsRootEncoded}&amp;listAllEvents=true">My Pending Events</a></li>
249         </xsl:otherwise>
250       </xsl:choose>
251     </ul>
252   </xsl:template>
253
254   <!--==== HOME ====-->
255   <xsl:template name="home">
256     <div class="navButtons navBox">
257       <a href="{$initEvent}">start
258         <img alt="previous"
259           src="{$resourcesRoot}/resources/arrowRight.gif"
260           width="13"
261           height="13"
262           border="0"/>
263       </a>
264     </div>
265     <h1>Entering Events</h1>
266     <ol id="introduction">
267       <li>
268         Before submitting a public event, <a href="/cal">see if it has already been
269         entered</a>. It is possible that an event may be created under a
270         different title than you'd expect.
271       </li>
272       <li>
273         Make your titles descriptive: rather than
274         "Lecture" use "Music Lecture Series: 'Uses of the
275         Neapolitan Chord'". "Cinema Club" would also be too vague,
276         while "Cinema Club: 'Citizen Kane'" is better. Bear in
277         mind that your event will "share the stage" with other events
278         in the calendar - try to be as clear as possible when
279         thinking of titles. Express not only what the event is, but
280         (briefly) what it's about. Elaborate on the event in the
281         description field, but try not to repeat the same
282         information.  Try to think like a user when suggesting an event:
283         use language that will explain your event to someone who knows
284         absolutely nothing about it.
285       </li>
286       <li>
287         Do not include locations and times in the description
288         field (unless it is to add extra information not already
289         displayed).
290       </li>
291     </ol>
292   </xsl:template>
293
294   <!--==== ADD EVENT ====-->
295   <xsl:template match="formElements" mode="addEvent">
296     <xsl:variable name="submitter">
297       <xsl:choose>
298         <xsl:when test="form/xproperties/node()[name()='X-BEDEWORK-SUBMITTEDBY']"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMITTEDBY']/values/text"/></xsl:when>
299         <xsl:otherwise><xsl:value-of select="/bedework/userid"/></xsl:otherwise>
300       </xsl:choose>
301     </xsl:variable>
302     <form name="eventForm" method="post" action="{$addEvent}" id="standardForm" onsubmit="setEventFields(this,{$portalFriendly},'{$submitter}');">
303       <xsl:apply-templates select="." mode="eventForm"/>
304     </form>
305   </xsl:template>
306
307   <!--==== EDIT EVENT ====-->
308   <xsl:template match="formElements" mode="editEvent">
309     <xsl:variable name="submitter">
310       <xsl:choose>
311         <xsl:when test="form/xproperties/node()[name()='X-BEDEWORK-SUBMITTEDBY']"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMITTEDBY']/values/text"/></xsl:when>
312         <xsl:otherwise><xsl:value-of select="/bedework/userid"/></xsl:otherwise>
313       </xsl:choose>
314     </xsl:variable>
315     <form name="eventForm" method="post" action="{$updateEvent}" id="standardForm" onsubmit="setEventFields(this,{$portalFriendly},'{$submitter}');">
316       <xsl:apply-templates select="." mode="eventForm"/>
317     </form>
318   </xsl:template>
319
320
321   <!--==== ADD and EDIT EVENT FORM ====-->
322   <xsl:template match="formElements" mode="eventForm">
323     <xsl:variable name="subscriptionId" select="subscriptionId"/>
324     <xsl:variable name="calPathEncoded" select="form/calendar/encodedPath"/>
325     <xsl:variable name="calPath" select="form/calendar/path"/>
326     <xsl:variable name="guid" select="guid"/>
327     <xsl:variable name="recurrenceId" select="recurrenceId"/>
328     <!-- comment field to hold the user's suggestions:  -->
329     <input type="hidden" name="xbwsubmitcomment" id="bwEventComment" value=""/>
330
331       <!-- event info for edit event -->
332       <xsl:if test="/bedework/creating != 'true'">
333
334         <table class="common" cellspacing="0">
335           <tr>
336             <th colspan="2" class="commonHeader">
337               <div id="eventActions">
338                 <xsl:choose>
339                   <xsl:when test="recurrenceId != ''">
340                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
341                     Delete:
342                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}" title="delete master (recurring event)">all</a>,
343                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="delete instance (recurring event)">instance</a>
344                   </xsl:when>
345                   <xsl:otherwise>
346                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="delete event">
347                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
348                       Delete
349                       <xsl:if test="form/recurringEntity='true'">
350                         all
351                       </xsl:if>
352                     </a>
353                   </xsl:otherwise>
354                 </xsl:choose>
355               </div>
356               <!-- Display type of event -->
357               <xsl:variable name="entityType">
358                 <xsl:choose>
359                   <xsl:when test="entityType = '2'">Task</xsl:when>
360                   <xsl:when test="scheduleMethod = '2'">Meeting</xsl:when>
361                   <xsl:otherwise>Event</xsl:otherwise>
362                 </xsl:choose>
363               </xsl:variable>
364               <xsl:if test="form/recurringEntity='true' or recurrenceId != ''">
365                 Recurring
366               </xsl:if>
367               <xsl:choose>
368                 <xsl:when test="form">
369                   <!-- just a placeholder: need to add owner to the jsp -->
370                   Personal <xsl:value-of select="$entityType"/>
371                 </xsl:when>
372                 <xsl:when test="public = 'true'">
373                   Public <xsl:value-of select="$entityType"/>
374                 </xsl:when>
375                 <xsl:otherwise>
376                   <xsl:value-of select="$entityType"/> (<xsl:value-of select="calendar/owner"/>)
377                 </xsl:otherwise>
378               </xsl:choose>
379               <xsl:if test="form/recurringEntity='true' and recurrenceId = ''">
380                 <xsl:text> </xsl:text>
381                 <em>(recurrence master)</em>
382               </xsl:if>
383             </th>
384           </tr>
385         </table>
386       </xsl:if>
387
388     <div id="instructions">
389       <div id="bwHelp-Details">
390         <div class="navButtons">
391           <a href="javascript:show('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');hide('bwEventTab-Details','bwHelp-Details','bwBottomNav-Details');"
392              onclick="return validateStep1();">
393             next
394             <img alt="previous"
395               src="{$resourcesRoot}/resources/arrowRight.gif"
396               width="13"
397               height="13"
398               border="0"/>
399           </a>
400         </div>
401         <strong>Step 1:</strong> Enter Event Details. <em>Optional fields are italicized.</em>
402       </div>
403       <div id="bwHelp-Location" class="invisible">
404         <div class="navButtons">
405           <a href="javascript:show('bwEventTab-Details','bwHelp-Details','bwBottomNav-Details'); hide('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');">
406             <img alt="previous"
407               src="{$resourcesRoot}/resources/arrowLeft.gif"
408               width="13"
409               height="13"
410               border="0"/>
411           previous</a> |
412           <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact','bwBottomNav-Contact'); hide('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');"
413              onclick="return validateStep2();">
414             next
415             <img alt="previous"
416               src="{$resourcesRoot}/resources/arrowRight.gif"
417               width="13"
418               height="13"
419               border="0"/>
420           </a>
421         </div>
422         <strong>Step 2:</strong> Select Location.
423       </div>
424       <div id="bwHelp-Contact" class="invisible">
425         <div class="navButtons">
426           <a href="javascript:show('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location'); hide('bwHelp-Contact','bwEventTab-Contact','bwBottomNav-Contact');">
427             <img alt="previous"
428               src="{$resourcesRoot}/resources/arrowLeft.gif"
429               width="13"
430               height="13"
431               border="0"/>
432           previous</a> |
433           <a href="javascript:show('bwEventTab-Categories','bwHelp-Categories','bwBottomNav-Categories'); hide('bwHelp-Contact','bwEventTab-Contact','bwBottomNav-Contact');"
434              onclick="return validateStep3();">
435             next
436             <img alt="previous"
437               src="{$resourcesRoot}/resources/arrowRight.gif"
438               width="13"
439               height="13"
440               border="0"/>
441           </a>
442         </div>
443         <strong>Step 3:</strong> Select Contact.
444       </div>
445       <div id="bwHelp-Categories" class="invisible">
446         <div class="navButtons">
447           <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact','bwBottomNav-Contact'); hide('bwHelp-Categories','bwEventTab-Categories','bwBottomNav-Categories');">
448             <img alt="previous"
449               src="{$resourcesRoot}/resources/arrowLeft.gif"
450               width="13"
451               height="13"
452               border="0"/>
453           previous</a> |
454           <a href="javascript:show('bwHelp-Review','bwEventTab-Review','bwBottomNav-Review'); hide('bwHelp-Categories','bwEventTab-Categories','bwBottomNav-Categories'); ">
455             next
456             <img alt="previous"
457               src="{$resourcesRoot}/resources/arrowRight.gif"
458               width="13"
459               height="13"
460               border="0"/>
461           </a>
462         </div>
463         <strong>Step 4:</strong> Select Categories. <em>Optional.</em>
464       </div>
465       <div id="bwHelp-Review" class="invisible">
466         <div class="navButtons">
467           <a href="javascript:show('bwHelp-Categories','bwEventTab-Categories','bwBottomNav-Categories'); hide('bwHelp-Review','bwEventTab-Review','bwBottomNav-Review'); ">
468             <img alt="previous"
469               src="{$resourcesRoot}/resources/arrowLeft.gif"
470               width="13"
471               height="13"
472               border="0"/>
473           previous</a>
474           <span class="hidden">
475             <!-- this is here just to take up the appropriate space  -->
476             <xsl:text> </xsl:text>| next
477             <img alt="previous"
478               src="{$resourcesRoot}/resources/arrowRight.gif"
479               width="13"
480               height="13"
481               border="0"/>
482           </span>
483         </div>
484         <strong>Step 5:</strong> Add Comments. <em>Optional.</em>
485       </div>
486     </div>
487
488     <div id="eventFormContent">
489       <!-- Basic tab -->
490       <!-- ============== -->
491       <!-- this tab is visible by default -->
492       <div id="bwEventTab-Details">
493         <table cellspacing="0" class="common">
494           <!-- Calendar -->
495           <!-- ======== -->
496           <xsl:variable name="submissionCalendars">
497             <xsl:value-of select="count(/bedework/myCalendars//calendar[calType='1'])"/>
498           </xsl:variable>
499           <tr>
500             <xsl:if test="$submissionCalendars = 1">
501               <xsl:attribute name="class">invisible</xsl:attribute>
502               <!-- hide this row altogether if there is only one calendar; if you want the calendar
503                    path displayed, comment out this xsl:if. -->
504             </xsl:if>
505             <td class="fieldname">
506               Calendar:
507             </td>
508             <td class="fieldval">
509               <xsl:choose>
510                 <xsl:when test="$submissionCalendars = 1">
511                   <!-- there is only 1 writable calendar, just send a hidden field -->
512                   <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[calType='1']/path"/></xsl:variable>
513                   <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
514                   <span id="bwEventCalDisplay">
515                     <xsl:value-of select="$newCalPath"/>
516                   </span>
517                 </xsl:when>
518                 <xsl:otherwise>
519                   <select name="newCalPath" id="bwNewCalPathField">
520                     <xsl:for-each select="/bedework/myCalendars//calendar[calType='1']">
521                       <option>
522                         <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
523                         <xsl:value-of select="substring-after(substring-after(path,/bedework/submissionsRoot/unencoded),'/')"/>
524                       </option>
525                     </xsl:for-each>
526                   </select>
527                 </xsl:otherwise>
528               </xsl:choose>
529             </td>
530           </tr>
531           <!--  Summary (title) of event  -->
532           <!--  ========================= -->
533           <tr>
534             <td class="fieldname">
535               Title:
536             </td>
537             <td class="fieldval">
538               <div id="bwEventTitleNotice" class="invisible">You must include a title.</div> <!-- a holder for validation notes -->
539               <xsl:variable name="title" select="form/title/input/@value"/>
540               <input type="text" name="summary" size="80" value="{$title}" id="bwEventTitle"/>
541             </td>
542           </tr>
543
544           <!--  Date and Time -->
545           <!--  ============= -->
546           <tr>
547             <td class="fieldname">
548               Date &amp; Time:
549             </td>
550             <td class="fieldval">
551               <!-- Set the timefields class for the first load of the page;
552                    subsequent changes will take place using javascript without a
553                    page reload. -->
554               <xsl:variable name="timeFieldsClass">
555                 <xsl:choose>
556                   <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
557                   <xsl:otherwise>timeFields</xsl:otherwise>
558                 </xsl:choose>
559               </xsl:variable>
560
561               <!-- date only event: anniversary event - often interpreted as "all day event" -->
562               <xsl:choose>
563                 <xsl:when test="form/allDay/input/@checked='checked'">
564                   <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
565                   <input type="hidden" name="eventStartDate.dateOnly" value="true" id="allDayStartDateField"/>
566                   <input type="hidden" name="eventEndDate.dateOnly" value="true" id="allDayEndDateField"/>
567                 </xsl:when>
568                 <xsl:otherwise>
569                   <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
570                   <input type="hidden" name="eventStartDate.dateOnly" value="false" id="allDayStartDateField"/>
571                   <input type="hidden" name="eventEndDate.dateOnly" value="false" id="allDayEndDateField"/>
572                 </xsl:otherwise>
573               </xsl:choose>
574               all day
575
576               <!-- HIDE floating event: no timezone (and not UTC)
577               <xsl:choose>
578                 <xsl:when test="form/floating/input/@checked='checked'">
579                   <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="on" checked="checked"/>
580                   <input type="hidden" name="eventStartDate.floating" value="true" id="startFloating"/>
581                   <input type="hidden" name="eventEndDate.floating" value="true" id="endFloating"/>
582                 </xsl:when>
583                 <xsl:otherwise>
584                   <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="off"/>
585                   <input type="hidden" name="eventStartDate.floating" value="false" id="startFloating"/>
586                   <input type="hidden" name="eventEndDate.floating" value="false" id="endFloating"/>
587                 </xsl:otherwise>
588               </xsl:choose>
589               floating -->
590
591               <!-- HIDE store time as coordinated universal time (UTC)
592               <xsl:choose>
593                 <xsl:when test="form/storeUTC/input/@checked='checked'">
594                   <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="on" checked="checked"/>
595                   <input type="hidden" name="eventStartDate.storeUTC" value="true" id="startStoreUTC"/>
596                   <input type="hidden" name="eventEndDate.storeUTC" value="true" id="endStoreUTC"/>
597                 </xsl:when>
598                 <xsl:otherwise>
599                   <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="off"/>
600                   <input type="hidden" name="eventStartDate.storeUTC" value="false" id="startStoreUTC"/>
601                   <input type="hidden" name="eventEndDate.storeUTC" value="false" id="endStoreUTC"/>
602                 </xsl:otherwise>
603               </xsl:choose>
604               store as UTC-->
605
606               <br/>
607               <div class="dateStartEndBox">
608                 <strong>Start:</strong>
609                 <div class="dateFields">
610                   <span class="startDateLabel">Date </span>
611                   <xsl:choose>
612                     <xsl:when test="$portalFriendly = 'true'">
613                       <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
614                       <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
615                       <xsl:choose>
616                         <xsl:when test="/bedework/creating = 'true'">
617                           <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
618                         </xsl:when>
619                         <xsl:otherwise>
620                           <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
621                         </xsl:otherwise>
622                       </xsl:choose>
623                       <script language="JavaScript" type="text/javascript">
624                         <xsl:comment>
625                         startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', <xsl:value-of select="number(/bedework/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedework/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'startDateCalWidgetCallback', '<xsl:value-of select="$resourcesRoot"/>/resources/');
626                         </xsl:comment>
627                       </script>
628                     </xsl:when>
629                     <xsl:otherwise>
630                       <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetStartDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
631                         <xsl:attribute name="value"><xsl:value-of select="form/start/rfc3339DateTime"/></xsl:attribute>
632                         <xsl:text> </xsl:text>
633                       </span>
634                       <input type="hidden" name="eventStartDate.year">
635                         <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute>
636                       </input>
637                       <input type="hidden" name="eventStartDate.month">
638                         <xsl:attribute name="value"><xsl:value-of select="form/start/month/select/option[@selected = 'selected']/@value"/></xsl:attribute>
639                       </input>
640                       <input type="hidden" name="eventStartDate.day">
641                         <xsl:attribute name="value"><xsl:value-of select="form/start/day/select/option[@selected = 'selected']/@value"/></xsl:attribute>
642                       </input>
643                     </xsl:otherwise>
644                   </xsl:choose>
645                 </div>
646                 <div class="{$timeFieldsClass}" id="startTimeFields">
647                   <span id="calWidgetStartTimeHider" class="show">
648                     <xsl:copy-of select="form/start/hour/*"/>
649                     <xsl:copy-of select="form/start/minute/*"/>
650                     <xsl:if test="form/start/ampm">
651                       <xsl:copy-of select="form/start/ampm/*"/>
652                     </xsl:if>
653                     <xsl:text> </xsl:text>
654                     <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0" alt="bwClock"/></a>
655
656                     <select name="eventStartDate.tzid" id="startTzid" class="timezones">
657                       <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
658                       <option value="-1">select timezone...</option>
659                       <xsl:variable name="startTzId" select="form/start/tzid"/>
660                       <xsl:for-each select="/bedework/timezones/timezone">
661                         <option>
662                           <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
663                           <xsl:if test="$startTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
664                           <xsl:value-of select="name"/>
665                         </option>
666                       </xsl:for-each>
667                     </select>
668                   </span>
669                 </div>
670               </div>
671               <div class="dateStartEndBox">
672                 <strong>
673                   <xsl:choose>
674                     <xsl:when test="form/entityType = '2'">Due:</xsl:when>
675                     <xsl:otherwise>End:</xsl:otherwise>
676                   </xsl:choose>
677                 </strong>
678                 <xsl:choose>
679                   <xsl:when test="form/end/type='E'">
680                     <input type="radio" name="eventEndType" value="E" checked="checked" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
681                   </xsl:when>
682                   <xsl:otherwise>
683                     <input type="radio" name="eventEndType" value="E" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
684                   </xsl:otherwise>
685                 </xsl:choose>
686                 Date
687                 <xsl:variable name="endDateTimeClass">
688                   <xsl:choose>
689                     <xsl:when test="form/end/type='E'">shown</xsl:when>
690                     <xsl:otherwise>invisible</xsl:otherwise>
691                   </xsl:choose>
692                 </xsl:variable>
693                 <div class="{$endDateTimeClass}" id="endDateTime">
694                   <div class="dateFields">
695                     <xsl:choose>
696                       <xsl:when test="$portalFriendly = 'true'">
697                         <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
698                         <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
699                         <xsl:choose>
700                           <xsl:when test="/bedework/creating = 'true'">
701                             <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
702                           </xsl:when>
703                           <xsl:otherwise>
704                             <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
705                           </xsl:otherwise>
706                         </xsl:choose>
707                         <script language="JavaScript" type="text/javascript">
708                         <xsl:comment>
709                           endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', <xsl:value-of select="number(/bedework/formElements/form/start/yearText/input/@value)"/>, <xsl:value-of select="number(/bedework/formElements/form/start/month/select/option[@selected='selected']/@value)-1"/>, <xsl:value-of select="number(/bedework/formElements/form/start/day/select/option[@selected='selected']/@value)"/>, 'endDateCalWidgetCallback', '<xsl:value-of select="$resourcesRoot"/>/resources/');
710                         </xsl:comment>
711                         </script>
712                       </xsl:when>
713                       <xsl:otherwise>
714                         <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetEndDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
715                           <xsl:attribute name="value"><xsl:value-of select="form/end/rfc3339DateTime"/></xsl:attribute>
716                           <xsl:text> </xsl:text>
717                         </span>
718                         <input type="hidden" name="eventEndDate.year">
719                           <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/yearText/input/@value"/></xsl:attribute>
720                         </input>
721                         <input type="hidden" name="eventEndDate.month">
722                           <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/month/select/option[@selected = 'selected']/@value"/></xsl:attribute>
723                         </input>
724                         <input type="hidden" name="eventEndDate.day">
725                           <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/day/select/option[@selected = 'selected']/@value"/></xsl:attribute>
726                         </input>
727                       </xsl:otherwise>
728                     </xsl:choose>
729                   </div>
730                   <div class="{$timeFieldsClass}" id="endTimeFields">
731                     <span id="calWidgetEndTimeHider" class="show">
732                       <xsl:copy-of select="form/end/dateTime/hour/*"/>
733                       <xsl:copy-of select="form/end/dateTime/minute/*"/>
734                       <xsl:if test="form/end/dateTime/ampm">
735                         <xsl:copy-of select="form/end/dateTime/ampm/*"/>
736                       </xsl:if>
737                       <xsl:text> </xsl:text>
738                       <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0" alt="bwClock"/></a>
739
740                       <select name="eventEndDate.tzid" id="endTzid" class="timezones">
741                         <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
742                         <option value="-1">select timezone...</option>
743                         <xsl:variable name="endTzId" select="form/end/dateTime/tzid"/>
744                         <xsl:for-each select="/bedework/timezones/timezone">
745                           <option>
746                             <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
747                               <xsl:if test="$endTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
748                             <xsl:value-of select="name"/>
749                           </option>
750                         </xsl:for-each>
751                       </select>
752                     </span>
753                   </div>
754                 </div><br/>
755                 <div id="clock" class="invisible">
756                   <xsl:call-template name="clock"/>
757                 </div>
758                 <div class="dateFields">
759                   <xsl:choose>
760                     <xsl:when test="form/end/type='D'">
761                       <input type="radio" name="eventEndType" value="D" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
762                     </xsl:when>
763                     <xsl:otherwise>
764                       <input type="radio" name="eventEndType" value="D" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
765                     </xsl:otherwise>
766                   </xsl:choose>
767                   Duration
768                   <xsl:variable name="endDurationClass">
769                     <xsl:choose>
770                       <xsl:when test="form/end/type='D'">shown</xsl:when>
771                       <xsl:otherwise>invisible</xsl:otherwise>
772                     </xsl:choose>
773                   </xsl:variable>
774                   <xsl:variable name="durationHrMinClass">
775                     <xsl:choose>
776                       <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
777                       <xsl:otherwise>shown</xsl:otherwise>
778                     </xsl:choose>
779                   </xsl:variable>
780                   <div class="{$endDurationClass}" id="endDuration">
781                     <xsl:choose>
782                       <xsl:when test="form/end/duration/weeks/input/@value = '0'">
783                       <!-- we are using day, hour, minute format -->
784                       <!-- must send either no week value or week value of 0 (zero) -->
785                         <div class="durationBox">
786                           <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
787                           <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
788                           <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
789                           <span id="durationHrMin" class="{$durationHrMinClass}">
790                             <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
791                             <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
792                             <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
793                             <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
794                           </span>
795                         </div>
796                         <span class="durationSpacerText">or</span>
797                         <div class="durationBox">
798                           <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
799                           <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
800                           <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="disabled"/>weeks
801                         </div>
802                       </xsl:when>
803                       <xsl:otherwise>
804                         <!-- we are using week format -->
805                         <div class="durationBox">
806                           <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
807                           <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
808                           <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="disabled"/>days
809                           <span id="durationHrMin" class="{$durationHrMinClass}">
810                             <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
811                             <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="disabled"/>hours
812                             <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
813                             <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="disabled"/>minutes
814                           </span>
815                         </div>
816                         <span class="durationSpacerText">or</span>
817                         <div class="durationBox">
818                           <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
819                           <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
820                           <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
821                         </div>
822                       </xsl:otherwise>
823                     </xsl:choose>
824                   </div>
825                 </div><br/>
826                 <div class="dateFields" id="noDuration">
827                   <xsl:choose>
828                     <xsl:when test="form/end/type='N'">
829                       <input type="radio" name="eventEndType" value="N" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
830                     </xsl:when>
831                     <xsl:otherwise>
832                       <input type="radio" name="eventEndType" value="N" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
833                     </xsl:otherwise>
834                   </xsl:choose>
835                   This
836                   <xsl:choose>
837                     <xsl:when test="form/entityType = '2'">task</xsl:when>
838                     <xsl:otherwise>event</xsl:otherwise>
839                   </xsl:choose>
840                   has no duration / end date
841                 </div>
842               </div>
843             </td>
844           </tr>
845
846           <!--  Description  -->
847           <tr>
848             <td class="fieldname">Description:</td>
849             <td class="fieldval">
850               <div id="bwEventDescNotice" class="invisible">You must include a description.</div> <!-- a holder for validation notes -->
851               <xsl:choose>
852                 <xsl:when test="normalize-space(form/desc/textarea) = ''">
853                   <textarea name="description" cols="60" rows="4" id="bwEventDesc">
854                     <xsl:text> </xsl:text>
855                   </textarea>
856                   <!-- keep this space to avoid browser
857                   rendering errors when the text area is empty -->
858                 </xsl:when>
859                 <xsl:otherwise>
860                   <textarea name="description" cols="60" rows="4" id="bwEventDesc">
861                     <xsl:value-of select="form/desc/textarea"/>
862                   </textarea>
863                 </xsl:otherwise>
864               </xsl:choose>
865             </td>
866           </tr>
867           <!--  Link (url associated with event)  -->
868           <tr>
869             <td class="fieldname"><em>Event Link:</em></td>
870             <td class="fieldval">
871               <xsl:variable name="link" select="form/link/input/@value"/>
872               <input type="text" name="event.link" size="81" value="{$link}"/>
873               <span class="note"> optional</span>
874             </td>
875           </tr>
876           <!--  Status  -->
877           <tr>
878             <td class="fieldname">
879               Status:
880             </td>
881             <td class="fieldval">
882               <input type="radio" name="eventStatus" value="CONFIRMED">
883                 <xsl:if test="form/status = 'CONFIRMED' or /bedework/creating = 'true' or form/status = ''"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
884               </input>
885               confirmed
886               <input type="radio" name="eventStatus" value="TENTATIVE">
887                 <xsl:if test="form/status = 'TENTATIVE'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
888               </input>
889               tentative
890               <input type="radio" name="eventStatus" value="CANCELLED">
891                 <xsl:if test="form/status = 'CANCELLED'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
892               </input>
893               cancelled
894             </td>
895           </tr>
896         </table>
897       </div>
898
899       <!-- Location tab -->
900       <!-- ============== -->
901       <div id="bwEventTab-Location" class="invisible">
902         <div id="bwLocationUidNotice" class="invisible">You must either select a location or suggest one below.</div>
903         <div class="mainForm">
904           <span id="eventFormLocationList">
905             <select name="locationUid" class="bigSelect" id="bwLocationUid">
906               <option value="">select an existing location...</option>
907               <xsl:copy-of select="form/location/locationmenu/select/*"/>
908             </select>
909           </span>
910         </div>
911         <p class="subFormMessage">
912           Didn't find the location?  Suggest a new one:
913         </p>
914         <div class="subForm">
915           <p>
916             <label for="commentLocationAddress">Address: </label>
917             <input type="text" name="commentLocationAddress" id="bwCommentLocationAddress">
918               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-LOCATION']/values/text"/></xsl:attribute>
919             </input>
920           </p>
921           <p>
922             <label for="commentLocationSubaddress"><em>Sub-address:</em> </label>
923             <input type="text" name="commentLocationSubaddress" id="commentLocationSubaddress">
924               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-LOCATION']/parameters/node()[name()='X-BEDEWORK-PARAM-SUBADDRESS']"/></xsl:attribute>
925             </input>
926             <span class="note"> optional</span>
927           </p>
928           <p>
929             <label for="commentLocationURL"><em>URL:</em> </label>
930             <input type="text" name="commentLocationURL" id="commentLocationURL">
931               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-LOCATION']/parameters/node()[name()='X-BEDEWORK-PARAM-URL']"/></xsl:attribute>
932             </input>
933             <span class="note"> optional</span>
934           </p>
935         </div>
936       </div>
937
938       <!-- Contact tab -->
939       <!-- ============== -->
940       <div id="bwEventTab-Contact" class="invisible">
941         <div id="bwContactUidNotice" class="invisible">You must either select a contact or suggest one below.</div>
942         <div class="mainForm">
943           <select name="contactUid" id="bwContactUid" class="bigSelect">
944             <option value="">
945               select an existing contact...
946             </option>
947             <xsl:copy-of select="form/contact/all/select/*"/>
948           </select>
949         </div>
950         <p class="subFormMessage">
951           Didn't find the contact you need?  Suggest a new one:
952         </p>
953         <div class="subForm">
954           <p>
955             <label for="commentContactName">Organization Name: </label>
956             <input type="text" name="commentContactName" id="bwCommentContactName" size="40">
957               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-CONTACT']/values/text"/></xsl:attribute>
958             </input>
959             <span class="note"> Please limit contacts to organizations, not individuals.</span>
960           </p>
961           <p>
962             <label for="commentContactPhone"><em>Phone:</em> </label>
963             <input type="text" name="commentContactPhone">
964               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-CONTACT']/parameters/node()[name()='X-BEDEWORK-PARAM-PHONE']"/></xsl:attribute>
965             </input>
966             <span class="note"> optional</span>
967           </p>
968           <p>
969             <label for="commentContactURL"><em>URL:</em> </label>
970             <input type="text" name="commentContactURL">
971               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-CONTACT']/parameters/node()[name()='X-BEDEWORK-PARAM-URL']"/></xsl:attribute>
972             </input>
973             <span class="note"> optional</span>
974           </p>
975           <p>
976             <label for="commentContactEmail"><em>Email:</em> </label>
977             <input type="text" name="commentContactEmail">
978               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-CONTACT']/parameters/node()[name()='X-BEDEWORK-PARAM-EMAIL']"/></xsl:attribute>
979             </input>
980             <span class="note"> optional</span>
981           </p>
982         </div>
983       </div>
984
985       <!-- Categories tab -->
986       <!-- ============== -->
987       <div id="bwEventTab-Categories" class="invisible">
988         <xsl:variable name="catCount" select="count(form/categories/all/category)"/>
989         <xsl:choose>
990           <xsl:when test="not(form/categories/all/category)">
991             no categories defined
992           </xsl:when>
993           <xsl:otherwise>
994             <table cellpadding="0" id="allCategoryCheckboxes">
995               <tr>
996                 <td>
997                   <xsl:for-each select="form/categories/all/category[position() &lt;= ceiling($catCount div 2)]">
998                     <input type="checkbox" name="categoryKey">
999                       <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
1000                       <xsl:if test="keyword = ../../current//category/keyword"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
1001                       <xsl:value-of select="keyword"/>
1002                     </input><br/>
1003                   </xsl:for-each>
1004                 </td>
1005                 <td>
1006                   <xsl:for-each select="form/categories/all/category[position() &gt; ceiling($catCount div 2)]">
1007                     <input type="checkbox" name="categoryKey">
1008                       <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
1009                       <xsl:if test="keyword = ../../current//category/keyword"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
1010                       <xsl:value-of select="keyword"/>
1011                     </input><br/>
1012                   </xsl:for-each>
1013                 </td>
1014               </tr>
1015             </table>
1016           </xsl:otherwise>
1017         </xsl:choose>
1018         <p class="subFormMessage">
1019           Didn't find the category you want?  Suggest a new one:
1020         </p>
1021         <div class="subForm">
1022           <p>
1023             <label for="commentCategories">Category suggestion: </label>
1024             <input type="text" name="commentCategories" size="30">
1025               <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-CATEGORIES']/values/text"/></xsl:attribute>
1026             </input>
1027           </p>
1028         </div>
1029       </div>
1030
1031       <!--   Review tab   -->
1032       <!-- ============== -->
1033       <div id="bwEventTab-Review" class="invisible">
1034         <!--  <table id="bwEventSubmitReview" class="common">
1035           <tr>
1036             <th colspan="2">Event Details</th>
1037           </tr>-->
1038           <!-- the form elements will be inserted here -->
1039         <!-- </table>-->
1040         <div id="bwCommentNotes">
1041           Please supply any final notes or instructions regarding your event:<br/>
1042           <!-- note: don't remove the #160 from the textarea or browsers will see it as a closed tag when empty -->
1043           <textarea name="commentNotes" cols="60" rows="4"><!--
1044            --><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/values/text"/>&#160;<!--
1045            --></textarea>
1046         </div>
1047         <div class="eventSubmitButtons">
1048           <input name="submit" class="submit" type="submit" value="submit for approval"/>
1049           <input name="cancelled" type="submit" value="cancel"/>
1050         </div>
1051       </div>
1052     </div>
1053
1054     <div id="bwBottomNav">
1055       <div id="bwBottomNav-Details">
1056         <div class="navButtons">
1057           <a href="javascript:show('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location'); hide('bwEventTab-Details','bwHelp-Details','bwBottomNav-Details');">
1058             next
1059             <img alt="previous"
1060               src="{$resourcesRoot}/resources/arrowRight.gif"
1061               width="13"
1062               height="13"
1063               border="0"/>
1064           </a>
1065         </div>
1066       </div>
1067       <div id="bwBottomNav-Location" class="invisible">
1068         <div class="navButtons">
1069           <a href="javascript:show('bwEventTab-Details','bwHelp-Details','bwBottomNav-Details'); hide('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');">
1070             <img alt="previous"
1071               src="{$resourcesRoot}/resources/arrowLeft.gif"
1072               width="13"
1073               height="13"
1074               border="0"/>
1075           previous</a> |
1076           <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact','bwBottomNav-Contact'); hide('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location');">
1077             next
1078             <img alt="previous"
1079               src="{$resourcesRoot}/resources/arrowRight.gif"
1080               width="13"
1081               height="13"
1082               border="0"/>
1083           </a>
1084         </div>
1085       </div>
1086       <div id="bwBottomNav-Contact" class="invisible">
1087         <div class="navButtons">
1088           <a href="javascript:show('bwEventTab-Location','bwHelp-Location','bwBottomNav-Location'); hide('bwHelp-Contact','bwEventTab-Contact','bwBottomNav-Contact');">
1089             <img alt="previous"
1090               src="{$resourcesRoot}/resources/arrowLeft.gif"
1091               width="13"
1092               height="13"
1093               border="0"/>
1094           previous</a> |
1095           <a href="javascript:show('bwEventTab-Categories','bwHelp-Categories','bwBottomNav-Categories'); hide('bwHelp-Contact','bwEventTab-Contact','bwBottomNav-Contact');">
1096             next
1097             <img alt="previous"
1098               src="{$resourcesRoot}/resources/arrowRight.gif"
1099               width="13"
1100               height="13"
1101               border="0"/>
1102           </a>
1103         </div>
1104       </div>
1105       <div id="bwBottomNav-Categories" class="invisible">
1106         <div class="navButtons">
1107           <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact','bwBottomNav-Contact'); hide('bwHelp-Categories','bwEventTab-Categories','bwBottomNav-Categories');">
1108             <img alt="previous"
1109               src="{$resourcesRoot}/resources/arrowLeft.gif"
1110               width="13"
1111               height="13"
1112               border="0"/>
1113           previous</a> |
1114           <a href="javascript:show('bwHelp-Review','bwEventTab-Review','bwBottomNav-Review'); hide('bwHelp-Categories','bwEventTab-Categories','bwBottomNav-Categories');">
1115             <!-- displayReview('standardForm','bwEventSubmitReview',1) -->
1116             next
1117             <img alt="previous"
1118               src="{$resourcesRoot}/resources/arrowRight.gif"
1119               width="13"
1120               height="13"
1121               border="0"/>
1122           </a>
1123         </div>
1124       </div>
1125       <div id="bwBottomNav-Review" class="invisible">
1126         <div class="navButtons">
1127           <a href="javascript:show('bwHelp-Categories','bwEventTab-Categories','bwBottomNav-Categories'); hide('bwHelp-Review','bwEventTab-Review','bwBottomNav-Review'); ">
1128             <img alt="previous"
1129               src="{$resourcesRoot}/resources/arrowLeft.gif"
1130               width="13"
1131               height="13"
1132               border="0"/>
1133           previous</a>
1134           <span class="hidden">
1135             <xsl:text> </xsl:text>| next
1136             <img alt="previous"
1137               src="{$resourcesRoot}/resources/arrowRight.gif"
1138               width="13"
1139               height="13"
1140               border="0"/>
1141           </span>
1142         </div>
1143       </div>
1144     </div>
1145   </xsl:template>
1146
1147   <xsl:template match="val" mode="weekMonthYearNumbers">
1148     <xsl:if test="position() != 1 and position() = last()"> and </xsl:if>
1149     <xsl:value-of select="."/><xsl:choose>
1150       <xsl:when test="substring(., string-length(.)-1, 2) = '11' or
1151                       substring(., string-length(.)-1, 2) = '12' or
1152                       substring(., string-length(.)-1, 2) = '13'">th</xsl:when>
1153       <xsl:when test="substring(., string-length(.), 1) = '1'">st</xsl:when>
1154       <xsl:when test="substring(., string-length(.), 1) = '2'">nd</xsl:when>
1155       <xsl:when test="substring(., string-length(.), 1) = '3'">rd</xsl:when>
1156       <xsl:otherwise>th</xsl:otherwise>
1157     </xsl:choose>
1158     <xsl:if test="position() != last()">, </xsl:if>
1159   </xsl:template>
1160
1161   <xsl:template name="byDayChkBoxList">
1162     <xsl:param name="name"/>
1163     <xsl:for-each select="/bedework/shortdaynames/val">
1164       <xsl:variable name="pos" select="position()"/>
1165       <input type="checkbox">
1166         <xsl:attribute name="value"><xsl:value-of select="/bedework/recurdayvals/val[position() = $pos]"/></xsl:attribute>
1167         <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
1168       </input>
1169       <xsl:value-of select="."/>
1170     </xsl:for-each>
1171   </xsl:template>
1172
1173   <xsl:template name="buildCheckboxList">
1174     <xsl:param name="current"/>
1175     <xsl:param name="end"/>
1176     <xsl:param name="name"/>
1177     <xsl:param name="splitter">10</xsl:param>
1178     <span class="chkBoxListItem">
1179       <input type="checkbox">
1180         <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
1181         <xsl:attribute name="value"><xsl:value-of select="$current"/></xsl:attribute>
1182       </input>
1183       <xsl:value-of select="$current"/>
1184     </span>
1185     <xsl:if test="$current mod $splitter = 0"><br/></xsl:if>
1186     <xsl:if test="$current = $end"><br/></xsl:if>
1187     <xsl:if test="$current &lt; $end">
1188       <xsl:call-template name="buildCheckboxList">
1189         <xsl:with-param name="current"><xsl:value-of select="$current + 1"/></xsl:with-param>
1190         <xsl:with-param name="end"><xsl:value-of select="$end"/></xsl:with-param>
1191         <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param>
1192       </xsl:call-template>
1193     </xsl:if>
1194   </xsl:template>
1195
1196   <xsl:template name="recurrenceDayPosOptions">
1197     <option value="0">none</option>
1198     <option value="1">the first</option>
1199     <option value="2">the second</option>
1200     <option value="3">the third</option>
1201     <option value="4">the fourth</option>
1202     <option value="5">the fifth</option>
1203     <option value="-1">the last</option>
1204     <option value="">every</option>
1205   </xsl:template>
1206
1207   <xsl:template name="buildRecurFields">
1208     <xsl:param name="current"/>
1209     <xsl:param name="total"/>
1210     <xsl:param name="name"/>
1211     <div class="invisible">
1212       <xsl:attribute name="id"><xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current"/></xsl:attribute>
1213       and
1214       <select width="12em">
1215         <xsl:attribute name="name">by<xsl:value-of select="$name"/>posPos<xsl:value-of select="$current"/></xsl:attribute>
1216         <xsl:if test="$current != $total">
1217           <xsl:attribute name="onchange">changeClass('<xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current+1"/>','shown')</xsl:attribute>
1218         </xsl:if>
1219         <xsl:call-template name="recurrenceDayPosOptions"/>
1220       </select>
1221       <xsl:call-template name="byDayChkBoxList"/>
1222     </div>
1223     <xsl:if test="$current &lt; $total">
1224       <xsl:call-template name="buildRecurFields">
1225         <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param>
1226         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
1227         <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param>
1228       </xsl:call-template>
1229     </xsl:if>
1230   </xsl:template>
1231
1232   <xsl:template name="buildNumberOptions">
1233     <xsl:param name="current"/>
1234     <xsl:param name="total"/>
1235     <option value="{$current}"><xsl:value-of select="$current"/></option>
1236     <xsl:if test="$current &lt; $total">
1237       <xsl:call-template name="buildNumberOptions">
1238         <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param>
1239         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
1240       </xsl:call-template>
1241     </xsl:if>
1242   </xsl:template>
1243
1244   <xsl:template name="clock">
1245     <div id="bwClock">
1246       <!-- Bedework 24-Hour Clock time selection widget
1247            used with resources/bwClock.js and resources/bwClock.css -->
1248       <xsl:variable name="hour24" select="/bedework/hour24"/><!-- true or false -->
1249       <div id="bwClockClock">
1250         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="bwClock" usemap="#bwClockMap" />
1251       </div>
1252       <div id="bwClockCover">
1253         &#160;
1254         <!-- this is a special effect div used simply to cover the pixelated edge
1255              where the clock meets the clock box title -->
1256       </div>
1257       <div id="bwClockBox">
1258         <h2>
1259           Bedework 24-Hour Clock
1260         </h2>
1261         <div id="bwClockDateTypeIndicator">
1262           type
1263         </div>
1264         <div id="bwClockTime">
1265           select time
1266         </div>
1267         <div id="bwClockSwitch">
1268           switch
1269         </div>
1270         <div id="bwClockCloseText">
1271           close
1272         </div>
1273         <div id="bwClockCloseButton">
1274           <a href="javascript:bwClockClose();">X</a>
1275         </div>
1276       </div>
1277       <map name="bwClockMap" id="bwClockMap">
1278         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1279         <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')" />
1280         <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')" />
1281         <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')" />
1282         <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')" />
1283         <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')" />
1284         <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')" />
1285         <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')" />
1286         <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')" />
1287         <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')" />
1288         <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')" />
1289         <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')" />
1290         <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')" />
1291         <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})" />
1292         <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})" />
1293         <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})" />
1294         <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})" />
1295         <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})" />
1296         <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})" />
1297         <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})" />
1298         <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})" />
1299         <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})" />
1300         <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})" />
1301         <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})" />
1302         <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})" />
1303         <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})" />
1304         <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})" />
1305         <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})" />
1306         <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})" />
1307         <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})" />
1308         <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})" />
1309         <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})" />
1310         <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})" />
1311         <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})" />
1312         <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})" />
1313         <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})" />
1314         <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})" />
1315       </map>
1316     </div>
1317   </xsl:template>
1318
1319   <!--++++++++++++++++++ Events ++++++++++++++++++++-->
1320   <xsl:template name="eventList">
1321     <h1>Pending Events</h1>
1322     <p>
1323       The events below are waiting to be published by a
1324       calendar administrator.  You may edit or delete the
1325       events until they have been accepted.  Once your
1326       event is picked up, you
1327       will no longer see it in your list.
1328     </p>
1329     <xsl:call-template name="eventListCommon"/>
1330   </xsl:template>
1331
1332   <xsl:template name="eventListCommon">
1333     <table id="commonListTable">
1334       <tr>
1335         <th>Title</th>
1336         <!-- <th>Submitted</th> -->
1337         <th>Start</th>
1338         <th>End</th>
1339         <th>Categories</th>
1340         <th>Description</th>
1341       </tr>
1342
1343       <xsl:for-each select="/bedework/events/event">
1344         <xsl:variable name="subscriptionId" select="subscription/id"/>
1345         <xsl:variable name="calPath" select="calendar/encodedPath"/>
1346         <xsl:variable name="guid" select="guid"/>
1347         <xsl:variable name="recurrenceId" select="recurrenceId"/>
1348         <tr>
1349           <td>
1350             <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1351               <xsl:choose>
1352                 <xsl:when test="summary != ''">
1353                   <xsl:value-of select="summary"/>
1354                 </xsl:when>
1355                 <xsl:otherwise>
1356                   <em>no title</em>
1357                 </xsl:otherwise>
1358               </xsl:choose>
1359             </a>
1360           </td>
1361           <!-- need to output created date
1362           <td class="date">
1363             <xsl:value-of select="end/longdate"/>
1364           </td> -->
1365           <td class="date">
1366             <xsl:value-of select="start/shortdate"/>
1367             <xsl:text> </xsl:text>
1368             <xsl:value-of select="start/time"/>
1369           </td>
1370           <td class="date">
1371             <xsl:value-of select="end/shortdate"/>
1372             <xsl:text> </xsl:text>
1373             <xsl:value-of select="end/time"/>
1374           </td>
1375           <td>
1376             <xsl:for-each select="categories/category">
1377               <xsl:value-of select="word"/><br/>
1378             </xsl:for-each>
1379           </td>
1380           <td>
1381             <xsl:value-of select="description"/>
1382             <xsl:if test="recurring = 'true' or recurrenceId != ''">
1383               <div class="recurrenceEditLinks">
1384                 Recurring event.
1385                 Edit:
1386                 <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">
1387                   master
1388                 </a> |
1389                 <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1390                   instance
1391                 </a>
1392               </div>
1393             </xsl:if>
1394           </td>
1395         </tr>
1396       </xsl:for-each>
1397     </table>
1398   </xsl:template>
1399
1400   <!--==== UPLOAD ====-->
1401   <xsl:template name="upload">
1402   <!-- The name "eventForm" is referenced by several javascript functions. Do not
1403     change it without modifying bedework.js -->
1404     <form name="eventForm" method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
1405       <h2>Upload iCAL File</h2>
1406       <table class="common" cellspacing="0">
1407         <tr>
1408           <td class="fieldname">
1409             Filename:
1410           </td>
1411           <td align="left">
1412             <input type="file" name="uploadFile" size="60" />
1413           </td>
1414         </tr>
1415         <tr>
1416           <td class="fieldname padMeTop">
1417             Into calendar:
1418           </td>
1419           <td align="left" class="padMeTop">
1420             <input type="hidden" name="newCalPath" id="bwNewCalPathField" value=""/>
1421             <span id="bwEventCalDisplay">
1422               <em>default calendar</em>
1423             </span>
1424           </td>
1425         </tr>
1426         <tr>
1427           <td class="fieldname padMeTop">
1428             Effects free/busy:
1429           </td>
1430           <td align="left" class="padMeTop">
1431             <input type="radio" value="" name="transparency" checked="checked"/> accept event's settings<br/>
1432             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
1433             <input type="radio" value="TRANSPARENT" name="transparency"/> no <span class="note">(transparent: event status does not affect your free/busy)</span><br/>
1434           </td>
1435         </tr>
1436         <tr>
1437           <td class="fieldname padMeTop">
1438             Status:
1439           </td>
1440           <td align="left" class="padMeTop">
1441             <input type="radio" value="" name="status" checked="checked"/> accept event's status<br/>
1442             <input type="radio" value="CONFIRMED" name="status"/> confirmed<br/>
1443             <input type="radio" value="TENTATIVE" name="status"/> tentative<br/>
1444             <input type="radio" value="CANCELLED" name="status"/> cancelled<br/>
1445           </td>
1446         </tr>
1447       </table>
1448       <table border="0" id="submitTable">
1449         <tr>
1450           <td>
1451             <input name="submit" type="submit" value="Continue"/>
1452             <input name="cancelled" type="submit" value="cancel"/>
1453           </td>
1454         </tr>
1455       </table>
1456     </form>
1457   </xsl:template>
1458
1459   <!--==== UTILITY TEMPLATES ====-->
1460
1461   <!-- time formatter (should be extended as needed) -->
1462   <xsl:template name="timeFormatter">
1463     <xsl:param name="timeString"/><!-- required -->
1464     <xsl:param name="showMinutes">yes</xsl:param>
1465     <xsl:param name="showAmPm">yes</xsl:param>
1466     <xsl:param name="hour24">no</xsl:param>
1467     <xsl:variable name="hour" select="number(substring($timeString,1,2))"/>
1468     <xsl:variable name="minutes" select="substring($timeString,3,2)"/>
1469     <xsl:variable name="AmPm">
1470       <xsl:choose>
1471         <xsl:when test="$hour &lt; 12">AM</xsl:when>
1472         <xsl:otherwise>PM</xsl:otherwise>
1473       </xsl:choose>
1474     </xsl:variable>
1475     <xsl:choose>
1476       <xsl:when test="hour24 = 'yes'">
1477         <xsl:value-of select="$hour"/><!--
1478      --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if>
1479       </xsl:when>
1480       <xsl:otherwise>
1481         <xsl:choose>
1482           <xsl:when test="$hour = 0">12</xsl:when>
1483           <xsl:when test="$hour &lt; 13"><xsl:value-of select="$hour"/></xsl:when>
1484           <xsl:otherwise><xsl:value-of select="$hour - 12"/></xsl:otherwise>
1485         </xsl:choose><!--
1486      --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if>
1487         <xsl:if test="$showAmPm = 'yes'">
1488           <xsl:text> </xsl:text>
1489           <xsl:value-of select="$AmPm"/>
1490         </xsl:if>
1491       </xsl:otherwise>
1492     </xsl:choose>
1493   </xsl:template>
1494
1495   <!-- search and replace template taken from
1496        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1497   <xsl:template name="replace">
1498     <xsl:param name="string" select="''"/>
1499     <xsl:param name="pattern" select="''"/>
1500     <xsl:param name="replacement" select="''"/>
1501     <xsl:choose>
1502       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1503         <xsl:value-of select="substring-before($string, $pattern)"/>
1504         <xsl:copy-of select="$replacement"/>
1505         <xsl:call-template name="replace">
1506           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1507           <xsl:with-param name="pattern" select="$pattern"/>
1508           <xsl:with-param name="replacement" select="$replacement"/>
1509         </xsl:call-template>
1510       </xsl:when>
1511       <xsl:otherwise>
1512         <xsl:value-of select="$string"/>
1513       </xsl:otherwise>
1514     </xsl:choose>
1515   </xsl:template>
1516
1517   <!--==== FOOTER ====-->
1518   <xsl:template name="footer">
1519     <div id="footer">
1520       Demonstration calendar; place footer information here.
1521     </div>
1522     <div id="subfoot">
1523       <a href="http://www.bedework.org/">Bedework Website</a> |
1524       <a href="?noxslt=yes">show XML</a> |
1525       <a href="?refreshXslt=yes">refresh XSLT</a>
1526     </div>
1527   </xsl:template>
1528 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.