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

Revision 1598 (checked in by johnsa, 6 years ago)

websubmit: further work on building up the UI

  • 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="menuTabs"/>
105           <div id="bodyContent">
106             <xsl:choose>
107               <xsl:when test="/bedework/page='addEvent'">
108                 <xsl:apply-templates select="/bedework/formElements" mode="addEvent"/>
109               </xsl:when>
110               <xsl:when test="/bedework/page='editEvent'">
111                 <xsl:apply-templates select="/bedework/formElements" mode="editEvent"/>
112               </xsl:when>
113               <xsl:when test="/bedework/page='upload'">
114                 <xsl:call-template name="upload" />
115               </xsl:when>
116               <xsl:otherwise>
117                 <!-- home / entrance screen -->
118                 <xsl:call-template name="home"/>
119               </xsl:otherwise>
120             </xsl:choose>
121           </div>
122           <!-- footer -->
123           <xsl:call-template name="footer"/>
124         </div>
125       </body>
126     </html>
127   </xsl:template>
128
129   <!--==== HEAD SECTION  ====-->
130   <xsl:template name="headSection">
131     <title>Bedework: Submit a Public Event</title>
132     <meta name="robots" content="noindex,nofollow"/>
133     <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
134     <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
135     <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
136     <!-- note: the non-breaking spaces in the script bodies below are to avoid
137          losing the script closing tags (which avoids browser problems) -->
138     <script type="text/javascript" src="{$resourcesRoot}/resources/bedework.js">&#160;</script>
139     <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js">&#160;</script>
140     <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
141     <script type="text/javascript" src="/bedework-common/javascript/dojo/dojo.js">&#160;</script>
142     <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkEventForm.js">&#160;</script>
143     <!-- <script type="text/javascript" src="{$resourcesRoot}/resources/bedeworkAccess.js">&#160;</script> -->
144     <xsl:if test="$portalFriendly = 'true'">
145       <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js">&#160;</script>
146       <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
147     </xsl:if>
148     <script type="text/javascript">
149       <xsl:comment>
150       <![CDATA[
151       function focusElement(id) {
152       // focuses element by id
153         document.getElementById(id).focus();
154       }
155       ]]>
156       </xsl:comment>
157     </script>
158   </xsl:template>
159
160   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
161
162   <xsl:template name="header">
163     <div id="header">
164       <a href="/bedework/">
165         <img id="logo"
166             alt="logo"
167             src="{$resourcesRoot}/resources/bedeworkAdminLogo.gif"
168             width="217"
169             height="40"
170             border="0"/>
171       </a>
172       <!-- set the page heading: -->
173       <h1>
174         Bedework Public Event Submission
175       </h1>
176
177       <xsl:call-template name="messagesAndErrors"/>
178
179     </div>
180     <div id="statusBar">
181       logged in as
182           <xsl:text> </xsl:text>
183           <strong><xsl:value-of select="/bedework/userid"/></strong>
184           <xsl:text> </xsl:text>
185           <span class="logout"><a href="{$setup}&amp;logout=true">logout</a></span>
186     </div>
187     <div id="titleBar">
188       CALENDAR of EVENTS
189     </div>
190   </xsl:template>
191
192   <xsl:template name="messagesAndErrors">
193     <xsl:if test="/bedework/message">
194       <ul id="messages">
195         <xsl:for-each select="/bedework/message">
196           <li><xsl:apply-templates select="."/></li>
197         </xsl:for-each>
198       </ul>
199     </xsl:if>
200     <xsl:if test="/bedework/error">
201       <ul id="errors">
202         <xsl:for-each select="/bedework/error">
203           <li><xsl:apply-templates select="."/></li>
204         </xsl:for-each>
205       </ul>
206     </xsl:if>
207   </xsl:template>
208
209   <!--==== MENUTABS ====-->
210   <xsl:template name="menuTabs">
211     <ul id="menuTabs">
212       <xsl:choose>
213         <xsl:when test="/bedework/page='home'">
214           <li class="selected">Overview</li>
215           <li><a href="{$initEvent}">Add Event</a></li>
216           <li><a href="">My Pending Events</a></li>
217         </xsl:when>
218         <xsl:when test="/bedework/page='eventList'">
219           <li><a href="{$setup}">Overview</a></li>
220           <li><a href="{$initEvent}">Add Event</a></li>
221           <li class="selected">My Pending Events</li>
222         </xsl:when>
223         <xsl:otherwise>
224           <li><a href="{$setup}">Overview</a></li>
225           <li class="selected">Add Event</li>
226           <li><a href="">My Pending Events</a></li>
227         </xsl:otherwise>
228       </xsl:choose>
229     </ul>
230   </xsl:template>
231
232   <!--==== HOME ====-->
233   <xsl:template name="home">
234     Descriptive information here
235   </xsl:template>
236
237   <!--==== ADD EVENT ====-->
238   <xsl:template match="formElements" mode="addEvent">
239     <form name="eventForm" method="post" action="{$addEvent}" id="standardForm" onsubmit="setEventFields(this)">
240       <xsl:apply-templates select="." mode="eventForm"/>
241     </form>
242   </xsl:template>
243
244   <!--==== EDIT EVENT ====-->
245   <xsl:template match="formElements" mode="editEvent">
246     <form name="eventForm" method="post" action="{$updateEvent}" id="standardForm" onsubmit="setEventFields(this)">
247       <xsl:apply-templates select="." mode="eventForm"/>
248     </form>
249   </xsl:template>
250
251
252   <!--==== ADD and EDIT EVENT FORM ====-->
253   <xsl:template match="formElements" mode="eventForm">
254     <xsl:variable name="subscriptionId" select="subscriptionId"/>
255     <xsl:variable name="calPathEncoded" select="form/calendar/encodedPath"/>
256     <xsl:variable name="calPath" select="form/calendar/path"/>
257     <xsl:variable name="guid" select="guid"/>
258     <xsl:variable name="recurrenceId" select="recurrenceId"/>
259     <input type="hidden" name="endType" value="date"/>
260
261       <!-- event info for edit event -->
262       <xsl:if test="/bedework/creating != 'true'">
263
264         <table class="common" cellspacing="0">
265           <tr>
266             <th colspan="2" class="commonHeader">
267               <div id="eventActions">
268                 <xsl:choose>
269                   <xsl:when test="recurrenceId != ''">
270                     <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
271                     Delete:
272                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}" title="delete master (recurring event)">all</a>,
273                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="delete instance (recurring event)">instance</a>
274                   </xsl:when>
275                   <xsl:otherwise>
276                     <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="delete event">
277                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete"/>
278                       Delete
279                       <xsl:if test="form/recurringEntity='true'">
280                         all
281                       </xsl:if>
282                     </a>
283                   </xsl:otherwise>
284                 </xsl:choose>
285               </div>
286               <!-- Display type of event -->
287               <xsl:variable name="entityType">
288                 <xsl:choose>
289                   <xsl:when test="entityType = '2'">Task</xsl:when>
290                   <xsl:when test="scheduleMethod = '2'">Meeting</xsl:when>
291                   <xsl:otherwise>Event</xsl:otherwise>
292                 </xsl:choose>
293               </xsl:variable>
294               <xsl:if test="form/recurringEntity='true' or recurrenceId != ''">
295                 Recurring
296               </xsl:if>
297               <xsl:choose>
298                 <xsl:when test="form">
299                   <!-- just a placeholder: need to add owner to the jsp -->
300                   Personal <xsl:value-of select="$entityType"/>
301                 </xsl:when>
302                 <xsl:when test="public = 'true'">
303                   Public <xsl:value-of select="$entityType"/>
304                 </xsl:when>
305                 <xsl:otherwise>
306                   <xsl:value-of select="$entityType"/> (<xsl:value-of select="calendar/owner"/>)
307                 </xsl:otherwise>
308               </xsl:choose>
309               <xsl:if test="form/recurringEntity='true' and recurrenceId = ''">
310                 <xsl:text> </xsl:text>
311                 <em>(recurrence master)</em>
312               </xsl:if>
313             </th>
314           </tr>
315         </table>
316       </xsl:if>
317
318       <!-- event form submenu -->
319       <!--
320       <ul id="eventFormTabs" class="submenu">
321         <li class="selected">
322           <a href="javascript:setTab('eventFormTabs',0); show('bwEventTab-Details'); hide('bwEventTab-Location','bwEventTab-Categories','bwEventTab-Contact');">
323             1. details
324           </a>
325         </li>
326         <li>
327           <a href="javascript:setTab('eventFormTabs',1); show('bwEventTab-Location'); hide('bwEventTab-Details','bwEventTab-Categories','bwEventTab-Contact');">
328             2. location
329           </a>
330         </li>
331         <li>
332           <a href="javascript:setTab('eventFormTabs',2); show('bwEventTab-Contact'); hide('bwEventTab-Details','bwEventTab-Location','bwEventTab-Categories');">
333             3. contact
334           </a>
335         </li>
336         <li>
337           <a href="javascript:setTab('eventFormTabs',3); show('bwEventTab-Categories'); hide('bwEventTab-Details','bwEventTab-Location','bwEventTab-Contact');">
338             4. categories
339           </a>
340         </li>
341       </ul>
342     -->
343
344     <div id="instructions">
345       <div id="bwHelp-Details">
346         <strong>Step 1:</strong> Enter your basic event information.
347         <a href="javascript:show('bwEventTab-Location','bwHelp-Location'); hide('bwEventTab-Details','bwHelp-Details');">
348           next&gt;
349         </a>
350       </div>
351       <div id="bwHelp-Location" class="invisible">
352         <strong>Step 2:</strong> Enter your location.
353         <a href="javascript:show('bwEventTab-Details','bwHelp-Details'); hide('bwEventTab-Location','bwHelp-Location');">
354           &lt;prev
355         </a>
356         <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact'); hide('bwEventTab-Location','bwHelp-Location');">
357           next&gt;
358         </a>
359       </div>
360       <div id="bwHelp-Contact" class="invisible">
361           <strong>Step 3:</strong> Select an event contact.
362           <a href="javascript:show('bwEventTab-Location','bwHelp-Location'); hide('bwHelp-Contact','bwEventTab-Contact');">
363             &lt;prev
364           </a>
365           <a href="javascript:show('bwEventTab-Categories','bwHelp-Categories'); hide('bwHelp-Contact','bwEventTab-Contact');">
366             next&gt;
367           </a>
368         </div>
369       <div id="bwHelp-Categories" class="invisible">
370         <strong>Step 4:</strong> Select categories.
371         <a href="javascript:show('bwEventTab-Contact','bwHelp-Contact'); hide('bwHelp-Categories','bwEventTab-Categories');">
372           &lt;prev
373         </a>
374         <div class="eventSubmitButtons">
375           <input name="submit" type="submit" value="submit for approval"/>
376           <input name="cancelled" type="submit" value="cancel"/>
377         </div>
378       </div>
379     </div>
380
381     <div id="eventFormContent">
382       <!-- Basic tab -->
383       <!-- ============== -->
384       <!-- this tab is visible by default -->
385       <div id="bwEventTab-Details">
386         <!--  For now, hard code the path to the submissions calendar -->
387         <input type="hidden" name="newCalPath" value="/public/unbrowsable/submissions/submissions"/>
388         <table cellspacing="0" class="common">
389           <!--  and hide calendar selection code;
390           <tr>
391             <td class="fieldname">
392               Calendar:
393             </td>
394             <td class="fieldval">
395               // the string "user/" should not be hard coded; fix this
396               <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
397               <xsl:variable name="writableCalendars">
398                 <xsl:value-of select="
399                   count(/bedework/myCalendars//calendar[calType = '1' and
400                          currentAccess/current-user-privilege-set/privilege/write-content]) +
401                   count(/bedework/mySubscriptions//calendar[calType = '1' and
402                          currentAccess/current-user-privilege-set/privilege/write-content and
403                          (not(contains(path,$userPath)))])"/>
404               </xsl:variable>
405               <xsl:choose>
406                 <xsl:when test="$writableCalendars = 1">
407                   // there is only 1 writable calendar, so find it by looking down both trees at once
408                   <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[calType = '1' and
409                            currentAccess/current-user-privilege-set/privilege/write-content]/path"/><xsl:value-of select="/bedework/mySubscriptions//calendar[calType = '1' and
410                          currentAccess/current-user-privilege-set/privilege/write-content and
411                          (not(contains(path,$userPath)))]/path"/></xsl:variable>
412
413                   <input type="hidden" name="newCalPath" value="{$newCalPath}"/>
414
415                   <xsl:variable name="userFullPath"><xsl:value-of select="$userPath"/>/</xsl:variable>
416                   <span id="bwEventCalDisplay">
417                     <xsl:choose>
418                       <xsl:when test="contains($newCalPath,$userFullPath)">
419                         <xsl:value-of select="substring-after($newCalPath,$userFullPath)"/>
420                       </xsl:when>
421                       <xsl:otherwise>
422                         <xsl:value-of select="$newCalPath"/>
423                       </xsl:otherwise>
424                     </xsl:choose>
425                   </span>
426                 </xsl:when>
427                 <xsl:otherwise>
428                   <input type="hidden" name="newCalPath" id="bwNewCalPathField">
429                     <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute>
430                   </input>
431
432                   <xsl:variable name="userFullPath"><xsl:value-of select="$userPath"/>/</xsl:variable>
433                   <span id="bwEventCalDisplay">
434                     <xsl:choose>
435                       <xsl:when test="contains(form/calendar/path,$userFullPath)">
436                         <xsl:value-of select="substring-after(form/calendar/path,$userFullPath)"/>
437                       </xsl:when>
438                       <xsl:otherwise>
439                         <xsl:value-of select="form/calendar/path"/>
440                       </xsl:otherwise>
441                     </xsl:choose>
442                     <xsl:text> </xsl:text>
443                     // this final text element is required to avoid an empty
444                          span element which is improperly rendered in the browser
445                   </span>
446
447                 </xsl:otherwise>
448               </xsl:choose>
449             </td>
450           </tr>
451           -->
452           <!--  Summary (title) of event  -->
453           <tr>
454             <td class="fieldname">
455               Title:
456             </td>
457             <td class="fieldval">
458               <xsl:variable name="title" select="form/title/input/@value"/>
459               <input type="text" name="summary" size="80" value="{$title}" id="bwEventTitle"/>
460             </td>
461           </tr>
462
463           <!--  Date and Time -->
464           <!--  ============= -->
465           <tr>
466             <td class="fieldname">
467               Date &amp; Time:
468             </td>
469             <td class="fieldval">
470               <!-- Set the timefields class for the first load of the page;
471                    subsequent changes will take place using javascript without a
472                    page reload. -->
473               <xsl:variable name="timeFieldsClass">
474                 <xsl:choose>
475                   <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
476                   <xsl:otherwise>timeFields</xsl:otherwise>
477                 </xsl:choose>
478               </xsl:variable>
479
480               <!-- date only event: anniversary event - often interpreted as "all day event" -->
481               <xsl:choose>
482                 <xsl:when test="form/allDay/input/@checked='checked'">
483                   <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
484                   <input type="hidden" name="eventStartDate.dateOnly" value="true" id="allDayStartDateField"/>
485                   <input type="hidden" name="eventEndDate.dateOnly" value="true" id="allDayEndDateField"/>
486                 </xsl:when>
487                 <xsl:otherwise>
488                   <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
489                   <input type="hidden" name="eventStartDate.dateOnly" value="false" id="allDayStartDateField"/>
490                   <input type="hidden" name="eventEndDate.dateOnly" value="false" id="allDayEndDateField"/>
491                 </xsl:otherwise>
492               </xsl:choose>
493               all day
494
495               <!-- HIDE floating event: no timezone (and not UTC)
496               <xsl:choose>
497                 <xsl:when test="form/floating/input/@checked='checked'">
498                   <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="on" checked="checked"/>
499                   <input type="hidden" name="eventStartDate.floating" value="true" id="startFloating"/>
500                   <input type="hidden" name="eventEndDate.floating" value="true" id="endFloating"/>
501                 </xsl:when>
502                 <xsl:otherwise>
503                   <input type="checkbox" name="floatingFlag" id="floatingFlag" onclick="swapFloatingTime(this)" value="off"/>
504                   <input type="hidden" name="eventStartDate.floating" value="false" id="startFloating"/>
505                   <input type="hidden" name="eventEndDate.floating" value="false" id="endFloating"/>
506                 </xsl:otherwise>
507               </xsl:choose>
508               floating -->
509
510               <!-- HIDE store time as coordinated universal time (UTC)
511               <xsl:choose>
512                 <xsl:when test="form/storeUTC/input/@checked='checked'">
513                   <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="on" checked="checked"/>
514                   <input type="hidden" name="eventStartDate.storeUTC" value="true" id="startStoreUTC"/>
515                   <input type="hidden" name="eventEndDate.storeUTC" value="true" id="endStoreUTC"/>
516                 </xsl:when>
517                 <xsl:otherwise>
518                   <input type="checkbox" name="storeUTCFlag" id="storeUTCFlag" onclick="swapStoreUTC(this)" value="off"/>
519                   <input type="hidden" name="eventStartDate.storeUTC" value="false" id="startStoreUTC"/>
520                   <input type="hidden" name="eventEndDate.storeUTC" value="false" id="endStoreUTC"/>
521                 </xsl:otherwise>
522               </xsl:choose>
523               store as UTC-->
524
525               <br/>
526               <div class="dateStartEndBox">
527                 <strong>Start:</strong>
528                 <div class="dateFields">
529                   <span class="startDateLabel">Date </span>
530                   <xsl:choose>
531                     <xsl:when test="$portalFriendly = 'true'">
532                       <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
533                       <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
534                       <xsl:choose>
535                         <xsl:when test="/bedework/creating = 'true'">
536                           <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
537                         </xsl:when>
538                         <xsl:otherwise>
539                           <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
540                         </xsl:otherwise>
541                       </xsl:choose>
542                       <script language="JavaScript" type="text/javascript">
543                         <xsl:comment>
544                         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/');
545                         </xsl:comment>
546                       </script>
547                     </xsl:when>
548                     <xsl:otherwise>
549                       <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetStartDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
550                         <xsl:attribute name="value"><xsl:value-of select="form/start/rfc3339DateTime"/></xsl:attribute>
551                         <xsl:text> </xsl:text>
552                       </span>
553                       <input type="hidden" name="eventStartDate.year">
554                         <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute>
555                       </input>
556                       <input type="hidden" name="eventStartDate.month">
557                         <xsl:attribute name="value"><xsl:value-of select="form/start/month/select/option[@selected = 'selected']/@value"/></xsl:attribute>
558                       </input>
559                       <input type="hidden" name="eventStartDate.day">
560                         <xsl:attribute name="value"><xsl:value-of select="form/start/day/select/option[@selected = 'selected']/@value"/></xsl:attribute>
561                       </input>
562                     </xsl:otherwise>
563                   </xsl:choose>
564                 </div>
565                 <div class="{$timeFieldsClass}" id="startTimeFields">
566                   <span id="calWidgetStartTimeHider" class="show">
567                     <xsl:copy-of select="form/start/hour/*"/>
568                     <xsl:copy-of select="form/start/minute/*"/>
569                     <xsl:if test="form/start/ampm">
570                       <xsl:copy-of select="form/start/ampm/*"/>
571                     </xsl:if>
572                     <xsl:text> </xsl:text>
573                     <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0" alt="bwClock"/></a>
574
575                     <select name="eventStartDate.tzid" id="startTzid" class="timezones">
576                       <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
577                       <option value="-1">select timezone...</option>
578                       <xsl:variable name="startTzId" select="form/start/tzid"/>
579                       <xsl:for-each select="/bedework/timezones/timezone">
580                         <option>
581                           <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
582                           <xsl:if test="$startTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
583                           <xsl:value-of select="name"/>
584                         </option>
585                       </xsl:for-each>
586                     </select>
587                   </span>
588                 </div>
589               </div>
590               <div class="dateStartEndBox">
591                 <strong>
592                   <xsl:choose>
593                     <xsl:when test="form/entityType = '2'">Due:</xsl:when>
594                     <xsl:otherwise>End:</xsl:otherwise>
595                   </xsl:choose>
596                 </strong>
597                 <xsl:choose>
598                   <xsl:when test="form/end/type='E'">
599                     <input type="radio" name="eventEndType" value="E" checked="checked" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
600                   </xsl:when>
601                   <xsl:otherwise>
602                     <input type="radio" name="eventEndType" value="E" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
603                   </xsl:otherwise>
604                 </xsl:choose>
605                 Date
606                 <xsl:variable name="endDateTimeClass">
607                   <xsl:choose>
608                     <xsl:when test="form/end/type='E'">shown</xsl:when>
609                     <xsl:otherwise>invisible</xsl:otherwise>
610                   </xsl:choose>
611                 </xsl:variable>
612                 <div class="{$endDateTimeClass}" id="endDateTime">
613                   <div class="dateFields">
614                     <xsl:choose>
615                       <xsl:when test="$portalFriendly = 'true'">
616                         <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
617                         <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
618                         <xsl:choose>
619                           <xsl:when test="/bedework/creating = 'true'">
620                             <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
621                           </xsl:when>
622                           <xsl:otherwise>
623                             <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
624                           </xsl:otherwise>
625                         </xsl:choose>
626                         <script language="JavaScript" type="text/javascript">
627                         <xsl:comment>
628                           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/');
629                         </xsl:comment>
630                         </script>
631                       </xsl:when>
632                       <xsl:otherwise>
633                         <span dojoType="dropdowndatepicker" formatLength="medium" value="today" saveFormat="yyyyMMdd" id="bwEventWidgetEndDate" iconURL="{$resourcesRoot}/resources/calIcon.gif">
634                           <xsl:attribute name="value"><xsl:value-of select="form/end/rfc3339DateTime"/></xsl:attribute>
635                           <xsl:text> </xsl:text>
636                         </span>
637                         <input type="hidden" name="eventEndDate.year">
638                           <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/yearText/input/@value"/></xsl:attribute>
639                         </input>
640                         <input type="hidden" name="eventEndDate.month">
641                           <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/month/select/option[@selected = 'selected']/@value"/></xsl:attribute>
642                         </input>
643                         <input type="hidden" name="eventEndDate.day">
644                           <xsl:attribute name="value"><xsl:value-of select="form/end/dateTime/day/select/option[@selected = 'selected']/@value"/></xsl:attribute>
645                         </input>
646                       </xsl:otherwise>
647                     </xsl:choose>
648                   </div>
649                   <div class="{$timeFieldsClass}" id="endTimeFields">
650                     <span id="calWidgetEndTimeHider" class="show">
651                       <xsl:copy-of select="form/end/dateTime/hour/*"/>
652                       <xsl:copy-of select="form/end/dateTime/minute/*"/>
653                       <xsl:if test="form/end/dateTime/ampm">
654                         <xsl:copy-of select="form/end/dateTime/ampm/*"/>
655                       </xsl:if>
656                       <xsl:text> </xsl:text>
657                       <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0" alt="bwClock"/></a>
658
659                       <select name="eventEndDate.tzid" id="endTzid" class="timezones">
660                         <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if>
661                         <option value="-1">select timezone...</option>
662                         <xsl:variable name="endTzId" select="form/end/dateTime/tzid"/>
663                         <xsl:for-each select="/bedework/timezones/timezone">
664                           <option>
665                             <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
666                               <xsl:if test="$endTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
667                             <xsl:value-of select="name"/>
668                           </option>
669                         </xsl:for-each>
670                       </select>
671                     </span>
672                   </div>
673                 </div><br/>
674                 <div id="clock" class="invisible">
675                   <xsl:call-template name="clock"/>
676                 </div>
677                 <div class="dateFields">
678                   <xsl:choose>
679                     <xsl:when test="form/end/type='D'">
680                       <input type="radio" name="eventEndType" value="D" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
681                     </xsl:when>
682                     <xsl:otherwise>
683                       <input type="radio" name="eventEndType" value="D" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
684                     </xsl:otherwise>
685                   </xsl:choose>
686                   Duration
687                   <xsl:variable name="endDurationClass">
688                     <xsl:choose>
689                       <xsl:when test="form/end/type='D'">shown</xsl:when>
690                       <xsl:otherwise>invisible</xsl:otherwise>
691                     </xsl:choose>
692                   </xsl:variable>
693                   <xsl:variable name="durationHrMinClass">
694                     <xsl:choose>
695                       <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
696                       <xsl:otherwise>shown</xsl:otherwise>
697                     </xsl:choose>
698                   </xsl:variable>
699                   <div class="{$endDurationClass}" id="endDuration">
700                     <xsl:choose>
701                       <xsl:when test="form/end/duration/weeks/input/@value = '0'">
702                       <!-- we are using day, hour, minute format -->
703                       <!-- must send either no week value or week value of 0 (zero) -->
704                         <div class="durationBox">
705                           <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
706                           <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
707                           <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
708                           <span id="durationHrMin" class="{$durationHrMinClass}">
709                             <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
710                             <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
711                             <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
712                             <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
713                           </span>
714                         </div>
715                         <span class="durationSpacerText">or</span>
716                         <div class="durationBox">
717                           <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
718                           <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
719                           <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="disabled"/>weeks
720                         </div>
721                       </xsl:when>
722                       <xsl:otherwise>
723                         <!-- we are using week format -->
724                         <div class="durationBox">
725                           <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
726                           <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
727                           <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="disabled"/>days
728                           <span id="durationHrMin" class="{$durationHrMinClass}">
729                             <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
730                             <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="disabled"/>hours
731                             <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
732                             <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="disabled"/>minutes
733                           </span>
734                         </div>
735                         <span class="durationSpacerText">or</span>
736                         <div class="durationBox">
737                           <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
738                           <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
739                           <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
740                         </div>
741                       </xsl:otherwise>
742                     </xsl:choose>
743                   </div>
744                 </div><br/>
745                 <div class="dateFields" id="noDuration">
746                   <xsl:choose>
747                     <xsl:when test="form/end/type='N'">
748                       <input type="radio" name="eventEndType" value="N" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
749                     </xsl:when>
750                     <xsl:otherwise>
751                       <input type="radio" name="eventEndType" value="N" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
752                     </xsl:otherwise>
753                   </xsl:choose>
754                   This
755                   <xsl:choose>
756                     <xsl:when test="form/entityType = '2'">task</xsl:when>
757                     <xsl:otherwise>event</xsl:otherwise>
758                   </xsl:choose>
759                   has no duration / end date
760                 </div>
761               </div>
762             </td>
763           </tr>
764
765
766           <!--  Link (url associated with event)  -->
767           <tr>
768             <td class="fieldname">Event Link:</td>
769             <td class="fieldval">
770               <xsl:variable name="link" select="form/link/input/@value"/>
771               <input type="text" name="event.link" size="80" value="{$link}"/>
772             </td>
773           </tr>
774           <!--  Description  -->
775           <tr>
776             <td class="fieldname">Description:</td>
777             <td class="fieldval">
778               <xsl:choose>
779                 <xsl:when test="normalize-space(form/desc/textarea) = ''">
780                   <textarea name="description" cols="60" rows="4">
781                     <xsl:text> </xsl:text>
782                   </textarea>
783                   <!-- keep this space to avoid browser
784                   rendering errors when the text area is empty -->
785                 </xsl:when>
786                 <xsl:otherwise>
787                   <textarea name="description" cols="60" rows="4">
788                     <xsl:value-of select="form/desc/textarea"/>
789                   </textarea>
790                 </xsl:otherwise>
791               </xsl:choose>
792             </td>
793           </tr>
794           <!--  Status  -->
795           <tr>
796             <td class="fieldname">
797               Status:
798             </td>
799             <td class="fieldval">
800               <input type="radio" name="eventStatus" value="CONFIRMED">
801                 <xsl:if test="form/status = 'CONFIRMED' or /bedework/creating = 'true' or form/status = ''"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
802               </input>
803               confirmed
804               <input type="radio" name="eventStatus" value="TENTATIVE">
805                 <xsl:if test="form/status = 'TENTATIVE'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
806               </input>
807               tentative
808               <input type="radio" name="eventStatus" value="CANCELLED">
809                 <xsl:if test="form/status = 'CANCELLED'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
810               </input>
811               cancelled
812             </td>
813           </tr>
814         </table>
815       </div>
816
817       <!-- Location tab -->
818       <!-- ============== -->
819       <div id="bwEventTab-Location" class="invisible">
820         <span class="std-text">Choose: </span>
821         <span id="eventFormLocationList">
822           <select name="locationUid">
823             <option value="">select...</option>
824             <xsl:copy-of select="form/location/locationmenu/select/*"/>
825           </select>
826         </span>
827       </div>
828
829       <!-- Contact tab -->
830       <!-- ============== -->
831       <div id="bwEventTab-Contact" class="invisible">
832         <p><strong>Select a contact:</strong></p>
833         <xsl:if test="form/contact/preferred/select/option">
834           <select name="prefContactId" id="eventFormContactList">
835             <option value="">
836               Select preferred:
837             </option>option>
838             <xsl:copy-of select="form/contact/preferred/select/*"/>
839           </select>
840           or Contact (all):
841         </xsl:if>
842         <select name="allContactId" id="eventFormPrefContactList">
843           <option value="">
844             Select:
845           </option>
846           <xsl:copy-of select="form/contact/all/select/*"/>
847         </select>
848       </div>
849
850       <!-- Categories tab -->
851       <!-- ============== -->
852       <div id="bwEventTab-Categories" class="invisible">
853         <p><strong>Choose categories:</strong></p>
854         <xsl:variable name="catCount" select="count(form/categories/all/category)"/>
855         <xsl:choose>
856           <xsl:when test="not(form/categories/all/category)">
857             no categories defined
858           </xsl:when>
859           <xsl:otherwise>
860             <table cellpadding="0" id="allCategoryCheckboxes">
861               <tr>
862                 <td>
863                   <xsl:for-each select="form/categories/all/category[position() &lt;= ceiling($catCount div 2)]">
864                     <input type="checkbox" name="categoryKey">
865                       <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
866                       <xsl:if test="keyword = form/categories/current//category/keyword"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
867                       <xsl:value-of select="keyword"/>
868                     </input><br/>
869                   </xsl:for-each>
870                 </td>
871                 <td>
872                   <xsl:for-each select="form/categories/all/category[position() &gt; ceiling($catCount div 2)]">
873                     <input type="checkbox" name="categoryKey">
874                       <xsl:attribute name="value"><xsl:value-of select="keyword"/></xsl:attribute>
875                       <xsl:if test="keyword = form/categories/current//category/keyword"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>
876                       <xsl:value-of select="keyword"/>
877                     </input><br/>
878                   </xsl:for-each>
879                 </td>
880               </tr>
881             </table>
882           </xsl:otherwise>
883         </xsl:choose>
884       </div>
885     </div>
886   </xsl:template>
887
888   <xsl:template match="val" mode="weekMonthYearNumbers">
889     <xsl:if test="position() != 1 and position() = last()"> and </xsl:if>
890     <xsl:value-of select="."/><xsl:choose>
891       <xsl:when test="substring(., string-length(.)-1, 2) = '11' or
892                       substring(., string-length(.)-1, 2) = '12' or
893                       substring(., string-length(.)-1, 2) = '13'">th</xsl:when>
894       <xsl:when test="substring(., string-length(.), 1) = '1'">st</xsl:when>
895       <xsl:when test="substring(., string-length(.), 1) = '2'">nd</xsl:when>
896       <xsl:when test="substring(., string-length(.), 1) = '3'">rd</xsl:when>
897       <xsl:otherwise>th</xsl:otherwise>
898     </xsl:choose>
899     <xsl:if test="position() != last()">, </xsl:if>
900   </xsl:template>
901
902   <xsl:template name="byDayChkBoxList">
903     <xsl:param name="name"/>
904     <xsl:for-each select="/bedework/shortdaynames/val">
905       <xsl:variable name="pos" select="position()"/>
906       <input type="checkbox">
907         <xsl:attribute name="value"><xsl:value-of select="/bedework/recurdayvals/val[position() = $pos]"/></xsl:attribute>
908         <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
909       </input>
910       <xsl:value-of select="."/>
911     </xsl:for-each>
912   </xsl:template>
913
914   <xsl:template name="buildCheckboxList">
915     <xsl:param name="current"/>
916     <xsl:param name="end"/>
917     <xsl:param name="name"/>
918     <xsl:param name="splitter">10</xsl:param>
919     <span class="chkBoxListItem">
920       <input type="checkbox">
921         <xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
922         <xsl:attribute name="value"><xsl:value-of select="$current"/></xsl:attribute>
923       </input>
924       <xsl:value-of select="$current"/>
925     </span>
926     <xsl:if test="$current mod $splitter = 0"><br/></xsl:if>
927     <xsl:if test="$current = $end"><br/></xsl:if>
928     <xsl:if test="$current &lt; $end">
929       <xsl:call-template name="buildCheckboxList">
930         <xsl:with-param name="current"><xsl:value-of select="$current + 1"/></xsl:with-param>
931         <xsl:with-param name="end"><xsl:value-of select="$end"/></xsl:with-param>
932         <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param>
933       </xsl:call-template>
934     </xsl:if>
935   </xsl:template>
936
937   <xsl:template name="recurrenceDayPosOptions">
938     <option value="0">none</option>
939     <option value="1">the first</option>
940     <option value="2">the second</option>
941     <option value="3">the third</option>
942     <option value="4">the fourth</option>
943     <option value="5">the fifth</option>
944     <option value="-1">the last</option>
945     <option value="">every</option>
946   </xsl:template>
947
948   <xsl:template name="buildRecurFields">
949     <xsl:param name="current"/>
950     <xsl:param name="total"/>
951     <xsl:param name="name"/>
952     <div class="invisible">
953       <xsl:attribute name="id"><xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current"/></xsl:attribute>
954       and
955       <select width="12em">
956         <xsl:attribute name="name">by<xsl:value-of select="$name"/>posPos<xsl:value-of select="$current"/></xsl:attribute>
957         <xsl:if test="$current != $total">
958           <xsl:attribute name="onchange">changeClass('<xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current+1"/>','shown')</xsl:attribute>
959         </xsl:if>
960         <xsl:call-template name="recurrenceDayPosOptions"/>
961       </select>
962       <xsl:call-template name="byDayChkBoxList"/>
963     </div>
964     <xsl:if test="$current &lt; $total">
965       <xsl:call-template name="buildRecurFields">
966         <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param>
967         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
968         <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param>
969       </xsl:call-template>
970     </xsl:if>
971   </xsl:template>
972
973   <xsl:template name="buildNumberOptions">
974     <xsl:param name="current"/>
975     <xsl:param name="total"/>
976     <option value="{$current}"><xsl:value-of select="$current"/></option>
977     <xsl:if test="$current &lt; $total">
978       <xsl:call-template name="buildNumberOptions">
979         <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param>
980         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
981       </xsl:call-template>
982     </xsl:if>
983   </xsl:template>
984
985   <xsl:template name="clock">
986     <div id="bwClock">
987       <!-- Bedework 24-Hour Clock time selection widget
988            used with resources/bwClock.js and resources/bwClock.css -->
989       <xsl:variable name="hour24" select="/bedework/hour24"/><!-- true or false -->
990       <div id="bwClockClock">
991         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="bwClock" usemap="#bwClockMap" />
992       </div>
993       <div id="bwClockCover">
994         &#160;
995         <!-- this is a special effect div used simply to cover the pixelated edge
996              where the clock meets the clock box title -->
997       </div>
998       <div id="bwClockBox">
999         <h2>
1000           Bedework 24-Hour Clock
1001         </h2>
1002         <div id="bwClockDateTypeIndicator">
1003           type
1004         </div>
1005         <div id="bwClockTime">
1006           select time
1007         </div>
1008         <div id="bwClockSwitch">
1009           switch
1010         </div>
1011         <div id="bwClockCloseText">
1012           close
1013         </div>
1014         <div id="bwClockCloseButton">
1015           <a href="javascript:bwClockClose();">X</a>
1016         </div>
1017       </div>
1018       <map name="bwClockMap" id="bwClockMap">
1019         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1020         <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')" />
1021         <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')" />
1022         <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')" />
1023         <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')" />
1024         <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')" />
1025         <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')" />
1026         <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')" />
1027         <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')" />
1028         <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')" />
1029         <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')" />
1030         <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')" />
1031         <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')" />
1032         <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})" />
1033         <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})" />
1034         <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})" />
1035         <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})" />
1036         <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})" />
1037         <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})" />
1038         <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})" />
1039         <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})" />
1040         <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})" />
1041         <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})" />
1042         <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})" />
1043         <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})" />
1044         <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})" />
1045         <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})" />
1046         <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})" />
1047         <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})" />
1048         <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})" />
1049         <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})" />
1050         <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})" />
1051         <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})" />
1052         <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})" />
1053         <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})" />
1054         <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})" />
1055         <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})" />
1056       </map>
1057     </div>
1058   </xsl:template>
1059
1060   <!--==== UPLOAD ====-->
1061   <xsl:template name="upload">
1062   <!-- The name "eventForm" is referenced by several javascript functions. Do not
1063     change it without modifying bedework.js -->
1064     <form name="eventForm" method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
1065       <h2>Upload iCAL File</h2>
1066       <table class="common" cellspacing="0">
1067         <tr>
1068           <td class="fieldname">
1069             Filename:
1070           </td>
1071           <td align="left">
1072             <input type="file" name="uploadFile" size="60" />
1073           </td>
1074         </tr>
1075         <tr>
1076           <td class="fieldname padMeTop">
1077             Into calendar:
1078           </td>
1079           <td align="left" class="padMeTop">
1080             <input type="hidden" name="newCalPath" id="bwNewCalPathField" value=""/>
1081             <span id="bwEventCalDisplay">
1082               <em>default calendar</em>
1083             </span>
1084           </td>
1085         </tr>
1086         <tr>
1087           <td class="fieldname padMeTop">
1088             Effects free/busy:
1089           </td>
1090           <td align="left" class="padMeTop">
1091             <input type="radio" value="" name="transparency" checked="checked"/> accept event's settings<br/>
1092             <input type="radio" value="OPAQUE" name="transparency"/> yes <span class="note">(opaque: event status affects your free/busy)</span><br/>
1093             <input type="radio" value="TRANSPARENT" name="transparency"/> no <span class="note">(transparent: event status does not affect your free/busy)</span><br/>
1094           </td>
1095         </tr>
1096         <tr>
1097           <td class="fieldname padMeTop">
1098             Status:
1099           </td>
1100           <td align="left" class="padMeTop">
1101             <input type="radio" value="" name="status" checked="checked"/> accept event's status<br/>
1102             <input type="radio" value="CONFIRMED" name="status"/> confirmed<br/>
1103             <input type="radio" value="TENTATIVE" name="status"/> tentative<br/>
1104             <input type="radio" value="CANCELLED" name="status"/> cancelled<br/>
1105           </td>
1106         </tr>
1107       </table>
1108       <table border="0" id="submitTable">
1109         <tr>
1110           <td>
1111             <input name="submit" type="submit" value="Continue"/>
1112             <input name="cancelled" type="submit" value="cancel"/>
1113           </td>
1114         </tr>
1115       </table>
1116     </form>
1117   </xsl:template>
1118
1119   <!--==== UTILITY TEMPLATES ====-->
1120
1121   <!-- time formatter (should be extended as needed) -->
1122   <xsl:template name="timeFormatter">
1123     <xsl:param name="timeString"/><!-- required -->
1124     <xsl:param name="showMinutes">yes</xsl:param>
1125     <xsl:param name="showAmPm">yes</xsl:param>
1126     <xsl:param name="hour24">no</xsl:param>
1127     <xsl:variable name="hour" select="number(substring($timeString,1,2))"/>
1128     <xsl:variable name="minutes" select="substring($timeString,3,2)"/>
1129     <xsl:variable name="AmPm">
1130       <xsl:choose>
1131         <xsl:when test="$hour &lt; 12">AM</xsl:when>
1132         <xsl:otherwise>PM</xsl:otherwise>
1133       </xsl:choose>
1134     </xsl:variable>
1135     <xsl:choose>
1136       <xsl:when test="hour24 = 'yes'">
1137         <xsl:value-of select="$hour"/><!--
1138      --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if>
1139       </xsl:when>
1140       <xsl:otherwise>
1141         <xsl:choose>
1142           <xsl:when test="$hour = 0">12</xsl:when>
1143           <xsl:when test="$hour &lt; 13"><xsl:value-of select="$hour"/></xsl:when>
1144           <xsl:otherwise><xsl:value-of select="$hour - 12"/></xsl:otherwise>
1145         </xsl:choose><!--
1146      --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if>
1147         <xsl:if test="$showAmPm = 'yes'">
1148           <xsl:text> </xsl:text>
1149           <xsl:value-of select="$AmPm"/>
1150         </xsl:if>
1151       </xsl:otherwise>
1152     </xsl:choose>
1153   </xsl:template>
1154
1155   <!-- search and replace template taken from
1156        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1157   <xsl:template name="replace">
1158     <xsl:param name="string" select="''"/>
1159     <xsl:param name="pattern" select="''"/>
1160     <xsl:param name="replacement" select="''"/>
1161     <xsl:choose>
1162       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1163         <xsl:value-of select="substring-before($string, $pattern)"/>
1164         <xsl:copy-of select="$replacement"/>
1165         <xsl:call-template name="replace">
1166           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1167           <xsl:with-param name="pattern" select="$pattern"/>
1168           <xsl:with-param name="replacement" select="$replacement"/>
1169         </xsl:call-template>
1170       </xsl:when>
1171       <xsl:otherwise>
1172         <xsl:value-of select="$string"/>
1173       </xsl:otherwise>
1174     </xsl:choose>
1175   </xsl:template>
1176
1177   <!--==== FOOTER ====-->
1178   <xsl:template name="footer">
1179     <div id="footer">
1180       Demonstration calendar; place footer information here.
1181     </div>
1182     <div id="subfoot">
1183       <a href="http://www.bedework.org/">Bedework Website</a> |
1184       <a href="?noxslt=yes">show XML</a> |
1185       <a href="?refreshXslt=yes">refresh XSLT</a>
1186     </div>
1187   </xsl:template>
1188 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.