root/releases/bedework-3.4.1/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl

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

submissions client: correct calendar path bug

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