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

Revision 1651 (checked in by douglm, 5 years ago)

Break event submission for Arlen

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