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

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

websubmit: preparing the stylesheets, building the UI framework

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