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

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

web clients: fix an xproperty initialization problem; clean some graphics

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