root/trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

Revision 354 (checked in by johnsa, 7 years ago)

tweaks to calendar listing in web clients - added link to calendar from single event.

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="html"
5   indent="yes"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/html4/loose.dtd"
9   standalone="yes"
10 />
11    <!-- ======================================== -->
12   <!--  Rensselaer PERSONAL CALENDAR STYLESHEET  -->
13   <!-- ========================================= -->
14
15   <!-- DEFINE INCLUDES -->
16   <xsl:include href="errors.xsl"/>
17   <xsl:include href="messages.xsl"/>
18
19   <!-- DEFINE GLOBAL CONSTANTS -->
20   <!-- URL of html resources (images, css, other html); by default this is
21        set to the application root, but for the personal calendar
22        this should be changed to point to a
23        web server over https to avoid mixed content errors, e.g.,
24   <xsl:variable name="resourcesRoot" select="'https://mywebserver.edu/myresourcesdir'"/>
25     -->
26   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
27
28   <!-- URL of the XSL template directory -->
29   <!-- The approot is an appropriate place to put
30        included stylesheets and xml fragments. These are generally
31        referenced relatively (like errors.xsl and messages.xsl above);
32        this variable is here for your convenience if you choose to
33        reference it explicitly.  It is not used in this stylesheet, however,
34        and can be safely removed if you so choose. -->
35   <xsl:variable name="appRoot" select="/bedework/approot"/>
36
37   <!-- Properly encoded prefixes to the application actions; use these to build
38        urls; allows the application to be used without cookies or within a portal. -->
39   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
40   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/setSelection"/>
41   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
42   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/setViewPeriod"/>
43   <xsl:variable name="eventView" select="/bedework/urlPrefixes/eventView"/>
44   <xsl:variable name="initEvent" select="/bedework/urlPrefixes/initEvent"/>
45   <xsl:variable name="addEvent" select="/bedework/urlPrefixes/addEvent"/>
46   <xsl:variable name="addEventUsingPage" select="/bedework/urlPrefixes/addEventUsingPage"/>
47   <xsl:variable name="editEvent" select="/bedework/urlPrefixes/editEvent"/>
48   <xsl:variable name="delEvent" select="/bedework/urlPrefixes/delEvent"/>
49   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
50   <xsl:variable name="export" select="/bedework/urlPrefixes/export"/>
51   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
52   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
53   <xsl:variable name="manageLocations" select="/bedework/urlPrefixes/manageLocations"/>
54   <xsl:variable name="addLocation" select="/bedework/urlPrefixes/addLocation"/>
55   <xsl:variable name="editLocation" select="/bedework/urlPrefixes/editLocation"/>
56   <xsl:variable name="delLocation" select="/bedework/urlPrefixes/delLocation"/>
57   <xsl:variable name="initEventAlarm" select="/bedework/urlPrefixes/initEventAlarm"/>
58   <xsl:variable name="setAlarm" select="/bedework/urlPrefixes/setAlarm"/>
59   <xsl:variable name="initUpload" select="/bedework/urlPrefixes/initUpload"/>
60   <xsl:variable name="upload" select="/bedework/urlPrefixes/upload"/>
61
62   <xsl:variable name="subscriptions-fetch" select="/bedework/urlPrefixes/subscriptions/fetch/a/@href"/>
63   <xsl:variable name="subscriptions-fetchForUpdate" select="/bedework/urlPrefixes/subscriptions/fetchForUpdate/a/@href"/>
64   <xsl:variable name="subscriptions-initAdd" select="/bedework/urlPrefixes/subscriptions/initAdd/a/@href"/>
65   <xsl:variable name="subscriptions-subscribe" select="/bedework/urlPrefixes/subscriptions/subscribe/a/@href"/>
66
67   <!-- URL of the web application - includes web context
68   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/> -->
69
70   <!-- Other generally useful global variables -->
71   <xsl:variable name="confId" select="/bedework/confirmationid"/>
72   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
73   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
74   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
75   <xsl:variable name="skin">default</xsl:variable>
76   <xsl:variable name="publicCal">/cal</xsl:variable>
77
78  <!-- BEGIN MAIN TEMPLATE -->
79   <xsl:template match="/">
80     <html lang="en">
81       <head>
82         <xsl:call-template name="headSection"/>
83       </head>
84       <body>
85         <xsl:call-template name="headBar"/>
86         <xsl:if test="/bedework/message">
87           <div id="messages">
88             <xsl:apply-templates select="/bedework/message"/>
89           </div>
90         </xsl:if>
91         <xsl:if test="/bedework/error">
92           <div id="errors">
93             <xsl:apply-templates select="/bedework/error"/>
94           </div>
95         </xsl:if>
96         <table id="bodyBlock" cellspacing="0">
97           <tr>
98             <xsl:choose>
99               <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
100                 <td id="sideBarClosed">
101                   <img src="{$resourcesRoot}/resources/spacer.gif" width="1" height="1" border="0" alt="*"/>
102                 </td>
103               </xsl:when>
104               <xsl:otherwise>
105                 <td id="sideBar">
106                   <xsl:call-template name="sideBar"/>
107                 </td>
108               </xsl:otherwise>
109             </xsl:choose>
110             <td id="bodyContent">
111               <xsl:call-template name="tabs"/>
112               <xsl:call-template name="navigation"/>
113               <xsl:choose>
114                 <xsl:when test="/bedework/page='event'">
115                   <!-- show an event -->
116                   <xsl:apply-templates select="/bedework/event"/>
117                 </xsl:when>
118                 <xsl:when test="/bedework/page='addEvent'">
119                   <xsl:call-template name="addEvent"/>
120                 </xsl:when>
121                 <xsl:when test="/bedework/page='editEvent'">
122                   <!-- edit an event -->
123                   <xsl:apply-templates select="/bedework/formElements"/>
124                 </xsl:when>
125                 <xsl:when test="/bedework/page='alarmOptions'">
126                   <xsl:call-template name="alarmOptions" />
127                 </xsl:when>
128                 <xsl:when test="/bedework/page='upload'">
129                   <xsl:call-template name="upload" />
130                 </xsl:when>
131                 <xsl:when test="/bedework/page='manageLocations'">
132                   <xsl:call-template name="manageLocations" />
133                 </xsl:when>
134                 <xsl:when test="/bedework/page='editLocation'">
135                   <!-- edit an event -->
136                   <xsl:apply-templates select="/bedework/locationform"/>
137                 </xsl:when>
138                 <xsl:when test="/bedework/page='subscriptions' or /bedework/page='modSubscription'">
139                   <xsl:apply-templates select="/bedework/subscriptions"/>
140                 </xsl:when>
141                 <xsl:when test="/bedework/page='calendars'">
142                   <xsl:apply-templates select="/bedework/calendars"/>
143                 </xsl:when>
144                 <xsl:when test="/bedework/page='other'">
145                   <!-- show an arbitrary page -->
146                   <xsl:call-template name="selectPage"/>
147                 </xsl:when>
148                 <xsl:otherwise>
149                   <!-- otherwise, show the eventsCalendar -->
150                   <xsl:call-template name="utilBar"/>
151                   <!-- main eventCalendar content -->
152                   <xsl:choose>
153                     <xsl:when test="/bedework/periodname='Day'">
154                       <xsl:call-template name="listView"/>
155                     </xsl:when>
156                     <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
157                       <xsl:choose>
158                         <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
159                           <xsl:call-template name="listView"/>
160                         </xsl:when>
161                         <xsl:otherwise>
162                           <xsl:call-template name="weekView"/>
163                         </xsl:otherwise>
164                       </xsl:choose>
165                     </xsl:when>
166                     <xsl:when test="/bedework/periodname='Month'">
167                       <xsl:choose>
168                         <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
169                           <xsl:call-template name="listView"/>
170                         </xsl:when>
171                         <xsl:otherwise>
172                           <xsl:call-template name="monthView"/>
173                         </xsl:otherwise>
174                       </xsl:choose>
175                     </xsl:when>
176                     <xsl:otherwise>
177                       <xsl:call-template name="yearView"/>
178                     </xsl:otherwise>
179                   </xsl:choose>
180                 </xsl:otherwise>
181               </xsl:choose>
182             </td>
183           </tr>
184         </table>
185         <!-- footer -->
186         <xsl:call-template name="footer"/>
187       </body>
188     </html>
189   </xsl:template>
190
191   <!--==== HEAD SECTION  ====-->
192
193   <xsl:template name="headSection">
194     <title>Bedework: Personal Calendar Client</title>
195     <meta name="robots" content="noindex,nofollow"/>
196     <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css"/>
197     <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
198     <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
199     <xsl:if test="/bedework/page='addEvent' or /bedework/page='editEvent'">
200       <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
201       <script type="text/javascript" src="{$resourcesRoot}/resources/bwClock.js"></script>
202       <link rel="stylesheet" href="{$resourcesRoot}/resources/bwClock.css"/>
203       <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
204       <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
205       <script type="text/javascript" src="{$resourcesRoot}/resources/browserSniffer.js"></script>
206     </xsl:if>
207   </xsl:template>
208
209   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
210
211   <xsl:template name="headBar">
212     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
213       <tr>
214         <td colspan="3" id="logoCell"><a href="http://www.bedework.org/"><img src="{$resourcesRoot}/resources/bedeworkLogo.gif" width="292" height="75" border="0" alt="Bedework"/></a></td>
215         <td colspan="2" id="schoolLinksCell">
216           <h2>Personal Calendar</h2>
217           <a href="{$publicCal}">Public Calendar</a> |
218           <a href="http://www.yourschoolhere.edu">School Home</a> |
219           <a href="http://www.bedework.org/">Other Link</a> |
220           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
221             Example Calendar Help
222           </a>
223         </td>
224       </tr>
225     </table>
226     <!--<table width="100%" border="0" cellpadding="0" cellspacing="0">
227       <tr>
228         <td width="50%"><img alt="" src="{$resourcesRoot}/resources/metacal-topBorder.gif" width="100%" height="23" border="0"/></td>
229         <td><img src="{$resourcesRoot}/resources/metacal-topTitlePersonal.gif" width="221" height="23" border="0" alt="Bedework Personal Events Calendar"/></td>
230         <td width="50%"><img alt="" src="{$resourcesRoot}/resources/metacal-topBorder.gif" width="100%" height="23" border="0"/></td>
231       </tr>
232     </table>-->
233     <table id="curDateRangeTable"  cellspacing="0">
234       <td class="sideBarOpenCloseIcon">
235         <xsl:choose>
236           <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
237             <a href="?setappvar=sidebar(opened)">
238               <img alt="open sidebar" src="{$resourcesRoot}/resources/std-sidebaropen-icon.gif" width="13" height="13" border="0" align="left"/>
239             </a>
240           </xsl:when>
241           <xsl:otherwise>
242             <a href="?setappvar=sidebar(closed)">
243               <img alt="close sidebar" src="{$resourcesRoot}/resources/std-sidebarclose-icon.gif" width="13" height="13" border="0" align="left"/>
244             </a>
245           </xsl:otherwise>
246         </xsl:choose>
247       </td>
248       <td class="date">
249         <xsl:value-of select="/bedework/firstday/longdate"/>
250         <xsl:if test="/bedework/periodname!='Day'">
251           -
252           <xsl:value-of select="/bedework/lastday/longdate"/>
253         </xsl:if>
254       </td>
255       <td class="rssPrint">
256         <a href="javascript:window.print()" title="print this view">
257           <img alt="print this view" src="{$resourcesRoot}/resources/std-print-icon.gif" width="20" height="14" border="0"/> print
258         </a>
259         <a class="rss" href="{$setSelection}?calId=&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
260       </td>
261     </table>
262   </xsl:template>
263
264   <xsl:template name="sideBar">
265     <h3>
266       <img alt="manage views" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/> views
267     </h3>
268     <ul id="myViews">
269       <xsl:choose>
270         <xsl:when test="/bedework/views/view">
271           <xsl:for-each select="/bedework/views/view">
272             <xsl:variable name="viewName" select="name"/>
273             <xsl:choose>
274               <xsl:when test="/bedework/selectionState/selectionType = 'view'
275                               and name=/bedework/selectionState/view/name">
276                 <li class="selected"><a href="{$setSelection}?viewName={$viewName}"><xsl:value-of select="name"/></a></li>
277               </xsl:when>
278               <xsl:otherwise>
279                 <li><a href="{$setSelection}?viewName={$viewName}"><xsl:value-of select="name"/></a></li>
280               </xsl:otherwise>
281             </xsl:choose>
282           </xsl:for-each>
283         </xsl:when>
284         <xsl:otherwise>
285           <li class="none">no subscriptions</li>
286         </xsl:otherwise>
287       </xsl:choose>
288     </ul>
289
290     <h3><img alt="manage calendars" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/> calendars</h3>
291     <ul class="calendarTree">
292       <xsl:apply-templates select="/bedework/myCalendars/calendars/calendar" mode="myCalendars"/>
293     </ul>
294
295     <h3>
296       <a href="{$subscriptions-fetch}" title="manage subscriptions">
297         <img alt="manage subscriptions" src="{$resourcesRoot}/resources/glassFill-icon-menuButton.gif" width="12" height="11" border="0"/>
298         subscriptions
299       </a>
300     </h3>
301     <ul class="calendarTree">
302       <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable>
303       <xsl:choose>
304         <xsl:when test="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]">
305           <xsl:apply-templates select="/bedework/mySubscriptions/subscription[not(contains(uri,$userPath))]" mode="mySubscriptions"/>
306         </xsl:when>
307         <xsl:otherwise>
308           <li class="none">no subscriptions</li>
309         </xsl:otherwise>
310       </xsl:choose>
311     </ul>
312
313     <h3>options</h3>
314     <ul id="sideBarMenu">
315       <li><a href="{$manageLocations}">Manage Locations</a></li>
316       <li>Preferences</li>
317     </ul>
318   </xsl:template>
319
320   <xsl:template name="tabs">
321     <xsl:choose>
322       <xsl:when test="/bedework/page='eventscalendar'">
323         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
324           <tr>
325             <td>
326               <xsl:choose>
327                 <xsl:when test="/bedework/periodname='Day'">
328                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-on.gif" width="91" height="20" border="0" alt="DAY"/></a>
329                 </xsl:when>
330                 <xsl:otherwise>
331                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
332                 </xsl:otherwise>
333               </xsl:choose>
334             </td>
335             <td>
336               <xsl:choose>
337                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
338                   <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-on.gif" width="92" height="20" border="0" alt="WEEK"/></a>
339                  </xsl:when>
340                 <xsl:otherwise>
341                   <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
342                  </xsl:otherwise>
343               </xsl:choose>
344             </td>
345             <td>
346               <xsl:choose>
347                 <xsl:when test="/bedework/periodname='Month'">
348                   <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-on.gif" width="90" height="20" border="0" alt="MONTH"/></a>
349                 </xsl:when>
350                 <xsl:otherwise>
351                   <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
352                 </xsl:otherwise>
353               </xsl:choose>
354             </td>
355             <td>
356               <xsl:choose>
357                 <xsl:when test="/bedework/periodname='Year'">
358                   <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-on.gif" width="92" height="20" border="0" alt="YEAR"/></a>
359                 </xsl:when>
360                 <xsl:otherwise>
361                   <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
362                 </xsl:otherwise>
363               </xsl:choose>
364             </td>
365             <td class="rightCell">
366               welcome
367               <xsl:text> </xsl:text>
368               <strong><xsl:value-of select="/bedework/userid"/></strong>
369               <xsl:text> </xsl:text>
370               <span class="logout"><a href="{$setup}?logout=true">logout</a></span>
371             </td>
372           </tr>
373         </table>
374       </xsl:when>
375       <xsl:otherwise>
376         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
377           <tr>
378             <td>
379               <a href="{$setViewPeriod}?viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
380             </td>
381             <td>
382               <a href="{$setViewPeriod}?viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
383             </td>
384             <td>
385               <a href="{$setViewPeriod}?viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
386             </td>
387             <td>
388               <a href="{$setViewPeriod}?viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/resources/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
389             </td>
390             <td class="rightCell">
391               welcome
392               <xsl:text> </xsl:text>
393               <strong><xsl:value-of select="/bedework/userid"/></strong>
394               <xsl:text> </xsl:text>
395               <span class="logout"><a href="{$setup}?logout=true">logout</a></span>
396             </td>
397           </tr>
398         </table>
399       </xsl:otherwise>
400     </xsl:choose>
401   </xsl:template>
402
403   <xsl:template name="navigation">
404     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
405       <tr>
406         <td class="leftCell">
407           <a href="{$setViewPeriod}?date={$prevdate}"><img src="{$resourcesRoot}/resources/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
408           <a href="{$setViewPeriod}?date={$nextdate}"><img src="{$resourcesRoot}/resources/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
409           <xsl:choose>
410             <xsl:when test="/bedework/periodname='Year'">
411               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
412             </xsl:when>
413             <xsl:when test="/bedework/periodname='Month'">
414               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
415             </xsl:when>
416             <xsl:when test="/bedework/periodname='Week'">
417               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
418             </xsl:when>
419             <xsl:otherwise>
420               <xsl:value-of select="/bedework/firstday/longdate"/>
421             </xsl:otherwise>
422           </xsl:choose>
423         </td>
424         <td class="todayButton">
425           <a href="{$setViewPeriod}?viewType=todayView&amp;date={$curdate}">
426             <img src="{$resourcesRoot}/resources/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
427           </a>
428         </td>
429         <td align="right" class="gotoForm">
430           <form name="calForm" method="get" action="{$setViewPeriod}">
431              <table border="0" cellpadding="0" cellspacing="0">
432               <tr>
433                 <xsl:if test="/bedework/periodname!='Year'">
434                   <td>
435                     <select name="viewStartDate.month">
436                       <xsl:for-each select="/bedework/monthvalues/val">
437                         <xsl:variable name="temp" select="."/>
438                         <xsl:variable name="pos" select="position()"/>
439                         <xsl:choose>
440                           <xsl:when test="/bedework/monthvalues[start=$temp]">
441                             <option value="{$temp}" selected="selected">
442                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
443                             </option>
444                           </xsl:when>
445                           <xsl:otherwise>
446                             <option value="{$temp}">
447                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
448                             </option>
449                           </xsl:otherwise>
450                         </xsl:choose>
451                       </xsl:for-each>
452                     </select>
453                   </td>
454                   <xsl:if test="/bedework/periodname!='Month'">
455                     <td>
456                       <select name="viewStartDate.day">
457                         <xsl:for-each select="/bedework/dayvalues/val">
458                           <xsl:variable name="temp" select="."/>
459                           <xsl:variable name="pos" select="position()"/>
460                           <xsl:choose>
461                             <xsl:when test="/bedework/dayvalues[start=$temp]">
462                               <option value="{$temp}" selected="selected">
463                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
464                               </option>
465                             </xsl:when>
466                             <xsl:otherwise>
467                               <option value="{$temp}">
468                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
469                               </option>
470                             </xsl:otherwise>
471                           </xsl:choose>
472                         </xsl:for-each>
473                       </select>
474                     </td>
475                   </xsl:if>
476                 </xsl:if>
477                 <td>
478                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
479                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
480                 </td>
481                 <td>
482                   <input name="submit" type="submit" value="go"/>
483                 </td>
484               </tr>
485             </table>
486           </form>
487         </td>
488         <!--
489         <td class="rightCell">
490           <form method="post" action="{$setSelection}">
491             <select name="calId" onChange="submit()" >
492               <option>select a calendar</option>
493               <xsl:for-each select="/bedework/calendars/calendar">
494                 <xsl:variable name="id" select="id"/>
495                 <xsl:choose>
496                   <xsl:when test="title=/bedework/title">
497                     <option value="{$id}" selected="selected"><xsl:value-of select="title"/></option>
498                   </xsl:when>
499                   <xsl:otherwise>
500                     <option value="{$id}"><xsl:value-of select="title"/></option>
501                   </xsl:otherwise>
502                 </xsl:choose>
503               </xsl:for-each>
504             </select>
505           </form>
506           <span class="calLinks"><a href="{$setSelection}?calId=">show all</a> | <a href="{$fetchPublicCalendars}">calendar list</a></span>
507         </td> -->
508       </tr>
509     </table>
510   </xsl:template>
511
512   <xsl:template name="utilBar">
513     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="utilBarTable">
514        <tr>
515          <td class="leftCell">
516            <xsl:choose>
517              <xsl:when test="/bedework/periodname = 'day'">
518                <xsl:variable name="date" select="/bedework/firstday/date"/>
519                <a href="{$initEvent}?date={$date}" title="add event">
520                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
521                   add event
522                </a>
523              </xsl:when>
524              <xsl:otherwise>
525                <a href="{$initEvent}" title="add event">
526                   <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
527                   add event
528                </a>
529              </xsl:otherwise>
530            </xsl:choose>
531            <a href="{$initUpload}" title="upload event">
532               <img src="{$resourcesRoot}/resources/std-icalUpload-icon-small.gif" width="12" height="16" border="0" alt="upload event"/>
533               upload
534            </a>
535          </td>
536          <td class="rightCell">
537            <xsl:choose>
538             <xsl:when test="/bedework/periodname='Day'">
539               <img src="{$resourcesRoot}/resources/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
540             </xsl:when>
541             <xsl:when test="/bedework/periodname='Year'">
542               <img src="{$resourcesRoot}/resources/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
543             </xsl:when>
544             <xsl:when test="/bedework/periodname='Month'">
545               <xsl:choose>
546                 <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
547                   <a href="{$setup}?setappvar=monthViewMode(cal)" title="toggle list/calendar view">
548                     <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
549                   </a>
550                 </xsl:when>
551                 <xsl:otherwise>
552                   <a href="{$setup}?setappvar=monthViewMode(list)" title="toggle list/calendar view">
553                     <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
554                   </a>
555                 </xsl:otherwise>
556               </xsl:choose>
557             </xsl:when>
558             <xsl:otherwise>
559               <xsl:choose>
560                 <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
561                   <a href="{$setup}?setappvar=weekViewMode(cal)" title="toggle list/calendar view">
562                     <img src="{$resourcesRoot}/resources/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
563                   </a>
564                 </xsl:when>
565                 <xsl:otherwise>
566                   <a href="{$setup}?setappvar=weekViewMode(list)" title="toggle list/calendar view">
567                     <img src="{$resourcesRoot}/resources/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
568                   </a>
569                 </xsl:otherwise>
570               </xsl:choose>
571             </xsl:otherwise>
572           </xsl:choose>
573            <xsl:choose>
574               <xsl:when test="/bedework/periodname='Year' or
575                               (/bedework/periodname='Month' and
576                               (/bedework/appvar[key='monthViewMode']/value='cal' or
577                                not(/bedework/appvar[key='monthViewMode']))) or
578                               (/bedework/periodname='Week' and
579                               (/bedework/appvar[key='weekViewMode']/value='cal' or
580                                not(/bedework/appvar[key='weekViewMode'])))">
581                 <xsl:choose>
582                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
583                     <img src="{$resourcesRoot}/resources/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
584                   </xsl:when>
585                   <xsl:otherwise>
586                     <img src="{$resourcesRoot}/resources/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
587                   </xsl:otherwise>
588                 </xsl:choose>
589               </xsl:when>
590               <xsl:otherwise>
591                 <xsl:choose>
592                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
593                     <a href="{$setup}?setappvar=summaryMode(summary)" title="toggle summary/detailed view">
594                       <img src="{$resourcesRoot}/resources/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
595                     </a>
596                   </xsl:when>
597                   <xsl:otherwise>
598                     <a href="{$setup}?setappvar=summaryMode(details)" title="toggle summary/detailed view">
599                       <img src="{$resourcesRoot}/resources/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
600                     </a>
601                   </xsl:otherwise>
602                 </xsl:choose>
603               </xsl:otherwise>
604             </xsl:choose>
605             <a href="setup.do"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
606          </td>
607        </tr>
608     </table>
609   </xsl:template>
610
611   <!--==== LIST VIEW  (for day, week, and month) ====-->
612   <xsl:template name="listView">
613     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
614       <xsl:choose>
615         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
616           <tr>
617             <td class="noEventsCell">
618               There are no events posted
619               <xsl:choose>
620                 <xsl:when test="/bedework/periodname='Day'">
621                   today<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
622                 </xsl:when>
623                 <xsl:when test="/bedework/periodname='Month'">
624                   this month<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
625                 </xsl:when>
626                 <xsl:otherwise>
627                   this week<xsl:if test="/bedework/title!=''"> for <strong><xsl:value-of select="/bedework/title"/></strong></xsl:if><xsl:if test="/bedework/search!=''"> for search term <strong>"<xsl:value-of select="/bedework/search"/>"</strong></xsl:if>.
628                 </xsl:otherwise>
629               </xsl:choose>
630             </td>
631           </tr>
632         </xsl:when>
633         <xsl:otherwise>
634           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
635             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
636               <tr>
637                 <td colspan="6" class="dateRow">
638                    <xsl:variable name="date" select="date"/>
639                    <a href="{$initEvent}?date={$date}" class="listAdd">
640                      add event
641                    </a>
642                    <a href="{$setViewPeriod}?viewType=dayView&amp;date={$date}">
643                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
644                    </a>
645                  </td>
646               </tr>
647             </xsl:if>
648             <xsl:for-each select="event">
649               <xsl:variable name="id" select="id"/>
650               <xsl:variable name="subscriptionId" select="subscription/id"/>
651               <xsl:variable name="calendarId" select="calendar/id"/>
652               <xsl:variable name="guid" select="guid"/>
653               <xsl:variable name="recurrenceId" select="recurrenceId"/>
654               <tr>
655                 <xsl:variable name="dateRangeStyle">
656                   <xsl:choose>
657                     <xsl:when test="start/shortdate = parent::day/shortdate">
658                       <xsl:choose>
659                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
660                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
661                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
662                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
663                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
664                       </xsl:choose>
665                     </xsl:when>
666                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
667                   </xsl:choose>
668                 </xsl:variable>
669                 <xsl:choose>
670                   <xsl:when test="start/allday = 'true' and
671                                   start/shortdate = end/shortdate">
672                     <td class="{$dateRangeStyle} center" colspan="3">
673                       all day
674                     </td>
675                   </xsl:when>
676                   <xsl:otherwise>
677                     <td class="{$dateRangeStyle} right">
678                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
679                       <xsl:choose>
680                         <xsl:when test="start/allday = 'true' and
681                                         parent::day/shortdate = start/shortdate">
682                           today
683                         </xsl:when>
684                         <xsl:when test="parent::day/shortdate != start/shortdate">
685                           <span class="littleArrow">&#171;</span>&#160;
686                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
687                         </xsl:when>
688                         <xsl:otherwise>
689                           <xsl:value-of select="start/time"/>
690                         </xsl:otherwise>
691                       </xsl:choose>
692                       </a>
693                     </td>
694                     <td class="{$dateRangeStyle} center">
695                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
696                     </td>
697                     <td class="{$dateRangeStyle} left">
698                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
699                       <xsl:choose>
700                         <xsl:when test="end/allday = 'true' and
701                                         parent::day/shortdate = end/shortdate">
702                           today
703                         </xsl:when>
704                         <xsl:when test="parent::day/shortdate != end/shortdate">
705                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
706                           &#160;<span class="littleArrow">&#187;</span>
707                         </xsl:when>
708                         <xsl:otherwise>
709                           <xsl:value-of select="end/time"/>
710                         </xsl:otherwise>
711                       </xsl:choose>
712                       </a>
713                     </td>
714                   </xsl:otherwise>
715                 </xsl:choose>
716                 <xsl:variable name="descriptionClass">
717                   <xsl:choose>
718                     <xsl:when test="priority='cancelled'">description cancelled</xsl:when>
719                     <xsl:otherwise>description</xsl:otherwise>
720                   </xsl:choose>
721                 </xsl:variable>
722                 <td class="{$descriptionClass}">
723                   <xsl:choose>
724                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
725                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
726                         <strong><xsl:value-of select="summary"/>: </strong>
727                         <xsl:value-of select="description"/>&#160;
728                         <em>
729                           <xsl:value-of select="location/address"/>
730                           <xsl:if test="location/subaddress != ''">
731                             , <xsl:value-of select="location/subaddress"/>
732                           </xsl:if>.&#160;
733                           <xsl:if test="cost!=''">
734                             <xsl:value-of select="cost"/>.&#160;
735                           </xsl:if>
736                           <xsl:if test="sponsor/name!='none'">
737                             Contact: <xsl:value-of select="sponsor/name"/>
738                           </xsl:if>
739                         </em>
740                       </a>
741                       <xsl:if test="link != ''">
742                         <xsl:variable name="link" select="link"/>
743                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
744                       </xsl:if>
745                     </xsl:when>
746                     <xsl:otherwise>
747                       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
748                         <xsl:value-of select="summary"/>, <xsl:value-of select="location/address"/>
749                       </a>
750                     </xsl:otherwise>
751                   </xsl:choose>
752                 </td>
753                 <td class="eventLinks">
754                   <xsl:call-template name="eventLinks"/>
755                 </td>
756                 <td class="smallIcon">
757                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
758                   <a href="{$export}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
759                     <img src="{$resourcesRoot}/resources/std-ical_icon_small.gif" width="12" height="16" border="0" alt="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars"/>
760                   </a>
761                 </td>
762               </tr>
763             </xsl:for-each>
764           </xsl:for-each>
765         </xsl:otherwise>
766       </xsl:choose>
767     </table>
768   </xsl:template>
769
770   <xsl:template name="eventLinks">
771     <xsl:variable name="subscriptionId" select="subscription/id"/>
772           <xsl:variable name="calendarId" select="calendar/id"/>
773     <xsl:variable name="guid" select="guid"/>
774     <xsl:variable name="recurrenceId" select="recurrenceId"/>
775     <xsl:choose>
776       <xsl:when test="isAnnotation">
777         <xsl:choose>
778           <xsl:when test="recurring=true">
779             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">Remove All</a>
780           </xsl:when>
781           <xsl:otherwise>
782             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Remove</a>
783           </xsl:otherwise>
784         </xsl:choose>
785       </xsl:when>
786       <xsl:when test="calendar/owner = /bedework/userid">
787         <a href="{$editEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">Edit</a> |
788         <xsl:choose>
789           <xsl:when test="recurring=true">
790             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete All</a>
791           </xsl:when>
792           <xsl:otherwise>
793             <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">Delete</a>
794           </xsl:otherwise>
795         </xsl:choose>
796       </xsl:when>
797       <xsl:otherwise>
798         <a href="{$subscriptions-fetch}">Subscription</a>
799       </xsl:otherwise>
800     </xsl:choose>
801   </xsl:template>
802
803   <!--==== WEEK CALENDAR VIEW ====-->
804   <xsl:template name="weekView">
805     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
806       <tr>
807         <xsl:for-each select="/bedework/daynames/val">
808           <th class="dayHeading"><xsl:value-of select="."/></th>
809         </xsl:for-each>
810       </tr>
811       <tr>
812         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
813           <xsl:variable name="dayPos" select="position()"/>
814           <xsl:if test="filler='false'">
815             <td>
816               <xsl:variable name="dayDate" select="date"/>
817               <a href="{$initEvent}?date={$dayDate}" class="gridAdd" title="add event">
818                 <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="10" height="10" border="0" alt="add event"/>
819               </a>
820               <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
821                 <xsl:value-of select="value"/>
822               </a>
823               <ul>
824                 <xsl:apply-templates select="event" mode="calendarLayout">
825                   <xsl:with-param name="dayPos" select="$dayPos"/>
826                 </xsl:apply-templates>
827               </ul>
828             </td>
829           </xsl:if>
830         </xsl:for-each>
831       </tr>
832     </table>
833   </xsl:template>
834
835   <!--==== MONTH CALENDAR VIEW ====-->
836   <xsl:template name="monthView">
837     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
838       <tr>
839         <xsl:for-each select="/bedework/daynames/val">
840           <th class="dayHeading"><xsl:value-of select="."/></th>
841         </xsl:for-each>
842       </tr>
843       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
844         <tr>
845           <xsl:for-each select="day">
846             <xsl:variable name="dayPos" select="position()"/>
847             <xsl:choose>
848               <xsl:when test="filler='true'">
849                 <td class="filler">&#160;</td>
850               </xsl:when>
851               <xsl:otherwise>
852                 <td>
853                   <xsl:variable name="dayDate" select="date"/>
854                   <a href="{$initEvent}?date={$dayDate}" class="gridAdd" title="add event">
855                     <img src="{$resourcesRoot}/resources/addEvent-forGrid-icon.gif" width="10" height="10" border="0" alt="add event"/>
856                   </a>
857                   <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}" class="dayLink" title="go to day">
858                     <xsl:value-of select="value"/>
859                   </a>
860                   <ul>
861                     <xsl:apply-templates select="event" mode="calendarLayout">
862                       <xsl:with-param name="dayPos" select="$dayPos"/>
863                     </xsl:apply-templates>
864                   </ul>
865                 </td>
866               </xsl:otherwise>
867             </xsl:choose>
868           </xsl:for-each>
869         </tr>
870       </xsl:for-each>
871     </table>
872   </xsl:template>
873
874   <xsl:template match="event" mode="calendarLayout">
875     <xsl:param name="dayPos"/>
876     <xsl:variable name="subscriptionId" select="subscription/id"/>
877     <xsl:variable name="calendarId" select="calendar/id"/>
878     <xsl:variable name="guid" select="guid"/>
879     <xsl:variable name="recurrenceId" select="recurrenceId"/>
880     <xsl:variable name="eventClass">
881       <xsl:choose>
882         <!-- Special styles for the month grid -->
883         <xsl:when test="status='cancelled'">eventCancelled</xsl:when>
884         <xsl:when test="calendar/name='Holidays'">holiday</xsl:when>
885         <!-- Alternating colors for all standard events -->
886         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
887         <xsl:otherwise>eventLinkB</xsl:otherwise>
888       </xsl:choose>
889     </xsl:variable>
890     <li>
891       <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass}">
892         <xsl:value-of select="summary"/>
893         <xsl:variable name="eventTipClass">
894           <xsl:choose>
895             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
896             <xsl:otherwise>eventTip</xsl:otherwise>
897           </xsl:choose>
898         </xsl:variable>
899         <span class="{$eventTipClass}">
900           <strong><xsl:value-of select="summary"/></strong><br/>
901           Time:
902           <xsl:choose>
903             <xsl:when test="start/allday = 'false'">
904               <xsl:value-of select="start/time"/>
905                - <xsl:value-of select="end/time"/>
906             </xsl:when>
907             <xsl:otherwise>
908               all day
909             </xsl:otherwise>
910           </xsl:choose><br/>
911           <xsl:if test="location/address">
912             Location: <xsl:value-of select="location/address"/><br/>
913           </xsl:if>
914           Calendar: <xsl:value-of select="calendar/name"/>
915           Type:
916           <xsl:choose>
917             <xsl:when test="isAnnotation">
918               public event
919             </xsl:when>
920             <xsl:when test="calendar/owner = /bedework/userid">
921               personal event, editable
922             </xsl:when>
923             <xsl:otherwise>
924               subscription
925             </xsl:otherwise>
926           </xsl:choose>
927         </span>
928       </a>
929     </li>
930   </xsl:template>
931
932   <!--==== YEAR VIEW ====-->
933   <xsl:template name="yearView">
934     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
935       <tr>
936         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
937       </tr>
938       <tr>
939         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
940       </tr>
941       <tr>
942         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
943       </tr>
944       <tr>
945         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
946       </tr>
947     </table>
948   </xsl:template>
949
950   <!-- year view month tables -->
951   <xsl:template match="month">
952     <td>
953       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
954         <tr>
955           <td colspan="8" class="monthName">
956             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
957             <a href="{$setViewPeriod}?viewType=monthView&amp;date={$firstDayOfMonth}">
958               <xsl:value-of select="longname"/>
959             </a>
960           </td>
961         </tr>
962         <tr>
963           <th>&#160;</th>
964           <xsl:for-each select="/bedework/shortdaynames/val">
965             <th><xsl:value-of select="."/></th>
966           </xsl:for-each>
967         </tr>
968         <xsl:for-each select="week">
969           <tr>
970             <td class="weekCell">
971               <xsl:variable name="firstDayOfWeek" select="day/date"/>
972               <a href="{$setViewPeriod}?viewType=weekView&amp;date={$firstDayOfWeek}">
973                 <xsl:value-of select="value"/>
974               </a>
975             </td>
976             <xsl:for-each select="day">
977               <xsl:choose>
978                 <xsl:when test="filler='true'">
979                   <td class="filler">&#160;</td>
980                 </xsl:when>
981                 <xsl:otherwise>
982                   <td>
983                     <xsl:variable name="dayDate" select="date"/>
984                     <a href="{$setViewPeriod}?viewType=dayView&amp;date={$dayDate}">
985                       <xsl:value-of select="value"/>
986                     </a>
987                   </td>
988                 </xsl:otherwise>
989               </xsl:choose>
990             </xsl:for-each>
991           </tr>
992         </xsl:for-each>
993       </table>
994     </td>
995   </xsl:template>
996
997   <!--==== SINGLE EVENT ====-->
998   <xsl:template match="event">
999     <xsl:variable name="subscriptionId" select="subscription/id"/>
1000     <xsl:variable name="calendarId" select="calendar/id"/>
1001     <xsl:variable name="guid" select="guid"/>
1002     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1003     <h2>
1004       <xsl:choose>
1005         <xsl:when test="link != ''">
1006           <xsl:variable name="link" select="link"/>
1007           <a href="{$link}">
1008             <xsl:value-of select="summary"/>
1009           </a>
1010         </xsl:when>
1011         <xsl:otherwise>
1012           <xsl:value-of select="summary"/>
1013         </xsl:otherwise>
1014       </xsl:choose>
1015     </h2>
1016     <table id="commonTable" cellspacing="0">
1017       <tr>
1018         <th colspan="3" class="commonHeader">
1019           <div id="eventActions">
1020             <xsl:choose>
1021               <xsl:when test="isAnnotation">
1022                 <xsl:choose>
1023                   <xsl:when test="recurring=true">
1024                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">
1025                       Remove All (recurring)
1026                     </a>
1027                   </xsl:when>
1028                   <xsl:otherwise>
1029                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1030                       Remove
1031                     </a>
1032                   </xsl:otherwise>
1033                 </xsl:choose>
1034               </xsl:when>
1035               <xsl:when test="calendar/owner = /bedework/userid">
1036                 <a href="{$editEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1037                   Edit Event
1038                 </a> |
1039                 <xsl:choose>
1040                   <xsl:when test="recurring=true">
1041                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;confirmationid={$confId}">
1042                       Delete All (recurring)
1043                     </a>
1044                   </xsl:when>
1045                   <xsl:otherwise>
1046                     <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1047                       Delete Event
1048                     </a>
1049                   </xsl:otherwise>
1050                 </xsl:choose>
1051               </xsl:when>
1052               <xsl:otherwise>
1053                 <a href="{$subscriptions-fetch}">
1054                   Manage Subscriptions
1055                 </a>
1056               </xsl:otherwise>
1057             </xsl:choose>
1058           </div>
1059           <xsl:choose>
1060             <xsl:when test="isAnnotation">
1061               Public Event
1062             </xsl:when>
1063             <xsl:when test="calendar/owner = /bedework/userid">
1064               Personal Event
1065             </xsl:when>
1066             <xsl:otherwise>
1067               Public Event from Subscription
1068             </xsl:otherwise>
1069           </xsl:choose>
1070         </th>
1071       </tr>
1072       <!--<tr>
1073         <td class="fieldname">Title:</td>
1074         <td class="fieldval">
1075           <strong>
1076             <xsl:choose>
1077               <xsl:when test="link != ''">
1078                 <xsl:variable name="link" select="link"/>
1079                 <a href="{$link}">
1080                   <xsl:value-of select="summary"/>
1081                 </a>
1082               </xsl:when>
1083               <xsl:otherwise>
1084                 <xsl:value-of select="summary"/>
1085               </xsl:otherwise>
1086             </xsl:choose>
1087           </strong>
1088         </td>
1089       </tr>-->
1090       <tr>
1091         <td class="fieldname">When:</td>
1092         <td class="fieldval">
1093           <!-- was using abbrev dayname: substring(start/dayname,1,3) -->
1094           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
1095           <span class="time"><xsl:value-of select="start/time"/></span>
1096           <xsl:if test="end/time != '' or end/longdate != start/longdate"> - </xsl:if>
1097           <xsl:if test="end/longdate != start/longdate"><xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text></xsl:if>
1098           <xsl:if test="end/time != ''"><span class="time"><xsl:value-of select="end/time"/></span></xsl:if>
1099         </td>
1100         <th class="icon" rowspan="2">
1101           <xsl:variable name="icalName" select="concat($guid,'.ics')"/>
1102           <a href="{$eventView}?subid={$subscriptionId}&amp;&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$icalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
1103             <img src="{$resourcesRoot}/resources/std-ical-icon.gif" width="20" height="26" border="0" align="left" alt="Download this event"/>
1104           </a><!-- <br />
1105           [<a href="">help</a>] -->
1106         </th>
1107       </tr>
1108       <tr>
1109         <td class="fieldname">Where:</td>
1110         <td colspan="3" class="fieldval">
1111           <xsl:choose>
1112             <xsl:when test="location/link=''">
1113               <xsl:value-of select="location/address"/>
1114             </xsl:when>
1115             <xsl:otherwise>
1116               <xsl:variable name="locationLink" select="location/link"/>
1117               <a href="{$locationLink}">
1118                 <xsl:value-of select="location/address"/>
1119               </a>
1120             </xsl:otherwise>
1121           </xsl:choose>
1122           <xsl:if test="location/subaddress!=''">
1123             <br/><xsl:value-of select="location/subaddress"/>
1124           </xsl:if>
1125         </td>
1126       </tr>
1127       <tr>
1128         <td class="fieldname">Description:</td>
1129         <td colspan="3" class="fieldval">
1130           <xsl:call-template name="replace">
1131             <xsl:with-param name="string" select="description"/>
1132             <xsl:with-param name="pattern" select="'&#xA;'"/>
1133             <xsl:with-param name="replacement"><br/></xsl:with-param>
1134           </xsl:call-template>
1135         </td>
1136       </tr>
1137        <xsl:if test="cost!=''">
1138         <tr>
1139           <td class="fieldname">Cost:</td>
1140           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
1141         </tr>
1142       </xsl:if>
1143       <xsl:if test="link != ''">
1144         <tr>
1145           <td class="fieldname">See:</td>
1146           <td colspan="3" class="fieldval">
1147             <xsl:variable name="link" select="link"/>
1148             <a href="{$link}"><xsl:value-of select="link"/></a>
1149           </td>
1150         </tr>
1151       </xsl:if>
1152       <xsl:if test="sponsor/name!='none'">
1153         <tr>
1154           <td class="fieldname">Contact:</td>
1155           <td colspan="3" class="fieldval">
1156             <xsl:choose>
1157               <xsl:when test="sponsor/link=''">
1158                 <xsl:value-of select="sponsor/name"/>
1159               </xsl:when>
1160               <xsl:otherwise>
1161                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
1162                 <a href="{$sponsorLink}">
1163                   <xsl:value-of select="sponsor/name"/>
1164                 </a>
1165               </xsl:otherwise>
1166             </xsl:choose>
1167             <xsl:if test="sponsor/phone!=''">
1168               <br /><xsl:value-of select="sponsor/phone"/>
1169             </xsl:if>
1170             <xsl:if test="sponsor/email!=''">
1171               <br />
1172               <xsl:variable name="email" select="sponsor/email"/>
1173               <xsl:variable name="subject" select="summary"/>
1174               <a href="mailto:{$email}?subject={$subject}">
1175                 <xsl:value-of select="sponsor/email"/>
1176               </a>
1177             </xsl:if>
1178           </td>
1179         </tr>
1180       </xsl:if>
1181       <xsl:if test="calendar/name!=''">
1182         <tr>
1183           <td class="fieldname">Calendar:</td>
1184           <td class="fieldval">
1185             <xsl:variable name="calUrl" select="calendar/path"/>
1186             <a href="{$setSelection}?calUrl={$calUrl}">
1187               <xsl:value-of select="calendar/name"/>
1188             </a>
1189           </td>
1190         </tr>
1191       </xsl:if>
1192       <tr>
1193         <td class="fieldname filler">&#160;</td>
1194         <td class="fieldval">&#160;</td>
1195       </tr>
1196     </table>
1197   </xsl:template>
1198
1199  <!--==== ADD EVENT ====-->
1200   <xsl:template name="addEvent">
1201     <form name="eventForm" method="post" action="{$addEventUsingPage}" id="standardForm">
1202       <input type="hidden" name="confirmationid" value="{$confId}"/>
1203       <input type="hidden" name="endType" value="date"/>
1204       <h2>Add Event</h2>
1205       <table id="commonTable" cellspacing="0">
1206         <tr>
1207           <td class="fieldname">
1208             Title:
1209           </td>
1210           <td class="fieldval">
1211             <xsl:variable name="title" select="/bedework/eventform/form/title/input/@value"/>
1212             <input type="text" name="newEvent.summary" size="80" value="{$title}"/>
1213           </td>
1214         </tr>
1215         <tr>
1216           <td class="fieldname">
1217             Date &amp; Time:
1218           </td>
1219           <td class="fieldval">
1220             <!-- Set the timefields class for the first load of the page;
1221                  subsequent changes will take place using javascript without a
1222                  page reload. -->
1223             <xsl:variable name="timeFieldsClass">
1224               <xsl:choose>
1225                 <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1226                 <xsl:otherwise>timeFields</xsl:otherwise>
1227               </xsl:choose>
1228             </xsl:variable>
1229             <xsl:choose>
1230               <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">
1231                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1232                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1233                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1234               </xsl:when>
1235               <xsl:otherwise>
1236                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1237                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1238                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1239               </xsl:otherwise>
1240             </xsl:choose>
1241             all day event<br/>
1242             <div class="dateStartEndBox">
1243               <strong>Start:</strong>
1244               <div class="dateFields">
1245                 <span class="startDateLabel">Date </span>
1246                 <xsl:copy-of select="/bedework/formElements/form/start/month/*"/>
1247                 <xsl:copy-of select="/bedework/formElements/form/start/day/*"/>
1248                 <xsl:choose>
1249                   <xsl:when test="/bedework/creating = 'true'">
1250                     <xsl:copy-of select="/bedework/formElements/form/start/year/*"/>
1251                   </xsl:when>
1252                   <xsl:otherwise>
1253                     <xsl:copy-of select="/bedework/formElements/form/start/yearText/*"/>
1254                   </xsl:otherwise>
1255                 </xsl:choose>
1256               </div>
1257               <script language="JavaScript" type="text/javascript">
1258               <xsl:comment>
1259                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback');
1260               </xsl:comment>
1261               </script>
1262               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1263               <div class="{$timeFieldsClass}" id="startTimeFields">
1264                 <span id="calWidgetStartTimeHider" class="show">
1265                   <xsl:copy-of select="/bedework/formElements/form/start/hour/*"/>
1266                   <xsl:copy-of select="/bedework/formElements/form/start/minute/*"/>
1267                   <xsl:if test="/bedework/formElements/form/start/ampm">
1268                     <xsl:copy-of select="/bedework/formElements/form/start/ampm/*"/>
1269                   </xsl:if>
1270                   <xsl:text> </xsl:text>
1271                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1272                 </span>
1273               </div>
1274             </div>
1275             <div class="dateStartEndBox">
1276               <strong>End:</strong>
1277               <xsl:choose>
1278                 <xsl:when test="/bedework/formElements/form/end/type='E'">
1279                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1280                 </xsl:when>
1281                 <xsl:otherwise>
1282                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1283                 </xsl:otherwise>
1284               </xsl:choose>
1285               Date
1286               <xsl:variable name="endDateTimeClass">
1287                 <xsl:choose>
1288                   <xsl:when test="/bedework/formElements/form/end/type='E'">shown</xsl:when>
1289                   <xsl:otherwise>invisible</xsl:otherwise>
1290                 </xsl:choose>
1291               </xsl:variable>
1292               <div class="{$endDateTimeClass}" id="endDateTime">
1293                 <div class="dateFields">
1294                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/month/*"/>
1295                   <xsl:copy-of select="/bedework/formElements/form/end/dateTime/day/*"/>
1296                   <xsl:choose>
1297                     <xsl:when test="/bedework/creating = 'true'">
1298                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/year/*"/>
1299                     </xsl:when>
1300                     <xsl:otherwise>
1301                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/yearText/*"/>
1302                     </xsl:otherwise>
1303                   </xsl:choose>
1304                 </div>
1305                 <script language="JavaScript" type="text/javascript">
1306                 <xsl:comment>
1307                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback');
1308                 </xsl:comment>
1309                 </script>
1310                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1311                 <div class="{$timeFieldsClass}" id="endTimeFields">
1312                   <span id="calWidgetEndTimeHider" class="show">
1313                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/hour/*"/>
1314                     <xsl:copy-of select="/bedework/formElements/form/end/dateTime/minute/*"/>
1315                     <xsl:if test="/bedework/formElements/form/end/dateTime/ampm">
1316                       <xsl:copy-of select="/bedework/formElements/form/end/dateTime/ampm/*"/>
1317                     </xsl:if>
1318                     <xsl:text> </xsl:text>
1319                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1320                   </span>
1321                 </div>
1322               </div><br/>
1323               <div id="clock" class="invisible">
1324                 <xsl:call-template name="clock"/>
1325               </div>
1326               <div class="dateFields">
1327                 <xsl:choose>
1328                   <xsl:when test="/bedework/formElements/form/end/type='D'">
1329                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1330                   </xsl:when>
1331                   <xsl:otherwise>
1332                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1333                   </xsl:otherwise>
1334                 </xsl:choose>
1335                 Duration
1336                 <xsl:variable name="endDurationClass">
1337                   <xsl:choose>
1338                     <xsl:when test="/bedework/formElements/form/end/type='D'">shown</xsl:when>
1339                     <xsl:otherwise>invisible</xsl:otherwise>
1340                   </xsl:choose>
1341                 </xsl:variable>
1342                 <xsl:variable name="durationHrMinClass">
1343                   <xsl:choose>
1344                     <xsl:when test="/bedework/formElements/form/allDay/input/@checked='checked'">invisible</xsl:when>
1345                     <xsl:otherwise>shown</xsl:otherwise>
1346                   </xsl:choose>
1347                 </xsl:variable>
1348                 <div class="{$endDurationClass}" id="endDuration">
1349                   <xsl:choose>
1350                     <xsl:when test="/bedework/formElements/form/end/duration/weeks/input/@value = '0'">
1351                     <!-- we are using day, hour, minute format -->
1352                     <!-- must send either no week value or week value of 0 (zero) -->
1353                       <div class="durationBox">
1354                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1355                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1356                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1357                         <span id="durationHrMin" class="{$durationHrMinClass}">
1358                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1359                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1360                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1361                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1362                         </span>
1363                       </div>
1364                       <span class="durationSpacerText">or</span>
1365                       <div class="durationBox">
1366                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1367                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1368                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1369                       </div>
1370                     </xsl:when>
1371                     <xsl:otherwise>
1372                       <!-- we are using week format -->
1373                       <div class="durationBox">
1374                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1375                         <xsl:variable name="daysStr" select="/bedework/formElements/form/end/duration/days/input/@value"/>
1376                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1377                         <span id="durationHrMin" class="{$durationHrMinClass}">
1378                           <xsl:variable name="hoursStr" select="/bedework/formElements/form/end/duration/hours/input/@value"/>
1379                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1380                           <xsl:variable name="minutesStr" select="/bedework/formElements/form/end/duration/minutes/input/@value"/>
1381                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1382                         </span>
1383                       </div>
1384                       <span class="durationSpacerText">or</span>
1385                       <div class="durationBox">
1386                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1387                         <xsl:variable name="weeksStr" select="/bedework/formElements/form/end/duration/weeks/input/@value"/>
1388                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1389                       </div>
1390                     </xsl:otherwise>
1391                   </xsl:choose>
1392                 </div>
1393               </div><br/>
1394               <div class="dateFields" id="noDuration">
1395                 <xsl:choose>
1396                   <xsl:when test="/bedework/formElements/form/end/type='N'">
1397                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1398                   </xsl:when>
1399                   <xsl:otherwise>
1400                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1401                   </xsl:otherwise>
1402                 </xsl:choose>
1403                 This event has no duration / end date
1404               </div>
1405             </div>
1406           </td>
1407         </tr>
1408         <!--  Status  -->
1409         <tr>
1410           <td class="fieldname">
1411             Status:
1412           </td>
1413           <td class="fieldval">
1414             <xsl:choose>
1415               <xsl:when test="/bedework/formElements/form/status = 'TENTATIVE'">
1416                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1417               </xsl:when>
1418               <xsl:when test="/bedework/formElements/form/status = 'CANCELLED'">
1419                 <input type="radio" name="event.status" value="CONFIRMED"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED" checked="checked"/>cancelled
1420               </xsl:when>
1421               <xsl:otherwise>
1422                 <input type="radio" name="event.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="event.status" value="TENTATIVE"/>tentative <input type="radio" name="event.status" value="CANCELLED"/>cancelled
1423               </xsl:otherwise>
1424             </xsl:choose>
1425           </td>
1426         </tr>
1427         <tr>
1428           <td class="fieldname">Description:</td>
1429           <td class="fieldval">
1430             <textarea name="newEvent.description" cols="60" rows="4">
1431               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
1432             </textarea>
1433           </td>
1434         </tr>
1435         <tr>
1436           <td class="fieldname">Location:</td>
1437           <td class="fieldval" align="left">
1438             <span class="std-text">choose: </span>
1439             <span id="eventFormLocationList">
1440               <xsl:copy-of select="/bedework/formElements/form/location/locationmenu/*"/>
1441             </span>
1442             <span class="std-text"> or add new: </span>
1443             <xsl:copy-of select="/bedework/formElements/form/location/locationtext/*"/>
1444           </td>
1445         </tr>
1446         <tr>
1447           <td class="fieldname">Event Link:</td>
1448           <td class="fieldval">
1449             <xsl:variable name="link" select="/bedework/formElements/form/link/input/@value"/>
1450             <input type="text" name="newEvent.link" size="80" value="{$link}"/>
1451           </td>
1452         </tr>
1453         <tr>
1454           <td class="fieldname">&#160;</td>
1455           <td class="fieldval">
1456             <input name="submit" type="submit" value="Submit Event"/>&#160;
1457             <input name="cancelled" type="submit" value="Cancel"/>
1458           </td>
1459         </tr>
1460       </table>
1461     </form>
1462   </xsl:template>
1463
1464   <xsl:template name="clock">
1465     <div id="bwClock">
1466       <!-- Bedework 24-Hour Clock time selection widget
1467            used with resources/bwClock.js and resources/bwClock.css -->
1468       <div id="bwClockClock">
1469         <img id="clockMap" src="{$resourcesRoot}/resources/clockMap.gif" width="368" height="368" border="0" alt="" usemap="#bwClockMap" />
1470       </div>
1471       <div id="bwClockCover">
1472         <!-- this is a special effect div used simply to cover the pixelated edge
1473              where the clock meets the clock box title -->
1474       </div>
1475       <div id="bwClockBox">
1476         <h2>
1477           Bedework 24-Hour Clock
1478         </h2>
1479         <div id="bwClockDateTypeIndicator">
1480           type
1481         </div>
1482         <div id="bwClockTime">
1483           select time
1484         </div>
1485         <div id="bwClockCloseText">
1486           close
1487         </div>
1488         <div id="bwClockCloseButton">
1489           <a href="javascript:bwClockClose();">X</a>
1490         </div>
1491       </div>
1492       <map name="bwClockMap" id="bwClockMap">
1493         <area shape="rect" alt="close clock" title="close clock" coords="160,167, 200,200" href="javascript:bwClockClose()"/>
1494         <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')" />
1495         <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')" />
1496         <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')" />
1497         <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')" />
1498         <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')" />
1499         <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')" />
1500         <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')" />
1501         <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')" />
1502         <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')" />
1503         <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')" />
1504         <area shape="poly" alt="minute 00:05" title="minute 00:05" coords="196,155, 209,164, 238,126, 206,107" href="javascript:bwClockUpdateDateTimeForm('minute','05')" />
1505         <area shape="poly" alt="minute 00:00" title="minute 00:00" coords="169,155, 196,155, 206,105, 156,105" href="javascript:bwClockUpdateDateTimeForm('minute','00')" />
1506         <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')" />
1507         <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')" />
1508         <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')" />
1509         <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')" />
1510         <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')" />
1511         <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')" />
1512         <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')" />
1513         <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')" />
1514         <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')" />
1515         <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')" />
1516         <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')" />
1517         <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')" />
1518         <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')" />
1519         <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')" />
1520         <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','09')" />
1521         <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','08')" />
1522         <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','07')" />
1523         <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','06')" />
1524         <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','05')" />
1525         <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','04')" />
1526         <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','03')" />
1527         <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','02')" />
1528         <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','01')" />
1529         <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','00')" />
1530       </map>
1531     </div>
1532   </xsl:template>
1533
1534   <!--==== EDIT EVENT ====-->
1535   <xsl:template match="formElements">
1536     <form name="eventForm" method="post" action="{$editEvent}" id="standardForm">
1537       <input type="hidden" name="updateEvent" value="true"/>
1538       <input type="hidden" name="confirmationid" value="{$confId}"/>
1539       <input type="hidden" name="endType" value="date"/>
1540       <h2>Edit Event</h2>
1541       <table id="commonTable" cellspacing="0">
1542         <tr>
1543           <th colspan="2" class="commonHeader">
1544             <div id="eventActions">
1545               <xsl:variable name="subscriptionId" select="subscriptionId"/>
1546               <xsl:variable name="calendarId" select="calendarId"/>
1547               <xsl:variable name="guid" select="guid"/>
1548               <xsl:variable name="recurrenceId" select="recurrenceId"/>
1549               <a href="{$eventView}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1550                 View Event
1551               </a> |
1552               <a href="{$delEvent}?subid={$subscriptionId}&amp;calid={$calendarId}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;confirmationid={$confId}">
1553                 Delete Event
1554               </a>
1555             </div>
1556             Personal Event
1557           </th>
1558         </tr>
1559         <tr>
1560           <td class="fieldname">
1561             Title:
1562           </td>
1563           <td class="fieldval">
1564             <xsl:variable name="title" select="form/title/input/@value"/>
1565             <input type="text" name="editEvent.summary" size="80" value="{$title}"/>
1566           </td>
1567         </tr>
1568         <tr>
1569           <td class="fieldname">
1570             Date &amp; Time:
1571           </td>
1572           <td class="fieldval">
1573             <!-- Set the timefields class for the first load of the page;
1574                  subsequent changes will take place using javascript without a
1575                  page reload. -->
1576             <xsl:variable name="timeFieldsClass">
1577               <xsl:choose>
1578                 <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1579                 <xsl:otherwise>timeFields</xsl:otherwise>
1580               </xsl:choose>
1581             </xsl:variable>
1582             <xsl:choose>
1583               <xsl:when test="form/allDay/input/@checked='checked'">
1584                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="on" checked="checked"/>
1585                 <input type="hidden" name="eventStartDate.dateOnly" value="on" id="allDayStartDateField"/>
1586                 <input type="hidden" name="eventEndDate.dateOnly" value="on" id="allDayEndDateField"/>
1587               </xsl:when>
1588               <xsl:otherwise>
1589                 <input type="checkbox" name="allDayFlag" onclick="swapAllDayEvent(this)" value="off"/>
1590                 <input type="hidden" name="eventStartDate.dateOnly" value="off" id="allDayStartDateField"/>
1591                 <input type="hidden" name="eventEndDate.dateOnly" value="off" id="allDayEndDateField"/>
1592               </xsl:otherwise>
1593             </xsl:choose>
1594             all day event<br/>
1595             <div class="dateStartEndBox">
1596               <strong>Start:</strong>
1597               <div class="dateFields">
1598                 <span class="startDateLabel">Date </span>
1599                 <xsl:copy-of select="form/start/month/*"/>
1600                 <xsl:copy-of select="form/start/day/*"/>
1601                 <xsl:choose>
1602                   <xsl:when test="/bedework/creating = 'true'">
1603                     <xsl:copy-of select="form/start/year/*"/>
1604                   </xsl:when>
1605                   <xsl:otherwise>
1606                     <xsl:copy-of select="form/start/yearText/*"/>
1607                   </xsl:otherwise>
1608                 </xsl:choose>
1609               </div>
1610               <script language="JavaScript" type="text/javascript">
1611               <xsl:comment>
1612                 startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback');
1613               </xsl:comment>
1614               </script>
1615               <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1616               <div class="{$timeFieldsClass}" id="startTimeFields">
1617                 <span id="calWidgetStartTimeHider" class="show">
1618                   <xsl:copy-of select="form/start/hour/*"/>
1619                   <xsl:copy-of select="form/start/minute/*"/>
1620                   <xsl:if test="form/start/ampm">
1621                     <xsl:copy-of select="form/start/ampm/*"/>
1622                   </xsl:if>
1623                   <xsl:text> </xsl:text>
1624                   <a href="javascript:bwClockLaunch('eventStartDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1625                 </span>
1626               </div>
1627             </div>
1628             <div class="dateStartEndBox">
1629               <strong>End:</strong>
1630               <xsl:choose>
1631                 <xsl:when test="form/end/type='E'">
1632                   <input type="radio" name="eventEndType" value="E" checked="checked" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1633                 </xsl:when>
1634                 <xsl:otherwise>
1635                   <input type="radio" name="eventEndType" value="E" onClick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>
1636                 </xsl:otherwise>
1637               </xsl:choose>
1638               Date
1639               <xsl:variable name="endDateTimeClass">
1640                 <xsl:choose>
1641                   <xsl:when test="form/end/type='E'">shown</xsl:when>
1642                   <xsl:otherwise>invisible</xsl:otherwise>
1643                 </xsl:choose>
1644               </xsl:variable>
1645               <div class="{$endDateTimeClass}" id="endDateTime">
1646                 <div class="dateFields">
1647                   <xsl:copy-of select="form/end/dateTime/month/*"/>
1648                   <xsl:copy-of select="form/end/dateTime/day/*"/>
1649                   <xsl:choose>
1650                     <xsl:when test="/bedework/creating = 'true'">
1651                       <xsl:copy-of select="form/end/dateTime/year/*"/>
1652                     </xsl:when>
1653                     <xsl:otherwise>
1654                       <xsl:copy-of select="form/end/dateTime/yearText/*"/>
1655                     </xsl:otherwise>
1656                   </xsl:choose>
1657                 </div>
1658                 <script language="JavaScript" type="text/javascript">
1659                 <xsl:comment>
1660                   endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback');
1661                 </xsl:comment>
1662                 </script>
1663                 <!--<img src="{$resourcesRoot}/resources/calIcon.gif" width="16" height="15" border="0"/>-->
1664                 <div class="{$timeFieldsClass}" id="endTimeFields">
1665                   <span id="calWidgetEndTimeHider" class="show">
1666                     <xsl:copy-of select="form/end/dateTime/hour/*"/>
1667                     <xsl:copy-of select="form/end/dateTime/minute/*"/>
1668                     <xsl:if test="form/end/dateTime/ampm">
1669                       <xsl:copy-of select="form/end/dateTime/ampm/*"/>
1670                     </xsl:if>
1671                     <xsl:text> </xsl:text>
1672                     <a href="javascript:bwClockLaunch('eventEndDate');"><img src="{$resourcesRoot}/resources/clockIcon.gif" width="16" height="15" border="0"/></a>
1673                   </span>
1674                 </div>
1675               </div><br/>
1676               <div id="clock" class="invisible">
1677                 <xsl:call-template name="clock"/>
1678               </div>
1679               <div class="dateFields">
1680                 <xsl:choose>
1681                   <xsl:when test="form/end/type='D'">
1682                     <input type="radio" name="eventEndType" value="D" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1683                   </xsl:when>
1684                   <xsl:otherwise>
1685                     <input type="radio" name="eventEndType" value="D" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>
1686                   </xsl:otherwise>
1687                 </xsl:choose>
1688                 Duration
1689                 <xsl:variable name="endDurationClass">
1690                   <xsl:choose>
1691                     <xsl:when test="form/end/type='D'">shown</xsl:when>
1692                     <xsl:otherwise>invisible</xsl:otherwise>
1693                   </xsl:choose>
1694                 </xsl:variable>
1695                 <xsl:variable name="durationHrMinClass">
1696                   <xsl:choose>
1697                     <xsl:when test="form/allDay/input/@checked='checked'">invisible</xsl:when>
1698                     <xsl:otherwise>shown</xsl:otherwise>
1699                   </xsl:choose>
1700                 </xsl:variable>
1701                 <div class="{$endDurationClass}" id="endDuration">
1702                   <xsl:choose>
1703                     <xsl:when test="form/end/duration/weeks/input/@value = '0'">
1704                     <!-- we are using day, hour, minute format -->
1705                     <!-- must send either no week value or week value of 0 (zero) -->
1706                       <div class="durationBox">
1707                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')" checked="checked"/>
1708                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1709                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays"/>days
1710                         <span id="durationHrMin" class="{$durationHrMinClass}">
1711                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1712                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours"/>hours
1713                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1714                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes"/>minutes
1715                         </span>
1716                       </div>
1717                       <span class="durationSpacerText">or</span>
1718                       <div class="durationBox">
1719                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')"/>
1720                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1721                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks" disabled="true"/>weeks
1722                       </div>
1723                     </xsl:when>
1724                     <xsl:otherwise>
1725                       <!-- we are using week format -->
1726                       <div class="durationBox">
1727                         <input type="radio" name="eventDuration.type" value="daytime" onclick="swapDurationType('daytime')"/>
1728                         <xsl:variable name="daysStr" select="form/end/duration/days/input/@value"/>
1729                         <input type="text" name="eventDuration.daysStr" size="2" value="{$daysStr}" id="durationDays" disabled="true"/>days
1730                         <span id="durationHrMin" class="{$durationHrMinClass}">
1731                           <xsl:variable name="hoursStr" select="form/end/duration/hours/input/@value"/>
1732                           <input type="text" name="eventDuration.hoursStr" size="2" value="{$hoursStr}" id="durationHours" disabled="true"/>hours
1733                           <xsl:variable name="minutesStr" select="form/end/duration/minutes/input/@value"/>
1734                           <input type="text" name="eventDuration.minutesStr" size="2" value="{$minutesStr}" id="durationMinutes" disabled="true"/>minutes
1735                         </span>
1736                       </div>
1737                       <span class="durationSpacerText">or</span>
1738                       <div class="durationBox">
1739                         <input type="radio" name="eventDuration.type" value="weeks" onclick="swapDurationType('week')" checked="checked"/>
1740                         <xsl:variable name="weeksStr" select="form/end/duration/weeks/input/@value"/>
1741                         <input type="text" name="eventDuration.weeksStr" size="2" value="{$weeksStr}" id="durationWeeks"/>weeks
1742                       </div>
1743                     </xsl:otherwise>
1744                   </xsl:choose>
1745                 </div>
1746               </div><br/>
1747               <div class="dateFields" id="noDuration">
1748                 <xsl:choose>
1749                   <xsl:when test="form/end/type='N'">
1750                     <input type="radio" name="eventEndType" value="N" checked="checked" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1751                   </xsl:when>
1752                   <xsl:otherwise>
1753                     <input type="radio" name="eventEndType" value="N" onClick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>
1754                   </xsl:otherwise>
1755                 </xsl:choose>
1756                 This event has no duration / end date
1757               </div>
1758             </div>
1759           </td>
1760         </tr>
1761         <!--  Status  -->
1762         <tr>
1763           <td class="fieldname">
1764             Status:
1765           </td>
1766           <td class="fieldval">
1767             <xsl:choose>
1768               <xsl:when test="form/status = 'TENTATIVE'">
1769                 <input type="radio" name="editEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE" checked="checked"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED"/>cancelled
1770               </xsl:when>
1771               <xsl:when test="form/status = 'CANCELLED'">
1772                 <input type="radio" name="editEvent.status" value="CONFIRMED"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED" checked="checked"/>cancelled
1773               </xsl:when>
1774               <xsl:otherwise>
1775                 <input type="radio" name="editEvent.status" value="CONFIRMED" checked="checked"/>confirmed <input type="radio" name="editEvent.status" value="TENTATIVE"/>tentative <input type="radio" name="editEvent.status" value="CANCELLED"/>cancelled
1776               </xsl:otherwise>
1777             </xsl:choose>
1778           </td>
1779         </tr>
1780         <tr>
1781           <td class="fieldname">Description:</td>
1782           <td class="fieldval">
1783             <textarea name="editEvent.description" cols="60" rows="4">
1784               <xsl:value-of select="/bedework/formElements/form/desc/textarea"/>
1785             </textarea>
1786           </td>
1787         </tr>
1788         <tr>
1789           <td class="fieldname">Location:</td>
1790           <td class="fieldval" align="left">
1791             <span class="std-text">choose: </span>
1792             <span id="eventFormLocationList">
1793               <xsl:copy-of select="form/location/locationmenu/*"/>
1794             </span>
1795             <span class="std-text"> or add new: </span>
1796             <xsl:copy-of select="form/location/locationtext/*"/>
1797           </td>
1798         </tr>
1799         <tr>
1800           <td class="fieldname">Event Link:</td>
1801           <td class="fieldval">
1802             <xsl:variable name="link" select="form/link/input/@value"/>
1803             <input type="text" name="editEvent.link" size="80" value="{$link}"/>
1804           </td>
1805         </tr>
1806         <tr>
1807           <td class="fieldname">&#160;</td>
1808           <td class="fieldval">
1809             <input name="submit" type="submit" value="Submit Event"/>&#160;
1810             <input name="cancelled" type="submit" value="Cancel"/>
1811           </td>
1812         </tr>
1813       </table>
1814     </form>
1815   </xsl:template>
1816
1817   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
1818   <xsl:template match="subscriptions">
1819     <h2>Manage Subscriptions</h2>
1820     <table id="subsTable">
1821       <tr>
1822         <td class="cals">
1823           <h3>Public calendars</h3>
1824           <p class="smaller">
1825             Select a calendar below to add a <em><strong>new</strong></em>
1826             internal subscription. <!-- or
1827             <a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">
1828             subscribe to an external calendar</a>.-->
1829           </p>
1830           <ul class="calendarTree">
1831             <xsl:apply-templates select="/bedework/subscriptions/subscribe/calendars/calendar" mode="subscribe"/>
1832           </ul>
1833         </td>
1834         <td class="subs">
1835           <xsl:choose>
1836             <xsl:when test="/bedework/page='subscriptions'">
1837               <xsl:call-template name="subscriptionList"/>
1838             </xsl:when>
1839             <xsl:when test="/bedework/creating='true'">
1840               <xsl:apply-templates select="subscription" mode="addSubscription"/>
1841             </xsl:when>
1842             <xsl:otherwise>
1843               <xsl:apply-templates select="subscription" mode="modSubscription"/>
1844             </xsl:otherwise>
1845           </xsl:choose>
1846         </td>
1847       </tr>
1848     </table>
1849   </xsl:template>
1850
1851   <xsl:template match="calendar" mode="subscribe">
1852     <xsl:variable name="id" select="id"/>
1853     <xsl:variable name="itemClass">
1854       <xsl:choose>
1855         <xsl:when test="calendarCollection='false'">folder</xsl:when>
1856         <xsl:otherwise>calendar</xsl:otherwise>
1857       </xsl:choose>
1858     </xsl:variable>
1859     <li class="{$itemClass}">
1860       <a href="{$subscriptions-initAdd}&amp;calId={$id}">
1861         <xsl:value-of select="name"/>
1862       </a>
1863       <xsl:if test="calendar">
1864         <ul>
1865           <xsl:apply-templates select="calendar" mode="subscribe">
1866             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
1867           </xsl:apply-templates>
1868         </ul>
1869       </xsl:if>
1870     </li>
1871   </xsl:template>
1872
1873   <xsl:template match="calendar" mode="myCalendars">
1874     <!-- supress Inbox and Outbox for the moment -->
1875     <xsl:if test="(name != 'Inbox') and (name != 'Outbox')">
1876       <xsl:variable name="id" select="id"/>
1877       <xsl:variable name="itemClass">
1878         <xsl:choose>
1879           <xsl:when test="/bedework/selectionState/selectionType = 'calendar'
1880                           and name = /bedework/selectionState/subscriptions/subscription/calendar/name">selected</xsl:when>
1881           <xsl:when test="name='Trash'">trash</xsl:when>
1882           <xsl:when test="calendarCollection='false'">folder</xsl:when>
1883           <xsl:otherwise>calendar</xsl:otherwise>
1884         </xsl:choose>
1885       </xsl:variable>
1886       <li class="{$itemClass}">
1887         <xsl:variable name="url" select="path"/>
1888         <a href="{$setSelection}?calUrl={$url}">
1889           <xsl:value-of select="name"/>
1890         </a>
1891         <xsl:if test="calendar">
1892           <ul>
1893             <xsl:apply-templates select="calendar" mode="myCalendars"/>
1894           </ul>
1895         </xsl:if>
1896       </li>
1897     </xsl:if>
1898   </xsl:template>
1899
1900   <xsl:template match="subscription" mode="addSubscription">
1901     <h3>Add New Subscription</h3>
1902     <p class="note">*the subsciption name must be unique</p>
1903     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
1904       <table id="commonTable" cellspacing="0">
1905         <tr>
1906           <td class="fieldname">Name:</td>
1907           <td>
1908             <xsl:variable name="subName" select="name"/>
1909             <input type="text" value="{$subName}" name="subscription.name" size="60"/>
1910           </td>
1911         </tr>
1912         <xsl:if test="internal='false'">
1913           <tr>
1914             <td class="fieldname">Uri:</td>
1915             <td>
1916               <xsl:variable name="subUri" select="uri"/>
1917               <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
1918             </td>
1919           </tr>
1920         </xsl:if>
1921         <tr>
1922           <td class="fieldname">Display:</td>
1923           <td>
1924             <input type="radio" value="true" name="subscription.display"/> yes
1925             <input type="radio" value="false" name="subscription.display" checked="checked"/> no
1926           </td>
1927         </tr>
1928         <tr>
1929           <td class="fieldname">Style:</td>
1930           <td>
1931             <xsl:variable name="subStyle" select="style"/>
1932             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
1933           </td>
1934         </tr>
1935         <!--<tr>
1936           <td class="fieldname">Unremovable:</td>
1937           <td>
1938             <input type="radio" value="true" name="unremoveable" size="60"/> true
1939             <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
1940           </td>
1941         </tr>-->
1942       </table>
1943       <table border="0" id="submitTable">
1944         <tr>
1945           <td>
1946             <input type="submit" name="addSubscription" value="Add Subscription"/>
1947             <input type="submit" name="cancelled" value="Cancel"/>
1948             <input type="reset" value="Clear"/>
1949           </td>
1950         </tr>
1951       </table>
1952     </form>
1953   </xsl:template>
1954
1955   <xsl:template match="subscription" mode="modSubscription">
1956     <h3>Modify Subscription</h3>
1957     <form name="subscribeForm" action="{$subscriptions-subscribe}" method="post">
1958       <table id="commonTable" cellspacing="0">
1959         <tr>
1960           <td class="fieldname">Name:</td>
1961           <td>
1962             <xsl:value-of select="name"/>
1963             <xsl:variable name="subName" select="name"/>
1964             <input type="hidden" value="{$subName}" name="name"/>
1965           </td>
1966         </tr>
1967         <xsl:choose>
1968           <xsl:when test="internal='false'">
1969             <tr>
1970               <td class="fieldname">Uri:</td>
1971               <td>
1972                 <xsl:variable name="subUri" select="uri"/>
1973                 <input type="text" value="{$subUri}" name="subscription.uri" size="60"/>
1974               </td>
1975             </tr>
1976           </xsl:when>
1977           <xsl:otherwise>
1978             <tr>
1979               <td class="fieldname">Uri:</td>
1980               <td>
1981                 <xsl:value-of select="uri"/>
1982               </td>
1983             </tr>
1984           </xsl:otherwise>
1985         </xsl:choose>
1986         <tr>
1987           <td class="fieldname">Display:</td>
1988           <td>
1989             <xsl:choose>
1990               <xsl:when test="display='true'">
1991                 <input type="radio" value="true" name="subscription.display" checked="checked"/> yes
1992                 <input type="radio" value="false" name="subscription.display"/> no
1993               </xsl:when>
1994               <xsl:otherwise>
1995                 <input type="radio" value="true" name="subscription.display"/> yes
1996                 <input type="radio" value="false" name="subscription.display" checked="checked"/> no
1997               </xsl:otherwise>
1998             </xsl:choose>
1999           </td>
2000         </tr>
2001         <tr>
2002           <td class="fieldname">Style:</td>
2003           <td>
2004             <xsl:variable name="subStyle" select="style"/>
2005             <input type="text" value="{$subStyle}" name="subscription.style" size="60"/>
2006           </td>
2007         </tr>
2008         <!--<tr>
2009           <td class="fieldname">Unremovable:</td>
2010           <td>
2011             <xsl:choose>
2012               <xsl:when test="unremoveable='true'">
2013                 <input type="radio" value="true" name="unremoveable" size="60" checked="checked"/> true
2014                 <input type="radio" value="false" name="unremoveable" size="60"/> false
2015               </xsl:when>
2016               <xsl:otherwise>
2017                 <input type="radio" value="true" name="unremoveable" size="60"/> true
2018                 <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
2019               </xsl:otherwise>
2020             </xsl:choose>
2021           </td>
2022         </tr>-->
2023       </table>
2024       <table border="0" id="submitTable">
2025         <tr>
2026           <td>
2027             <input type="submit" name="updateSubscription" value="Update Subscription"/>
2028             <input type="submit" name="cancelled" value="Cancel"/>
2029             <input type="reset" value="Reset"/>
2030           </td>
2031           <td align="right">
2032             <input type="submit" name="delete" value="Delete Subscription"/>
2033           </td>
2034         </tr>
2035       </table>
2036     </form>
2037   </xsl:template>
2038
2039   <xsl:template name="subscriptionList">
2040     <h3>Current subscriptions</h3>
2041     <table id="commonTable" cellspacing="0">
2042       <tr>
2043         <th>Name</th>
2044         <th>URI</th>
2045         <th>Style</th>
2046         <th>Display</th>
2047         <!--<th>Unremovable</th>
2048         <th>External</th>
2049         <th>Deleted?</th>-->
2050       </tr>
2051       <xsl:for-each select="subscription">
2052         <!--<xsl:sort select="name" order="ascending" case-order="upper-first"/>-->
2053         <tr>
2054           <td>
2055             <xsl:variable name="subname" select="name"/>
2056             <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">
2057               <xsl:value-of select="name"/>
2058             </a>
2059           </td>
2060           <td>
2061             <xsl:value-of select="uri"/>
2062           </td>
2063           <td>
2064             <xsl:value-of select="style"/>
2065           </td>
2066           <td class="center">
2067             <xsl:if test="display='true'">
2068               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2069             </xsl:if>
2070           </td>
2071           <!--<td class="center">
2072             <xsl:if test="unremoveable='true'">
2073               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2074             </xsl:if>
2075           </td>
2076           <td class="center">
2077             <xsl:if test="internal='false'">
2078               <img src="{$resourcesRoot}/resources/greenCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2079             </xsl:if>
2080           </td>
2081           <td class="center">
2082             <xsl:if test="calendarDeleted='true'">
2083               <img src="{$resourcesRoot}/resources/redCheckIcon.gif" width="13" height="13" alt="true" border="0"/>
2084             </xsl:if>
2085           </td>-->
2086         </tr>
2087       </xsl:for-each>
2088     </table>
2089     <!--<h4><a href="{$subscriptions-initAdd}&amp;calUri=please enter a calendar uri">Subscribe to a remote calendar</a> (by URI)</h4>-->
2090   </xsl:template>
2091
2092   <xsl:template match="subscription" mode="mySubscriptions">
2093     <li class="calendar">
2094       <!--<xsl:variable name="subname" select="name"/>
2095       <a href="{$subscriptions-fetchForUpdate}&amp;subname={$subname}">-->
2096         <xsl:value-of select="name"/>
2097       <!--</a>-->
2098     </li>
2099   </xsl:template>
2100
2101   <!--==== ALARM OPTIONS ====-->
2102   <xsl:template name="alarmOptions">
2103     <form method="get" action="{$setAlarm}" id="standardForm">
2104       <input type="hidden" name="updateAlarmOptions" value="true"/>
2105       <table id="commonTable" cellspacing="0">
2106         <tr>
2107           <th colspan="2" class="commonHeader">Alarm options</th>
2108         </tr>
2109         <tr>
2110           <td class="fieldname">
2111             Alarm Date/Time:
2112             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDate/*"/>
2113           </td>
2114           <td class="fieldval">
2115             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmdate/*"/>
2116             <span class="std-text">at  </span>
2117             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmtime/*"/>
2118           </td>
2119         </tr>
2120         <tr>
2121           <td class="fieldname">
2122             or Before/After event:
2123             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmTriggerSelectorDuration/*"/>
2124           </td>
2125           <td align="left">
2126             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/days/*"/>
2127             days
2128             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/hours/*"/>
2129             hours
2130             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/minutes/*"/>
2131             minutes
2132             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/seconds/*"/>
2133             seconds OR:
2134             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmduration/weeks/*"/>
2135             weeks
2136             &#160;
2137             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationBefore/*"/>
2138             before
2139             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationAfter/*"/>
2140             after
2141             &#160;
2142             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelStart/*"/>
2143             start
2144             <xsl:copy-of select="/bedework/alarmoptionsform/form/alarmDurationRelEnd/*"/>
2145             end
2146           </td>
2147         </tr>
2148         <tr>
2149           <td>
2150             Email Address:
2151           </td>
2152           <td align="left">
2153             <xsl:copy-of select="/bedework/alarmoptionsform/form/email/*"/>
2154           </td>
2155         </tr>
2156         <tr>
2157           <td>
2158             Subject:
2159           </td>
2160           <td align="left">
2161             <xsl:copy-of select="/bedework/alarmoptionsform/form/subject/*"/>
2162           </td>
2163         </tr>
2164         <tr>
2165           <td>&#160;</td>
2166           <td>
2167             <input name="submit" type="submit" value="Continue"/>&#160;
2168             <input name="cancelled" type="submit" value="Cancel"/>
2169           </td>
2170         </tr>
2171       </table>
2172     </form>
2173   </xsl:template>
2174
2175   <!--==== UPLOAD ====-->
2176   <xsl:template name="upload">
2177     <form method="post" action="{$upload}" id="standardForm"  enctype="multipart/form-data">
2178       <h2>Upload iCAL File</h2>
2179       <table id="commonTable" cellspacing="0">
2180         <tr>
2181           <td class="fieldname">
2182             Filename:
2183           </td>
2184           <td align="left">
2185             <input type="file" name="uploadFile" size="80" />
2186           </td>
2187         </tr>
2188         <tr>
2189           <td>&#160;</td>
2190           <td>
2191             <input name="submit" type="submit" value="Continue"/>&#160;
2192             <input name="cancelled" type="submit" value="Cancel"/>
2193           </td>
2194         </tr>
2195       </table>
2196     </form>
2197   </xsl:template>
2198
2199   <!--==== EMAIL OPTIONS ====-->
2200   <xsl:template name="emailOptions">
2201     <form method="get" action="{$mailEvent}" id="standardForm">
2202       <input type="hidden" name="updateEmailOptions" value="true"/>
2203       <table id="commonTable" cellspacing="0">
2204         <tr>
2205           <th colspan="2" class="commonHeader">Update email options</th>
2206         </tr>
2207         <tr>
2208           <td>
2209
2210             Email Address:
2211           </td>
2212           <td align="left">
2213             <xsl:copy-of select="/bedework/emailoptionsform/form/email/*"/>
2214           </td>
2215         </tr>
2216         <tr>
2217           <td>
2218             Subject:
2219           </td>
2220           <td align="left">
2221             <xsl:copy-of select="/bedework/emailoptionsform/form/subject/*"/>
2222           </td>
2223         </tr>
2224         <tr>
2225           <td>&#160;</td>
2226           <td>
2227             <input name="submit" type="submit" value="Continue"/>&#160;
2228             <input name="cancelled" type="submit" value="Cancel"/>
2229           </td>
2230         </tr>
2231       </table>
2232     </form>
2233   </xsl:template>
2234
2235   <!--==== MANAGE LOCATIONS ====-->
2236   <xsl:template name="manageLocations">
2237     <form name="addLocationForm" method="post" action="{$addLocation}" id="standardForm">
2238       <input type="hidden" name="confirmationid" value="{$confId}"/>
2239       <h2>Manage Locations</h2>
2240       <table id="commonTable" cellspacing="0">
2241         <tr>
2242           <th class="commonHeader" colspan="2">Add Location</th>
2243         </tr>
2244         <tr>
2245           <td class="fieldname">
2246             Main Address:
2247           </td>
2248           <td>
2249             <input size="60" name="newLocation.address" type="text"/>
2250           </td>
2251         </tr>
2252         <tr>
2253           <td class="fieldname">
2254             Subaddress:
2255           </td>
2256           <td>
2257             <input size="60" name="newLocation.subaddress" type="text"/>
2258           </td>
2259         </tr>
2260         <tr>
2261           <td class="fieldname">
2262             Location Link:
2263           </td>
2264           <td>
2265             <input size="60" name="newLocation.link" type="text"/>
2266           </td>
2267         </tr>
2268         <tr>
2269           <td></td>
2270           <td class="padMe">
2271             <input name="submit" type="submit" value="Submit Location"/>&#160;
2272             <input name="cancelled" type="submit" value="Cancel"/>
2273           </td>
2274         </tr>
2275         <tr>
2276           <th class="commonHeader" colspan="2">Edit/Delete Locations</th>
2277         </tr>
2278         <td colspan="2" class="plain">
2279           <ul>
2280             <xsl:for-each select="/bedework/eventform/form/location/locationmenu/select/option[@value>'3']">
2281               <xsl:sort select="."/>
2282               <li>
2283                 <xsl:variable name="locationId" select="@value"/>
2284                 <a href="{$editLocation}?locationId={$locationId}"><xsl:value-of select="."/></a>
2285               </li>
2286             </xsl:for-each>
2287           </ul>
2288         </td>
2289       </table>
2290     </form>
2291   </xsl:template>
2292
2293   <!--==== EDIT LOCATION ====-->
2294   <xsl:template match="locationform">
2295     <form name="editLocationForm" method="post" action="{$editLocation}" id="standardForm">
2296       <input type="hidden" name="updateLocation" value="true"/>
2297       <input type="hidden" name="confirmationid" value="{$confId}"/>
2298       <h2>Manage Locations</h2>
2299       <table id="commonTable" cellspacing="0">
2300         <tr>
2301           <th colspan="2" class="commonHeader">
2302             <xsl:variable name="locId" select="/bedework/locationform/form/id"/>
2303             <div id="eventActions">
2304               <a href="{$delLocation}?locationId={$locId}">Delete Location</a>
2305             </div>
2306             Edit Location
2307           </th>
2308         </tr>
2309         <tr>
2310           <td class="fieldname">
2311             Address:
2312           </td>
2313           <td align="left">
2314             <xsl:copy-of select="/bedework/locationform/form/address/*"/>
2315           </td>
2316         </tr>
2317         <tr>
2318           <td class="fieldname">
2319             Subaddress:
2320           </td>
2321           <td align="left">
2322             <xsl:copy-of select="/bedework/locationform/form/subaddress/*"/>
2323           </td>
2324         </tr>
2325         <tr>
2326           <td class="fieldname">
2327             Location's URL:
2328           </td>
2329           <td>
2330             <xsl:copy-of select="/bedework/locationform/form/link/*"/>
2331           </td>
2332         </tr>
2333         <tr>
2334           <td>&#160;</td>
2335           <td class="padMe">
2336             <input name="submit" type="submit" value="Submit Location"/>&#160;
2337             <input name="cancelled" type="submit" value="Cancel"/>
2338           </td>
2339         </tr>
2340       </table>
2341     </form>
2342   </xsl:template>
2343
2344   <!--==== SIDE CALENDAR MENU ====-->
2345   <xsl:template match="calendar" mode="sideList">
2346     <xsl:variable name="id" select="id"/>
2347     <div class="std-text">
2348       <a href="{$setSelection}?calId={$id}"><xsl:value-of select="title"/></a>
2349     </div>
2350   </xsl:template>
2351
2352   <!--==== STAND-ALONE PAGES ====-->
2353   <!-- not currently in use -->
2354   <xsl:template name="selectPage">
2355     <!-- <xsl:choose>
2356       <xsl:when test="/bedework/appvar[key='page']">
2357         <xsl:choose>
2358           <xsl:otherwise>
2359             <xsl:call-template name="noPage"/>
2360           </xsl:otherwise>
2361         </xsl:choose>
2362       </xsl:when>
2363       <xsl:otherwise> -->
2364         <xsl:call-template name="noPage"/>
2365       <!--</xsl:otherwise>
2366     </xsl:choose>-->
2367   </xsl:template>
2368
2369   <xsl:template name="noPage">
2370     <p>
2371       Error: there is no page with that name.  Please select a navigational
2372       link to continue.
2373     </p>
2374   </xsl:template>
2375
2376   <!--==== UTILITY TEMPLATES ====-->
2377
2378   <!-- search and replace template taken from
2379        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
2380   <xsl:template name="replace">
2381     <xsl:param name="string" select="''"/>
2382     <xsl:param name="pattern" select="''"/>
2383     <xsl:param name="replacement" select="''"/>
2384     <xsl:choose>
2385       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
2386         <xsl:value-of select="substring-before($string, $pattern)"/>
2387         <xsl:copy-of select="$replacement"/>
2388         <xsl:call-template name="replace">
2389           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
2390           <xsl:with-param name="pattern" select="$pattern"/>
2391           <xsl:with-param name="replacement" select="$replacement"/>
2392         </xsl:call-template>
2393       </xsl:when>
2394       <xsl:otherwise>
2395         <xsl:value-of select="$string"/>
2396       </xsl:otherwise>
2397     </xsl:choose>
2398   </xsl:template>
2399
2400   <!--==== FOOTER ====-->
2401   <xsl:template name="footer">
2402     <div id="footer">
2403       Demonstration calendar; place footer information here.
2404     </div>
2405     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
2406       <tr>
2407         <td class="leftCell">
2408           <a href="http://www.bedework.org/">Bedework Calendar</a> |
2409           <a href="?noxslt=yes">show XML</a> |
2410           <a href="?refreshXslt=yes">refresh XSLT</a>
2411         </td>
2412         <td class="rightCell">
2413           <!--<form name="skinSelectForm" method="get" action="{$setup}">
2414             skin selector:
2415             <select name="skinNameSticky" onChange="submit()">
2416               <option>select a skin</option>
2417               <option value="default">Demo Calendar</option>
2418               <option value="rensselaer">Rensselaer</option>
2419               <option value="washington">Washington</option>
2420             </select>
2421           </form>-->
2422         </td>
2423       </tr>
2424     </table>
2425   </xsl:template>
2426 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.