root/trunk/bedework/deployment/freebusyAggregator/webapp/resources/demoskins/MainCampus/default/default/default.xsl

Revision 952 (checked in by douglm, 7 years ago)

--

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   <!--       BEDEWORK FREEBUSY AGGREGATOR        -->
13   <!-- ========================================= -->
14
15   <!-- **********************************************************************
16     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
17
18     Redistribution and use of this distribution in source and binary forms,
19     with or without modification, are permitted provided that:
20        The above copyright notice and this permission notice appear in all
21         copies and supporting documentation;
22
23         The name, identifiers, and trademarks of Rensselaer Polytechnic
24         Institute are not used in advertising or publicity without the
25         express prior written permission of Rensselaer Polytechnic Institute;
26
27     DISCLAIMER: The software is distributed" AS IS" without any express or
28     implied warranty, including but not limited to, any implied warranties
29     of merchantability or fitness for a particular purpose or any warrant)'
30     of non-infringement of any current or pending patent rights. The authors
31     of the software make no representations about the suitability of this
32     software for any particular purpose. The entire risk as to the quality
33     and performance of the software is with the user. Should the software
34     prove defective, the user assumes the cost of all necessary servicing,
35     repair or correction. In particular, neither Rensselaer Polytechnic
36     Institute, nor the authors of the software are liable for any indirect,
37     special, consequential, or incidental damages related to the software,
38     to the maximum extent the law permits. -->
39
40   <!-- DEFINE INCLUDES -->
41   <xsl:include href="errors.xsl"/>
42   <xsl:include href="messages.xsl"/>
43
44   <!-- DEFINE GLOBAL CONSTANTS -->
45   <!-- URL of html resources (images, css, other html); by default this is
46        set to the application root, but for the personal calendar
47        this should be changed to point to a
48        web server over https to avoid mixed content errors, e.g.,
49   <xsl:variable name="resourcesRoot">https://mywebserver.edu/myresourcesdir</xsl:variable>
50     -->
51   <xsl:variable name="resourcesRoot" select="/bedework-fbaggregator/approot"/>
52
53   <!-- URL of the XSL template directory -->
54   <!-- The approot is an appropriate place to put
55        included stylesheets and xml fragments. These are generally
56        referenced relatively (like errors.xsl and messages.xsl above);
57        this variable is here for your convenience if you choose to
58        reference it explicitly.  It is not used in this stylesheet, however,
59        and can be safely removed if you so choose. -->
60   <xsl:variable name="appRoot" select="/bedework-fbaggregator/approot"/>
61
62   <!-- Properly encoded prefixes to the application actions; use these to build
63        urls; allows the application to be used without cookies or within a portal.
64        These urls are rewritten in header.jsp and simply passed through for use
65        here. Every url includes a query string (either ?b=de or a real query
66        string) so that all links constructed in this stylesheet may begin the
67        query string with an ampersand. -->
68   <xsl:variable name="setup" select="/bedework-fbaggregator/urlPrefixes/setup"/>
69   <xsl:variable name="initialise" select="/bedework-fbaggregator/urlPrefixes/initialise"/>
70   <xsl:variable name="fetchFreeBusy" select="/bedework-fbaggregator/urlPrefixes/fetchFreeBusy"/>
71   <xsl:variable name="showManageGroup" select="/bedework-fbaggregator/urlPrefixes/showManageGroup"/>
72   <xsl:variable name="updateGroup" select="/bedework-fbaggregator/urlPrefixes/updateGroup"/>
73   <xsl:variable name="selectUsers" select="/bedework-fbaggregator/urlPrefixes/selectUsers"/>
74   <xsl:variable name="showAddUser" select="/bedework-fbaggregator/urlPrefixes/showAddUser"/>
75   <xsl:variable name="getUser" select="/bedework-fbaggregator/urlPrefixes/getUser"/>
76   <xsl:variable name="editUser" select="/bedework-fbaggregator/urlPrefixes/editUser"/>
77   <xsl:variable name="addUser" select="/bedework-fbaggregator/urlPrefixes/addUser"/>
78   <xsl:variable name="initInvitation" select="/bedework-fbaggregator/urlPrefixes/initInvitation"/>
79   <xsl:variable name="makeMeeting" select="/bedework-fbaggregator/urlPrefixes/makeMeeting"/>
80
81   <!-- URL of the web application - includes web context
82   <xsl:variable name="urlPrefix" select="/bedework-fbaggregator/urlprefix"/> -->
83
84   <!-- Other generally useful global variables-->
85   <xsl:variable name="currentTimezone">America/New_York</xsl:variable><!-- for now just set it -->
86   <!--<xsl:variable name="prevdate" select="/bedework-fbaggregator/previousdate"/>
87   <xsl:variable name="nextdate" select="/bedework-fbaggregator/nextdate"/>
88   <xsl:variable name="curdate" select="/bedework-fbaggregator/currentdate/date"/>
89   <xsl:variable name="skin">default</xsl:variable>
90   <xsl:variable name="publicCal">/cal</xsl:variable>-->
91
92
93  <!-- BEGIN MAIN TEMPLATE -->
94   <xsl:template match="/">
95     <html lang="en">
96       <head>
97         <title>CalConnect Boeing CalDav Freebusy Aggregator</title>
98         <meta name="robots" content="noindex,nofollow"/>
99         <link rel="stylesheet" href="{$resourcesRoot}/default/default/default.css" media="screen,all"/>
100         <link rel="icon" type="image/ico" href="{$resourcesRoot}/resources/bedework.ico" />
101         <script type="text/javascript" src="{$resourcesRoot}/resources/includes.js"></script>
102         <script type="text/javascript" src="{$resourcesRoot}/resources/dynCalendarWidget.js"></script>
103         <link rel="stylesheet" href="{$resourcesRoot}/resources/dynCalendarWidget.css"/>
104         <script language="JavaScript" type="text/javascript">
105           <xsl:comment>
106           <![CDATA[
107           // select first element when the page is loaded
108           // if a form exists on the page
109           function selectFirstElement() {
110             if (window.document.forms[0]) {
111               window.document.forms[0].elements[0].select();
112             }
113           }
114           ]]>
115           </xsl:comment>
116         </script>
117       </head>
118       <body>
119         <xsl:call-template name="headBar"/>
120         <xsl:if test="/bedework-fbaggregator/message">
121           <div id="messages">
122             <xsl:apply-templates select="/bedework-fbaggregator/message"/>
123           </div>
124         </xsl:if>
125         <xsl:if test="/bedework-fbaggregator/error">
126           <div id="errors">
127             <xsl:apply-templates select="/bedework-fbaggregator/error"/>
128           </div>
129         </xsl:if>
130         <xsl:choose>
131           <xsl:when test="/bedework-fbaggregator/page='manageGroup'">
132             <xsl:call-template name="manageGroup"/>
133           </xsl:when>
134           <xsl:when test="/bedework-fbaggregator/page='addUser'">
135             <xsl:call-template name="addUser"/>
136           </xsl:when>
137           <xsl:when test="/bedework-fbaggregator/page='editUser'">
138             <xsl:call-template name="editUser"/>
139           </xsl:when>
140           <xsl:when test="/bedework-fbaggregator/page='invitation'">
141             <xsl:call-template name="invitation"/>
142           </xsl:when>
143           <xsl:when test="/bedework-fbaggregator/page='timeZones'">
144             <xsl:apply-templates select="/bedework-fbaggregator/timezones"/>
145           </xsl:when>
146           <xsl:otherwise>
147             <!-- otherwise, show frontPage or freeBusy -->
148             <xsl:call-template name="freebusy"/>
149           </xsl:otherwise>
150         </xsl:choose>
151         <!-- footer -->
152         <div id="footer">
153           <a href="/fbagg/getFreeBusy.do?all=true&amp;startdt=20060703&amp;enddt=20060710&amp;refreshXslt=yes">Refresh Freebusy Aggregator</a>
154         </div>
155       </body>
156     </html>
157   </xsl:template>
158
159   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
160
161   <xsl:template name="headBar">
162     <div id="headBar">
163       <h1>CALCONNECT BOEING CALDAV FREEBUSY AGGREGATOR</h1>
164       <!--<h1>Calconnect Boeing CalDav Freebusy Aggregator</h1>-->
165     </div>
166     <div id="menuBar">
167       <a href="{$setup}&amp;refreshXslt=yes">Display Freebusy</a> |
168       <a href="{$showAddUser}&amp;refreshXslt=yes">Register User</a>
169     </div>
170   </xsl:template>
171
172   <!--+++++++++++++++ Free / Busy ++++++++++++++++++++-->
173   <xsl:template name="freebusy">
174     <xsl:variable name="startdt" select="/bedework-fbaggregator/startDate"/>
175     <xsl:variable name="enddt" select="/bedework-fbaggregator/endDate"/>
176     <xsl:variable name="formattedStartDate">
177       <xsl:value-of select="substring($startdt,1,4)"/>-<xsl:value-of select="number(substring($startdt,5,2))"/>-<xsl:value-of select="number(substring($startdt,7,2))"/>
178     </xsl:variable>
179     <xsl:variable name="formattedEndDate">
180       <xsl:value-of select="substring($enddt,1,4)"/>-<xsl:value-of select="number(substring($enddt,5,2))"/>-<xsl:value-of select="number(substring($enddt,7,2))"/>
181     </xsl:variable>
182     <form
183      name="freebusyForm"
184      method="post"
185      action="{$fetchFreeBusy}"
186      enctype="multipart/form-data"
187      id="freebusyForm">
188       <table id="bodyBlock" cellspacing="0">
189         <tr>
190           <td id="fbForm">
191             <h4>aggregation</h4>
192             <div id="dateForm">
193               <p>
194                 Start date:<br/>
195                 <input
196                  type="text"
197                  name="startdt"
198                  size="8"
199                  value="{$startdt}"
200                  onfocus="enableFbSubmit('start')"/>
201                 <span class="calWidget">
202                   <script language="JavaScript" type="text/javascript">
203                     startDateDynCalWidget = new dynCalendar('startDateDynCalWidget', 'startDateCalWidgetCallback','<xsl:value-of select="$resourcesRoot"/>/resources/');
204                   </script>
205                 </span>
206               </p>
207               <p>
208                 End date:<br/>
209                 <input
210                  type="text"
211                  name="enddt"
212                  size="8"
213                  value="{$enddt}"
214                  onfocus="enableFbSubmit('end')"/>
215                 <span class="calWidget">
216                   <script language="JavaScript" type="text/javascript">
217                     endDateDynCalWidget = new dynCalendar('endDateDynCalWidget', 'endDateCalWidgetCallback','<xsl:value-of select="$resourcesRoot"/>/resources/');
218                   </script>
219                 </span>
220               </p>
221               <div class="dateFormat">yyyymmdd</div>
222               <p class="padTop">
223                 <input type="submit" name="submitFb" value="aggregate" class="aggSubmit">
224                   <xsl:if test="$startdt = '' and $enddt = ''">
225                     <xsl:attribute name="disabled">disabled</xsl:attribute>
226                   </xsl:if>
227                 </input>
228               </p>
229             </div>
230           </td>
231           <td id="bodyContent">
232             <xsl:choose>
233               <xsl:when test="/bedework-fbaggregator/page='freeBusy'">
234                 <xsl:for-each select="/bedework-fbaggregator/freebusy">
235                 <!-- there's only one collection of freebusy; this for-each is
236                      being used to pick out just the freebusy node and
237                      shorten the select statements below. -->
238                   <h2>Freebusy Aggregator</h2>
239                   Day count: <xsl:value-of select="count(day)"/>
240                   <xsl:if test="/bedework-fbaggregator/failures/failure">
241                     <table id="failures" cellspacing="0">
242                       <tr class="title">
243                         <th colspan="3">request failures</th>
244                       </tr>
245                       <tr class="headers">
246                         <th>account</th>
247                         <th>host:port</th>
248                         <th>code</th>
249                       </tr>
250                       <xsl:for-each select="/bedework-fbaggregator/failures/failure">
251                         <tr>
252                           <td>
253                             <xsl:value-of select="account"/>
254                           </td>
255                           <td>
256                             <xsl:value-of select="host"/>:<xsl:value-of select="port"/>
257                             <xsl:if test="message">
258                               <br/>message: <em><xsl:value-of select="message"/></em>
259                             </xsl:if>
260                           </td>
261                           <td>
262                             <xsl:choose>
263                               <xsl:when test="noResponse = 'true'">
264                                 none
265                               </xsl:when>
266                               <xsl:otherwise>
267                                 <xsl:value-of select="respCode"/>
268                               </xsl:otherwise>
269                             </xsl:choose>
270                           </td>
271                         </tr>
272                       </xsl:for-each>
273                     </table>
274                   </xsl:if>
275                   <table id="freeBusy">
276                     <tr>
277                       <td></td>
278                       <th colspan="16" class="left">
279                         Freebusy for
280                         <span class="who">
281                           <xsl:choose>
282                             <xsl:when test="who != ''">
283                               <xsl:value-of select="who"/>
284                             </xsl:when>
285                             <xsl:otherwise>
286                               all attendees
287                             </xsl:otherwise>
288                           </xsl:choose>
289                         </span>
290                       </th>
291                       <th colspan="32" class="right">
292                         <xsl:value-of select="$formattedStartDate"/> to <xsl:value-of select="$formattedEndDate"/>
293                         <select name="timezone" id="timezonesDropDown" onchange="submit()">
294                           <xsl:for-each select="/bedework-fbaggregator/timezones/tzid">
295                             <option>
296                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
297                               <xsl:if test="node() = $currentTimezone"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
298                               <xsl:value-of select="."/>
299                             </option>
300                           </xsl:for-each>
301                         </select>
302                         <!--<input type="submit" value="change" id="timezonesButton"/>
303                         <span class="subLink">[<a href="{$getTimeZones}">map</a>]</span>-->
304                       </th>
305                     </tr>
306                     <tr>
307                       <td>&#160;</td>
308                       <td colspan="24" class="morning">AM</td>
309                       <td colspan="24" class="evening">PM</td>
310                     </tr>
311                     <tr>
312                       <td>&#160;</td>
313                       <xsl:for-each select="day[position()=1]/period">
314                         <td class="timeLabels">
315                           <xsl:choose>
316                             <xsl:when test="number(start) mod 200 = 0">
317                               <xsl:call-template name="timeFormatter">
318                                 <xsl:with-param name="timeString" select="start"/>
319                                 <xsl:with-param name="showMinutes">no</xsl:with-param>
320                                 <xsl:with-param name="showAmPm">no</xsl:with-param>
321                               </xsl:call-template>
322                             </xsl:when>
323                             <xsl:otherwise>
324                               &#160;
325                             </xsl:otherwise>
326                           </xsl:choose>
327                         </td>
328                       </xsl:for-each>
329                     </tr>
330                     <xsl:for-each select="day">
331                       <tr>
332                         <td class="dayDate"><xsl:value-of select="number(substring(dateString,5,2))"/>-<xsl:value-of select="number(substring(dateString,7,2))"/></td>
333                         <xsl:for-each select="period">
334                           <xsl:variable name="startTime" select="start"/>
335                           <!-- the start date for the add event link is a concat of the day's date plus the period's time (+ seconds)-->
336                           <xsl:variable name="startDate"><xsl:value-of select="../dateString"/>T<xsl:value-of select="start"/>00</xsl:variable>
337                           <xsl:variable name="meetingDuration" select="length"/>
338                           <td>
339                             <xsl:attribute name="class">
340                               <xsl:choose>
341                                 <xsl:when test="fbtype = '0'">busy</xsl:when>
342                                 <xsl:when test="fbtype = '3'">tentative</xsl:when>
343                                 <xsl:otherwise>free</xsl:otherwise>
344                               </xsl:choose>
345                             </xsl:attribute>
346                             <a href="{$initInvitation}&amp;meetingStartdt={$startDate}&amp;meetingDuration={$meetingDuration}">
347                               <xsl:choose>
348                                 <xsl:when test="((numBusy &gt; 0) and (numBusy &lt; 9)) or ((numTentative &gt; 0) and (numTentative &lt; 9)) and (number(numBusy) + number(numTentative) &lt; 9)">
349                                   <xsl:value-of select="number(numBusy) + number(numTentative)"/>
350                                 </xsl:when>
351                                 <xsl:otherwise>*</xsl:otherwise>
352                               </xsl:choose>
353                               <span class="eventTip">
354                                 <xsl:value-of select="$formattedStartDate"/><br/>
355                                 <strong>
356                                   <xsl:call-template name="timeFormatter">
357                                     <xsl:with-param name="timeString" select="$startTime"/>
358                                   </xsl:call-template>
359                                 </strong>
360                                 <xsl:if test="numBusy &gt; 0">
361                                   <br/><xsl:value-of select="numBusy"/> busy
362                                 </xsl:if>
363                                 <xsl:if test="numTentative &gt; 0">
364                                   <br/><xsl:value-of select="numTentative"/> tentative
365                                 </xsl:if>
366                                 <xsl:if test="numBusy = 0 and numTentative = 0">
367                                   <br/><em>all free</em>
368                                 </xsl:if>
369                               </span>
370                             </a>
371                           </td>
372                         </xsl:for-each>
373                       </tr>
374                     </xsl:for-each>
375                   </table>
376
377                   <table id="freeBusyKey">
378                     <tr>
379                       <td class="free">*</td>
380                       <td>free</td>
381                       <td>&#160;</td>
382                       <td class="busy">*</td>
383                       <td>busy</td>
384                       <td>&#160;</td>
385                       <td class="tentative">*</td>
386                       <td>tentative</td>
387                     </tr>
388                   </table>
389                 </xsl:for-each>
390               </xsl:when>
391               <xsl:otherwise>
392                 <!-- just show the default message -->
393                 <div id="frontPage">
394                   <p>
395                     <a href="http://www.calconnect.org">
396                       <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/calconnect.gif" width="175" height="67" alt="calconnect" border="0"/>
397                     </a>
398                     <a href="http://www.boeing.com">
399                       <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/boeing.gif" width="100" height="67" alt="calconnect" border="0"/>
400                     </a>
401                   </p>
402                   <h2>CalDAV Freebusy Aggregator</h2>
403                   <p>To begin, select or create a group of attendees,<br/>
404                   enter a date range on the left and click "aggregate".</p>
405                 </div>
406               </xsl:otherwise>
407             </xsl:choose>
408           </td>
409           <td rowspan="2" id="logos">
410             <h4>participants</h4>
411             <a href="http://www.bedework.org">
412               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/bedework.png" width="100" height="88" alt="Bedework" border="0"/>
413             </a>
414             <a href="http://www.boeing.com/">
415               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/boeing.png" width="100" height="67" alt="Boeing" border="0"/>
416             </a>
417             <a href="http://www.ibm.com">
418               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/ibm.png" width="100" height="85" alt="IBM" border="0"/>
419             </a>
420             <a href="http://www.oracle.com">
421               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/oracle.png" width="100" height="48" alt="Oracle" border="0"/>
422             </a>
423             <a href="http://www.osafoundation.org/">
424               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/osaf.png" width="100" height="54" alt="OSAF" border="0"/>
425             </a>
426             <a href="http://www.egenconsulting.com/">
427               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/pec.png" width="100" height="61" alt="PEC" border="0"/>
428             </a>
429             <a href="http://www.timebridge.com/">
430               <img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/logos/timebridge.png" width="100" height="55" alt="Timebridge" border="0"/>
431             </a>
432             <!--<img src="http://www.rpi.edu/dept/cct/apps/bedeworkLuwak2/images/freebusy/fbagg-logos2.gif" width="100" height="403" alt="participant logos" usemap="#logoMap" border="0"/>
433             <map name="logoMap">
434               <area shape="rect" alt="Timebridge" coords="0,340,100,380" href="http://www.timebridge.com/"/>
435               <area shape="rect" alt="OSAF" coords="0,260,100,302" href="http://www.osafoundation.org/"/>
436               <area shape="rect" alt="Oracle" coords="0,187,100,225" href="http://www.oracle.com"/>
437               <area shape="rect" alt="Boeing" coords="0,101,100,153" href="http://www.boeing.com/"/>
438               <area shape="rect" alt="Bedework" coords="0,13,100,77" href="http://www.bedework.org/bedework/"/>
439             </map>-->
440           </td>
441         </tr>
442         <tr>
443           <td id="groupCell" colspan="2">
444             <input type="hidden" name="all" value="true" />
445             <input type="hidden" name="account" value="" />
446             <h4>
447               current group
448             </h4>
449             <div id="groupMenu">
450               <select name="selectGroup" action="" onchange="javascript:setGroup(this)">
451                 <option value="">select group...</option>
452                 <xsl:for-each select="/bedework-fbaggregator/groups/group">
453                   <option>
454                     <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
455                     <xsl:if test="/bedework-fbaggregator/currentGroup = node()">
456                       <xsl:attribute name="selected">selected</xsl:attribute>
457                     </xsl:if>
458                     <xsl:value-of select="."/>
459                   </option>
460                 </xsl:for-each>
461               </select>
462               <ul>
463                 <li><a href="{$showManageGroup}">modify</a></li>
464                 <!--<li>duplicate</li>
465                 <li>create</li>-->
466               </ul>
467               <!--<p>
468                 Aggregate for
469                 <input type="radio" name="all" value="true" checked="checked"/>all attendees
470                 <input type="radio" name="all" value="false"/>selected attendees
471               </p>-->
472             </div>
473             <xsl:choose>
474               <xsl:when test="/bedework-fbaggregator/attendees/attendee">
475                 <table id="attendees">
476                   <!--<tr>
477                    <th>include</th>
478                    <th>required</th>
479                    <th>type</th>
480                    <th>account</th>
481                   </tr>-->
482                   <xsl:for-each select="/bedework-fbaggregator/attendees/attendee">
483                     <xsl:variable name="account" select="account"/>
484                     <tr>
485                       <!--<td>
486                         <input type="checkbox" checked="checked" value="{$account}" name="account"/>
487                       </td>
488                       <td>
489                         <input type="checkbox" checked="checked" value="required" name="required"/>
490                       </td>-->
491                       <td>
492                         <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="attendee"/>
493                       </td>
494                       <td>
495                         <!--<a href="{$fetchFreeBusy}&amp;account={$account}&amp;startdt={$startdt}&amp;enddt={$enddt}" title="display {$account}'s freebusy">-->
496                         <a href="javascript:showAccountFreebusy('{$account}')" title="display {$account}'s freebusy">
497                           <xsl:if test="/bedework-fbaggregator/freebusy/who=$account">
498                             <xsl:attribute name="class">selected</xsl:attribute>
499                           </xsl:if>
500                           <xsl:value-of select="account"/>
501                         </a>
502                       </td>
503                       <!--<td>
504                         <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
505                       </td>-->
506                     </tr>
507                   </xsl:for-each>
508                 </table>
509               </xsl:when>
510               <xsl:otherwise>
511                 <p id="attendees">no attendees</p>
512               </xsl:otherwise>
513             </xsl:choose>
514           </td>
515         </tr>
516       </table>
517     </form>
518   </xsl:template>
519
520   <xsl:template match="timezones">
521     <div id="content">
522       <h2>Select Timezone</h2>
523       <form name="timezoneForm" action="setTimeZone" method="post">
524         <select name="timezone">
525           <xsl:for-each select="tzid">
526             <option>
527               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
528               <xsl:value-of select="."/>
529             </option>
530           </xsl:for-each>
531         </select>
532         <input type="submit" value="select"/>
533       </form>
534     </div>
535   </xsl:template>
536
537   <xsl:template name="manageGroup">
538     <div id="content">
539       <h2>Manage Group</h2>
540       <table cellspacing="0" id="attendeeList">
541         <tr class="title">
542           <th colspan="6">
543             Attendees for group: <em><xsl:value-of select="/bedework-fbaggregator/currentGroup"/></em>
544           </th>
545           <td>
546             <a href="">delete group</a>
547           </td>
548         </tr>
549         <tr class="headers">
550           <th>account</th>
551           <th>type</th>
552           <th>host</th>
553           <th>port</th>
554           <th>secure</th>
555           <th>url</th>
556           <th></th>
557         </tr>
558         <xsl:for-each select="/bedework-fbaggregator/attendees/attendee">
559           <xsl:variable name="rowClass">
560             <xsl:choose>
561               <xsl:when test="position() mod 2 = 1">a</xsl:when>
562               <xsl:otherwise>b</xsl:otherwise>
563             </xsl:choose>
564           </xsl:variable>
565           <tr class="{$rowClass}">
566             <td class="first"><xsl:value-of select="account"/></td>
567             <td>
568               <xsl:variable name="account" select="account"/>
569               <a href="{$getUser}&amp;account={$account}">
570                 <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="edit"/>
571               </a>
572               <xsl:text> </xsl:text>
573               <xsl:value-of select="type"/>
574             </td>
575             <td><xsl:value-of select="host"/></td>
576             <td><xsl:value-of select="port"/></td>
577             <td><xsl:value-of select="secure"/></td>
578             <td><xsl:value-of select="url"/></td>
579             <td class="last"><img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/></td>
580           </tr>
581         </xsl:for-each>
582       </table>
583       <table cellspacing="0" id="searchUsers">
584         <tr>
585           <th>Search users:</th>
586           <th>Search results:</th>
587         </tr>
588         <tr>
589           <td>
590             <!--<form name="searchForm" onsubmit="doSearch(this,'{$selectUsers}')">-->
591             <form name="searchForm" action="{$selectUsers}" method="post">
592               <input type="text" name="term" size="40"/>
593               <input type="submit" name="search" value="search"/><br/>
594               <input type="radio" name="type" value="account" checked="checked"/>for account, <em>e.g. johndoe@somehost.org</em><br/>
595               <input type="radio" name="type" value="prefix"/>by email prefix, <em>e.g. johndoe</em><br/>
596               <input type="radio" name="type" value="suffix"/>by email suffix, <em>e.g. somehost.org</em><br/>
597             </form>
598           </td>
599           <td>
600             <xsl:if test="not(/bedework-fbaggregator/selectedUsers/user)">
601               To add attendees to this group, perform a search and click
602               "add search results to current group".  (Individual additions
603               to be added later.)
604             </xsl:if>
605             <ul>
606               <xsl:for-each select="/bedework-fbaggregator/selectedUsers/user">
607                 <li>
608                   <xsl:if test="position() mod 2 = 0"><xsl:attribute name="class">b</xsl:attribute></xsl:if>
609                   <strong><xsl:value-of select="account"/></strong><br/>
610                   <xsl:choose>
611                     <xsl:when test="secure='true'">https:</xsl:when>
612                     <xsl:otherwise>http:</xsl:otherwise>
613                   </xsl:choose>
614                   <xsl:value-of select="host"/>:<xsl:value-of select="port"/>
615                   <xsl:value-of select="url"/>
616                 </li>
617               </xsl:for-each>
618             </ul>
619             <p>
620               <xsl:if test="/bedework-fbaggregator/selectedUsers/user">
621                 <strong><a href="{$updateGroup}&amp;addSelected=true">Add search results to current group</a></strong>
622               </xsl:if>
623             </p>
624           </td>
625         </tr>
626       </table>
627     </div>
628   </xsl:template>
629
630   <xsl:template name="addUser">
631     <div id="content">
632       <h2>Register a New User</h2>
633       <form action="{$addUser}" method="post">
634         <fieldset id="commonForm">
635           <legend>Add user:</legend>
636           <table cellspacing="0">
637             <tr>
638               <th>User's account:</th>
639               <td>
640                 <input
641                  type="text"
642                  name="account"
643                  size="40"
644                  value="" />
645                  <xsl:text> </xsl:text>
646                  <em>e.g. user@somehost.org</em>
647                </td>
648              </tr>
649              <tr>
650               <th></th>
651               <td>
652                  <input type="radio" value="user" name="kind" checked="checked"/>user <!--
653               --><input type="radio" value="group" name="kind"/>group
654               </td>
655             </tr>
656             <tr>
657               <th>Authorized user:</th>
658               <td><input
659                  type="text"
660                  name="authUser"
661                  size="40"
662                  value="" />
663                  <xsl:text> </xsl:text>
664                  <em>user requesting freebusy data (e.g. you)</em>
665                </td>
666             </tr>
667             <tr>
668               <th>Authorized user's password:</th>
669               <td>
670                 <input
671                  type="password"
672                  name="authPw"
673                  size="40"
674                  value="" /></td>
675             </tr>
676             <tr>
677               <th>Host:</th>
678               <td>
679                 <input
680                  type="text"
681                  name="host"
682                  size="60"
683                  value="" /></td>
684             </tr>
685             <tr>
686               <th>Port:</th>
687               <td>
688                 <input
689                  type="text"
690                  name="port"
691                  size="8"
692                  value="" /></td>
693             </tr>
694             <tr>
695               <th>Secure:</th>
696               <td>
697                 <input
698                  type="radio"
699                  name="secure"
700                  value="true" />yes
701                 <input
702                  type="radio"
703                  name="secure"
704                  value="false"
705                  checked="checked"/>no
706                </td>
707             </tr>
708             <tr>
709               <th>URL:</th>
710               <td>
711                 <input
712                  type="text"
713                  name="url"
714                  size="60"
715                  value="" /></td>
716             </tr>
717             <tr>
718               <th>Depth:</th>
719               <td>
720                 <select name="depth">
721                   <option value="0">0</option>
722                   <option value="1">1</option>
723                   <option value="infinity">infinity</option>
724                 </select>
725               </td>
726             </tr>
727             <tr>
728               <th></th>
729               <td>
730                 <input type="submit" name="submit" value="add"/>
731                 <input type="submit" name="cancelled" value="cancel"/>
732               </td>
733             </tr>
734           </table>
735         </fieldset>
736       </form>
737     </div>
738     <div id="getUserForm">
739       <form action="{$getUser}" method="post">
740         Modify existing user (enter account name):
741         <input type="text" name="account" size="40"/>
742         <input type="submit" value="get user"/>
743       </form>
744     </div>
745   </xsl:template>
746
747   <xsl:template name="editUser">
748     <div id="content">
749       <h2>Modify User</h2>
750       <form action="{$editUser}" method="post">
751         <fieldset id="commonForm">
752           <legend>User information:</legend>
753           <table cellspacing="0">
754             <tr>
755               <th>User's account:</th>
756               <td>
757                 <input
758                  type="text"
759                  name="account"
760                  size="40">
761                  <xsl:attribute name="value"><xsl:value-of select="/bedework-fbaggregator/user/account"/></xsl:attribute>
762                 </input>
763                 <xsl:text> </xsl:text>
764                 <em>e.g. user@somehost.org</em>
765               </td>
766             </tr>
767             <tr>
768               <th></th>
769               <td>
770                  <input type="radio" value="user" name="kind" checked="checked"/>user <!--
771               --><input type="radio" value="group" name="kind"/>group
772               </td>
773             </tr>
774             <tr>
775               <th>Authorized user:</th>
776               <td><input
777                  type="text"
778                  name="authUser"
779                  size="40">
780                  <xsl:attribute name="value"><xsl:value-of select="/bedework-fbaggregator/user/authUser"/></xsl:attribute>
781                  </input>
782                  <xsl:text> </xsl:text>
783                  <em>user requesting freebusy data (e.g. you)</em>
784                </td>
785             </tr>
786             <tr>
787               <th><strong>Authorized user's password:</strong></th>
788               <td>
789                 <input
790                  type="password"
791                  name="authPw"
792                  size="40"
793                  value="" />
794                  <xsl:text> </xsl:text>
795                  <em>please re-enter</em>
796               </td>
797             </tr>
798             <tr>
799               <th>Host:</th>
800               <td>
801                 <input
802                  type="text"
803                  name="host"
804                  size="60">
805                  <xsl:attribute name="value"><xsl:value-of select="/bedework-fbaggregator/user/host"/></xsl:attribute>
806                 </input>
807               </td>
808             </tr>
809             <tr>
810               <th>Port:</th>
811               <td>
812                 <input
813                  type="text"
814                  name="port"
815                  size="8">
816                 <xsl:attribute name="value"><xsl:value-of select="/bedework-fbaggregator/user/port"/></xsl:attribute>
817                 </input>
818               </td>
819             </tr>
820             <tr>
821               <th>Secure:</th>
822               <td>
823                 <input
824                  type="radio"
825                  name="secure"
826                  value="true">
827                  <xsl:if test="/bedework-fbaggregator/user/secure = 'true'">
828                   <xsl:attribute name="checked">checked</xsl:attribute>
829                  </xsl:if>
830                 </input>
831                  yes
832                 <input
833                  type="radio"
834                  name="secure"
835                  value="false">
836                  <xsl:if test="/bedework-fbaggregator/user/secure = 'false'">
837                   <xsl:attribute name="checked">checked</xsl:attribute>
838                  </xsl:if>
839                 </input>
840                  no
841               </td>
842             </tr>
843             <tr>
844               <th>URL:</th>
845               <td>
846                 <input
847                  type="text"
848                  name="url"
849                  size="60">
850                 <xsl:attribute name="value"><xsl:value-of select="/bedework-fbaggregator/user/url"/></xsl:attribute>
851                 </input>
852               </td>
853             </tr>
854             <tr>
855               <th>Depth:</th>
856               <td>
857                 <select name="depth">
858                   <option value="0">
859                     <xsl:if test="/bedework-fbaggregator/user/depth = '0'">
860                      <xsl:attribute name="selected">selected</xsl:attribute>
861                     </xsl:if>
862                     0
863                   </option>
864                   <option value="1">
865                     <xsl:if test="/bedework-fbaggregator/user/depth = '1'">
866                      <xsl:attribute name="selected">selected</xsl:attribute>
867                     </xsl:if>
868                     1
869                   </option>
870                   <option value="infinity">
871                     <xsl:if test="/bedework-fbaggregator/user/depth = 'infinity'">
872                      <xsl:attribute name="selected">selected</xsl:attribute>
873                     </xsl:if>
874                     infinity
875                   </option>
876                 </select>
877               </td>
878             </tr>
879             <tr>
880               <th></th>
881               <td>
882                 <input type="submit" name="submit" value="update"/>
883                 <input type="submit" name="cancelled" value="cancel"/>
884               </td>
885             </tr>
886           </table>
887         </fieldset>
888       </form>
889     </div>
890     <div id="getUserForm">
891       <form action="{$getUser}" method="post">
892         Modify existing user (enter account name):<br/>
893         <input type="text" name="account" size="40"/>
894         <input type="submit" value="get user"/>
895       </form>
896     </div>
897   </xsl:template>
898
899   <xsl:template name="invitation">
900     <div id="content">
901       <h2>Send Meeting Invitation</h2>
902       <form action="{$makeMeeting}" method="post">
903         <input type="hidden" name="skinName" value="ical"/>
904         <input type="hidden" name="nocache" value="no"/>
905         <input type="hidden" name="contentType" value="text/calendar"/>
906         <input type="hidden" name="contentName">
907           <xsl:attribute name="value">meeting-<xsl:value-of select="/bedework-fbaggregator/meetingStart"/>.ics</xsl:attribute>
908         </input>
909         <!--<p>
910           <input type="submit" value="send invitation" name="submit"/>
911           <xsl:text> </xsl:text>
912           <input type="submit" value="cancel" name="cancelled"/>
913         </p>-->
914         <fieldset id="commonForm">
915           <legend>meeting information</legend>
916           <table cellspacing="0">
917             <tr>
918               <th>Start date:</th>
919               <td>
920                 <strong><xsl:value-of select="substring(/bedework-fbaggregator/meetingStart,1,4)"/>-<xsl:value-of select="substring(/bedework-fbaggregator/meetingStart,5,2)"/>-<xsl:value-of select="substring(/bedework-fbaggregator/meetingStart,7,2)"/></strong>
921               </td>
922             </tr>
923             <tr>
924               <th>Start time:</th>
925               <td>
926                 <strong>
927                   <xsl:call-template name="timeFormatter">
928                     <xsl:with-param name="timeString" select="substring(/bedework-fbaggregator/meetingStart,10,4)"/>
929                   </xsl:call-template>
930                 </strong>
931               </td>
932             </tr>
933             <tr>
934               <th class="padTop">Duration:</th>
935               <td class="padTop">
936                 <input type="text" name="meetingDuration" size="3"><xsl:attribute name="value"><xsl:value-of select="/bedework-fbaggregator/meetingDuration"/></xsl:attribute></input> minutes
937               </td>
938             </tr>
939             <tr>
940               <th>Summary:</th>
941               <td><input type="text" name="summary" size="90"/></td>
942             </tr>
943             <tr>
944               <th>Description:</th>
945               <td><textarea name="description" rows="6" cols="70"></textarea></td>
946             </tr>
947             <tr>
948               <th>Location:</th>
949               <td><input type="text" name="location" size="90"/></td>
950             </tr>
951             <tr>
952               <th>URL:</th>
953               <td><input type="text" name="url" size="90"/></td>
954             </tr>
955             <tr>
956               <th></th>
957               <td class="padTop">
958                 <input type="submit" value="send invitation" name="submit"/>
959                 <xsl:text> </xsl:text>
960                 <input type="submit" value="cancel" name="cancelled"/>
961               </td>
962             </tr>
963           </table>
964         </fieldset>
965         <fieldset>
966           <legend>attendees</legend>
967           <xsl:choose>
968             <xsl:when test="/bedework-fbaggregator/attendees/attendee">
969               <table id="attendees">
970                 <xsl:for-each select="/bedework-fbaggregator/attendees/attendee">
971                   <xsl:variable name="account" select="account"/>
972                   <tr>
973                     <td>
974                       <img src="{$resourcesRoot}/resources/userIcon.gif" width="13" height="13" border="0" alt="attendee"/>
975                     </td>
976                     <td>
977                       <xsl:if test="/bedework-fbaggregator/freebusy/who=$account">
978                         <xsl:attribute name="class">selected</xsl:attribute>
979                       </xsl:if>
980                       <xsl:value-of select="account"/>
981                     </td>
982                     <!--<td>
983                       <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="remove"/>
984                     </td>-->
985                   </tr>
986                 </xsl:for-each>
987               </table>
988             </xsl:when>
989             <xsl:otherwise>
990               <p id="attendees">no attendees</p>
991             </xsl:otherwise>
992           </xsl:choose>
993         </fieldset>
994       </form>
995     </div>
996   </xsl:template>
997
998   <xsl:template name="utilBar">
999     <!-- refresh button -->
1000     <a href="{$setup}"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
1001   </xsl:template>
1002
1003   <!--==== UTILITY TEMPLATES ====-->
1004
1005   <!-- time formatter (should be extended as needed) -->
1006   <xsl:template name="timeFormatter">
1007     <xsl:param name="timeString"/><!-- required -->
1008     <xsl:param name="showMinutes">yes</xsl:param>
1009     <xsl:param name="showAmPm">yes</xsl:param>
1010     <xsl:param name="hour24">no</xsl:param>
1011     <xsl:variable name="hour" select="number(substring($timeString,1,2))"/>
1012     <xsl:variable name="minutes" select="substring($timeString,3,2)"/>
1013     <xsl:variable name="AmPm">
1014       <xsl:choose>
1015         <xsl:when test="$hour &lt; 12">AM</xsl:when>
1016         <xsl:otherwise>PM</xsl:otherwise>
1017       </xsl:choose>
1018     </xsl:variable>
1019     <xsl:choose>
1020       <xsl:when test="hour24 = 'yes'">
1021         <xsl:value-of select="$hour"/><!--
1022      --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if>
1023       </xsl:when>
1024       <xsl:otherwise>
1025         <xsl:choose>
1026           <xsl:when test="$hour = 0">12</xsl:when>
1027           <xsl:when test="$hour &lt; 13"><xsl:value-of select="$hour"/></xsl:when>
1028           <xsl:otherwise><xsl:value-of select="$hour - 12"/></xsl:otherwise>
1029         </xsl:choose><!--
1030      --><xsl:if test="$showMinutes = 'yes'">:<xsl:value-of select="$minutes"/></xsl:if>
1031         <xsl:if test="$showAmPm = 'yes'">
1032           <xsl:text> </xsl:text>
1033           <xsl:value-of select="$AmPm"/>
1034         </xsl:if>
1035       </xsl:otherwise>
1036     </xsl:choose>
1037   </xsl:template>
1038
1039   <!-- search and replace template taken from
1040        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1041   <xsl:template name="replace">
1042     <xsl:param name="string" select="''"/>
1043     <xsl:param name="pattern" select="''"/>
1044     <xsl:param name="replacement" select="''"/>
1045     <xsl:choose>
1046       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1047         <xsl:value-of select="substring-before($string, $pattern)"/>
1048         <xsl:copy-of select="$replacement"/>
1049         <xsl:call-template name="replace">
1050           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1051           <xsl:with-param name="pattern" select="$pattern"/>
1052           <xsl:with-param name="replacement" select="$replacement"/>
1053         </xsl:call-template>
1054       </xsl:when>
1055       <xsl:otherwise>
1056         <xsl:value-of select="$string"/>
1057       </xsl:otherwise>
1058     </xsl:choose>
1059   </xsl:template>
1060 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.