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

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

event submit: added validation, more changes to admin to accomodate

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